diff --git a/contrib/binutils/ChangeLog b/contrib/binutils/ChangeLog index 1d6afc2e0f1..dbb7644376b 100644 --- a/contrib/binutils/ChangeLog +++ b/contrib/binutils/ChangeLog @@ -1,8 +1,691 @@ +2007-06-29 Bernd Schmidt + + * configure.ac: Don't add target-libmudflap to noconfigdirs for + uclinux and linux-uclibc targets. + * configure: Regenerate. + +2007-06-28 DJ Delorie + + * configure.ac (arm*-*-linux-gnueabi): Don't build libgloss if we're + not building newlib. + * configure: Regenerated. + +2007-06-22 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Correct typos. + +2007-06-18 Daniel Jacobowitz + + * Makefile.def: Add dependency from configure-gdb to all-bfd. + * Makefile.in: Regenerated. + +2007-06-14 Paolo Bonzini + + * Makefile.tpl (cleanstrap): Don't delete the toplevel Makefile. + (distclean-stage[+id+]): Possibly delete stage_last. + * Makefile.in: Regenerate. + +2007-06-07 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2007-06-07 Ben Elliston + + * Makefile.tpl: Fix spelling error. + * Makefile.in: Regenerate. + +2007-06-04 Paolo Bonzini + + Sync with gcc: + 2007-05-30 Jakub Jelinek + + PR bootstrap/29382 + * configure.ac: Don't use -fkeep-inline-functions for GCC < 3.3.1. + * configure: Rebuilt. + +2007-06-01 Steve Ellcey + + * libtool.m4 (LT_CMD_MAX_LEN): Try using getconf to set + lt_cv_sys_max_cmd_len. + +2007-05-31 Paolo Bonzini + + * ltgcc.m4: Update from GCC. + +2007-05-25 Andreas Tobler + + * ltmain.sh: Fix Darwin verstring, remove ${wl}. + +2007-05-24 Steve Ellcey + + * ltmain.sh: Update from GCC. + * libtool.m4: Update from GCC. + * ltsugar.m4: New. Update from GCC. + * ltversion.m4: New. Update from GCC. + * ltoptions.m4: New. Update from GCC. + * ltconfig: Remove. + * ltcf-c.sh: Remove. + * ltcf-cxx.sh: Remove. + * ltcf-gcj.sh: Remove. + * src-release: Update with new libtool file list. + +2007-05-16 Paolo Bonzini + + * Makefile.def (bootstrap_stage): Replace stage_make_flags with + stage_cflags. + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS, POSTSTAGE1_FLAGS_TO_PASS): + Remove CFLAGS/LIBCFLAGS. + (configure-stage[+id+]-[+prefix+][+module+], + all-stage[+id+]-[+prefix+][+module+]): Pass it from [+stage_cflags+]. + * Makefile.in: Regenerate. + +2007-04-14 Steve Ellcey + + * config-ml.in: Update from GCC. + +2007-04-09 Daniel Jacobowitz + + * src-release (do-proto-toplev): Process the support directories before + the tool directory. + +2007-03-21 Richard Sandiford + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting + of glob. Quote arguments with single quotes too. + * configure: Regenerate. + +2007-03-12 Brooks Moses + + * Makefile.def (fixincludes): Remove unneeded "missing" lines. + * Makefile.in: Regenerate + +2007-03-07 Andreas Schwab + + * configure: Regenerate. + +2007-03-01 Brooks Moses + + * configure.ac: Add "--with-pdfdir" configure option, + which defines pdfdir variable. + * Makefile.def (target=fixincludes): Add install-pdf to + missing targets. + (recursive_targets): Add install-pdf target. + (flags_to_pass): Add pdfdir. + * Makefile.tpl: Add pdfdir handling, add do-install-pdf + target. + * configure: Regenerate + * Makefile.in: Regenerate + +2007-02-28 Eric Christopher + + Revert: + 2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2007-02-27 Matt Kraai + + * configure: Regenerate. + * configure.ac: Move statements after variable declarations. + +2007-02-19 Joseph Myers + + * configure.ac: Adjust for loop syntax. + * configure: Regenerate. + +2007-02-18 Alexandre Oliva + + * configure: Rebuilt. + +2007-02-18 Alexandre Oliva + + * configure.ac: Drop multiple occurrences of --enable-languages, + and fix its quoting. + * configure: Rebuilt. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting. + * configure: Regenerate. + +2007-02-13 Daniel Jacobowitz + + * configure.ac (target_libraries): Move libgcc before libiberty. + * configure: Regenerated. + +2007-02-13 Paolo Bonzini + + * configure: Regenerate again? + +2007-02-13 Paolo Bonzini + + * configure: Reapply PR30748 fix which was lost in the previous commit. + +2007-02-13 Daniel Jacobowitz + Paolo Bonzini + + PR bootstrap/30753 + * configure.ac: Remove obsolete build / host tests. Use AC_PROG_CC + unconditionally. Use AC_PROG_CXX. Use ACX_TOOL_DIRS to find $prefix. + * configure: Regenerated. + +2007-02-10 Paolo Bonzini + + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + PR bootstrap/30748 + * configure.ac: Correct syntax for Solaris ksh. + * configure: Regenerated. + +2007-02-09 Paolo Bonzini + + * Makefile.def: Sync with GCC. + * Makefile.tpl: Sync with GCC. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-09 Daniel Jacobowitz + + * Makefile.tpl (build_alias, host_alias, target_alias): Use + noncanonical equivalents. + * configure.in: Rename to... + * configure.ac: ...this. Update AC_PREREQ. Prevent error for + AS_FOR_TARGET. Set build_noncanonical, host_noncanonical, and + target_noncanonical. Use them. Rewrite removal of configure + arguments for autoconf 2.59. Discard variable settings. Force + program_transform_name for native tools. + + * Makefile.in: Regenerated. + * configure: Regenerated with autoconf 2.59. + + * src-release (DEVO_SUPPORT, do-proto-toplev): Expect configure.ac. + +2007-02-08 Jeff Johnston + + * COPYING.LIBGLOSS: Reformat default Red Hat + license to fit within 80 columns. + * COPYING.NEWLIB: Ditto. + +2007-02-05 Dave Brolley + + * Contribute the following changes: + 2006-11-28 DJ Delorie + + * configure.in: Fix typo for mep's target_makefile_frag. + * configure: Regenerated. + + 2005-04-22 Richard Sandiford + + * configure.in (mep*): Add -mlibrary to FLAGS_FOR_TARGET. + * configure: Regenerate. + + 2001-09-19 DJ Delorie + + * configure.in (target_makefile_frag): use mt-mep + + 2001-06-12 Don Howard + + * configure.in: Remove gdb from MeP skip list. + + 2001-04-05 DJ Delorie + + * configure.in (noconfigdirs): Remove gcc from MeP skip list. + + 2001-03-20 Ben Elliston + + * configure.in (noconfigdirs): Add gcc and gdb for MeP. + + 2001-03-19 Ben Elliston + + * config.sub (mep, mep-*): Add. + +2007-01-31 Andreas Schwab + + * Makefile.tpl (LDFLAGS): Substitute it. + * Makefile.in: Regenerate. + +2007-01-11 Paolo Bonzini + + * configure.in: Change == to = in test command. + * configure: Regenerate. + +2007-01-11 Paolo Bonzini + Nick Clifton + Kaveh R. Ghazi + + * configure.in (build_configargs, host_configargs, target_configargs): + Remove build/host/target parameters. + (host_libs): Add gmp and mpfr. + (GMP tests): Reorganize to allow in-tree GMP/MPFR. + * Makefile.def (gmp, mpfr): New. + (gcc): Remove target. + * Makefile.tpl (build_os, build_vendor, host_os, host_vendor, + target_os, target_vendor): New. + (configure): Add host_alias/target_alias arguments. Adjust invocations. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-01-11 Matt Fago + + * configure.in: Try to link to functions only in mpfr 2.2.x + to improve robustness of configure tests. + * configure: Regenerate. + +2007-01-08 Kai Tietz + + * configure.in: Add support for an x86_64-mingw* target. + * configure: Regenerate. + +2007-01-05 Daniel Jacobowitz + + * Makefile.tpl (all-target): Correct @if conditional for target + modules. + * configure.in: Omit libiberty if building only target libgcc. + * configure, Makefile.in: Regenerated. + +2007-01-04 Paolo Bonzini + + * configure.in: Use DEV-PHASE to detect the default for --enable-werror. + * configure: Regenerate. + +2007-01-03 Daniel Jacobowitz + + * Makefile.def (target_modules): Add libgcc. + (lang_env_dependencies): Remove default items. Use no_c and no_gcc. + * Makefile.tpl (clean-target-libgcc): Delete. + (configure-target-[+module+]): Emit --disable-bootstrap dependencies + on gcc even for bootstrapped modules. Rewrite handling of + lang_env_dependencies to loop over target_modules. + * configure.in (target_libraries): Add target-libgcc. + * Makefile.in, configure: Regenerated. + +2006-12-29 Paolo Bonzini + + Sync with gcc: + 2006-12-29 Paolo Bonzini + + * configure.in: Reorganize recognition of languages. Add + --enable-stage1-languages. Show supported languages for the chosen + target rather than all recognized languages. + * configure: Regenerate. + + 2006-12-29 Paolo Bonzini + + * Makefile.tpl (GCC_STRAP_TARGETS, all-prebootstrap): Remove. + * Makefile.in: Regenerate. + + 2006-12-29 Kaveh R. Ghazi + + * configure.in: Warn that MPFR 2.2.0 is buggy. + * configure: Regenerate. + +2006-12-27 Ian Lance Taylor + + * configure.in: When removing Makefiles to force a reconfigure, also + remove prev-DIR*/Makefile. + * configure: Regenerate. + +2006-12-23 Kazu Hirata + + * config.bfd: Recognize fido. + +2006-12-19 Paolo Bonzini + + Sync with gcc: + + 2006-12-19 Paolo Bonzini + + * configure.in: Remove "$build" case for powerpc-*-darwin* since + it only affects bootstrap and could be tested on "$host" as well. + * configure: Regenerate. + * config/mh-ppc-darwin: Add to the stage1 cflags here. + + 2006-12-19 Paolo Bonzini + + PR bootstrap/29544 + * Makefile.def (flags_to_pass): Add STAGE1_CHECKING. + (bootstrap_stage): Add STAGE1_CHECKING to stage1 configure flags, + move here comment from Makefile.tpl. + * Makefile.tpl: Move some definitions higher in the file. + (STAGE1_CHECKING): New. + * configure.in: Add --enable-stage1-checking. + * configure: Regenerate. + * Makefile.in: Regenerate. + + 2006-12-03 Kaveh R. Ghazi + + * configure.in: Update error message for missing GMP/MPFR. + + * configure: Regenerate. + + 2006-12-02 Kaveh R. Ghazi + + * configure.in: Update MPFR version in error message. + + * configure: Regenerate. + + 2006-11-26 Kaveh R. Ghazi + + * configure.in (--with-mpfr-dir, --with-gmp-dir): Remove flags. + (--with-mpfr-include, --with-mpfr-lib, --with-gmp-include, + --with-gmp-lib): New flags. + + * configure: Regenerate. + +2006-12-12 Andreas Tobler + + PR bootstrap/30134 + * configure.in: Correct x86 darwin support for libjava to powerpc + and i?86 only. + * configure: Regenerate. + +2006-12-11 Alan Modra + + * configure.in: Handle spu makefile frag. + * Makefile.tpl (MAINT): Define + (MAINTAINER_MODE_FALSE, MAINTAINER_MODE_TRUE): Define. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2006-12-11 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-12-11 Ben Elliston + + * configure.in: Sync with GCC (spu-*-*). + * configure: Sync with GCC. + +2006-12-07 Mike Stump + + * Makefile.def (dependencies): Add dependency for + install-target-libssp and install-target-libgomp on + install-gcc. + * Makefile.in: Regenerate. + +2006-11-16 Paolo Bonzini + + * Makefile.tpl (clean-target-libgcc): Test for gcc Makefile presence. + (unstage): Test for stage_last presence. + + PR bootstrap/29802 + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Add HOST_SUBDIR in STAGE_PREFIX. + * Makefile.in: Regenerate. + +2006-11-14 DJ Delorie + + * Makefile.tpl (clean-stage*): Sync with GCC (clean). + * Makefile.in: Sync with GCC. + * configure.in: Sync with GCC (mpfr, gmp). + * configure: Sync with GCC. + +2006-11-08 Jie Zhang + + * configure.in: Remove target-libgloss from noconfigdirs for + bfin-*-*. + * configure: Regenerated. + +2006-10-27 Jeff Johnston + + * COPYING.NEWLIB: Add spu license. + * COPYING.LIBGLOSS: Ditto. + +2006-10-17 Brooks Moses + + * Makefile.def: Added pdf target handling. + * Makefile.tpl: Added pdf target handling. + * Makefile.in: Regenerated. + +2006-10-11 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2006-09-27 Dave Brolley + + * configure.in (RUNTEST): Look for 'runtest' in the source tree by using + $s instead of $r. + * configure: Regenerated. + +2006-09-26 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-09-20 Thiemo Seufer + + * configure.in: Remove redundant handling of mips*-dec-bsd*. Likewise + for mipstx39-*-*. Disable libgloss for mips64*-*-linux*. + * configure: Regenerate. + +2006-08-30 Corinna Vinschen + + * configure.in: Never build newlib for a Mingw host. + Never build newlib as Mingw target library. + Test the existence of winsup/cygwin for building a Cygwin newlib, + rather than just winsup. + Add winsup/mingw and winsup/w32api paths to FLAGS_FOR_TARGET if + building a Mingw target. + * configure: Regenerate. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.sub: Add support for sde as alias of mipsisa32-sde-elf. + +2006-07-25 Paolo Bonzini + + Sync from GCC: + 2006-07-04 Eric Botcazou + + PR bootstrap/18058 + * configure.in: Add -fkeep-inline-functions to CFLAGS for stage 1 + if the bootstrap compiler is a GCC version that supports it. + * configure: Regenerate. + +2006-07-22 Daniel Jacobowitz + + * configure.in: Allow mingw32 and cygwin targets to build cross-gdb. + * configure: Regenerated. + +2006-07-18 Paolo Bonzini + + * Makefile.tpl (configure-stageN-MODULE): Pass --with-build-libsubdir + for stages after the first. + +2006-07-17 Jakub Jelinek + + * Makefile.def: Add dependencies for configure-opcodes + on configure-intl and all-opcodes on all-intl. + * Makefile.in: Regenerated. + +2006-07-04 Peter O'Gorman + + * ltconfig: chmod 644 before ranlib during install. + +2006-07-03 Paolo Bonzini + + * configure.in: Fix thinkos in previous check-in. + * configure: Regenerate. + +2006-07-03 Paolo Bonzini + + Sync from gcc: + + 2007-07-03 Paolo Bonzini + + PR other/27063 + * configure.in: Test subdir_requires and give an appropriate + error message. + * configure: Regenerate. + + 2006-06-16 Rainer Orth + + PR target/27540 + * configure.in: Only enable libgomp on IRIX 6. + * configure: Regenerate. + +2006-06-20 David Ayers + + PR bootstrap/28072 + * configure.in: Add target-boehm-gc to noconfigdirs depending on + whether target-libjava is being configured instead of whether the + java front end is enabled. + * configure: Regenerate. + +2006-06-15 Mark Shinwell + + * include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2} + to R_ARM_LDC_SB_G{0,1,2} respectively. + +2006-06-15 Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Export CFLAGS and LDFLAGS + too. + * Makefile.in: Regenerate. + +2006-06-13 John David Anglin + + Sync from gcc: + + 2006-06-12 John David Anglin + * configure.in: Don't enable libgomp on hpux10. + * configure: Rebuilt. + +2006-06-13 David Ayers + + Sync from gcc: + + 2006-06-12 David Ayers + + PR bootstrap/27963 + PR target/19970 + * configure.in: Remove target-boehm-gc from noconfigdirs where + ${libgcj} is specified. + * configure: Regenerate. + +2006-06-08 Jeff Johnston + + Sync from gcc: + + 2005-01-12 David Edelsohn + Andreas Schwab + + PR bootstrap/18033 + * config-ml.in: Eval option if surrounded by single quotes. + +2006-06-07 Carlos O'Donell + + Sync from gcc: + + 2006-06-06 David Ayers + + PR libobjc/13946 + * Makefile.def: Add dependencies for libobjc which boehm-gc. + * Makefile.in: Regenerate. + * configure.in: Add --enable-objc-gc at toplevel and have it + enable boehm-gc for Objective-C. + Remove target-boehm-gc from libgcj. + Add target-boehm-gc to target_libraries. + Add target-boehm-gc to noconfigdirs where ${libgcj} + is specified. + Assert that boehm-gc is supported when requested for Objective-C. + Only build boehm-gc if needed either for Java or Objective-C. + * configure: Regenerate. + + 2006-06-05 Paolo Bonzini + + PR 27674 + * Makefile.tpl (configure-[+prefix+][+module+], + all-[+prefix+][+module+]): Depend on stage_current if bootstrapping. + Remove rule to unstage bootstrapped modules. + (stage_current): New. + * Makefile.in: Regenerate. + + 2006-05-20 John David Anglin + Andreas Tobler + + * configure.in: Enable libgcj for hppa*-hp-hpux11*. + * configure: Rebuilt. + + Revert + 2006-01-31 Richard Guenther + Paolo Bonzini + + * Makefile.def (target_modules): Add libgcc-math target module. + * configure.in (target_libraries): Add libgcc-math target library. + (--enable-libgcc-math): New configure switch. + * Makefile.in: Re-generate. + * configure: Re-generate. + +2006-06-05 Jeff Johnston + + * config-ml.in: Alter CCASFLAGS to include special + multilib options the same as is done for CFLAGS. + +2006-05-31 Daniel Jacobowitz + + * Makefile.def: Added dependencies from sim and gdb on intl, and + added configure dependencies to everything with an all dependency + on intl. + * gettext.m4: Removed. + * src-release (DEVO_SUPPORT): Don't mention gettext.m4. + (GDB_SUPPORT_DIRS): Add intl. + * Makefile.in: Regenerated. + +2006-05-25 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add config.rpath. + +2006-05-25 Paolo Bonzini + + * Makefile.def (bfd, opcodes): Fix lib_path. + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Replace ADAC with ADAFLAGS. + (restrap): Move under "@if gcc-bootstrap". Fix typo. + * Makefile.in: Regenerate. + +2006-05-24 Mark Shinwell + + * configure.in: Enable gprof for cross builds. + * configure: Regenerate. + 2006-05-17 Daniel Jacobowitz * src-release (MAKEINFOFLAGS): Define. (do-proto-toplev): Pass MAKEINFOFLAGS to submakes. +2006-05-14 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-12 Ben Elliston + + * config.sub, config.guess: Update from upstream sources. + +2006-05-04 Steve Ellcey + + * blt, iwidgets, mmalloc: Remove directories. + +2006-05-01 DJ Delorie + + * configure.in: Restore CFLAGS if GMP isn't present. + * configure: Regenerate. + +2006-04-18 DJ Delorie + + * configure.in (m32c): Build libstdc++-v3. Pass flags to + reference libgloss so that libssp can be built in a combined + tree. + * configure: Regenerate. + 2006-04-10 Ben Elliston * contrib: Remove directory. @@ -35,7 +718,7 @@ * configure: Regenerate. 2006-02-21 Rafael Avila de Espindola - + * Makefile.tpl (BUILD_CONFIGDIRS): Remove. (TARGET_CONFIGDIRS): Remove. * configure.in: Remove AC_SUBST(target_configdirs). @@ -105,7 +788,7 @@ 2006-02-14 Paolo Bonzini Andreas Schwab - + * configure: Regenerate. 2006-01-16 Paolo Bonzini @@ -117,7 +800,7 @@ 2006-01-16 Nick Clifton - * config.sub, config.guess: Sync from config repository. + * config.sub, config.guess: Sync from config repository. 2006-01-05 Alexandre Oliva @@ -397,7 +1080,7 @@ CONFIGURED_LIPO_FOR_TARGET, CONFIGURED_STRIP_FOR_TARGET. * Makefile.in: Regenerate. * configure: Regenerate. - + 2005-09-19 David Edelsohn * configure.in (powerpc-*-aix*): Add target-libssp to noconfigdirs. @@ -464,7 +1147,7 @@ 2005-07-27 Mark Mitchell * Makefile.tpl (EXTRA_TARGET_FLAGS): Set LDFLAGS=LDFLAGS_FOR_TARGET. - * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET. + * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET. * Makefile.in: Regenerated. 2005-07-26 Mark Mitchell @@ -489,7 +1172,7 @@ * configure.in: Add cases for Renesas m32c. * configure: Regenerated. - + 2005-07-14 Kelley Cook * COPYING, compile, config-ml.in, config.guess, @@ -604,7 +1287,7 @@ 2005-05-19 Paul Brook - * configure.in: Rewrite misleading error message when requested + * configure.in: Rewrite misleading error message when requested language cannot be built. * configure: Regenerate. diff --git a/contrib/binutils/MAINTAINERS b/contrib/binutils/MAINTAINERS index b2077e7c26a..6c5f732805e 100644 --- a/contrib/binutils/MAINTAINERS +++ b/contrib/binutils/MAINTAINERS @@ -47,15 +47,15 @@ gdb/; readline/; sim/; GDB's part of include/ include/ See binutils/, gdb/, sid/, gcc/, libiberty/ etc. -libiberty/; libiberty's part of include/ +intl/; config.rhost; libiberty/; libiberty's part of include/ gcc: http://gcc.gnu.org Changes need to be done in tandem with the official GCC sources or submitted to the master file maintainer and brought - in via a merge. Note: approved patches in gcc's libiberty - are automatically approved in this libiberty also; feel free - to merge them yourself if needed sooner than the next merge. - Otherwise, changes are automatically merged, usually within - a day. + in via a merge. Note: approved patches in gcc's libiberty or + intl are automatically approved in this libiberty and intl also; + feel free to merge them yourself if needed sooner than the next + merge. Otherwise, changes are automatically merged, usually + within a day. ltconfig; ltmain.sh; ltcf-*.sh libtool: http://www.gnu.org/software/libtool/ @@ -99,7 +99,7 @@ winsup/ See also winsup/MAINTAINERS. config-ml.in; makefile.vms; mkdep; setup.com; -etc/; intl/; utils/; +etc/; utils/; Any global maintainer can approve changes to these files and directories. diff --git a/contrib/binutils/Makefile.def b/contrib/binutils/Makefile.def index 4c58ab5a71f..3d2c6eeeb44 100644 --- a/contrib/binutils/Makefile.def +++ b/contrib/binutils/Makefile.def @@ -30,15 +30,14 @@ build_modules= { module= byacc; }; build_modules= { module= flex; }; build_modules= { module= m4; }; build_modules= { module= texinfo; }; -build_modules= { module= fixincludes; - extra_configure_args='--target=$(target)'; }; +build_modules= { module= fixincludes; }; host_modules= { module= ash; }; host_modules= { module= autoconf; }; host_modules= { module= automake; }; host_modules= { module= bash; }; -host_modules= { module= bfd; lib_path=.; bootstrap=true; }; -host_modules= { module= opcodes; lib_path=.; bootstrap=true; }; +host_modules= { module= bfd; lib_path=.libs; bootstrap=true; }; +host_modules= { module= opcodes; lib_path=.libs; bootstrap=true; }; host_modules= { module= binutils; bootstrap=true; }; host_modules= { module= bison; no_check_cross= true; }; host_modules= { module= byacc; no_check_cross= true; }; @@ -52,18 +51,23 @@ host_modules= { module= fileutils; }; host_modules= { module= findutils; }; host_modules= { module= find; }; host_modules= { module= fixincludes; - missing= info; - missing= dvi; - missing= TAGS; - missing= install-info; - missing= installcheck; }; + missing= TAGS; }; host_modules= { module= flex; no_check_cross= true; }; host_modules= { module= gas; bootstrap=true; }; host_modules= { module= gcc; bootstrap=true; - target="`if [ -f stage_last ]; then echo quickstrap ; else echo all; fi`"; extra_make_flags="$(EXTRA_GCC_FLAGS)"; }; host_modules= { module= gawk; }; host_modules= { module= gettext; }; +host_modules= { module= gmp; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared'; + no_install= true; + host="none-${host_vendor}-${host_os}"; + target="none-${host_vendor}-${host_os}"; }; +host_modules= { module= mpfr; lib_path=.libs; bootstrap=true; + extra_configure_flags='--disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp'; + no_install= true; + host="none-${host_vendor}-${host_os}"; + target="none-${host_vendor}-${host_os}"; }; host_modules= { module= gnuserv; }; host_modules= { module= gprof; }; host_modules= { module= gzip; }; @@ -117,8 +121,8 @@ host_modules= { module= gnattools; }; target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; }; target_modules = { module= libmudflap; lib_path=.libs; }; target_modules = { module= libssp; lib_path=.libs; }; -target_modules = { module= libgcc-math; lib_path=.libs; }; target_modules = { module= newlib; }; +target_modules = { module= libgcc; bootstrap=true; no_check=true; }; target_modules = { module= libgfortran; }; target_modules = { module= libobjc; }; target_modules = { module= libtermcap; no_check=true; @@ -148,6 +152,8 @@ recursive_targets = { make_target= info; depend=configure; }; recursive_targets = { make_target= dvi; depend=configure; }; +recursive_targets = { make_target= pdf; + depend=configure; }; recursive_targets = { make_target= html; depend=configure; }; recursive_targets = { make_target= TAGS; @@ -155,6 +161,9 @@ recursive_targets = { make_target= TAGS; recursive_targets = { make_target= install-info; depend=configure; depend=info; }; +recursive_targets = { make_target= install-pdf; + depend=configure; + depend=pdf; }; recursive_targets = { make_target= install-html; depend=configure; depend=html; }; @@ -178,6 +187,7 @@ flags_to_pass = { flag= includedir ; }; flags_to_pass = { flag= datarootdir ; }; flags_to_pass = { flag= docdir ; }; flags_to_pass = { flag= infodir ; }; +flags_to_pass = { flag= pdfdir ; }; flags_to_pass = { flag= htmldir ; }; flags_to_pass = { flag= libdir ; }; flags_to_pass = { flag= libexecdir ; }; @@ -224,7 +234,10 @@ flags_to_pass = { flag= LDFLAGS ; }; flags_to_pass = { flag= LIBCFLAGS ; }; flags_to_pass = { flag= LIBCXXFLAGS ; }; flags_to_pass = { flag= STAGE1_CFLAGS ; }; +flags_to_pass = { flag= STAGE1_CHECKING ; }; flags_to_pass = { flag= STAGE1_LANGUAGES ; }; +flags_to_pass = { flag= GNATBIND ; }; +flags_to_pass = { flag= GNATMAKE ; }; // Target tools flags_to_pass = { flag= AR_FOR_TARGET ; }; @@ -271,7 +284,9 @@ dependencies = { module=configure-gcc; on=all-binutils; }; dependencies = { module=configure-gcc; on=all-gas; }; dependencies = { module=configure-gcc; on=all-ld; }; dependencies = { module=all-gcc; on=all-libiberty; hard=true; }; +dependencies = { module=all-gcc; on=all-gmp; }; dependencies = { module=all-gcc; on=all-intl; }; +dependencies = { module=all-gcc; on=all-mpfr; }; dependencies = { module=all-gcc; on=all-build-texinfo; }; dependencies = { module=all-gcc; on=all-build-bison; }; dependencies = { module=all-gcc; on=all-build-byacc; }; @@ -294,11 +309,15 @@ dependencies = { module=all-fixincludes; on=all-libiberty; }; dependencies = { module=all-gnattools; on=all-target-libada; }; +dependencies = { module=configure-mpfr; on=all-gmp; }; + // Host modules specific to gdb. +dependencies = { module=configure-gdb; on=configure-intl; }; dependencies = { module=configure-gdb; on=configure-sim; }; +dependencies = { module=configure-gdb; on=all-bfd; }; +dependencies = { module=all-gdb; on=all-intl; }; dependencies = { module=all-gdb; on=all-libiberty; }; dependencies = { module=all-gdb; on=all-opcodes; }; -dependencies = { module=all-gdb; on=all-bfd; }; dependencies = { module=all-gdb; on=all-readline; }; dependencies = { module=all-gdb; on=all-build-bison; }; dependencies = { module=all-gdb; on=all-build-byacc; }; @@ -312,9 +331,11 @@ dependencies = { module=all-libgui; on=all-itcl; }; // Host modules specific to binutils. dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; }; +dependencies = { module=configure-bfd; on=configure-intl; }; dependencies = { module=all-bfd; on=all-libiberty; }; dependencies = { module=all-bfd; on=all-intl; }; +dependencies = { module=configure-binutils; on=configure-intl; }; dependencies = { module=all-binutils; on=all-libiberty; }; dependencies = { module=all-binutils; on=all-opcodes; }; dependencies = { module=all-binutils; on=all-bfd; }; @@ -331,14 +352,17 @@ dependencies = { module=install-binutils; on=install-opcodes; }; // libopcodes depends on libbfd dependencies = { module=install-opcodes; on=install-bfd; }; +dependencies = { module=configure-gas; on=configure-intl; }; dependencies = { module=all-gas; on=all-libiberty; }; dependencies = { module=all-gas; on=all-opcodes; }; dependencies = { module=all-gas; on=all-bfd; }; dependencies = { module=all-gas; on=all-intl; }; +dependencies = { module=configure-gprof; on=configure-intl; }; dependencies = { module=all-gprof; on=all-libiberty; }; dependencies = { module=all-gprof; on=all-bfd; }; dependencies = { module=all-gprof; on=all-opcodes; }; dependencies = { module=all-gprof; on=all-intl; }; +dependencies = { module=configure-ld; on=configure-intl; }; dependencies = { module=all-ld; on=all-libiberty; }; dependencies = { module=all-ld; on=all-bfd; }; dependencies = { module=all-ld; on=all-opcodes; }; @@ -347,8 +371,10 @@ dependencies = { module=all-ld; on=all-build-byacc; }; dependencies = { module=all-ld; on=all-build-flex; }; dependencies = { module=all-ld; on=all-intl; }; +dependencies = { module=configure-opcodes; on=configure-intl; }; dependencies = { module=all-opcodes; on=all-bfd; }; dependencies = { module=all-opcodes; on=all-libiberty; }; +dependencies = { module=all-opcodes; on=all-intl; }; // Other host modules in the 'src' repository. dependencies = { module=all-dejagnu; on=all-tcl; }; @@ -378,6 +404,8 @@ dependencies = { module=all-sid; on=all-tk; }; dependencies = { module=install-sid; on=install-tcl; }; dependencies = { module=install-sid; on=install-tk; }; +dependencies = { module=configure-sim; on=configure-intl; }; +dependencies = { module=all-sim; on=all-intl; }; dependencies = { module=all-sim; on=all-libiberty; }; dependencies = { module=all-sim; on=all-bfd; }; dependencies = { module=all-sim; on=all-opcodes; }; @@ -425,18 +453,17 @@ dependencies = { module=all-tar; on=all-build-texinfo; }; dependencies = { module=all-uudecode; on=all-build-texinfo; }; // Target modules. These can also have dependencies on the language -// environment (e.g. on libstdc++). -lang_env_dependencies = { module=boehm-gc; }; +// environment (e.g. on libstdc++). By default target modules depend +// on libgcc and newlib/libgloss. lang_env_dependencies = { module=gperf; cxx=true; }; -lang_env_dependencies = { module=libada; }; -lang_env_dependencies = { module=libgfortran; }; -lang_env_dependencies = { module=libffi; }; lang_env_dependencies = { module=libjava; cxx=true; }; -lang_env_dependencies = { module=libmudflap; }; -lang_env_dependencies = { module=libobjc; }; -lang_env_dependencies = { module=libssp; }; -lang_env_dependencies = { module=libstdc++-v3; }; -lang_env_dependencies = { module=zlib; }; +lang_env_dependencies = { module=newlib; no_c=true; }; +lang_env_dependencies = { module=libgloss; no_c=true; }; +lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; }; +// libiberty does not depend on newlib or libgloss because it must be +// built newlib on some targets (e.g. Cygwin). It still needs +// a dependency on libgcc for native targets to configure. +lang_env_dependencies = { module=libiberty; no_c=true; }; dependencies = { module=configure-target-boehm-gc; on=configure-target-qthreads; }; dependencies = { module=configure-target-fastjar; on=configure-target-zlib; }; @@ -451,7 +478,9 @@ dependencies = { module=all-target-libjava; on=all-target-zlib; }; dependencies = { module=all-target-libjava; on=all-target-boehm-gc; }; dependencies = { module=all-target-libjava; on=all-target-qthreads; }; dependencies = { module=all-target-libjava; on=all-target-libffi; }; +dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc; }; dependencies = { module=all-target-libobjc; on=all-target-libiberty; }; +dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; }; dependencies = { module=all-target-libstdc++-v3; on=all-target-libiberty; }; // Target modules in the 'src' repository. @@ -468,33 +497,40 @@ dependencies = { module=all-target-winsup; on=all-target-libtermcap; }; // Toplevel bootstrap bootstrap_stage = { id=1 ; - stage_configure_flags='--disable-intermodule \ + + // * We force-disable intermodule optimizations, even if + // --enable-intermodule was passed, since the installed compiler + // probably can't handle them. Luckily, autoconf always respects + // the last argument when conflicting --enable arguments are passed. + // * Likewise, we force-disable coverage flags, since the installed + // compiler probably has never heard of them. + stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \ --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ; - stage_make_flags='CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)"' ; }; + stage_cflags='$(STAGE1_CFLAGS)' ; }; bootstrap_stage = { id=2 ; prev=1 ; bootstrap_target=bootstrap2 ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags="" ; }; + stage_cflags="$(BOOT_CFLAGS)" ; }; bootstrap_stage = { id=3 ; prev=2 ; lean=1 ; compare_target=compare ; bootstrap_target=bootstrap ; cleanstrap_target=cleanstrap ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags="" ; }; + stage_cflags="$(BOOT_CFLAGS)" ; }; bootstrap_stage = { id=4 ; prev=3 ; lean=2 ; compare_target=compare3 ; bootstrap_target=bootstrap4 ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags="" ; }; + stage_cflags="$(BOOT_CFLAGS)" ; }; bootstrap_stage = { id=profile ; prev=1 ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"' ; }; + stage_cflags='$(BOOT_CFLAGS) -fprofile-generate' ; }; bootstrap_stage = { id=feedback ; prev=profile ; bootstrap_target=profiledbootstrap ; stage_configure_flags="@stage2_werror_flag@" ; - stage_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-use"' ; }; + stage_cflags='$(BOOT_CFLAGS) -fprofile-use' ; }; diff --git a/contrib/binutils/Makefile.in b/contrib/binutils/Makefile.in index 2d0da2e7c3c..e34410cf18b 100644 --- a/contrib/binutils/Makefile.in +++ b/contrib/binutils/Makefile.in @@ -25,11 +25,17 @@ # ------------------------------- VPATH=@srcdir@ -build_alias=@build_alias@ +build_alias=@build_noncanonical@ +build_vendor=@build_vendor@ +build_os=@build_os@ build=@build@ -host_alias=@host_alias@ +host_alias=@host_noncanonical@ +host_vendor=@host_vendor@ +host_os=@host_os@ host=@host@ -target_alias=@target_alias@ +target_alias=@target_noncanonical@ +target_vendor=@target_vendor@ +target_os=@target_os@ target=@target@ program_transform_name = @program_transform_name@ @@ -52,6 +58,7 @@ oldincludedir = @oldincludedir@ infodir = @infodir@ datarootdir = @datarootdir@ docdir = @docdir@ +pdfdir = @pdfdir@ htmldir = @htmldir@ mandir = @mandir@ man1dir = $(mandir)/man1 @@ -70,6 +77,9 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ LN = @LN@ LN_S = @LN_S@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ # ------------------------------------------------- # Miscellaneous non-standard autoconf-set variables @@ -177,7 +187,8 @@ POSTSTAGE1_HOST_EXPORTS = \ CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \ $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ \ - -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; + -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \ + LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS; # Target libraries are put under this directory: TARGET_SUBDIR = @target_subdir@ @@ -285,13 +296,26 @@ RANLIB = @RANLIB@ STRIP = @STRIP@ WINDRES = @WINDRES@ +GNATBIND = @GNATBIND@ +GNATMAKE = @GNATMAKE@ + CFLAGS = @CFLAGS@ -LDFLAGS = +LDFLAGS = @LDFLAGS@ LIBCFLAGS = $(CFLAGS) CXXFLAGS = @CXXFLAGS@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates PICFLAG = +# Only build the C compiler for stage1, because that is the only one that +# we can guarantee will build with the native compiler, and also it is the +# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). + +STAGE1_CFLAGS=@stage1_cflags@ +STAGE1_CHECKING=@stage1_checking@ +STAGE1_LANGUAGES=@stage1_languages@ + # ----------------------------------------------- # Programs producing files for the TARGET machine # ----------------------------------------------- @@ -354,7 +378,7 @@ all: # This is the list of directories that may be needed in RPATH_ENVVAR # so that prorgams built for the target machine work. -TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgcc-math)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc) +TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc) @if target-libstdc++-v3 TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/.libs: @@ -368,10 +392,6 @@ TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs: TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs: @endif target-libssp -@if target-libgcc-math -TARGET_LIB_PATH_libgcc-math = $$r/$(TARGET_SUBDIR)/libgcc-math/.libs: -@endif target-libgcc-math - @if target-libgomp TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs: @endif target-libgomp @@ -380,7 +400,7 @@ TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs: # This is the list of directories that may be needed in RPATH_ENVVAR # so that programs built for the host machine work. -HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes) +HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes)$(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr) # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch @if gcc @@ -390,14 +410,24 @@ HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc: @if bfd HOST_LIB_PATH_bfd = \ - $$r/$(HOST_SUBDIR)/bfd/.:$$r/$(HOST_SUBDIR)/prev-bfd/.: + $$r/$(HOST_SUBDIR)/bfd/.libs:$$r/$(HOST_SUBDIR)/prev-bfd/.libs: @endif bfd @if opcodes HOST_LIB_PATH_opcodes = \ - $$r/$(HOST_SUBDIR)/opcodes/.:$$r/$(HOST_SUBDIR)/prev-opcodes/.: + $$r/$(HOST_SUBDIR)/opcodes/.libs:$$r/$(HOST_SUBDIR)/prev-opcodes/.libs: @endif opcodes +@if gmp +HOST_LIB_PATH_gmp = \ + $$r/$(HOST_SUBDIR)/gmp/.libs:$$r/$(HOST_SUBDIR)/prev-gmp/.libs: +@endif gmp + +@if mpfr +HOST_LIB_PATH_mpfr = \ + $$r/$(HOST_SUBDIR)/mpfr/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/.libs: +@endif mpfr + # Flags to pass down to all sub-makes. BASE_FLAGS_TO_PASS = \ @@ -411,6 +441,7 @@ BASE_FLAGS_TO_PASS = \ "datarootdir=$(datarootdir)" \ "docdir=$(docdir)" \ "infodir=$(infodir)" \ + "pdfdir=$(pdfdir)" \ "htmldir=$(htmldir)" \ "libdir=$(libdir)" \ "libexecdir=$(libexecdir)" \ @@ -453,7 +484,10 @@ BASE_FLAGS_TO_PASS = \ "LIBCFLAGS=$(LIBCFLAGS)" \ "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ "STAGE1_CFLAGS=$(STAGE1_CFLAGS)" \ + "STAGE1_CHECKING=$(STAGE1_CHECKING)" \ "STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \ + "GNATBIND=$(GNATBIND)" \ + "GNATMAKE=$(GNATMAKE)" \ "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ @@ -512,6 +546,14 @@ X11_FLAGS_TO_PASS = \ 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' +# Flags to pass to stage2 and later makes. + +POSTSTAGE1_FLAGS_TO_PASS = \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \ + LDFLAGS="$(BOOT_LDFLAGS)" \ + "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + # Flags to pass down to makes which are built with the target environment. # The double $ decreases the length of the command line; those variables # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The @@ -577,6 +619,8 @@ configure-host: \ maybe-configure-gcc \ maybe-configure-gawk \ maybe-configure-gettext \ + maybe-configure-gmp \ + maybe-configure-mpfr \ maybe-configure-gnuserv \ maybe-configure-gprof \ maybe-configure-gzip \ @@ -626,8 +670,8 @@ configure-target: \ maybe-configure-target-libstdc++-v3 \ maybe-configure-target-libmudflap \ maybe-configure-target-libssp \ - maybe-configure-target-libgcc-math \ maybe-configure-target-newlib \ + maybe-configure-target-libgcc \ maybe-configure-target-libgfortran \ maybe-configure-target-libobjc \ maybe-configure-target-libtermcap \ @@ -709,6 +753,12 @@ all-host: maybe-all-gcc @endif gcc-no-bootstrap all-host: maybe-all-gawk all-host: maybe-all-gettext +@if gmp-no-bootstrap +all-host: maybe-all-gmp +@endif gmp-no-bootstrap +@if mpfr-no-bootstrap +all-host: maybe-all-mpfr +@endif mpfr-no-bootstrap all-host: maybe-all-gnuserv all-host: maybe-all-gprof all-host: maybe-all-gzip @@ -771,8 +821,10 @@ all-host: maybe-all-gnattools all-target: maybe-all-target-libstdc++-v3 all-target: maybe-all-target-libmudflap all-target: maybe-all-target-libssp -all-target: maybe-all-target-libgcc-math all-target: maybe-all-target-newlib +@if target-libgcc-no-bootstrap +all-target: maybe-all-target-libgcc +@endif target-libgcc-no-bootstrap all-target: maybe-all-target-libgfortran all-target: maybe-all-target-libobjc all-target: maybe-all-target-libtermcap @@ -830,6 +882,8 @@ info-host: maybe-info-gas info-host: maybe-info-gcc info-host: maybe-info-gawk info-host: maybe-info-gettext +info-host: maybe-info-gmp +info-host: maybe-info-mpfr info-host: maybe-info-gnuserv info-host: maybe-info-gprof info-host: maybe-info-gzip @@ -880,8 +934,8 @@ info-host: maybe-info-gnattools info-target: maybe-info-target-libstdc++-v3 info-target: maybe-info-target-libmudflap info-target: maybe-info-target-libssp -info-target: maybe-info-target-libgcc-math info-target: maybe-info-target-newlib +info-target: maybe-info-target-libgcc info-target: maybe-info-target-libgfortran info-target: maybe-info-target-libobjc info-target: maybe-info-target-libtermcap @@ -934,6 +988,8 @@ dvi-host: maybe-dvi-gas dvi-host: maybe-dvi-gcc dvi-host: maybe-dvi-gawk dvi-host: maybe-dvi-gettext +dvi-host: maybe-dvi-gmp +dvi-host: maybe-dvi-mpfr dvi-host: maybe-dvi-gnuserv dvi-host: maybe-dvi-gprof dvi-host: maybe-dvi-gzip @@ -984,8 +1040,8 @@ dvi-host: maybe-dvi-gnattools dvi-target: maybe-dvi-target-libstdc++-v3 dvi-target: maybe-dvi-target-libmudflap dvi-target: maybe-dvi-target-libssp -dvi-target: maybe-dvi-target-libgcc-math dvi-target: maybe-dvi-target-newlib +dvi-target: maybe-dvi-target-libgcc dvi-target: maybe-dvi-target-libgfortran dvi-target: maybe-dvi-target-libobjc dvi-target: maybe-dvi-target-libtermcap @@ -1003,6 +1059,112 @@ dvi-target: maybe-dvi-target-rda dvi-target: maybe-dvi-target-libada dvi-target: maybe-dvi-target-libgomp +.PHONY: do-pdf +do-pdf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) pdf-host \ + pdf-target + + +.PHONY: pdf-host + +pdf-host: maybe-pdf-ash +pdf-host: maybe-pdf-autoconf +pdf-host: maybe-pdf-automake +pdf-host: maybe-pdf-bash +pdf-host: maybe-pdf-bfd +pdf-host: maybe-pdf-opcodes +pdf-host: maybe-pdf-binutils +pdf-host: maybe-pdf-bison +pdf-host: maybe-pdf-byacc +pdf-host: maybe-pdf-bzip2 +pdf-host: maybe-pdf-dejagnu +pdf-host: maybe-pdf-diff +pdf-host: maybe-pdf-dosutils +pdf-host: maybe-pdf-etc +pdf-host: maybe-pdf-fastjar +pdf-host: maybe-pdf-fileutils +pdf-host: maybe-pdf-findutils +pdf-host: maybe-pdf-find +pdf-host: maybe-pdf-fixincludes +pdf-host: maybe-pdf-flex +pdf-host: maybe-pdf-gas +pdf-host: maybe-pdf-gcc +pdf-host: maybe-pdf-gawk +pdf-host: maybe-pdf-gettext +pdf-host: maybe-pdf-gmp +pdf-host: maybe-pdf-mpfr +pdf-host: maybe-pdf-gnuserv +pdf-host: maybe-pdf-gprof +pdf-host: maybe-pdf-gzip +pdf-host: maybe-pdf-hello +pdf-host: maybe-pdf-indent +pdf-host: maybe-pdf-intl +pdf-host: maybe-pdf-tcl +pdf-host: maybe-pdf-itcl +pdf-host: maybe-pdf-ld +pdf-host: maybe-pdf-libcpp +pdf-host: maybe-pdf-libdecnumber +pdf-host: maybe-pdf-libgui +pdf-host: maybe-pdf-libiberty +pdf-host: maybe-pdf-libtool +pdf-host: maybe-pdf-m4 +pdf-host: maybe-pdf-make +pdf-host: maybe-pdf-mmalloc +pdf-host: maybe-pdf-patch +pdf-host: maybe-pdf-perl +pdf-host: maybe-pdf-prms +pdf-host: maybe-pdf-rcs +pdf-host: maybe-pdf-readline +pdf-host: maybe-pdf-release +pdf-host: maybe-pdf-recode +pdf-host: maybe-pdf-sed +pdf-host: maybe-pdf-send-pr +pdf-host: maybe-pdf-shellutils +pdf-host: maybe-pdf-sid +pdf-host: maybe-pdf-sim +pdf-host: maybe-pdf-tar +pdf-host: maybe-pdf-texinfo +pdf-host: maybe-pdf-textutils +pdf-host: maybe-pdf-time +pdf-host: maybe-pdf-uudecode +pdf-host: maybe-pdf-wdiff +pdf-host: maybe-pdf-zip +pdf-host: maybe-pdf-zlib +pdf-host: maybe-pdf-gdb +pdf-host: maybe-pdf-expect +pdf-host: maybe-pdf-guile +pdf-host: maybe-pdf-tk +pdf-host: maybe-pdf-libtermcap +pdf-host: maybe-pdf-utils +pdf-host: maybe-pdf-gnattools + +.PHONY: pdf-target + +pdf-target: maybe-pdf-target-libstdc++-v3 +pdf-target: maybe-pdf-target-libmudflap +pdf-target: maybe-pdf-target-libssp +pdf-target: maybe-pdf-target-newlib +pdf-target: maybe-pdf-target-libgcc +pdf-target: maybe-pdf-target-libgfortran +pdf-target: maybe-pdf-target-libobjc +pdf-target: maybe-pdf-target-libtermcap +pdf-target: maybe-pdf-target-winsup +pdf-target: maybe-pdf-target-libgloss +pdf-target: maybe-pdf-target-libiberty +pdf-target: maybe-pdf-target-gperf +pdf-target: maybe-pdf-target-examples +pdf-target: maybe-pdf-target-libffi +pdf-target: maybe-pdf-target-libjava +pdf-target: maybe-pdf-target-zlib +pdf-target: maybe-pdf-target-boehm-gc +pdf-target: maybe-pdf-target-qthreads +pdf-target: maybe-pdf-target-rda +pdf-target: maybe-pdf-target-libada +pdf-target: maybe-pdf-target-libgomp + .PHONY: do-html do-html: @: $(MAKE); $(unstage) @@ -1038,6 +1200,8 @@ html-host: maybe-html-gas html-host: maybe-html-gcc html-host: maybe-html-gawk html-host: maybe-html-gettext +html-host: maybe-html-gmp +html-host: maybe-html-mpfr html-host: maybe-html-gnuserv html-host: maybe-html-gprof html-host: maybe-html-gzip @@ -1088,8 +1252,8 @@ html-host: maybe-html-gnattools html-target: maybe-html-target-libstdc++-v3 html-target: maybe-html-target-libmudflap html-target: maybe-html-target-libssp -html-target: maybe-html-target-libgcc-math html-target: maybe-html-target-newlib +html-target: maybe-html-target-libgcc html-target: maybe-html-target-libgfortran html-target: maybe-html-target-libobjc html-target: maybe-html-target-libtermcap @@ -1142,6 +1306,8 @@ TAGS-host: maybe-TAGS-gas TAGS-host: maybe-TAGS-gcc TAGS-host: maybe-TAGS-gawk TAGS-host: maybe-TAGS-gettext +TAGS-host: maybe-TAGS-gmp +TAGS-host: maybe-TAGS-mpfr TAGS-host: maybe-TAGS-gnuserv TAGS-host: maybe-TAGS-gprof TAGS-host: maybe-TAGS-gzip @@ -1192,8 +1358,8 @@ TAGS-host: maybe-TAGS-gnattools TAGS-target: maybe-TAGS-target-libstdc++-v3 TAGS-target: maybe-TAGS-target-libmudflap TAGS-target: maybe-TAGS-target-libssp -TAGS-target: maybe-TAGS-target-libgcc-math TAGS-target: maybe-TAGS-target-newlib +TAGS-target: maybe-TAGS-target-libgcc TAGS-target: maybe-TAGS-target-libgfortran TAGS-target: maybe-TAGS-target-libobjc TAGS-target: maybe-TAGS-target-libtermcap @@ -1246,6 +1412,8 @@ install-info-host: maybe-install-info-gas install-info-host: maybe-install-info-gcc install-info-host: maybe-install-info-gawk install-info-host: maybe-install-info-gettext +install-info-host: maybe-install-info-gmp +install-info-host: maybe-install-info-mpfr install-info-host: maybe-install-info-gnuserv install-info-host: maybe-install-info-gprof install-info-host: maybe-install-info-gzip @@ -1296,8 +1464,8 @@ install-info-host: maybe-install-info-gnattools install-info-target: maybe-install-info-target-libstdc++-v3 install-info-target: maybe-install-info-target-libmudflap install-info-target: maybe-install-info-target-libssp -install-info-target: maybe-install-info-target-libgcc-math install-info-target: maybe-install-info-target-newlib +install-info-target: maybe-install-info-target-libgcc install-info-target: maybe-install-info-target-libgfortran install-info-target: maybe-install-info-target-libobjc install-info-target: maybe-install-info-target-libtermcap @@ -1315,6 +1483,112 @@ install-info-target: maybe-install-info-target-rda install-info-target: maybe-install-info-target-libada install-info-target: maybe-install-info-target-libgomp +.PHONY: do-install-pdf +do-install-pdf: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) install-pdf-host \ + install-pdf-target + + +.PHONY: install-pdf-host + +install-pdf-host: maybe-install-pdf-ash +install-pdf-host: maybe-install-pdf-autoconf +install-pdf-host: maybe-install-pdf-automake +install-pdf-host: maybe-install-pdf-bash +install-pdf-host: maybe-install-pdf-bfd +install-pdf-host: maybe-install-pdf-opcodes +install-pdf-host: maybe-install-pdf-binutils +install-pdf-host: maybe-install-pdf-bison +install-pdf-host: maybe-install-pdf-byacc +install-pdf-host: maybe-install-pdf-bzip2 +install-pdf-host: maybe-install-pdf-dejagnu +install-pdf-host: maybe-install-pdf-diff +install-pdf-host: maybe-install-pdf-dosutils +install-pdf-host: maybe-install-pdf-etc +install-pdf-host: maybe-install-pdf-fastjar +install-pdf-host: maybe-install-pdf-fileutils +install-pdf-host: maybe-install-pdf-findutils +install-pdf-host: maybe-install-pdf-find +install-pdf-host: maybe-install-pdf-fixincludes +install-pdf-host: maybe-install-pdf-flex +install-pdf-host: maybe-install-pdf-gas +install-pdf-host: maybe-install-pdf-gcc +install-pdf-host: maybe-install-pdf-gawk +install-pdf-host: maybe-install-pdf-gettext +install-pdf-host: maybe-install-pdf-gmp +install-pdf-host: maybe-install-pdf-mpfr +install-pdf-host: maybe-install-pdf-gnuserv +install-pdf-host: maybe-install-pdf-gprof +install-pdf-host: maybe-install-pdf-gzip +install-pdf-host: maybe-install-pdf-hello +install-pdf-host: maybe-install-pdf-indent +install-pdf-host: maybe-install-pdf-intl +install-pdf-host: maybe-install-pdf-tcl +install-pdf-host: maybe-install-pdf-itcl +install-pdf-host: maybe-install-pdf-ld +install-pdf-host: maybe-install-pdf-libcpp +install-pdf-host: maybe-install-pdf-libdecnumber +install-pdf-host: maybe-install-pdf-libgui +install-pdf-host: maybe-install-pdf-libiberty +install-pdf-host: maybe-install-pdf-libtool +install-pdf-host: maybe-install-pdf-m4 +install-pdf-host: maybe-install-pdf-make +install-pdf-host: maybe-install-pdf-mmalloc +install-pdf-host: maybe-install-pdf-patch +install-pdf-host: maybe-install-pdf-perl +install-pdf-host: maybe-install-pdf-prms +install-pdf-host: maybe-install-pdf-rcs +install-pdf-host: maybe-install-pdf-readline +install-pdf-host: maybe-install-pdf-release +install-pdf-host: maybe-install-pdf-recode +install-pdf-host: maybe-install-pdf-sed +install-pdf-host: maybe-install-pdf-send-pr +install-pdf-host: maybe-install-pdf-shellutils +install-pdf-host: maybe-install-pdf-sid +install-pdf-host: maybe-install-pdf-sim +install-pdf-host: maybe-install-pdf-tar +install-pdf-host: maybe-install-pdf-texinfo +install-pdf-host: maybe-install-pdf-textutils +install-pdf-host: maybe-install-pdf-time +install-pdf-host: maybe-install-pdf-uudecode +install-pdf-host: maybe-install-pdf-wdiff +install-pdf-host: maybe-install-pdf-zip +install-pdf-host: maybe-install-pdf-zlib +install-pdf-host: maybe-install-pdf-gdb +install-pdf-host: maybe-install-pdf-expect +install-pdf-host: maybe-install-pdf-guile +install-pdf-host: maybe-install-pdf-tk +install-pdf-host: maybe-install-pdf-libtermcap +install-pdf-host: maybe-install-pdf-utils +install-pdf-host: maybe-install-pdf-gnattools + +.PHONY: install-pdf-target + +install-pdf-target: maybe-install-pdf-target-libstdc++-v3 +install-pdf-target: maybe-install-pdf-target-libmudflap +install-pdf-target: maybe-install-pdf-target-libssp +install-pdf-target: maybe-install-pdf-target-newlib +install-pdf-target: maybe-install-pdf-target-libgcc +install-pdf-target: maybe-install-pdf-target-libgfortran +install-pdf-target: maybe-install-pdf-target-libobjc +install-pdf-target: maybe-install-pdf-target-libtermcap +install-pdf-target: maybe-install-pdf-target-winsup +install-pdf-target: maybe-install-pdf-target-libgloss +install-pdf-target: maybe-install-pdf-target-libiberty +install-pdf-target: maybe-install-pdf-target-gperf +install-pdf-target: maybe-install-pdf-target-examples +install-pdf-target: maybe-install-pdf-target-libffi +install-pdf-target: maybe-install-pdf-target-libjava +install-pdf-target: maybe-install-pdf-target-zlib +install-pdf-target: maybe-install-pdf-target-boehm-gc +install-pdf-target: maybe-install-pdf-target-qthreads +install-pdf-target: maybe-install-pdf-target-rda +install-pdf-target: maybe-install-pdf-target-libada +install-pdf-target: maybe-install-pdf-target-libgomp + .PHONY: do-install-html do-install-html: @: $(MAKE); $(unstage) @@ -1350,6 +1624,8 @@ install-html-host: maybe-install-html-gas install-html-host: maybe-install-html-gcc install-html-host: maybe-install-html-gawk install-html-host: maybe-install-html-gettext +install-html-host: maybe-install-html-gmp +install-html-host: maybe-install-html-mpfr install-html-host: maybe-install-html-gnuserv install-html-host: maybe-install-html-gprof install-html-host: maybe-install-html-gzip @@ -1400,8 +1676,8 @@ install-html-host: maybe-install-html-gnattools install-html-target: maybe-install-html-target-libstdc++-v3 install-html-target: maybe-install-html-target-libmudflap install-html-target: maybe-install-html-target-libssp -install-html-target: maybe-install-html-target-libgcc-math install-html-target: maybe-install-html-target-newlib +install-html-target: maybe-install-html-target-libgcc install-html-target: maybe-install-html-target-libgfortran install-html-target: maybe-install-html-target-libobjc install-html-target: maybe-install-html-target-libtermcap @@ -1454,6 +1730,8 @@ installcheck-host: maybe-installcheck-gas installcheck-host: maybe-installcheck-gcc installcheck-host: maybe-installcheck-gawk installcheck-host: maybe-installcheck-gettext +installcheck-host: maybe-installcheck-gmp +installcheck-host: maybe-installcheck-mpfr installcheck-host: maybe-installcheck-gnuserv installcheck-host: maybe-installcheck-gprof installcheck-host: maybe-installcheck-gzip @@ -1504,8 +1782,8 @@ installcheck-host: maybe-installcheck-gnattools installcheck-target: maybe-installcheck-target-libstdc++-v3 installcheck-target: maybe-installcheck-target-libmudflap installcheck-target: maybe-installcheck-target-libssp -installcheck-target: maybe-installcheck-target-libgcc-math installcheck-target: maybe-installcheck-target-newlib +installcheck-target: maybe-installcheck-target-libgcc installcheck-target: maybe-installcheck-target-libgfortran installcheck-target: maybe-installcheck-target-libobjc installcheck-target: maybe-installcheck-target-libtermcap @@ -1558,6 +1836,8 @@ mostlyclean-host: maybe-mostlyclean-gas mostlyclean-host: maybe-mostlyclean-gcc mostlyclean-host: maybe-mostlyclean-gawk mostlyclean-host: maybe-mostlyclean-gettext +mostlyclean-host: maybe-mostlyclean-gmp +mostlyclean-host: maybe-mostlyclean-mpfr mostlyclean-host: maybe-mostlyclean-gnuserv mostlyclean-host: maybe-mostlyclean-gprof mostlyclean-host: maybe-mostlyclean-gzip @@ -1608,8 +1888,8 @@ mostlyclean-host: maybe-mostlyclean-gnattools mostlyclean-target: maybe-mostlyclean-target-libstdc++-v3 mostlyclean-target: maybe-mostlyclean-target-libmudflap mostlyclean-target: maybe-mostlyclean-target-libssp -mostlyclean-target: maybe-mostlyclean-target-libgcc-math mostlyclean-target: maybe-mostlyclean-target-newlib +mostlyclean-target: maybe-mostlyclean-target-libgcc mostlyclean-target: maybe-mostlyclean-target-libgfortran mostlyclean-target: maybe-mostlyclean-target-libobjc mostlyclean-target: maybe-mostlyclean-target-libtermcap @@ -1662,6 +1942,8 @@ clean-host: maybe-clean-gas clean-host: maybe-clean-gcc clean-host: maybe-clean-gawk clean-host: maybe-clean-gettext +clean-host: maybe-clean-gmp +clean-host: maybe-clean-mpfr clean-host: maybe-clean-gnuserv clean-host: maybe-clean-gprof clean-host: maybe-clean-gzip @@ -1712,8 +1994,8 @@ clean-host: maybe-clean-gnattools clean-target: maybe-clean-target-libstdc++-v3 clean-target: maybe-clean-target-libmudflap clean-target: maybe-clean-target-libssp -clean-target: maybe-clean-target-libgcc-math clean-target: maybe-clean-target-newlib +clean-target: maybe-clean-target-libgcc clean-target: maybe-clean-target-libgfortran clean-target: maybe-clean-target-libobjc clean-target: maybe-clean-target-libtermcap @@ -1766,6 +2048,8 @@ distclean-host: maybe-distclean-gas distclean-host: maybe-distclean-gcc distclean-host: maybe-distclean-gawk distclean-host: maybe-distclean-gettext +distclean-host: maybe-distclean-gmp +distclean-host: maybe-distclean-mpfr distclean-host: maybe-distclean-gnuserv distclean-host: maybe-distclean-gprof distclean-host: maybe-distclean-gzip @@ -1816,8 +2100,8 @@ distclean-host: maybe-distclean-gnattools distclean-target: maybe-distclean-target-libstdc++-v3 distclean-target: maybe-distclean-target-libmudflap distclean-target: maybe-distclean-target-libssp -distclean-target: maybe-distclean-target-libgcc-math distclean-target: maybe-distclean-target-newlib +distclean-target: maybe-distclean-target-libgcc distclean-target: maybe-distclean-target-libgfortran distclean-target: maybe-distclean-target-libobjc distclean-target: maybe-distclean-target-libtermcap @@ -1870,6 +2154,8 @@ maintainer-clean-host: maybe-maintainer-clean-gas maintainer-clean-host: maybe-maintainer-clean-gcc maintainer-clean-host: maybe-maintainer-clean-gawk maintainer-clean-host: maybe-maintainer-clean-gettext +maintainer-clean-host: maybe-maintainer-clean-gmp +maintainer-clean-host: maybe-maintainer-clean-mpfr maintainer-clean-host: maybe-maintainer-clean-gnuserv maintainer-clean-host: maybe-maintainer-clean-gprof maintainer-clean-host: maybe-maintainer-clean-gzip @@ -1920,8 +2206,8 @@ maintainer-clean-host: maybe-maintainer-clean-gnattools maintainer-clean-target: maybe-maintainer-clean-target-libstdc++-v3 maintainer-clean-target: maybe-maintainer-clean-target-libmudflap maintainer-clean-target: maybe-maintainer-clean-target-libssp -maintainer-clean-target: maybe-maintainer-clean-target-libgcc-math maintainer-clean-target: maybe-maintainer-clean-target-newlib +maintainer-clean-target: maybe-maintainer-clean-target-libgcc maintainer-clean-target: maybe-maintainer-clean-target-libgfortran maintainer-clean-target: maybe-maintainer-clean-target-libobjc maintainer-clean-target: maybe-maintainer-clean-target-libtermcap @@ -1942,12 +2228,14 @@ maintainer-clean-target: maybe-maintainer-clean-target-libgomp # Here are the targets which correspond to the do-X targets. -.PHONY: info installcheck dvi html install-info install-html +.PHONY: info installcheck dvi pdf html +.PHONY: install-info install-pdf install-html .PHONY: clean distclean mostlyclean maintainer-clean realclean .PHONY: local-clean local-distclean local-maintainer-clean info: do-info installcheck: do-installcheck dvi: do-dvi +pdf: do-pdf html: do-html # Make sure makeinfo is built before we do a `make info', if we're @@ -1960,6 +2248,8 @@ install-info: do-install-info dir.info $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ else true ; fi +install-pdf: do-install-pdf + install-html: do-install-html local-clean: @@ -1992,11 +2282,6 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean maintainer-clean: local-distclean realclean: maintainer-clean -# Extra dependency for clean-target, owing to the mixed nature of gcc. -clean-target: clean-target-libgcc -clean-target-libgcc: - test ! -d gcc || (cd gcc && $(MAKE) $@) - # Check target. .PHONY: check do-check @@ -2029,6 +2314,8 @@ check-host: \ maybe-check-gcc \ maybe-check-gawk \ maybe-check-gettext \ + maybe-check-gmp \ + maybe-check-mpfr \ maybe-check-gnuserv \ maybe-check-gprof \ maybe-check-gzip \ @@ -2079,8 +2366,8 @@ check-target: \ maybe-check-target-libstdc++-v3 \ maybe-check-target-libmudflap \ maybe-check-target-libssp \ - maybe-check-target-libgcc-math \ maybe-check-target-newlib \ + maybe-check-target-libgcc \ maybe-check-target-libgfortran \ maybe-check-target-libobjc \ maybe-check-target-libtermcap \ @@ -2159,6 +2446,8 @@ install-host-nogcc: \ maybe-install-gas \ maybe-install-gawk \ maybe-install-gettext \ + maybe-install-gmp \ + maybe-install-mpfr \ maybe-install-gnuserv \ maybe-install-gprof \ maybe-install-gzip \ @@ -2230,6 +2519,8 @@ install-host: \ maybe-install-gcc \ maybe-install-gawk \ maybe-install-gettext \ + maybe-install-gmp \ + maybe-install-mpfr \ maybe-install-gnuserv \ maybe-install-gprof \ maybe-install-gzip \ @@ -2280,8 +2571,8 @@ install-target: \ maybe-install-target-libstdc++-v3 \ maybe-install-target-libmudflap \ maybe-install-target-libssp \ - maybe-install-target-libgcc-math \ maybe-install-target-newlib \ + maybe-install-target-libgcc \ maybe-install-target-libgfortran \ maybe-install-target-libobjc \ maybe-install-target-libtermcap \ @@ -2365,6 +2656,9 @@ TAGS: do-TAGS .PHONY: configure-build-libiberty maybe-configure-build-libiberty maybe-configure-build-libiberty: +@if gcc-bootstrap +configure-build-libiberty: stage_current +@endif gcc-bootstrap @if build-libiberty maybe-configure-build-libiberty: configure-build-libiberty configure-build-libiberty: @@ -2385,7 +2679,8 @@ configure-build-libiberty: libsrcdir="$$s/libiberty"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-libiberty @@ -2395,6 +2690,9 @@ configure-build-libiberty: .PHONY: all-build-libiberty maybe-all-build-libiberty maybe-all-build-libiberty: +@if gcc-bootstrap +all-build-libiberty: stage_current +@endif gcc-bootstrap @if build-libiberty TARGET-build-libiberty=all maybe-all-build-libiberty: all-build-libiberty @@ -2413,6 +2711,9 @@ all-build-libiberty: configure-build-libiberty .PHONY: configure-build-bison maybe-configure-build-bison maybe-configure-build-bison: +@if gcc-bootstrap +configure-build-bison: stage_current +@endif gcc-bootstrap @if build-bison maybe-configure-build-bison: configure-build-bison configure-build-bison: @@ -2433,7 +2734,8 @@ configure-build-bison: libsrcdir="$$s/bison"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-bison @@ -2443,6 +2745,9 @@ configure-build-bison: .PHONY: all-build-bison maybe-all-build-bison maybe-all-build-bison: +@if gcc-bootstrap +all-build-bison: stage_current +@endif gcc-bootstrap @if build-bison TARGET-build-bison=all maybe-all-build-bison: all-build-bison @@ -2461,6 +2766,9 @@ all-build-bison: configure-build-bison .PHONY: configure-build-byacc maybe-configure-build-byacc maybe-configure-build-byacc: +@if gcc-bootstrap +configure-build-byacc: stage_current +@endif gcc-bootstrap @if build-byacc maybe-configure-build-byacc: configure-build-byacc configure-build-byacc: @@ -2481,7 +2789,8 @@ configure-build-byacc: libsrcdir="$$s/byacc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-byacc @@ -2491,6 +2800,9 @@ configure-build-byacc: .PHONY: all-build-byacc maybe-all-build-byacc maybe-all-build-byacc: +@if gcc-bootstrap +all-build-byacc: stage_current +@endif gcc-bootstrap @if build-byacc TARGET-build-byacc=all maybe-all-build-byacc: all-build-byacc @@ -2509,6 +2821,9 @@ all-build-byacc: configure-build-byacc .PHONY: configure-build-flex maybe-configure-build-flex maybe-configure-build-flex: +@if gcc-bootstrap +configure-build-flex: stage_current +@endif gcc-bootstrap @if build-flex maybe-configure-build-flex: configure-build-flex configure-build-flex: @@ -2529,7 +2844,8 @@ configure-build-flex: libsrcdir="$$s/flex"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-flex @@ -2539,6 +2855,9 @@ configure-build-flex: .PHONY: all-build-flex maybe-all-build-flex maybe-all-build-flex: +@if gcc-bootstrap +all-build-flex: stage_current +@endif gcc-bootstrap @if build-flex TARGET-build-flex=all maybe-all-build-flex: all-build-flex @@ -2557,6 +2876,9 @@ all-build-flex: configure-build-flex .PHONY: configure-build-m4 maybe-configure-build-m4 maybe-configure-build-m4: +@if gcc-bootstrap +configure-build-m4: stage_current +@endif gcc-bootstrap @if build-m4 maybe-configure-build-m4: configure-build-m4 configure-build-m4: @@ -2577,7 +2899,8 @@ configure-build-m4: libsrcdir="$$s/m4"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-m4 @@ -2587,6 +2910,9 @@ configure-build-m4: .PHONY: all-build-m4 maybe-all-build-m4 maybe-all-build-m4: +@if gcc-bootstrap +all-build-m4: stage_current +@endif gcc-bootstrap @if build-m4 TARGET-build-m4=all maybe-all-build-m4: all-build-m4 @@ -2605,6 +2931,9 @@ all-build-m4: configure-build-m4 .PHONY: configure-build-texinfo maybe-configure-build-texinfo maybe-configure-build-texinfo: +@if gcc-bootstrap +configure-build-texinfo: stage_current +@endif gcc-bootstrap @if build-texinfo maybe-configure-build-texinfo: configure-build-texinfo configure-build-texinfo: @@ -2625,7 +2954,8 @@ configure-build-texinfo: libsrcdir="$$s/texinfo"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-texinfo @@ -2635,6 +2965,9 @@ configure-build-texinfo: .PHONY: all-build-texinfo maybe-all-build-texinfo maybe-all-build-texinfo: +@if gcc-bootstrap +all-build-texinfo: stage_current +@endif gcc-bootstrap @if build-texinfo TARGET-build-texinfo=all maybe-all-build-texinfo: all-build-texinfo @@ -2653,6 +2986,9 @@ all-build-texinfo: configure-build-texinfo .PHONY: configure-build-fixincludes maybe-configure-build-fixincludes maybe-configure-build-fixincludes: +@if gcc-bootstrap +configure-build-fixincludes: stage_current +@endif gcc-bootstrap @if build-fixincludes maybe-configure-build-fixincludes: configure-build-fixincludes configure-build-fixincludes: @@ -2673,7 +3009,8 @@ configure-build-fixincludes: libsrcdir="$$s/fixincludes"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ + $(BUILD_CONFIGARGS) --build=${build_alias} --host=${build_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif build-fixincludes @@ -2683,6 +3020,9 @@ configure-build-fixincludes: .PHONY: all-build-fixincludes maybe-all-build-fixincludes maybe-all-build-fixincludes: +@if gcc-bootstrap +all-build-fixincludes: stage_current +@endif gcc-bootstrap @if build-fixincludes TARGET-build-fixincludes=all maybe-all-build-fixincludes: all-build-fixincludes @@ -2706,6 +3046,9 @@ all-build-fixincludes: configure-build-fixincludes .PHONY: configure-ash maybe-configure-ash maybe-configure-ash: +@if gcc-bootstrap +configure-ash: stage_current +@endif gcc-bootstrap @if ash maybe-configure-ash: configure-ash configure-ash: @@ -2725,7 +3068,8 @@ configure-ash: srcdiroption="--srcdir=$${topdir}/ash"; \ libsrcdir="$$s/ash"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif ash @@ -2735,6 +3079,9 @@ configure-ash: .PHONY: all-ash maybe-all-ash maybe-all-ash: +@if gcc-bootstrap +all-ash: stage_current +@endif gcc-bootstrap @if ash TARGET-ash=all maybe-all-ash: all-ash @@ -2780,7 +3127,7 @@ install-ash: installdirs @endif ash -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-ash info-ash maybe-info-ash: @@ -2834,6 +3181,32 @@ dvi-ash: \ @endif ash +.PHONY: maybe-pdf-ash pdf-ash +maybe-pdf-ash: +@if ash +maybe-pdf-ash: pdf-ash + +pdf-ash: \ + configure-ash + @: $(MAKE); $(unstage) + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in ash" ; \ + (cd $(HOST_SUBDIR)/ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif ash + .PHONY: maybe-html-ash html-ash maybe-html-ash: @if ash @@ -2913,6 +3286,33 @@ install-info-ash: \ @endif ash +.PHONY: maybe-install-pdf-ash install-pdf-ash +maybe-install-pdf-ash: +@if ash +maybe-install-pdf-ash: install-pdf-ash + +install-pdf-ash: \ + configure-ash \ + pdf-ash + @: $(MAKE); $(unstage) + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in ash" ; \ + (cd $(HOST_SUBDIR)/ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif ash + .PHONY: maybe-install-html-ash install-html-ash maybe-install-html-ash: @if ash @@ -3070,6 +3470,9 @@ maintainer-clean-ash: .PHONY: configure-autoconf maybe-configure-autoconf maybe-configure-autoconf: +@if gcc-bootstrap +configure-autoconf: stage_current +@endif gcc-bootstrap @if autoconf maybe-configure-autoconf: configure-autoconf configure-autoconf: @@ -3089,7 +3492,8 @@ configure-autoconf: srcdiroption="--srcdir=$${topdir}/autoconf"; \ libsrcdir="$$s/autoconf"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif autoconf @@ -3099,6 +3503,9 @@ configure-autoconf: .PHONY: all-autoconf maybe-all-autoconf maybe-all-autoconf: +@if gcc-bootstrap +all-autoconf: stage_current +@endif gcc-bootstrap @if autoconf TARGET-autoconf=all maybe-all-autoconf: all-autoconf @@ -3144,7 +3551,7 @@ install-autoconf: installdirs @endif autoconf -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-autoconf info-autoconf maybe-info-autoconf: @@ -3198,6 +3605,32 @@ dvi-autoconf: \ @endif autoconf +.PHONY: maybe-pdf-autoconf pdf-autoconf +maybe-pdf-autoconf: +@if autoconf +maybe-pdf-autoconf: pdf-autoconf + +pdf-autoconf: \ + configure-autoconf + @: $(MAKE); $(unstage) + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in autoconf" ; \ + (cd $(HOST_SUBDIR)/autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif autoconf + .PHONY: maybe-html-autoconf html-autoconf maybe-html-autoconf: @if autoconf @@ -3277,6 +3710,33 @@ install-info-autoconf: \ @endif autoconf +.PHONY: maybe-install-pdf-autoconf install-pdf-autoconf +maybe-install-pdf-autoconf: +@if autoconf +maybe-install-pdf-autoconf: install-pdf-autoconf + +install-pdf-autoconf: \ + configure-autoconf \ + pdf-autoconf + @: $(MAKE); $(unstage) + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in autoconf" ; \ + (cd $(HOST_SUBDIR)/autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif autoconf + .PHONY: maybe-install-html-autoconf install-html-autoconf maybe-install-html-autoconf: @if autoconf @@ -3434,6 +3894,9 @@ maintainer-clean-autoconf: .PHONY: configure-automake maybe-configure-automake maybe-configure-automake: +@if gcc-bootstrap +configure-automake: stage_current +@endif gcc-bootstrap @if automake maybe-configure-automake: configure-automake configure-automake: @@ -3453,7 +3916,8 @@ configure-automake: srcdiroption="--srcdir=$${topdir}/automake"; \ libsrcdir="$$s/automake"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif automake @@ -3463,6 +3927,9 @@ configure-automake: .PHONY: all-automake maybe-all-automake maybe-all-automake: +@if gcc-bootstrap +all-automake: stage_current +@endif gcc-bootstrap @if automake TARGET-automake=all maybe-all-automake: all-automake @@ -3508,7 +3975,7 @@ install-automake: installdirs @endif automake -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-automake info-automake maybe-info-automake: @@ -3562,6 +4029,32 @@ dvi-automake: \ @endif automake +.PHONY: maybe-pdf-automake pdf-automake +maybe-pdf-automake: +@if automake +maybe-pdf-automake: pdf-automake + +pdf-automake: \ + configure-automake + @: $(MAKE); $(unstage) + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in automake" ; \ + (cd $(HOST_SUBDIR)/automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif automake + .PHONY: maybe-html-automake html-automake maybe-html-automake: @if automake @@ -3641,6 +4134,33 @@ install-info-automake: \ @endif automake +.PHONY: maybe-install-pdf-automake install-pdf-automake +maybe-install-pdf-automake: +@if automake +maybe-install-pdf-automake: install-pdf-automake + +install-pdf-automake: \ + configure-automake \ + pdf-automake + @: $(MAKE); $(unstage) + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in automake" ; \ + (cd $(HOST_SUBDIR)/automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif automake + .PHONY: maybe-install-html-automake install-html-automake maybe-install-html-automake: @if automake @@ -3798,6 +4318,9 @@ maintainer-clean-automake: .PHONY: configure-bash maybe-configure-bash maybe-configure-bash: +@if gcc-bootstrap +configure-bash: stage_current +@endif gcc-bootstrap @if bash maybe-configure-bash: configure-bash configure-bash: @@ -3817,7 +4340,8 @@ configure-bash: srcdiroption="--srcdir=$${topdir}/bash"; \ libsrcdir="$$s/bash"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bash @@ -3827,6 +4351,9 @@ configure-bash: .PHONY: all-bash maybe-all-bash maybe-all-bash: +@if gcc-bootstrap +all-bash: stage_current +@endif gcc-bootstrap @if bash TARGET-bash=all maybe-all-bash: all-bash @@ -3872,7 +4399,7 @@ install-bash: installdirs @endif bash -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bash info-bash maybe-info-bash: @@ -3926,6 +4453,32 @@ dvi-bash: \ @endif bash +.PHONY: maybe-pdf-bash pdf-bash +maybe-pdf-bash: +@if bash +maybe-pdf-bash: pdf-bash + +pdf-bash: \ + configure-bash + @: $(MAKE); $(unstage) + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bash" ; \ + (cd $(HOST_SUBDIR)/bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bash + .PHONY: maybe-html-bash html-bash maybe-html-bash: @if bash @@ -4005,6 +4558,33 @@ install-info-bash: \ @endif bash +.PHONY: maybe-install-pdf-bash install-pdf-bash +maybe-install-pdf-bash: +@if bash +maybe-install-pdf-bash: install-pdf-bash + +install-pdf-bash: \ + configure-bash \ + pdf-bash + @: $(MAKE); $(unstage) + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bash" ; \ + (cd $(HOST_SUBDIR)/bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bash + .PHONY: maybe-install-html-bash install-html-bash maybe-install-html-bash: @if bash @@ -4162,14 +4742,12 @@ maintainer-clean-bash: .PHONY: configure-bfd maybe-configure-bfd maybe-configure-bfd: +@if gcc-bootstrap +configure-bfd: stage_current +@endif gcc-bootstrap @if bfd maybe-configure-bfd: configure-bfd configure-bfd: -@endif bfd -@if bfd-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif bfd-bootstrap -@if bfd @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ @@ -4185,7 +4763,8 @@ configure-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bfd @@ -4202,6 +4781,8 @@ configure-stage1-bfd: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4213,8 +4794,10 @@ configure-stage1-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif bfd-bootstrap .PHONY: configure-stage2-bfd maybe-configure-stage2-bfd @@ -4229,6 +4812,8 @@ configure-stage2-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4240,7 +4825,9 @@ configure-stage2-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4256,6 +4843,8 @@ configure-stage3-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4267,7 +4856,9 @@ configure-stage3-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4283,6 +4874,8 @@ configure-stage4-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4294,7 +4887,9 @@ configure-stage4-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4310,6 +4905,8 @@ configure-stageprofile-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4321,7 +4918,9 @@ configure-stageprofile-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4337,6 +4936,8 @@ configure-stagefeedback-bfd: test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ cd $(HOST_SUBDIR)/bfd || exit 1; \ @@ -4348,7 +4949,9 @@ configure-stagefeedback-bfd: srcdiroption="--srcdir=$${topdir}/bfd"; \ libsrcdir="$$s/bfd"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif bfd-bootstrap @@ -4358,15 +4961,13 @@ configure-stagefeedback-bfd: .PHONY: all-bfd maybe-all-bfd maybe-all-bfd: +@if gcc-bootstrap +all-bfd: stage_current +@endif gcc-bootstrap @if bfd TARGET-bfd=all maybe-all-bfd: all-bfd all-bfd: configure-bfd -@endif bfd -@if bfd-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif bfd-bootstrap -@if bfd @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -4390,18 +4991,22 @@ all-stage1-bfd: configure-stage1-bfd s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-bfd) maybe-clean-stage1-bfd: clean-stage1-bfd clean-stage1: clean-stage1-bfd clean-stage1-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif bfd-bootstrap @@ -4420,19 +5025,23 @@ all-stage2-bfd: configure-stage2-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-bfd) maybe-clean-stage2-bfd: clean-stage2-bfd clean-stage2: clean-stage2-bfd clean-stage2-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif bfd-bootstrap @@ -4451,19 +5060,23 @@ all-stage3-bfd: configure-stage3-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-bfd) maybe-clean-stage3-bfd: clean-stage3-bfd clean-stage3: clean-stage3-bfd clean-stage3-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif bfd-bootstrap @@ -4482,19 +5095,23 @@ all-stage4-bfd: configure-stage4-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-bfd) maybe-clean-stage4-bfd: clean-stage4-bfd clean-stage4: clean-stage4-bfd clean-stage4-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif bfd-bootstrap @@ -4513,19 +5130,23 @@ all-stageprofile-bfd: configure-stageprofile-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-bfd) maybe-clean-stageprofile-bfd: clean-stageprofile-bfd clean-stageprofile: clean-stageprofile-bfd clean-stageprofile-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif bfd-bootstrap @@ -4544,19 +5165,23 @@ all-stagefeedback-bfd: configure-stagefeedback-bfd $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-bfd) maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd clean-stagefeedback: clean-stagefeedback-bfd clean-stagefeedback-bfd: - @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif bfd-bootstrap @@ -4593,7 +5218,7 @@ install-bfd: installdirs @endif bfd -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bfd info-bfd maybe-info-bfd: @@ -4645,6 +5270,31 @@ dvi-bfd: \ @endif bfd +.PHONY: maybe-pdf-bfd pdf-bfd +maybe-pdf-bfd: +@if bfd +maybe-pdf-bfd: pdf-bfd + +pdf-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bfd + .PHONY: maybe-html-bfd html-bfd maybe-html-bfd: @if bfd @@ -4721,6 +5371,32 @@ install-info-bfd: \ @endif bfd +.PHONY: maybe-install-pdf-bfd install-pdf-bfd +maybe-install-pdf-bfd: +@if bfd +maybe-install-pdf-bfd: install-pdf-bfd + +install-pdf-bfd: \ + configure-bfd \ + pdf-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bfd" ; \ + (cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bfd + .PHONY: maybe-install-html-bfd install-html-bfd maybe-install-html-bfd: @if bfd @@ -4872,14 +5548,12 @@ maintainer-clean-bfd: .PHONY: configure-opcodes maybe-configure-opcodes maybe-configure-opcodes: +@if gcc-bootstrap +configure-opcodes: stage_current +@endif gcc-bootstrap @if opcodes maybe-configure-opcodes: configure-opcodes configure-opcodes: -@endif opcodes -@if opcodes-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif opcodes-bootstrap -@if opcodes @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ @@ -4895,7 +5569,8 @@ configure-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif opcodes @@ -4912,6 +5587,8 @@ configure-stage1-opcodes: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -4923,8 +5600,10 @@ configure-stage1-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif opcodes-bootstrap .PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes @@ -4939,6 +5618,8 @@ configure-stage2-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -4950,7 +5631,9 @@ configure-stage2-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -4966,6 +5649,8 @@ configure-stage3-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -4977,7 +5662,9 @@ configure-stage3-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -4993,6 +5680,8 @@ configure-stage4-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -5004,7 +5693,9 @@ configure-stage4-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -5020,6 +5711,8 @@ configure-stageprofile-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -5031,7 +5724,9 @@ configure-stageprofile-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -5047,6 +5742,8 @@ configure-stagefeedback-opcodes: test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ cd $(HOST_SUBDIR)/opcodes || exit 1; \ @@ -5058,7 +5755,9 @@ configure-stagefeedback-opcodes: srcdiroption="--srcdir=$${topdir}/opcodes"; \ libsrcdir="$$s/opcodes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif opcodes-bootstrap @@ -5068,15 +5767,13 @@ configure-stagefeedback-opcodes: .PHONY: all-opcodes maybe-all-opcodes maybe-all-opcodes: +@if gcc-bootstrap +all-opcodes: stage_current +@endif gcc-bootstrap @if opcodes TARGET-opcodes=all maybe-all-opcodes: all-opcodes all-opcodes: configure-opcodes -@endif opcodes -@if opcodes-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif opcodes-bootstrap -@if opcodes @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -5100,18 +5797,22 @@ all-stage1-opcodes: configure-stage1-opcodes s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-opcodes) maybe-clean-stage1-opcodes: clean-stage1-opcodes clean-stage1: clean-stage1-opcodes clean-stage1-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif opcodes-bootstrap @@ -5130,19 +5831,23 @@ all-stage2-opcodes: configure-stage2-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-opcodes) maybe-clean-stage2-opcodes: clean-stage2-opcodes clean-stage2: clean-stage2-opcodes clean-stage2-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif opcodes-bootstrap @@ -5161,19 +5866,23 @@ all-stage3-opcodes: configure-stage3-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-opcodes) maybe-clean-stage3-opcodes: clean-stage3-opcodes clean-stage3: clean-stage3-opcodes clean-stage3-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif opcodes-bootstrap @@ -5192,19 +5901,23 @@ all-stage4-opcodes: configure-stage4-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-opcodes) maybe-clean-stage4-opcodes: clean-stage4-opcodes clean-stage4: clean-stage4-opcodes clean-stage4-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif opcodes-bootstrap @@ -5223,19 +5936,23 @@ all-stageprofile-opcodes: configure-stageprofile-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-opcodes) maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes clean-stageprofile: clean-stageprofile-opcodes clean-stageprofile-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif opcodes-bootstrap @@ -5254,19 +5971,23 @@ all-stagefeedback-opcodes: configure-stagefeedback-opcodes $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-opcodes) maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes clean-stagefeedback: clean-stagefeedback-opcodes clean-stagefeedback-opcodes: - @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif opcodes-bootstrap @@ -5303,7 +6024,7 @@ install-opcodes: installdirs @endif opcodes -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-opcodes info-opcodes maybe-info-opcodes: @@ -5355,6 +6076,31 @@ dvi-opcodes: \ @endif opcodes +.PHONY: maybe-pdf-opcodes pdf-opcodes +maybe-pdf-opcodes: +@if opcodes +maybe-pdf-opcodes: pdf-opcodes + +pdf-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif opcodes + .PHONY: maybe-html-opcodes html-opcodes maybe-html-opcodes: @if opcodes @@ -5431,6 +6177,32 @@ install-info-opcodes: \ @endif opcodes +.PHONY: maybe-install-pdf-opcodes install-pdf-opcodes +maybe-install-pdf-opcodes: +@if opcodes +maybe-install-pdf-opcodes: install-pdf-opcodes + +install-pdf-opcodes: \ + configure-opcodes \ + pdf-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in opcodes" ; \ + (cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif opcodes + .PHONY: maybe-install-html-opcodes install-html-opcodes maybe-install-html-opcodes: @if opcodes @@ -5582,14 +6354,12 @@ maintainer-clean-opcodes: .PHONY: configure-binutils maybe-configure-binutils maybe-configure-binutils: +@if gcc-bootstrap +configure-binutils: stage_current +@endif gcc-bootstrap @if binutils maybe-configure-binutils: configure-binutils configure-binutils: -@endif binutils -@if binutils-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif binutils-bootstrap -@if binutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ @@ -5605,7 +6375,8 @@ configure-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif binutils @@ -5622,6 +6393,8 @@ configure-stage1-binutils: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5633,8 +6406,10 @@ configure-stage1-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif binutils-bootstrap .PHONY: configure-stage2-binutils maybe-configure-stage2-binutils @@ -5649,6 +6424,8 @@ configure-stage2-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5660,7 +6437,9 @@ configure-stage2-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5676,6 +6455,8 @@ configure-stage3-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5687,7 +6468,9 @@ configure-stage3-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5703,6 +6486,8 @@ configure-stage4-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5714,7 +6499,9 @@ configure-stage4-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5730,6 +6517,8 @@ configure-stageprofile-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5741,7 +6530,9 @@ configure-stageprofile-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5757,6 +6548,8 @@ configure-stagefeedback-binutils: test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ cd $(HOST_SUBDIR)/binutils || exit 1; \ @@ -5768,7 +6561,9 @@ configure-stagefeedback-binutils: srcdiroption="--srcdir=$${topdir}/binutils"; \ libsrcdir="$$s/binutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif binutils-bootstrap @@ -5778,15 +6573,13 @@ configure-stagefeedback-binutils: .PHONY: all-binutils maybe-all-binutils maybe-all-binutils: +@if gcc-bootstrap +all-binutils: stage_current +@endif gcc-bootstrap @if binutils TARGET-binutils=all maybe-all-binutils: all-binutils all-binutils: configure-binutils -@endif binutils -@if binutils-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif binutils-bootstrap -@if binutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -5810,18 +6603,22 @@ all-stage1-binutils: configure-stage1-binutils s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-binutils) maybe-clean-stage1-binutils: clean-stage1-binutils clean-stage1: clean-stage1-binutils clean-stage1-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif binutils-bootstrap @@ -5840,19 +6637,23 @@ all-stage2-binutils: configure-stage2-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-binutils) maybe-clean-stage2-binutils: clean-stage2-binutils clean-stage2: clean-stage2-binutils clean-stage2-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif binutils-bootstrap @@ -5871,19 +6672,23 @@ all-stage3-binutils: configure-stage3-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-binutils) maybe-clean-stage3-binutils: clean-stage3-binutils clean-stage3: clean-stage3-binutils clean-stage3-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif binutils-bootstrap @@ -5902,19 +6707,23 @@ all-stage4-binutils: configure-stage4-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-binutils) maybe-clean-stage4-binutils: clean-stage4-binutils clean-stage4: clean-stage4-binutils clean-stage4-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif binutils-bootstrap @@ -5933,19 +6742,23 @@ all-stageprofile-binutils: configure-stageprofile-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-binutils) maybe-clean-stageprofile-binutils: clean-stageprofile-binutils clean-stageprofile: clean-stageprofile-binutils clean-stageprofile-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif binutils-bootstrap @@ -5964,19 +6777,23 @@ all-stagefeedback-binutils: configure-stagefeedback-binutils $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-binutils) maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils clean-stagefeedback: clean-stagefeedback-binutils clean-stagefeedback-binutils: - @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif binutils-bootstrap @@ -6013,7 +6830,7 @@ install-binutils: installdirs @endif binutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-binutils info-binutils maybe-info-binutils: @@ -6065,6 +6882,31 @@ dvi-binutils: \ @endif binutils +.PHONY: maybe-pdf-binutils pdf-binutils +maybe-pdf-binutils: +@if binutils +maybe-pdf-binutils: pdf-binutils + +pdf-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif binutils + .PHONY: maybe-html-binutils html-binutils maybe-html-binutils: @if binutils @@ -6141,6 +6983,32 @@ install-info-binutils: \ @endif binutils +.PHONY: maybe-install-pdf-binutils install-pdf-binutils +maybe-install-pdf-binutils: +@if binutils +maybe-install-pdf-binutils: install-pdf-binutils + +install-pdf-binutils: \ + configure-binutils \ + pdf-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif binutils + .PHONY: maybe-install-html-binutils install-html-binutils maybe-install-html-binutils: @if binutils @@ -6292,6 +7160,9 @@ maintainer-clean-binutils: .PHONY: configure-bison maybe-configure-bison maybe-configure-bison: +@if gcc-bootstrap +configure-bison: stage_current +@endif gcc-bootstrap @if bison maybe-configure-bison: configure-bison configure-bison: @@ -6311,7 +7182,8 @@ configure-bison: srcdiroption="--srcdir=$${topdir}/bison"; \ libsrcdir="$$s/bison"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bison @@ -6321,6 +7193,9 @@ configure-bison: .PHONY: all-bison maybe-all-bison maybe-all-bison: +@if gcc-bootstrap +all-bison: stage_current +@endif gcc-bootstrap @if bison TARGET-bison=all maybe-all-bison: all-bison @@ -6369,7 +7244,7 @@ install-bison: installdirs @endif bison -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bison info-bison maybe-info-bison: @@ -6423,6 +7298,32 @@ dvi-bison: \ @endif bison +.PHONY: maybe-pdf-bison pdf-bison +maybe-pdf-bison: +@if bison +maybe-pdf-bison: pdf-bison + +pdf-bison: \ + configure-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bison + .PHONY: maybe-html-bison html-bison maybe-html-bison: @if bison @@ -6502,6 +7403,33 @@ install-info-bison: \ @endif bison +.PHONY: maybe-install-pdf-bison install-pdf-bison +maybe-install-pdf-bison: +@if bison +maybe-install-pdf-bison: install-pdf-bison + +install-pdf-bison: \ + configure-bison \ + pdf-bison + @: $(MAKE); $(unstage) + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bison" ; \ + (cd $(HOST_SUBDIR)/bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bison + .PHONY: maybe-install-html-bison install-html-bison maybe-install-html-bison: @if bison @@ -6659,6 +7587,9 @@ maintainer-clean-bison: .PHONY: configure-byacc maybe-configure-byacc maybe-configure-byacc: +@if gcc-bootstrap +configure-byacc: stage_current +@endif gcc-bootstrap @if byacc maybe-configure-byacc: configure-byacc configure-byacc: @@ -6678,7 +7609,8 @@ configure-byacc: srcdiroption="--srcdir=$${topdir}/byacc"; \ libsrcdir="$$s/byacc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif byacc @@ -6688,6 +7620,9 @@ configure-byacc: .PHONY: all-byacc maybe-all-byacc maybe-all-byacc: +@if gcc-bootstrap +all-byacc: stage_current +@endif gcc-bootstrap @if byacc TARGET-byacc=all maybe-all-byacc: all-byacc @@ -6736,7 +7671,7 @@ install-byacc: installdirs @endif byacc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-byacc info-byacc maybe-info-byacc: @@ -6790,6 +7725,32 @@ dvi-byacc: \ @endif byacc +.PHONY: maybe-pdf-byacc pdf-byacc +maybe-pdf-byacc: +@if byacc +maybe-pdf-byacc: pdf-byacc + +pdf-byacc: \ + configure-byacc + @: $(MAKE); $(unstage) + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in byacc" ; \ + (cd $(HOST_SUBDIR)/byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif byacc + .PHONY: maybe-html-byacc html-byacc maybe-html-byacc: @if byacc @@ -6869,6 +7830,33 @@ install-info-byacc: \ @endif byacc +.PHONY: maybe-install-pdf-byacc install-pdf-byacc +maybe-install-pdf-byacc: +@if byacc +maybe-install-pdf-byacc: install-pdf-byacc + +install-pdf-byacc: \ + configure-byacc \ + pdf-byacc + @: $(MAKE); $(unstage) + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in byacc" ; \ + (cd $(HOST_SUBDIR)/byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif byacc + .PHONY: maybe-install-html-byacc install-html-byacc maybe-install-html-byacc: @if byacc @@ -7026,6 +8014,9 @@ maintainer-clean-byacc: .PHONY: configure-bzip2 maybe-configure-bzip2 maybe-configure-bzip2: +@if gcc-bootstrap +configure-bzip2: stage_current +@endif gcc-bootstrap @if bzip2 maybe-configure-bzip2: configure-bzip2 configure-bzip2: @@ -7045,7 +8036,8 @@ configure-bzip2: srcdiroption="--srcdir=$${topdir}/bzip2"; \ libsrcdir="$$s/bzip2"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif bzip2 @@ -7055,6 +8047,9 @@ configure-bzip2: .PHONY: all-bzip2 maybe-all-bzip2 maybe-all-bzip2: +@if gcc-bootstrap +all-bzip2: stage_current +@endif gcc-bootstrap @if bzip2 TARGET-bzip2=all maybe-all-bzip2: all-bzip2 @@ -7100,7 +8095,7 @@ install-bzip2: installdirs @endif bzip2 -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-bzip2 info-bzip2 maybe-info-bzip2: @@ -7154,6 +8149,32 @@ dvi-bzip2: \ @endif bzip2 +.PHONY: maybe-pdf-bzip2 pdf-bzip2 +maybe-pdf-bzip2: +@if bzip2 +maybe-pdf-bzip2: pdf-bzip2 + +pdf-bzip2: \ + configure-bzip2 + @: $(MAKE); $(unstage) + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in bzip2" ; \ + (cd $(HOST_SUBDIR)/bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif bzip2 + .PHONY: maybe-html-bzip2 html-bzip2 maybe-html-bzip2: @if bzip2 @@ -7233,6 +8254,33 @@ install-info-bzip2: \ @endif bzip2 +.PHONY: maybe-install-pdf-bzip2 install-pdf-bzip2 +maybe-install-pdf-bzip2: +@if bzip2 +maybe-install-pdf-bzip2: install-pdf-bzip2 + +install-pdf-bzip2: \ + configure-bzip2 \ + pdf-bzip2 + @: $(MAKE); $(unstage) + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in bzip2" ; \ + (cd $(HOST_SUBDIR)/bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif bzip2 + .PHONY: maybe-install-html-bzip2 install-html-bzip2 maybe-install-html-bzip2: @if bzip2 @@ -7390,6 +8438,9 @@ maintainer-clean-bzip2: .PHONY: configure-dejagnu maybe-configure-dejagnu maybe-configure-dejagnu: +@if gcc-bootstrap +configure-dejagnu: stage_current +@endif gcc-bootstrap @if dejagnu maybe-configure-dejagnu: configure-dejagnu configure-dejagnu: @@ -7409,7 +8460,8 @@ configure-dejagnu: srcdiroption="--srcdir=$${topdir}/dejagnu"; \ libsrcdir="$$s/dejagnu"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif dejagnu @@ -7419,6 +8471,9 @@ configure-dejagnu: .PHONY: all-dejagnu maybe-all-dejagnu maybe-all-dejagnu: +@if gcc-bootstrap +all-dejagnu: stage_current +@endif gcc-bootstrap @if dejagnu TARGET-dejagnu=all maybe-all-dejagnu: all-dejagnu @@ -7464,7 +8519,7 @@ install-dejagnu: installdirs @endif dejagnu -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-dejagnu info-dejagnu maybe-info-dejagnu: @@ -7518,6 +8573,32 @@ dvi-dejagnu: \ @endif dejagnu +.PHONY: maybe-pdf-dejagnu pdf-dejagnu +maybe-pdf-dejagnu: +@if dejagnu +maybe-pdf-dejagnu: pdf-dejagnu + +pdf-dejagnu: \ + configure-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif dejagnu + .PHONY: maybe-html-dejagnu html-dejagnu maybe-html-dejagnu: @if dejagnu @@ -7597,6 +8678,33 @@ install-info-dejagnu: \ @endif dejagnu +.PHONY: maybe-install-pdf-dejagnu install-pdf-dejagnu +maybe-install-pdf-dejagnu: +@if dejagnu +maybe-install-pdf-dejagnu: install-pdf-dejagnu + +install-pdf-dejagnu: \ + configure-dejagnu \ + pdf-dejagnu + @: $(MAKE); $(unstage) + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in dejagnu" ; \ + (cd $(HOST_SUBDIR)/dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif dejagnu + .PHONY: maybe-install-html-dejagnu install-html-dejagnu maybe-install-html-dejagnu: @if dejagnu @@ -7754,6 +8862,9 @@ maintainer-clean-dejagnu: .PHONY: configure-diff maybe-configure-diff maybe-configure-diff: +@if gcc-bootstrap +configure-diff: stage_current +@endif gcc-bootstrap @if diff maybe-configure-diff: configure-diff configure-diff: @@ -7773,7 +8884,8 @@ configure-diff: srcdiroption="--srcdir=$${topdir}/diff"; \ libsrcdir="$$s/diff"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif diff @@ -7783,6 +8895,9 @@ configure-diff: .PHONY: all-diff maybe-all-diff maybe-all-diff: +@if gcc-bootstrap +all-diff: stage_current +@endif gcc-bootstrap @if diff TARGET-diff=all maybe-all-diff: all-diff @@ -7828,7 +8943,7 @@ install-diff: installdirs @endif diff -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-diff info-diff maybe-info-diff: @@ -7882,6 +8997,32 @@ dvi-diff: \ @endif diff +.PHONY: maybe-pdf-diff pdf-diff +maybe-pdf-diff: +@if diff +maybe-pdf-diff: pdf-diff + +pdf-diff: \ + configure-diff + @: $(MAKE); $(unstage) + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in diff" ; \ + (cd $(HOST_SUBDIR)/diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif diff + .PHONY: maybe-html-diff html-diff maybe-html-diff: @if diff @@ -7961,6 +9102,33 @@ install-info-diff: \ @endif diff +.PHONY: maybe-install-pdf-diff install-pdf-diff +maybe-install-pdf-diff: +@if diff +maybe-install-pdf-diff: install-pdf-diff + +install-pdf-diff: \ + configure-diff \ + pdf-diff + @: $(MAKE); $(unstage) + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in diff" ; \ + (cd $(HOST_SUBDIR)/diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif diff + .PHONY: maybe-install-html-diff install-html-diff maybe-install-html-diff: @if diff @@ -8118,6 +9286,9 @@ maintainer-clean-diff: .PHONY: configure-dosutils maybe-configure-dosutils maybe-configure-dosutils: +@if gcc-bootstrap +configure-dosutils: stage_current +@endif gcc-bootstrap @if dosutils maybe-configure-dosutils: configure-dosutils configure-dosutils: @@ -8137,7 +9308,8 @@ configure-dosutils: srcdiroption="--srcdir=$${topdir}/dosutils"; \ libsrcdir="$$s/dosutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif dosutils @@ -8147,6 +9319,9 @@ configure-dosutils: .PHONY: all-dosutils maybe-all-dosutils maybe-all-dosutils: +@if gcc-bootstrap +all-dosutils: stage_current +@endif gcc-bootstrap @if dosutils TARGET-dosutils=all maybe-all-dosutils: all-dosutils @@ -8186,7 +9361,7 @@ install-dosutils: installdirs @endif dosutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-dosutils info-dosutils maybe-info-dosutils: @@ -8240,6 +9415,32 @@ dvi-dosutils: \ @endif dosutils +.PHONY: maybe-pdf-dosutils pdf-dosutils +maybe-pdf-dosutils: +@if dosutils +maybe-pdf-dosutils: pdf-dosutils + +pdf-dosutils: \ + configure-dosutils + @: $(MAKE); $(unstage) + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in dosutils" ; \ + (cd $(HOST_SUBDIR)/dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif dosutils + .PHONY: maybe-html-dosutils html-dosutils maybe-html-dosutils: @if dosutils @@ -8319,6 +9520,33 @@ install-info-dosutils: \ @endif dosutils +.PHONY: maybe-install-pdf-dosutils install-pdf-dosutils +maybe-install-pdf-dosutils: +@if dosutils +maybe-install-pdf-dosutils: install-pdf-dosutils + +install-pdf-dosutils: \ + configure-dosutils \ + pdf-dosutils + @: $(MAKE); $(unstage) + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in dosutils" ; \ + (cd $(HOST_SUBDIR)/dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif dosutils + .PHONY: maybe-install-html-dosutils install-html-dosutils maybe-install-html-dosutils: @if dosutils @@ -8476,6 +9704,9 @@ maintainer-clean-dosutils: .PHONY: configure-etc maybe-configure-etc maybe-configure-etc: +@if gcc-bootstrap +configure-etc: stage_current +@endif gcc-bootstrap @if etc maybe-configure-etc: configure-etc configure-etc: @@ -8495,7 +9726,8 @@ configure-etc: srcdiroption="--srcdir=$${topdir}/etc"; \ libsrcdir="$$s/etc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif etc @@ -8505,6 +9737,9 @@ configure-etc: .PHONY: all-etc maybe-all-etc maybe-all-etc: +@if gcc-bootstrap +all-etc: stage_current +@endif gcc-bootstrap @if etc TARGET-etc=all maybe-all-etc: all-etc @@ -8550,7 +9785,7 @@ install-etc: installdirs @endif etc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-etc info-etc maybe-info-etc: @@ -8604,6 +9839,32 @@ dvi-etc: \ @endif etc +.PHONY: maybe-pdf-etc pdf-etc +maybe-pdf-etc: +@if etc +maybe-pdf-etc: pdf-etc + +pdf-etc: \ + configure-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif etc + .PHONY: maybe-html-etc html-etc maybe-html-etc: @if etc @@ -8683,6 +9944,33 @@ install-info-etc: \ @endif etc +.PHONY: maybe-install-pdf-etc install-pdf-etc +maybe-install-pdf-etc: +@if etc +maybe-install-pdf-etc: install-pdf-etc + +install-pdf-etc: \ + configure-etc \ + pdf-etc + @: $(MAKE); $(unstage) + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in etc" ; \ + (cd $(HOST_SUBDIR)/etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif etc + .PHONY: maybe-install-html-etc install-html-etc maybe-install-html-etc: @if etc @@ -8840,6 +10128,9 @@ maintainer-clean-etc: .PHONY: configure-fastjar maybe-configure-fastjar maybe-configure-fastjar: +@if gcc-bootstrap +configure-fastjar: stage_current +@endif gcc-bootstrap @if fastjar maybe-configure-fastjar: configure-fastjar configure-fastjar: @@ -8859,7 +10150,8 @@ configure-fastjar: srcdiroption="--srcdir=$${topdir}/fastjar"; \ libsrcdir="$$s/fastjar"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif fastjar @@ -8869,6 +10161,9 @@ configure-fastjar: .PHONY: all-fastjar maybe-all-fastjar maybe-all-fastjar: +@if gcc-bootstrap +all-fastjar: stage_current +@endif gcc-bootstrap @if fastjar TARGET-fastjar=all maybe-all-fastjar: all-fastjar @@ -8917,7 +10212,7 @@ install-fastjar: installdirs @endif fastjar -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-fastjar info-fastjar maybe-info-fastjar: @@ -8971,6 +10266,32 @@ dvi-fastjar: \ @endif fastjar +.PHONY: maybe-pdf-fastjar pdf-fastjar +maybe-pdf-fastjar: +@if fastjar +maybe-pdf-fastjar: pdf-fastjar + +pdf-fastjar: \ + configure-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif fastjar + .PHONY: maybe-html-fastjar html-fastjar maybe-html-fastjar: @if fastjar @@ -9050,6 +10371,33 @@ install-info-fastjar: \ @endif fastjar +.PHONY: maybe-install-pdf-fastjar install-pdf-fastjar +maybe-install-pdf-fastjar: +@if fastjar +maybe-install-pdf-fastjar: install-pdf-fastjar + +install-pdf-fastjar: \ + configure-fastjar \ + pdf-fastjar + @: $(MAKE); $(unstage) + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fastjar" ; \ + (cd $(HOST_SUBDIR)/fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif fastjar + .PHONY: maybe-install-html-fastjar install-html-fastjar maybe-install-html-fastjar: @if fastjar @@ -9207,6 +10555,9 @@ maintainer-clean-fastjar: .PHONY: configure-fileutils maybe-configure-fileutils maybe-configure-fileutils: +@if gcc-bootstrap +configure-fileutils: stage_current +@endif gcc-bootstrap @if fileutils maybe-configure-fileutils: configure-fileutils configure-fileutils: @@ -9226,7 +10577,8 @@ configure-fileutils: srcdiroption="--srcdir=$${topdir}/fileutils"; \ libsrcdir="$$s/fileutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif fileutils @@ -9236,6 +10588,9 @@ configure-fileutils: .PHONY: all-fileutils maybe-all-fileutils maybe-all-fileutils: +@if gcc-bootstrap +all-fileutils: stage_current +@endif gcc-bootstrap @if fileutils TARGET-fileutils=all maybe-all-fileutils: all-fileutils @@ -9281,7 +10636,7 @@ install-fileutils: installdirs @endif fileutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-fileutils info-fileutils maybe-info-fileutils: @@ -9335,6 +10690,32 @@ dvi-fileutils: \ @endif fileutils +.PHONY: maybe-pdf-fileutils pdf-fileutils +maybe-pdf-fileutils: +@if fileutils +maybe-pdf-fileutils: pdf-fileutils + +pdf-fileutils: \ + configure-fileutils + @: $(MAKE); $(unstage) + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fileutils" ; \ + (cd $(HOST_SUBDIR)/fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif fileutils + .PHONY: maybe-html-fileutils html-fileutils maybe-html-fileutils: @if fileutils @@ -9414,6 +10795,33 @@ install-info-fileutils: \ @endif fileutils +.PHONY: maybe-install-pdf-fileutils install-pdf-fileutils +maybe-install-pdf-fileutils: +@if fileutils +maybe-install-pdf-fileutils: install-pdf-fileutils + +install-pdf-fileutils: \ + configure-fileutils \ + pdf-fileutils + @: $(MAKE); $(unstage) + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fileutils" ; \ + (cd $(HOST_SUBDIR)/fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif fileutils + .PHONY: maybe-install-html-fileutils install-html-fileutils maybe-install-html-fileutils: @if fileutils @@ -9571,6 +10979,9 @@ maintainer-clean-fileutils: .PHONY: configure-findutils maybe-configure-findutils maybe-configure-findutils: +@if gcc-bootstrap +configure-findutils: stage_current +@endif gcc-bootstrap @if findutils maybe-configure-findutils: configure-findutils configure-findutils: @@ -9590,7 +11001,8 @@ configure-findutils: srcdiroption="--srcdir=$${topdir}/findutils"; \ libsrcdir="$$s/findutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif findutils @@ -9600,6 +11012,9 @@ configure-findutils: .PHONY: all-findutils maybe-all-findutils maybe-all-findutils: +@if gcc-bootstrap +all-findutils: stage_current +@endif gcc-bootstrap @if findutils TARGET-findutils=all maybe-all-findutils: all-findutils @@ -9645,7 +11060,7 @@ install-findutils: installdirs @endif findutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-findutils info-findutils maybe-info-findutils: @@ -9699,6 +11114,32 @@ dvi-findutils: \ @endif findutils +.PHONY: maybe-pdf-findutils pdf-findutils +maybe-pdf-findutils: +@if findutils +maybe-pdf-findutils: pdf-findutils + +pdf-findutils: \ + configure-findutils + @: $(MAKE); $(unstage) + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in findutils" ; \ + (cd $(HOST_SUBDIR)/findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif findutils + .PHONY: maybe-html-findutils html-findutils maybe-html-findutils: @if findutils @@ -9778,6 +11219,33 @@ install-info-findutils: \ @endif findutils +.PHONY: maybe-install-pdf-findutils install-pdf-findutils +maybe-install-pdf-findutils: +@if findutils +maybe-install-pdf-findutils: install-pdf-findutils + +install-pdf-findutils: \ + configure-findutils \ + pdf-findutils + @: $(MAKE); $(unstage) + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in findutils" ; \ + (cd $(HOST_SUBDIR)/findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif findutils + .PHONY: maybe-install-html-findutils install-html-findutils maybe-install-html-findutils: @if findutils @@ -9935,6 +11403,9 @@ maintainer-clean-findutils: .PHONY: configure-find maybe-configure-find maybe-configure-find: +@if gcc-bootstrap +configure-find: stage_current +@endif gcc-bootstrap @if find maybe-configure-find: configure-find configure-find: @@ -9954,7 +11425,8 @@ configure-find: srcdiroption="--srcdir=$${topdir}/find"; \ libsrcdir="$$s/find"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif find @@ -9964,6 +11436,9 @@ configure-find: .PHONY: all-find maybe-all-find maybe-all-find: +@if gcc-bootstrap +all-find: stage_current +@endif gcc-bootstrap @if find TARGET-find=all maybe-all-find: all-find @@ -10009,7 +11484,7 @@ install-find: installdirs @endif find -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-find info-find maybe-info-find: @@ -10063,6 +11538,32 @@ dvi-find: \ @endif find +.PHONY: maybe-pdf-find pdf-find +maybe-pdf-find: +@if find +maybe-pdf-find: pdf-find + +pdf-find: \ + configure-find + @: $(MAKE); $(unstage) + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in find" ; \ + (cd $(HOST_SUBDIR)/find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif find + .PHONY: maybe-html-find html-find maybe-html-find: @if find @@ -10142,6 +11643,33 @@ install-info-find: \ @endif find +.PHONY: maybe-install-pdf-find install-pdf-find +maybe-install-pdf-find: +@if find +maybe-install-pdf-find: install-pdf-find + +install-pdf-find: \ + configure-find \ + pdf-find + @: $(MAKE); $(unstage) + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in find" ; \ + (cd $(HOST_SUBDIR)/find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif find + .PHONY: maybe-install-html-find install-html-find maybe-install-html-find: @if find @@ -10299,6 +11827,9 @@ maintainer-clean-find: .PHONY: configure-fixincludes maybe-configure-fixincludes maybe-configure-fixincludes: +@if gcc-bootstrap +configure-fixincludes: stage_current +@endif gcc-bootstrap @if fixincludes maybe-configure-fixincludes: configure-fixincludes configure-fixincludes: @@ -10318,7 +11849,8 @@ configure-fixincludes: srcdiroption="--srcdir=$${topdir}/fixincludes"; \ libsrcdir="$$s/fixincludes"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif fixincludes @@ -10328,6 +11860,9 @@ configure-fixincludes: .PHONY: all-fixincludes maybe-all-fixincludes maybe-all-fixincludes: +@if gcc-bootstrap +all-fixincludes: stage_current +@endif gcc-bootstrap @if fixincludes TARGET-fixincludes=all maybe-all-fixincludes: all-fixincludes @@ -10373,15 +11908,31 @@ install-fixincludes: installdirs @endif fixincludes -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-fixincludes info-fixincludes maybe-info-fixincludes: @if fixincludes maybe-info-fixincludes: info-fixincludes -# fixincludes doesn't support info. -info-fixincludes: +info-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 @endif fixincludes @@ -10390,8 +11941,50 @@ maybe-dvi-fixincludes: @if fixincludes maybe-dvi-fixincludes: dvi-fixincludes -# fixincludes doesn't support dvi. -dvi-fixincludes: +dvi-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-pdf-fixincludes pdf-fixincludes +maybe-pdf-fixincludes: +@if fixincludes +maybe-pdf-fixincludes: pdf-fixincludes + +pdf-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 @endif fixincludes @@ -10436,8 +12029,52 @@ maybe-install-info-fixincludes: @if fixincludes maybe-install-info-fixincludes: install-info-fixincludes -# fixincludes doesn't support install-info. -install-info-fixincludes: +install-info-fixincludes: \ + configure-fixincludes \ + info-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif fixincludes + +.PHONY: maybe-install-pdf-fixincludes install-pdf-fixincludes +maybe-install-pdf-fixincludes: +@if fixincludes +maybe-install-pdf-fixincludes: install-pdf-fixincludes + +install-pdf-fixincludes: \ + configure-fixincludes \ + pdf-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 @endif fixincludes @@ -10473,8 +12110,24 @@ maybe-installcheck-fixincludes: @if fixincludes maybe-installcheck-fixincludes: installcheck-fixincludes -# fixincludes doesn't support installcheck. -installcheck-fixincludes: +installcheck-fixincludes: \ + configure-fixincludes + @: $(MAKE); $(unstage) + @[ -f ./fixincludes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fixincludes" ; \ + (cd $(HOST_SUBDIR)/fixincludes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 @endif fixincludes @@ -10582,6 +12235,9 @@ maintainer-clean-fixincludes: .PHONY: configure-flex maybe-configure-flex maybe-configure-flex: +@if gcc-bootstrap +configure-flex: stage_current +@endif gcc-bootstrap @if flex maybe-configure-flex: configure-flex configure-flex: @@ -10601,7 +12257,8 @@ configure-flex: srcdiroption="--srcdir=$${topdir}/flex"; \ libsrcdir="$$s/flex"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif flex @@ -10611,6 +12268,9 @@ configure-flex: .PHONY: all-flex maybe-all-flex maybe-all-flex: +@if gcc-bootstrap +all-flex: stage_current +@endif gcc-bootstrap @if flex TARGET-flex=all maybe-all-flex: all-flex @@ -10659,7 +12319,7 @@ install-flex: installdirs @endif flex -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-flex info-flex maybe-info-flex: @@ -10713,6 +12373,32 @@ dvi-flex: \ @endif flex +.PHONY: maybe-pdf-flex pdf-flex +maybe-pdf-flex: +@if flex +maybe-pdf-flex: pdf-flex + +pdf-flex: \ + configure-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif flex + .PHONY: maybe-html-flex html-flex maybe-html-flex: @if flex @@ -10792,6 +12478,33 @@ install-info-flex: \ @endif flex +.PHONY: maybe-install-pdf-flex install-pdf-flex +maybe-install-pdf-flex: +@if flex +maybe-install-pdf-flex: install-pdf-flex + +install-pdf-flex: \ + configure-flex \ + pdf-flex + @: $(MAKE); $(unstage) + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in flex" ; \ + (cd $(HOST_SUBDIR)/flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif flex + .PHONY: maybe-install-html-flex install-html-flex maybe-install-html-flex: @if flex @@ -10949,14 +12662,12 @@ maintainer-clean-flex: .PHONY: configure-gas maybe-configure-gas maybe-configure-gas: +@if gcc-bootstrap +configure-gas: stage_current +@endif gcc-bootstrap @if gas maybe-configure-gas: configure-gas configure-gas: -@endif gas -@if gas-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif gas-bootstrap -@if gas @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ @@ -10972,7 +12683,8 @@ configure-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gas @@ -10989,6 +12701,8 @@ configure-stage1-gas: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11000,8 +12714,10 @@ configure-stage1-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif gas-bootstrap .PHONY: configure-stage2-gas maybe-configure-stage2-gas @@ -11016,6 +12732,8 @@ configure-stage2-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11027,7 +12745,9 @@ configure-stage2-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11043,6 +12763,8 @@ configure-stage3-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11054,7 +12776,9 @@ configure-stage3-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11070,6 +12794,8 @@ configure-stage4-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11081,7 +12807,9 @@ configure-stage4-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11097,6 +12825,8 @@ configure-stageprofile-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11108,7 +12838,9 @@ configure-stageprofile-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11124,6 +12856,8 @@ configure-stagefeedback-gas: test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ cd $(HOST_SUBDIR)/gas || exit 1; \ @@ -11135,7 +12869,9 @@ configure-stagefeedback-gas: srcdiroption="--srcdir=$${topdir}/gas"; \ libsrcdir="$$s/gas"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gas-bootstrap @@ -11145,15 +12881,13 @@ configure-stagefeedback-gas: .PHONY: all-gas maybe-all-gas maybe-all-gas: +@if gcc-bootstrap +all-gas: stage_current +@endif gcc-bootstrap @if gas TARGET-gas=all maybe-all-gas: all-gas all-gas: configure-gas -@endif gas -@if gas-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif gas-bootstrap -@if gas @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -11177,18 +12911,22 @@ all-stage1-gas: configure-stage1-gas s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-gas) maybe-clean-stage1-gas: clean-stage1-gas clean-stage1: clean-stage1-gas clean-stage1-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif gas-bootstrap @@ -11207,19 +12945,23 @@ all-stage2-gas: configure-stage2-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-gas) maybe-clean-stage2-gas: clean-stage2-gas clean-stage2: clean-stage2-gas clean-stage2-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif gas-bootstrap @@ -11238,19 +12980,23 @@ all-stage3-gas: configure-stage3-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-gas) maybe-clean-stage3-gas: clean-stage3-gas clean-stage3: clean-stage3-gas clean-stage3-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif gas-bootstrap @@ -11269,19 +13015,23 @@ all-stage4-gas: configure-stage4-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-gas) maybe-clean-stage4-gas: clean-stage4-gas clean-stage4: clean-stage4-gas clean-stage4-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif gas-bootstrap @@ -11300,19 +13050,23 @@ all-stageprofile-gas: configure-stageprofile-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-gas) maybe-clean-stageprofile-gas: clean-stageprofile-gas clean-stageprofile: clean-stageprofile-gas clean-stageprofile-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif gas-bootstrap @@ -11331,19 +13085,23 @@ all-stagefeedback-gas: configure-stagefeedback-gas $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-gas) maybe-clean-stagefeedback-gas: clean-stagefeedback-gas clean-stagefeedback: clean-stagefeedback-gas clean-stagefeedback-gas: - @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif gas-bootstrap @@ -11380,7 +13138,7 @@ install-gas: installdirs @endif gas -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gas info-gas maybe-info-gas: @@ -11432,6 +13190,31 @@ dvi-gas: \ @endif gas +.PHONY: maybe-pdf-gas pdf-gas +maybe-pdf-gas: +@if gas +maybe-pdf-gas: pdf-gas + +pdf-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gas + .PHONY: maybe-html-gas html-gas maybe-html-gas: @if gas @@ -11508,6 +13291,32 @@ install-info-gas: \ @endif gas +.PHONY: maybe-install-pdf-gas install-pdf-gas +maybe-install-pdf-gas: +@if gas +maybe-install-pdf-gas: install-pdf-gas + +install-pdf-gas: \ + configure-gas \ + pdf-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gas + .PHONY: maybe-install-html-gas install-html-gas maybe-install-html-gas: @if gas @@ -11659,14 +13468,12 @@ maintainer-clean-gas: .PHONY: configure-gcc maybe-configure-gcc maybe-configure-gcc: +@if gcc-bootstrap +configure-gcc: stage_current +@endif gcc-bootstrap @if gcc maybe-configure-gcc: configure-gcc configure-gcc: -@endif gcc -@if gcc-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif gcc-bootstrap -@if gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ @@ -11682,7 +13489,8 @@ configure-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gcc @@ -11699,6 +13507,8 @@ configure-stage1-gcc: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11710,8 +13520,10 @@ configure-stage1-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif gcc-bootstrap .PHONY: configure-stage2-gcc maybe-configure-stage2-gcc @@ -11726,6 +13538,8 @@ configure-stage2-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11737,7 +13551,9 @@ configure-stage2-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11753,6 +13569,8 @@ configure-stage3-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11764,7 +13582,9 @@ configure-stage3-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11780,6 +13600,8 @@ configure-stage4-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11791,7 +13613,9 @@ configure-stage4-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11807,6 +13631,8 @@ configure-stageprofile-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11818,7 +13644,9 @@ configure-stageprofile-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11834,6 +13662,8 @@ configure-stagefeedback-gcc: test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ cd $(HOST_SUBDIR)/gcc || exit 1; \ @@ -11845,7 +13675,9 @@ configure-stagefeedback-gcc: srcdiroption="--srcdir=$${topdir}/gcc"; \ libsrcdir="$$s/gcc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif gcc-bootstrap @@ -11855,15 +13687,13 @@ configure-stagefeedback-gcc: .PHONY: all-gcc maybe-all-gcc maybe-all-gcc: -@if gcc -TARGET-gcc=`if [ -f stage_last ]; then echo quickstrap ; else echo all; fi` -maybe-all-gcc: all-gcc -all-gcc: configure-gcc -@endif gcc @if gcc-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi +all-gcc: stage_current @endif gcc-bootstrap @if gcc +TARGET-gcc=all +maybe-all-gcc: all-gcc +all-gcc: configure-gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -11887,18 +13717,22 @@ all-stage1-gcc: configure-stage1-gcc s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \ $(TARGET-stage1-gcc) maybe-clean-stage1-gcc: clean-stage1-gcc clean-stage1: clean-stage1-gcc clean-stage1-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -11917,19 +13751,23 @@ all-stage2-gcc: configure-stage2-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stage2-gcc) maybe-clean-stage2-gcc: clean-stage2-gcc clean-stage2: clean-stage2-gcc clean-stage2-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -11948,19 +13786,23 @@ all-stage3-gcc: configure-stage3-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stage3-gcc) maybe-clean-stage3-gcc: clean-stage3-gcc clean-stage3: clean-stage3-gcc clean-stage3-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -11979,19 +13821,23 @@ all-stage4-gcc: configure-stage4-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stage4-gcc) maybe-clean-stage4-gcc: clean-stage4-gcc clean-stage4: clean-stage4-gcc clean-stage4-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -12010,19 +13856,23 @@ all-stageprofile-gcc: configure-stageprofile-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stageprofile-gcc) maybe-clean-stageprofile-gcc: clean-stageprofile-gcc clean-stageprofile: clean-stageprofile-gcc clean-stageprofile-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -12041,19 +13891,23 @@ all-stagefeedback-gcc: configure-stagefeedback-gcc $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ $(TARGET-stagefeedback-gcc) maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc clean-stagefeedback: clean-stagefeedback-gcc clean-stagefeedback-gcc: - @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean + $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap @@ -12090,7 +13944,7 @@ install-gcc: installdirs @endif gcc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gcc info-gcc maybe-info-gcc: @@ -12142,6 +13996,31 @@ dvi-gcc: \ @endif gcc +.PHONY: maybe-pdf-gcc pdf-gcc +maybe-pdf-gcc: +@if gcc +maybe-pdf-gcc: pdf-gcc + +pdf-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gcc + .PHONY: maybe-html-gcc html-gcc maybe-html-gcc: @if gcc @@ -12218,6 +14097,32 @@ install-info-gcc: \ @endif gcc +.PHONY: maybe-install-pdf-gcc install-pdf-gcc +maybe-install-pdf-gcc: +@if gcc +maybe-install-pdf-gcc: install-pdf-gcc + +install-pdf-gcc: \ + configure-gcc \ + pdf-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gcc" ; \ + (cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gcc + .PHONY: maybe-install-html-gcc install-html-gcc maybe-install-html-gcc: @if gcc @@ -12369,6 +14274,9 @@ maintainer-clean-gcc: .PHONY: configure-gawk maybe-configure-gawk maybe-configure-gawk: +@if gcc-bootstrap +configure-gawk: stage_current +@endif gcc-bootstrap @if gawk maybe-configure-gawk: configure-gawk configure-gawk: @@ -12388,7 +14296,8 @@ configure-gawk: srcdiroption="--srcdir=$${topdir}/gawk"; \ libsrcdir="$$s/gawk"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gawk @@ -12398,6 +14307,9 @@ configure-gawk: .PHONY: all-gawk maybe-all-gawk maybe-all-gawk: +@if gcc-bootstrap +all-gawk: stage_current +@endif gcc-bootstrap @if gawk TARGET-gawk=all maybe-all-gawk: all-gawk @@ -12443,7 +14355,7 @@ install-gawk: installdirs @endif gawk -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gawk info-gawk maybe-info-gawk: @@ -12497,6 +14409,32 @@ dvi-gawk: \ @endif gawk +.PHONY: maybe-pdf-gawk pdf-gawk +maybe-pdf-gawk: +@if gawk +maybe-pdf-gawk: pdf-gawk + +pdf-gawk: \ + configure-gawk + @: $(MAKE); $(unstage) + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gawk" ; \ + (cd $(HOST_SUBDIR)/gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gawk + .PHONY: maybe-html-gawk html-gawk maybe-html-gawk: @if gawk @@ -12576,6 +14514,33 @@ install-info-gawk: \ @endif gawk +.PHONY: maybe-install-pdf-gawk install-pdf-gawk +maybe-install-pdf-gawk: +@if gawk +maybe-install-pdf-gawk: install-pdf-gawk + +install-pdf-gawk: \ + configure-gawk \ + pdf-gawk + @: $(MAKE); $(unstage) + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gawk" ; \ + (cd $(HOST_SUBDIR)/gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gawk + .PHONY: maybe-install-html-gawk install-html-gawk maybe-install-html-gawk: @if gawk @@ -12733,6 +14698,9 @@ maintainer-clean-gawk: .PHONY: configure-gettext maybe-configure-gettext maybe-configure-gettext: +@if gcc-bootstrap +configure-gettext: stage_current +@endif gcc-bootstrap @if gettext maybe-configure-gettext: configure-gettext configure-gettext: @@ -12752,7 +14720,8 @@ configure-gettext: srcdiroption="--srcdir=$${topdir}/gettext"; \ libsrcdir="$$s/gettext"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gettext @@ -12762,6 +14731,9 @@ configure-gettext: .PHONY: all-gettext maybe-all-gettext maybe-all-gettext: +@if gcc-bootstrap +all-gettext: stage_current +@endif gcc-bootstrap @if gettext TARGET-gettext=all maybe-all-gettext: all-gettext @@ -12807,7 +14779,7 @@ install-gettext: installdirs @endif gettext -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gettext info-gettext maybe-info-gettext: @@ -12861,6 +14833,32 @@ dvi-gettext: \ @endif gettext +.PHONY: maybe-pdf-gettext pdf-gettext +maybe-pdf-gettext: +@if gettext +maybe-pdf-gettext: pdf-gettext + +pdf-gettext: \ + configure-gettext + @: $(MAKE); $(unstage) + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gettext" ; \ + (cd $(HOST_SUBDIR)/gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gettext + .PHONY: maybe-html-gettext html-gettext maybe-html-gettext: @if gettext @@ -12940,6 +14938,33 @@ install-info-gettext: \ @endif gettext +.PHONY: maybe-install-pdf-gettext install-pdf-gettext +maybe-install-pdf-gettext: +@if gettext +maybe-install-pdf-gettext: install-pdf-gettext + +install-pdf-gettext: \ + configure-gettext \ + pdf-gettext + @: $(MAKE); $(unstage) + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gettext" ; \ + (cd $(HOST_SUBDIR)/gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gettext + .PHONY: maybe-install-html-gettext install-html-gettext maybe-install-html-gettext: @if gettext @@ -13095,8 +15120,1611 @@ maintainer-clean-gettext: +.PHONY: configure-gmp maybe-configure-gmp +maybe-configure-gmp: +@if gcc-bootstrap +configure-gmp: stage_current +@endif gcc-bootstrap +@if gmp +maybe-configure-gmp: configure-gmp +configure-gmp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/gmp; \ + cd "$(HOST_SUBDIR)/gmp" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} --disable-shared \ + || exit 1 +@endif gmp + + + +.PHONY: configure-stage1-gmp maybe-configure-stage1-gmp +maybe-configure-stage1-gmp: +@if gmp-bootstrap +maybe-configure-stage1-gmp: configure-stage1-gmp +configure-stage1-gmp: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage2-gmp maybe-configure-stage2-gmp +maybe-configure-stage2-gmp: +@if gmp-bootstrap +maybe-configure-stage2-gmp: configure-stage2-gmp +configure-stage2-gmp: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage3-gmp maybe-configure-stage3-gmp +maybe-configure-stage3-gmp: +@if gmp-bootstrap +maybe-configure-stage3-gmp: configure-stage3-gmp +configure-stage3-gmp: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stage4-gmp maybe-configure-stage4-gmp +maybe-configure-stage4-gmp: +@if gmp-bootstrap +maybe-configure-stage4-gmp: configure-stage4-gmp +configure-stage4-gmp: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stageprofile-gmp maybe-configure-stageprofile-gmp +maybe-configure-stageprofile-gmp: +@if gmp-bootstrap +maybe-configure-stageprofile-gmp: configure-stageprofile-gmp +configure-stageprofile-gmp: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + +.PHONY: configure-stagefeedback-gmp maybe-configure-stagefeedback-gmp +maybe-configure-stagefeedback-gmp: +@if gmp-bootstrap +maybe-configure-stagefeedback-gmp: configure-stagefeedback-gmp +configure-stagefeedback-gmp: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gmp"; \ + libsrcdir="$$s/gmp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared +@endif gmp-bootstrap + + + + + +.PHONY: all-gmp maybe-all-gmp +maybe-all-gmp: +@if gcc-bootstrap +all-gmp: stage_current +@endif gcc-bootstrap +@if gmp +TARGET-gmp=all +maybe-all-gmp: all-gmp +all-gmp: configure-gmp + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gmp)) +@endif gmp + + + +.PHONY: all-stage1-gmp maybe-all-stage1-gmp +.PHONY: clean-stage1-gmp maybe-clean-stage1-gmp +maybe-all-stage1-gmp: +maybe-clean-stage1-gmp: +@if gmp-bootstrap +maybe-all-stage1-gmp: all-stage1-gmp +all-stage1: all-stage1-gmp +TARGET-stage1-gmp = $(TARGET-gmp) +all-stage1-gmp: configure-stage1-gmp + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-gmp) + +maybe-clean-stage1-gmp: clean-stage1-gmp +clean-stage1: clean-stage1-gmp +clean-stage1-gmp: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-gmp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage2-gmp maybe-all-stage2-gmp +.PHONY: clean-stage2-gmp maybe-clean-stage2-gmp +maybe-all-stage2-gmp: +maybe-clean-stage2-gmp: +@if gmp-bootstrap +maybe-all-stage2-gmp: all-stage2-gmp +all-stage2: all-stage2-gmp +TARGET-stage2-gmp = $(TARGET-gmp) +all-stage2-gmp: configure-stage2-gmp + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-gmp) + +maybe-clean-stage2-gmp: clean-stage2-gmp +clean-stage2: clean-stage2-gmp +clean-stage2-gmp: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-gmp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage3-gmp maybe-all-stage3-gmp +.PHONY: clean-stage3-gmp maybe-clean-stage3-gmp +maybe-all-stage3-gmp: +maybe-clean-stage3-gmp: +@if gmp-bootstrap +maybe-all-stage3-gmp: all-stage3-gmp +all-stage3: all-stage3-gmp +TARGET-stage3-gmp = $(TARGET-gmp) +all-stage3-gmp: configure-stage3-gmp + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-gmp) + +maybe-clean-stage3-gmp: clean-stage3-gmp +clean-stage3: clean-stage3-gmp +clean-stage3-gmp: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-gmp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stage4-gmp maybe-all-stage4-gmp +.PHONY: clean-stage4-gmp maybe-clean-stage4-gmp +maybe-all-stage4-gmp: +maybe-clean-stage4-gmp: +@if gmp-bootstrap +maybe-all-stage4-gmp: all-stage4-gmp +all-stage4: all-stage4-gmp +TARGET-stage4-gmp = $(TARGET-gmp) +all-stage4-gmp: configure-stage4-gmp + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-gmp) + +maybe-clean-stage4-gmp: clean-stage4-gmp +clean-stage4: clean-stage4-gmp +clean-stage4-gmp: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-gmp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stageprofile-gmp maybe-all-stageprofile-gmp +.PHONY: clean-stageprofile-gmp maybe-clean-stageprofile-gmp +maybe-all-stageprofile-gmp: +maybe-clean-stageprofile-gmp: +@if gmp-bootstrap +maybe-all-stageprofile-gmp: all-stageprofile-gmp +all-stageprofile: all-stageprofile-gmp +TARGET-stageprofile-gmp = $(TARGET-gmp) +all-stageprofile-gmp: configure-stageprofile-gmp + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-gmp) + +maybe-clean-stageprofile-gmp: clean-stageprofile-gmp +clean-stageprofile: clean-stageprofile-gmp +clean-stageprofile-gmp: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-gmp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + +.PHONY: all-stagefeedback-gmp maybe-all-stagefeedback-gmp +.PHONY: clean-stagefeedback-gmp maybe-clean-stagefeedback-gmp +maybe-all-stagefeedback-gmp: +maybe-clean-stagefeedback-gmp: +@if gmp-bootstrap +maybe-all-stagefeedback-gmp: all-stagefeedback-gmp +all-stagefeedback: all-stagefeedback-gmp +TARGET-stagefeedback-gmp = $(TARGET-gmp) +all-stagefeedback-gmp: configure-stagefeedback-gmp + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-gmp) + +maybe-clean-stagefeedback-gmp: clean-stagefeedback-gmp +clean-stagefeedback: clean-stagefeedback-gmp +clean-stagefeedback-gmp: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-gmp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gmp-bootstrap + + + + + +.PHONY: check-gmp maybe-check-gmp +maybe-check-gmp: +@if gmp +maybe-check-gmp: check-gmp + +check-gmp: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gmp + +.PHONY: install-gmp maybe-install-gmp +maybe-install-gmp: +@if gmp +maybe-install-gmp: install-gmp + +install-gmp: + +@endif gmp + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-gmp info-gmp +maybe-info-gmp: +@if gmp +maybe-info-gmp: info-gmp + +info-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-dvi-gmp dvi-gmp +maybe-dvi-gmp: +@if gmp +maybe-dvi-gmp: dvi-gmp + +dvi-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-pdf-gmp pdf-gmp +maybe-pdf-gmp: +@if gmp +maybe-pdf-gmp: pdf-gmp + +pdf-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-html-gmp html-gmp +maybe-html-gmp: +@if gmp +maybe-html-gmp: html-gmp + +html-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-TAGS-gmp TAGS-gmp +maybe-TAGS-gmp: +@if gmp +maybe-TAGS-gmp: TAGS-gmp + +TAGS-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-info-gmp install-info-gmp +maybe-install-info-gmp: +@if gmp +maybe-install-info-gmp: install-info-gmp + +install-info-gmp: \ + configure-gmp \ + info-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-pdf-gmp install-pdf-gmp +maybe-install-pdf-gmp: +@if gmp +maybe-install-pdf-gmp: install-pdf-gmp + +install-pdf-gmp: \ + configure-gmp \ + pdf-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-install-html-gmp install-html-gmp +maybe-install-html-gmp: +@if gmp +maybe-install-html-gmp: install-html-gmp + +install-html-gmp: \ + configure-gmp \ + html-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-installcheck-gmp installcheck-gmp +maybe-installcheck-gmp: +@if gmp +maybe-installcheck-gmp: installcheck-gmp + +installcheck-gmp: \ + configure-gmp + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-mostlyclean-gmp mostlyclean-gmp +maybe-mostlyclean-gmp: +@if gmp +maybe-mostlyclean-gmp: mostlyclean-gmp + +mostlyclean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-clean-gmp clean-gmp +maybe-clean-gmp: +@if gmp +maybe-clean-gmp: clean-gmp + +clean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-distclean-gmp distclean-gmp +maybe-distclean-gmp: +@if gmp +maybe-distclean-gmp: distclean-gmp + +distclean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif gmp + +.PHONY: maybe-maintainer-clean-gmp maintainer-clean-gmp +maybe-maintainer-clean-gmp: +@if gmp +maybe-maintainer-clean-gmp: maintainer-clean-gmp + +maintainer-clean-gmp: + @[ -f ./gmp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gmp" ; \ + (cd $(HOST_SUBDIR)/gmp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif gmp + + + +.PHONY: configure-mpfr maybe-configure-mpfr +maybe-configure-mpfr: +@if gcc-bootstrap +configure-mpfr: stage_current +@endif gcc-bootstrap +@if mpfr +maybe-configure-mpfr: configure-mpfr +configure-mpfr: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/mpfr; \ + cd "$(HOST_SUBDIR)/mpfr" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp \ + || exit 1 +@endif mpfr + + + +.PHONY: configure-stage1-mpfr maybe-configure-stage1-mpfr +maybe-configure-stage1-mpfr: +@if mpfr-bootstrap +maybe-configure-stage1-mpfr: configure-stage1-mpfr +configure-stage1-mpfr: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stage2-mpfr maybe-configure-stage2-mpfr +maybe-configure-stage2-mpfr: +@if mpfr-bootstrap +maybe-configure-stage2-mpfr: configure-stage2-mpfr +configure-stage2-mpfr: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stage3-mpfr maybe-configure-stage3-mpfr +maybe-configure-stage3-mpfr: +@if mpfr-bootstrap +maybe-configure-stage3-mpfr: configure-stage3-mpfr +configure-stage3-mpfr: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stage4-mpfr maybe-configure-stage4-mpfr +maybe-configure-stage4-mpfr: +@if mpfr-bootstrap +maybe-configure-stage4-mpfr: configure-stage4-mpfr +configure-stage4-mpfr: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stageprofile-mpfr maybe-configure-stageprofile-mpfr +maybe-configure-stageprofile-mpfr: +@if mpfr-bootstrap +maybe-configure-stageprofile-mpfr: configure-stageprofile-mpfr +configure-stageprofile-mpfr: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + +.PHONY: configure-stagefeedback-mpfr maybe-configure-stagefeedback-mpfr +maybe-configure-stagefeedback-mpfr: +@if mpfr-bootstrap +maybe-configure-stagefeedback-mpfr: configure-stagefeedback-mpfr +configure-stagefeedback-mpfr: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/mpfr"; \ + libsrcdir="$$s/mpfr"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \ + --target=none-${host_vendor}-${host_os} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ --disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp +@endif mpfr-bootstrap + + + + + +.PHONY: all-mpfr maybe-all-mpfr +maybe-all-mpfr: +@if gcc-bootstrap +all-mpfr: stage_current +@endif gcc-bootstrap +@if mpfr +TARGET-mpfr=all +maybe-all-mpfr: all-mpfr +all-mpfr: configure-mpfr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mpfr)) +@endif mpfr + + + +.PHONY: all-stage1-mpfr maybe-all-stage1-mpfr +.PHONY: clean-stage1-mpfr maybe-clean-stage1-mpfr +maybe-all-stage1-mpfr: +maybe-clean-stage1-mpfr: +@if mpfr-bootstrap +maybe-all-stage1-mpfr: all-stage1-mpfr +all-stage1: all-stage1-mpfr +TARGET-stage1-mpfr = $(TARGET-mpfr) +all-stage1-mpfr: configure-stage1-mpfr + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-mpfr) + +maybe-clean-stage1-mpfr: clean-stage1-mpfr +clean-stage1: clean-stage1-mpfr +clean-stage1-mpfr: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage2-mpfr maybe-all-stage2-mpfr +.PHONY: clean-stage2-mpfr maybe-clean-stage2-mpfr +maybe-all-stage2-mpfr: +maybe-clean-stage2-mpfr: +@if mpfr-bootstrap +maybe-all-stage2-mpfr: all-stage2-mpfr +all-stage2: all-stage2-mpfr +TARGET-stage2-mpfr = $(TARGET-mpfr) +all-stage2-mpfr: configure-stage2-mpfr + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-mpfr) + +maybe-clean-stage2-mpfr: clean-stage2-mpfr +clean-stage2: clean-stage2-mpfr +clean-stage2-mpfr: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage3-mpfr maybe-all-stage3-mpfr +.PHONY: clean-stage3-mpfr maybe-clean-stage3-mpfr +maybe-all-stage3-mpfr: +maybe-clean-stage3-mpfr: +@if mpfr-bootstrap +maybe-all-stage3-mpfr: all-stage3-mpfr +all-stage3: all-stage3-mpfr +TARGET-stage3-mpfr = $(TARGET-mpfr) +all-stage3-mpfr: configure-stage3-mpfr + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-mpfr) + +maybe-clean-stage3-mpfr: clean-stage3-mpfr +clean-stage3: clean-stage3-mpfr +clean-stage3-mpfr: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stage4-mpfr maybe-all-stage4-mpfr +.PHONY: clean-stage4-mpfr maybe-clean-stage4-mpfr +maybe-all-stage4-mpfr: +maybe-clean-stage4-mpfr: +@if mpfr-bootstrap +maybe-all-stage4-mpfr: all-stage4-mpfr +all-stage4: all-stage4-mpfr +TARGET-stage4-mpfr = $(TARGET-mpfr) +all-stage4-mpfr: configure-stage4-mpfr + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-mpfr) + +maybe-clean-stage4-mpfr: clean-stage4-mpfr +clean-stage4: clean-stage4-mpfr +clean-stage4-mpfr: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-mpfr/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stageprofile-mpfr maybe-all-stageprofile-mpfr +.PHONY: clean-stageprofile-mpfr maybe-clean-stageprofile-mpfr +maybe-all-stageprofile-mpfr: +maybe-clean-stageprofile-mpfr: +@if mpfr-bootstrap +maybe-all-stageprofile-mpfr: all-stageprofile-mpfr +all-stageprofile: all-stageprofile-mpfr +TARGET-stageprofile-mpfr = $(TARGET-mpfr) +all-stageprofile-mpfr: configure-stageprofile-mpfr + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-mpfr) + +maybe-clean-stageprofile-mpfr: clean-stageprofile-mpfr +clean-stageprofile: clean-stageprofile-mpfr +clean-stageprofile-mpfr: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-mpfr/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + +.PHONY: all-stagefeedback-mpfr maybe-all-stagefeedback-mpfr +.PHONY: clean-stagefeedback-mpfr maybe-clean-stagefeedback-mpfr +maybe-all-stagefeedback-mpfr: +maybe-clean-stagefeedback-mpfr: +@if mpfr-bootstrap +maybe-all-stagefeedback-mpfr: all-stagefeedback-mpfr +all-stagefeedback: all-stagefeedback-mpfr +TARGET-stagefeedback-mpfr = $(TARGET-mpfr) +all-stagefeedback-mpfr: configure-stagefeedback-mpfr + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-mpfr) + +maybe-clean-stagefeedback-mpfr: clean-stagefeedback-mpfr +clean-stagefeedback: clean-stagefeedback-mpfr +clean-stagefeedback-mpfr: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-mpfr/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif mpfr-bootstrap + + + + + +.PHONY: check-mpfr maybe-check-mpfr +maybe-check-mpfr: +@if mpfr +maybe-check-mpfr: check-mpfr + +check-mpfr: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif mpfr + +.PHONY: install-mpfr maybe-install-mpfr +maybe-install-mpfr: +@if mpfr +maybe-install-mpfr: install-mpfr + +install-mpfr: + +@endif mpfr + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-mpfr info-mpfr +maybe-info-mpfr: +@if mpfr +maybe-info-mpfr: info-mpfr + +info-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-dvi-mpfr dvi-mpfr +maybe-dvi-mpfr: +@if mpfr +maybe-dvi-mpfr: dvi-mpfr + +dvi-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-pdf-mpfr pdf-mpfr +maybe-pdf-mpfr: +@if mpfr +maybe-pdf-mpfr: pdf-mpfr + +pdf-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-html-mpfr html-mpfr +maybe-html-mpfr: +@if mpfr +maybe-html-mpfr: html-mpfr + +html-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-TAGS-mpfr TAGS-mpfr +maybe-TAGS-mpfr: +@if mpfr +maybe-TAGS-mpfr: TAGS-mpfr + +TAGS-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-info-mpfr install-info-mpfr +maybe-install-info-mpfr: +@if mpfr +maybe-install-info-mpfr: install-info-mpfr + +install-info-mpfr: \ + configure-mpfr \ + info-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-pdf-mpfr install-pdf-mpfr +maybe-install-pdf-mpfr: +@if mpfr +maybe-install-pdf-mpfr: install-pdf-mpfr + +install-pdf-mpfr: \ + configure-mpfr \ + pdf-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-install-html-mpfr install-html-mpfr +maybe-install-html-mpfr: +@if mpfr +maybe-install-html-mpfr: install-html-mpfr + +install-html-mpfr: \ + configure-mpfr \ + html-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-installcheck-mpfr installcheck-mpfr +maybe-installcheck-mpfr: +@if mpfr +maybe-installcheck-mpfr: installcheck-mpfr + +installcheck-mpfr: \ + configure-mpfr + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-mostlyclean-mpfr mostlyclean-mpfr +maybe-mostlyclean-mpfr: +@if mpfr +maybe-mostlyclean-mpfr: mostlyclean-mpfr + +mostlyclean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-clean-mpfr clean-mpfr +maybe-clean-mpfr: +@if mpfr +maybe-clean-mpfr: clean-mpfr + +clean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-distclean-mpfr distclean-mpfr +maybe-distclean-mpfr: +@if mpfr +maybe-distclean-mpfr: distclean-mpfr + +distclean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif mpfr + +.PHONY: maybe-maintainer-clean-mpfr maintainer-clean-mpfr +maybe-maintainer-clean-mpfr: +@if mpfr +maybe-maintainer-clean-mpfr: maintainer-clean-mpfr + +maintainer-clean-mpfr: + @[ -f ./mpfr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in mpfr" ; \ + (cd $(HOST_SUBDIR)/mpfr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif mpfr + + + .PHONY: configure-gnuserv maybe-configure-gnuserv maybe-configure-gnuserv: +@if gcc-bootstrap +configure-gnuserv: stage_current +@endif gcc-bootstrap @if gnuserv maybe-configure-gnuserv: configure-gnuserv configure-gnuserv: @@ -13116,7 +16744,8 @@ configure-gnuserv: srcdiroption="--srcdir=$${topdir}/gnuserv"; \ libsrcdir="$$s/gnuserv"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gnuserv @@ -13126,6 +16755,9 @@ configure-gnuserv: .PHONY: all-gnuserv maybe-all-gnuserv maybe-all-gnuserv: +@if gcc-bootstrap +all-gnuserv: stage_current +@endif gcc-bootstrap @if gnuserv TARGET-gnuserv=all maybe-all-gnuserv: all-gnuserv @@ -13171,7 +16803,7 @@ install-gnuserv: installdirs @endif gnuserv -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gnuserv info-gnuserv maybe-info-gnuserv: @@ -13225,6 +16857,32 @@ dvi-gnuserv: \ @endif gnuserv +.PHONY: maybe-pdf-gnuserv pdf-gnuserv +maybe-pdf-gnuserv: +@if gnuserv +maybe-pdf-gnuserv: pdf-gnuserv + +pdf-gnuserv: \ + configure-gnuserv + @: $(MAKE); $(unstage) + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gnuserv" ; \ + (cd $(HOST_SUBDIR)/gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gnuserv + .PHONY: maybe-html-gnuserv html-gnuserv maybe-html-gnuserv: @if gnuserv @@ -13304,6 +16962,33 @@ install-info-gnuserv: \ @endif gnuserv +.PHONY: maybe-install-pdf-gnuserv install-pdf-gnuserv +maybe-install-pdf-gnuserv: +@if gnuserv +maybe-install-pdf-gnuserv: install-pdf-gnuserv + +install-pdf-gnuserv: \ + configure-gnuserv \ + pdf-gnuserv + @: $(MAKE); $(unstage) + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gnuserv" ; \ + (cd $(HOST_SUBDIR)/gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gnuserv + .PHONY: maybe-install-html-gnuserv install-html-gnuserv maybe-install-html-gnuserv: @if gnuserv @@ -13461,6 +17146,9 @@ maintainer-clean-gnuserv: .PHONY: configure-gprof maybe-configure-gprof maybe-configure-gprof: +@if gcc-bootstrap +configure-gprof: stage_current +@endif gcc-bootstrap @if gprof maybe-configure-gprof: configure-gprof configure-gprof: @@ -13480,7 +17168,8 @@ configure-gprof: srcdiroption="--srcdir=$${topdir}/gprof"; \ libsrcdir="$$s/gprof"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gprof @@ -13490,6 +17179,9 @@ configure-gprof: .PHONY: all-gprof maybe-all-gprof maybe-all-gprof: +@if gcc-bootstrap +all-gprof: stage_current +@endif gcc-bootstrap @if gprof TARGET-gprof=all maybe-all-gprof: all-gprof @@ -13535,7 +17227,7 @@ install-gprof: installdirs @endif gprof -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gprof info-gprof maybe-info-gprof: @@ -13589,6 +17281,32 @@ dvi-gprof: \ @endif gprof +.PHONY: maybe-pdf-gprof pdf-gprof +maybe-pdf-gprof: +@if gprof +maybe-pdf-gprof: pdf-gprof + +pdf-gprof: \ + configure-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gprof + .PHONY: maybe-html-gprof html-gprof maybe-html-gprof: @if gprof @@ -13668,6 +17386,33 @@ install-info-gprof: \ @endif gprof +.PHONY: maybe-install-pdf-gprof install-pdf-gprof +maybe-install-pdf-gprof: +@if gprof +maybe-install-pdf-gprof: install-pdf-gprof + +install-pdf-gprof: \ + configure-gprof \ + pdf-gprof + @: $(MAKE); $(unstage) + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gprof" ; \ + (cd $(HOST_SUBDIR)/gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gprof + .PHONY: maybe-install-html-gprof install-html-gprof maybe-install-html-gprof: @if gprof @@ -13825,6 +17570,9 @@ maintainer-clean-gprof: .PHONY: configure-gzip maybe-configure-gzip maybe-configure-gzip: +@if gcc-bootstrap +configure-gzip: stage_current +@endif gcc-bootstrap @if gzip maybe-configure-gzip: configure-gzip configure-gzip: @@ -13844,7 +17592,8 @@ configure-gzip: srcdiroption="--srcdir=$${topdir}/gzip"; \ libsrcdir="$$s/gzip"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gzip @@ -13854,6 +17603,9 @@ configure-gzip: .PHONY: all-gzip maybe-all-gzip maybe-all-gzip: +@if gcc-bootstrap +all-gzip: stage_current +@endif gcc-bootstrap @if gzip TARGET-gzip=all maybe-all-gzip: all-gzip @@ -13899,7 +17651,7 @@ install-gzip: installdirs @endif gzip -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gzip info-gzip maybe-info-gzip: @@ -13953,6 +17705,32 @@ dvi-gzip: \ @endif gzip +.PHONY: maybe-pdf-gzip pdf-gzip +maybe-pdf-gzip: +@if gzip +maybe-pdf-gzip: pdf-gzip + +pdf-gzip: \ + configure-gzip + @: $(MAKE); $(unstage) + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gzip" ; \ + (cd $(HOST_SUBDIR)/gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gzip + .PHONY: maybe-html-gzip html-gzip maybe-html-gzip: @if gzip @@ -14032,6 +17810,33 @@ install-info-gzip: \ @endif gzip +.PHONY: maybe-install-pdf-gzip install-pdf-gzip +maybe-install-pdf-gzip: +@if gzip +maybe-install-pdf-gzip: install-pdf-gzip + +install-pdf-gzip: \ + configure-gzip \ + pdf-gzip + @: $(MAKE); $(unstage) + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gzip" ; \ + (cd $(HOST_SUBDIR)/gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gzip + .PHONY: maybe-install-html-gzip install-html-gzip maybe-install-html-gzip: @if gzip @@ -14189,6 +17994,9 @@ maintainer-clean-gzip: .PHONY: configure-hello maybe-configure-hello maybe-configure-hello: +@if gcc-bootstrap +configure-hello: stage_current +@endif gcc-bootstrap @if hello maybe-configure-hello: configure-hello configure-hello: @@ -14208,7 +18016,8 @@ configure-hello: srcdiroption="--srcdir=$${topdir}/hello"; \ libsrcdir="$$s/hello"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif hello @@ -14218,6 +18027,9 @@ configure-hello: .PHONY: all-hello maybe-all-hello maybe-all-hello: +@if gcc-bootstrap +all-hello: stage_current +@endif gcc-bootstrap @if hello TARGET-hello=all maybe-all-hello: all-hello @@ -14263,7 +18075,7 @@ install-hello: installdirs @endif hello -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-hello info-hello maybe-info-hello: @@ -14317,6 +18129,32 @@ dvi-hello: \ @endif hello +.PHONY: maybe-pdf-hello pdf-hello +maybe-pdf-hello: +@if hello +maybe-pdf-hello: pdf-hello + +pdf-hello: \ + configure-hello + @: $(MAKE); $(unstage) + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in hello" ; \ + (cd $(HOST_SUBDIR)/hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif hello + .PHONY: maybe-html-hello html-hello maybe-html-hello: @if hello @@ -14396,6 +18234,33 @@ install-info-hello: \ @endif hello +.PHONY: maybe-install-pdf-hello install-pdf-hello +maybe-install-pdf-hello: +@if hello +maybe-install-pdf-hello: install-pdf-hello + +install-pdf-hello: \ + configure-hello \ + pdf-hello + @: $(MAKE); $(unstage) + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in hello" ; \ + (cd $(HOST_SUBDIR)/hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif hello + .PHONY: maybe-install-html-hello install-html-hello maybe-install-html-hello: @if hello @@ -14553,6 +18418,9 @@ maintainer-clean-hello: .PHONY: configure-indent maybe-configure-indent maybe-configure-indent: +@if gcc-bootstrap +configure-indent: stage_current +@endif gcc-bootstrap @if indent maybe-configure-indent: configure-indent configure-indent: @@ -14572,7 +18440,8 @@ configure-indent: srcdiroption="--srcdir=$${topdir}/indent"; \ libsrcdir="$$s/indent"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif indent @@ -14582,6 +18451,9 @@ configure-indent: .PHONY: all-indent maybe-all-indent maybe-all-indent: +@if gcc-bootstrap +all-indent: stage_current +@endif gcc-bootstrap @if indent TARGET-indent=all maybe-all-indent: all-indent @@ -14627,7 +18499,7 @@ install-indent: installdirs @endif indent -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-indent info-indent maybe-info-indent: @@ -14681,6 +18553,32 @@ dvi-indent: \ @endif indent +.PHONY: maybe-pdf-indent pdf-indent +maybe-pdf-indent: +@if indent +maybe-pdf-indent: pdf-indent + +pdf-indent: \ + configure-indent + @: $(MAKE); $(unstage) + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in indent" ; \ + (cd $(HOST_SUBDIR)/indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif indent + .PHONY: maybe-html-indent html-indent maybe-html-indent: @if indent @@ -14760,6 +18658,33 @@ install-info-indent: \ @endif indent +.PHONY: maybe-install-pdf-indent install-pdf-indent +maybe-install-pdf-indent: +@if indent +maybe-install-pdf-indent: install-pdf-indent + +install-pdf-indent: \ + configure-indent \ + pdf-indent + @: $(MAKE); $(unstage) + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in indent" ; \ + (cd $(HOST_SUBDIR)/indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif indent + .PHONY: maybe-install-html-indent install-html-indent maybe-install-html-indent: @if indent @@ -14917,14 +18842,12 @@ maintainer-clean-indent: .PHONY: configure-intl maybe-configure-intl maybe-configure-intl: +@if gcc-bootstrap +configure-intl: stage_current +@endif gcc-bootstrap @if intl maybe-configure-intl: configure-intl configure-intl: -@endif intl -@if intl-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif intl-bootstrap -@if intl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ @@ -14940,7 +18863,8 @@ configure-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif intl @@ -14957,6 +18881,8 @@ configure-stage1-intl: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -14968,8 +18894,10 @@ configure-stage1-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif intl-bootstrap .PHONY: configure-stage2-intl maybe-configure-stage2-intl @@ -14984,6 +18912,8 @@ configure-stage2-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -14995,7 +18925,9 @@ configure-stage2-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15011,6 +18943,8 @@ configure-stage3-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15022,7 +18956,9 @@ configure-stage3-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15038,6 +18974,8 @@ configure-stage4-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15049,7 +18987,9 @@ configure-stage4-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15065,6 +19005,8 @@ configure-stageprofile-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15076,7 +19018,9 @@ configure-stageprofile-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15092,6 +19036,8 @@ configure-stagefeedback-intl: test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ cd $(HOST_SUBDIR)/intl || exit 1; \ @@ -15103,7 +19049,9 @@ configure-stagefeedback-intl: srcdiroption="--srcdir=$${topdir}/intl"; \ libsrcdir="$$s/intl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif intl-bootstrap @@ -15113,15 +19061,13 @@ configure-stagefeedback-intl: .PHONY: all-intl maybe-all-intl maybe-all-intl: +@if gcc-bootstrap +all-intl: stage_current +@endif gcc-bootstrap @if intl TARGET-intl=all maybe-all-intl: all-intl all-intl: configure-intl -@endif intl -@if intl-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif intl-bootstrap -@if intl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -15145,18 +19091,22 @@ all-stage1-intl: configure-stage1-intl s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-intl) maybe-clean-stage1-intl: clean-stage1-intl clean-stage1: clean-stage1-intl clean-stage1-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif intl-bootstrap @@ -15175,19 +19125,23 @@ all-stage2-intl: configure-stage2-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-intl) maybe-clean-stage2-intl: clean-stage2-intl clean-stage2: clean-stage2-intl clean-stage2-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif intl-bootstrap @@ -15206,19 +19160,23 @@ all-stage3-intl: configure-stage3-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-intl) maybe-clean-stage3-intl: clean-stage3-intl clean-stage3: clean-stage3-intl clean-stage3-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif intl-bootstrap @@ -15237,19 +19195,23 @@ all-stage4-intl: configure-stage4-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-intl) maybe-clean-stage4-intl: clean-stage4-intl clean-stage4: clean-stage4-intl clean-stage4-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif intl-bootstrap @@ -15268,19 +19230,23 @@ all-stageprofile-intl: configure-stageprofile-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-intl) maybe-clean-stageprofile-intl: clean-stageprofile-intl clean-stageprofile: clean-stageprofile-intl clean-stageprofile-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif intl-bootstrap @@ -15299,19 +19265,23 @@ all-stagefeedback-intl: configure-stagefeedback-intl $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-intl) maybe-clean-stagefeedback-intl: clean-stagefeedback-intl clean-stagefeedback: clean-stagefeedback-intl clean-stagefeedback-intl: - @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif intl-bootstrap @@ -15348,7 +19318,7 @@ install-intl: installdirs @endif intl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-intl info-intl maybe-info-intl: @@ -15400,6 +19370,31 @@ dvi-intl: \ @endif intl +.PHONY: maybe-pdf-intl pdf-intl +maybe-pdf-intl: +@if intl +maybe-pdf-intl: pdf-intl + +pdf-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif intl + .PHONY: maybe-html-intl html-intl maybe-html-intl: @if intl @@ -15476,6 +19471,32 @@ install-info-intl: \ @endif intl +.PHONY: maybe-install-pdf-intl install-pdf-intl +maybe-install-pdf-intl: +@if intl +maybe-install-pdf-intl: install-pdf-intl + +install-pdf-intl: \ + configure-intl \ + pdf-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in intl" ; \ + (cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif intl + .PHONY: maybe-install-html-intl install-html-intl maybe-install-html-intl: @if intl @@ -15627,6 +19648,9 @@ maintainer-clean-intl: .PHONY: configure-tcl maybe-configure-tcl maybe-configure-tcl: +@if gcc-bootstrap +configure-tcl: stage_current +@endif gcc-bootstrap @if tcl maybe-configure-tcl: configure-tcl configure-tcl: @@ -15646,7 +19670,8 @@ configure-tcl: srcdiroption="--srcdir=$${topdir}/tcl"; \ libsrcdir="$$s/tcl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif tcl @@ -15656,6 +19681,9 @@ configure-tcl: .PHONY: all-tcl maybe-all-tcl maybe-all-tcl: +@if gcc-bootstrap +all-tcl: stage_current +@endif gcc-bootstrap @if tcl TARGET-tcl=all maybe-all-tcl: all-tcl @@ -15701,7 +19729,7 @@ install-tcl: installdirs @endif tcl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-tcl info-tcl maybe-info-tcl: @@ -15755,6 +19783,32 @@ dvi-tcl: \ @endif tcl +.PHONY: maybe-pdf-tcl pdf-tcl +maybe-pdf-tcl: +@if tcl +maybe-pdf-tcl: pdf-tcl + +pdf-tcl: \ + configure-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif tcl + .PHONY: maybe-html-tcl html-tcl maybe-html-tcl: @if tcl @@ -15834,6 +19888,33 @@ install-info-tcl: \ @endif tcl +.PHONY: maybe-install-pdf-tcl install-pdf-tcl +maybe-install-pdf-tcl: +@if tcl +maybe-install-pdf-tcl: install-pdf-tcl + +install-pdf-tcl: \ + configure-tcl \ + pdf-tcl + @: $(MAKE); $(unstage) + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tcl" ; \ + (cd $(HOST_SUBDIR)/tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif tcl + .PHONY: maybe-install-html-tcl install-html-tcl maybe-install-html-tcl: @if tcl @@ -15976,6 +20057,9 @@ maintainer-clean-tcl: .PHONY: configure-itcl maybe-configure-itcl maybe-configure-itcl: +@if gcc-bootstrap +configure-itcl: stage_current +@endif gcc-bootstrap @if itcl maybe-configure-itcl: configure-itcl configure-itcl: @@ -15995,7 +20079,8 @@ configure-itcl: srcdiroption="--srcdir=$${topdir}/itcl"; \ libsrcdir="$$s/itcl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif itcl @@ -16005,6 +20090,9 @@ configure-itcl: .PHONY: all-itcl maybe-all-itcl maybe-all-itcl: +@if gcc-bootstrap +all-itcl: stage_current +@endif gcc-bootstrap @if itcl TARGET-itcl=all maybe-all-itcl: all-itcl @@ -16050,7 +20138,7 @@ install-itcl: installdirs @endif itcl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-itcl info-itcl maybe-info-itcl: @@ -16104,6 +20192,32 @@ dvi-itcl: \ @endif itcl +.PHONY: maybe-pdf-itcl pdf-itcl +maybe-pdf-itcl: +@if itcl +maybe-pdf-itcl: pdf-itcl + +pdf-itcl: \ + configure-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif itcl + .PHONY: maybe-html-itcl html-itcl maybe-html-itcl: @if itcl @@ -16183,6 +20297,33 @@ install-info-itcl: \ @endif itcl +.PHONY: maybe-install-pdf-itcl install-pdf-itcl +maybe-install-pdf-itcl: +@if itcl +maybe-install-pdf-itcl: install-pdf-itcl + +install-pdf-itcl: \ + configure-itcl \ + pdf-itcl + @: $(MAKE); $(unstage) + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in itcl" ; \ + (cd $(HOST_SUBDIR)/itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif itcl + .PHONY: maybe-install-html-itcl install-html-itcl maybe-install-html-itcl: @if itcl @@ -16340,14 +20481,12 @@ maintainer-clean-itcl: .PHONY: configure-ld maybe-configure-ld maybe-configure-ld: +@if gcc-bootstrap +configure-ld: stage_current +@endif gcc-bootstrap @if ld maybe-configure-ld: configure-ld configure-ld: -@endif ld -@if ld-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif ld-bootstrap -@if ld @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ @@ -16363,7 +20502,8 @@ configure-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif ld @@ -16380,6 +20520,8 @@ configure-stage1-ld: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16391,8 +20533,10 @@ configure-stage1-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif ld-bootstrap .PHONY: configure-stage2-ld maybe-configure-stage2-ld @@ -16407,6 +20551,8 @@ configure-stage2-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16418,7 +20564,9 @@ configure-stage2-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16434,6 +20582,8 @@ configure-stage3-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16445,7 +20595,9 @@ configure-stage3-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16461,6 +20613,8 @@ configure-stage4-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16472,7 +20626,9 @@ configure-stage4-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16488,6 +20644,8 @@ configure-stageprofile-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16499,7 +20657,9 @@ configure-stageprofile-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16515,6 +20675,8 @@ configure-stagefeedback-ld: test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ cd $(HOST_SUBDIR)/ld || exit 1; \ @@ -16526,7 +20688,9 @@ configure-stagefeedback-ld: srcdiroption="--srcdir=$${topdir}/ld"; \ libsrcdir="$$s/ld"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif ld-bootstrap @@ -16536,15 +20700,13 @@ configure-stagefeedback-ld: .PHONY: all-ld maybe-all-ld maybe-all-ld: +@if gcc-bootstrap +all-ld: stage_current +@endif gcc-bootstrap @if ld TARGET-ld=all maybe-all-ld: all-ld all-ld: configure-ld -@endif ld -@if ld-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif ld-bootstrap -@if ld @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -16568,18 +20730,22 @@ all-stage1-ld: configure-stage1-ld s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-ld) maybe-clean-stage1-ld: clean-stage1-ld clean-stage1: clean-stage1-ld clean-stage1-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif ld-bootstrap @@ -16598,19 +20764,23 @@ all-stage2-ld: configure-stage2-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-ld) maybe-clean-stage2-ld: clean-stage2-ld clean-stage2: clean-stage2-ld clean-stage2-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif ld-bootstrap @@ -16629,19 +20799,23 @@ all-stage3-ld: configure-stage3-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-ld) maybe-clean-stage3-ld: clean-stage3-ld clean-stage3: clean-stage3-ld clean-stage3-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif ld-bootstrap @@ -16660,19 +20834,23 @@ all-stage4-ld: configure-stage4-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-ld) maybe-clean-stage4-ld: clean-stage4-ld clean-stage4: clean-stage4-ld clean-stage4-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif ld-bootstrap @@ -16691,19 +20869,23 @@ all-stageprofile-ld: configure-stageprofile-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-ld) maybe-clean-stageprofile-ld: clean-stageprofile-ld clean-stageprofile: clean-stageprofile-ld clean-stageprofile-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif ld-bootstrap @@ -16722,19 +20904,23 @@ all-stagefeedback-ld: configure-stagefeedback-ld $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-ld) maybe-clean-stagefeedback-ld: clean-stagefeedback-ld clean-stagefeedback: clean-stagefeedback-ld clean-stagefeedback-ld: - @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif ld-bootstrap @@ -16771,7 +20957,7 @@ install-ld: installdirs @endif ld -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-ld info-ld maybe-info-ld: @@ -16823,6 +21009,31 @@ dvi-ld: \ @endif ld +.PHONY: maybe-pdf-ld pdf-ld +maybe-pdf-ld: +@if ld +maybe-pdf-ld: pdf-ld + +pdf-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif ld + .PHONY: maybe-html-ld html-ld maybe-html-ld: @if ld @@ -16899,6 +21110,32 @@ install-info-ld: \ @endif ld +.PHONY: maybe-install-pdf-ld install-pdf-ld +maybe-install-pdf-ld: +@if ld +maybe-install-pdf-ld: install-pdf-ld + +install-pdf-ld: \ + configure-ld \ + pdf-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in ld" ; \ + (cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif ld + .PHONY: maybe-install-html-ld install-html-ld maybe-install-html-ld: @if ld @@ -17050,14 +21287,12 @@ maintainer-clean-ld: .PHONY: configure-libcpp maybe-configure-libcpp maybe-configure-libcpp: +@if gcc-bootstrap +configure-libcpp: stage_current +@endif gcc-bootstrap @if libcpp maybe-configure-libcpp: configure-libcpp configure-libcpp: -@endif libcpp -@if libcpp-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libcpp-bootstrap -@if libcpp @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ @@ -17073,7 +21308,8 @@ configure-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libcpp @@ -17090,6 +21326,8 @@ configure-stage1-libcpp: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17101,8 +21339,10 @@ configure-stage1-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif libcpp-bootstrap .PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp @@ -17117,6 +21357,8 @@ configure-stage2-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17128,7 +21370,9 @@ configure-stage2-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17144,6 +21388,8 @@ configure-stage3-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17155,7 +21401,9 @@ configure-stage3-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17171,6 +21419,8 @@ configure-stage4-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17182,7 +21432,9 @@ configure-stage4-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17198,6 +21450,8 @@ configure-stageprofile-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17209,7 +21463,9 @@ configure-stageprofile-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17225,6 +21481,8 @@ configure-stagefeedback-libcpp: test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ cd $(HOST_SUBDIR)/libcpp || exit 1; \ @@ -17236,7 +21494,9 @@ configure-stagefeedback-libcpp: srcdiroption="--srcdir=$${topdir}/libcpp"; \ libsrcdir="$$s/libcpp"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libcpp-bootstrap @@ -17246,15 +21506,13 @@ configure-stagefeedback-libcpp: .PHONY: all-libcpp maybe-all-libcpp maybe-all-libcpp: +@if gcc-bootstrap +all-libcpp: stage_current +@endif gcc-bootstrap @if libcpp TARGET-libcpp=all maybe-all-libcpp: all-libcpp all-libcpp: configure-libcpp -@endif libcpp -@if libcpp-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libcpp-bootstrap -@if libcpp @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -17278,18 +21536,22 @@ all-stage1-libcpp: configure-stage1-libcpp s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-libcpp) maybe-clean-stage1-libcpp: clean-stage1-libcpp clean-stage1: clean-stage1-libcpp clean-stage1-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif libcpp-bootstrap @@ -17308,19 +21570,23 @@ all-stage2-libcpp: configure-stage2-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-libcpp) maybe-clean-stage2-libcpp: clean-stage2-libcpp clean-stage2: clean-stage2-libcpp clean-stage2-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libcpp-bootstrap @@ -17339,19 +21605,23 @@ all-stage3-libcpp: configure-stage3-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-libcpp) maybe-clean-stage3-libcpp: clean-stage3-libcpp clean-stage3: clean-stage3-libcpp clean-stage3-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libcpp-bootstrap @@ -17370,19 +21640,23 @@ all-stage4-libcpp: configure-stage4-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-libcpp) maybe-clean-stage4-libcpp: clean-stage4-libcpp clean-stage4: clean-stage4-libcpp clean-stage4-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libcpp-bootstrap @@ -17401,19 +21675,23 @@ all-stageprofile-libcpp: configure-stageprofile-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-libcpp) maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp clean-stageprofile: clean-stageprofile-libcpp clean-stageprofile-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif libcpp-bootstrap @@ -17432,19 +21710,23 @@ all-stagefeedback-libcpp: configure-stagefeedback-libcpp $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-libcpp) maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp clean-stagefeedback: clean-stagefeedback-libcpp clean-stagefeedback-libcpp: - @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif libcpp-bootstrap @@ -17481,7 +21763,7 @@ install-libcpp: installdirs @endif libcpp -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libcpp info-libcpp maybe-info-libcpp: @@ -17533,6 +21815,31 @@ dvi-libcpp: \ @endif libcpp +.PHONY: maybe-pdf-libcpp pdf-libcpp +maybe-pdf-libcpp: +@if libcpp +maybe-pdf-libcpp: pdf-libcpp + +pdf-libcpp: \ + configure-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libcpp + .PHONY: maybe-html-libcpp html-libcpp maybe-html-libcpp: @if libcpp @@ -17609,6 +21916,32 @@ install-info-libcpp: \ @endif libcpp +.PHONY: maybe-install-pdf-libcpp install-pdf-libcpp +maybe-install-pdf-libcpp: +@if libcpp +maybe-install-pdf-libcpp: install-pdf-libcpp + +install-pdf-libcpp: \ + configure-libcpp \ + pdf-libcpp + @[ -f ./libcpp/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libcpp" ; \ + (cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libcpp + .PHONY: maybe-install-html-libcpp install-html-libcpp maybe-install-html-libcpp: @if libcpp @@ -17760,14 +22093,12 @@ maintainer-clean-libcpp: .PHONY: configure-libdecnumber maybe-configure-libdecnumber maybe-configure-libdecnumber: +@if gcc-bootstrap +configure-libdecnumber: stage_current +@endif gcc-bootstrap @if libdecnumber maybe-configure-libdecnumber: configure-libdecnumber configure-libdecnumber: -@endif libdecnumber -@if libdecnumber-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libdecnumber-bootstrap -@if libdecnumber @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ @@ -17783,7 +22114,8 @@ configure-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libdecnumber @@ -17800,6 +22132,8 @@ configure-stage1-libdecnumber: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17811,8 +22145,10 @@ configure-stage1-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif libdecnumber-bootstrap .PHONY: configure-stage2-libdecnumber maybe-configure-stage2-libdecnumber @@ -17827,6 +22163,8 @@ configure-stage2-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17838,7 +22176,9 @@ configure-stage2-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17854,6 +22194,8 @@ configure-stage3-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17865,7 +22207,9 @@ configure-stage3-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17881,6 +22225,8 @@ configure-stage4-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17892,7 +22238,9 @@ configure-stage4-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17908,6 +22256,8 @@ configure-stageprofile-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17919,7 +22269,9 @@ configure-stageprofile-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17935,6 +22287,8 @@ configure-stagefeedback-libdecnumber: test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/libdecnumber ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ @@ -17946,7 +22300,9 @@ configure-stagefeedback-libdecnumber: srcdiroption="--srcdir=$${topdir}/libdecnumber"; \ libsrcdir="$$s/libdecnumber"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libdecnumber-bootstrap @@ -17956,15 +22312,13 @@ configure-stagefeedback-libdecnumber: .PHONY: all-libdecnumber maybe-all-libdecnumber maybe-all-libdecnumber: +@if gcc-bootstrap +all-libdecnumber: stage_current +@endif gcc-bootstrap @if libdecnumber TARGET-libdecnumber=all maybe-all-libdecnumber: all-libdecnumber all-libdecnumber: configure-libdecnumber -@endif libdecnumber -@if libdecnumber-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libdecnumber-bootstrap -@if libdecnumber @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -17988,18 +22342,22 @@ all-stage1-libdecnumber: configure-stage1-libdecnumber s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-libdecnumber) maybe-clean-stage1-libdecnumber: clean-stage1-libdecnumber clean-stage1: clean-stage1-libdecnumber clean-stage1-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif libdecnumber-bootstrap @@ -18018,19 +22376,23 @@ all-stage2-libdecnumber: configure-stage2-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-libdecnumber) maybe-clean-stage2-libdecnumber: clean-stage2-libdecnumber clean-stage2: clean-stage2-libdecnumber clean-stage2-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libdecnumber-bootstrap @@ -18049,19 +22411,23 @@ all-stage3-libdecnumber: configure-stage3-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-libdecnumber) maybe-clean-stage3-libdecnumber: clean-stage3-libdecnumber clean-stage3: clean-stage3-libdecnumber clean-stage3-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libdecnumber-bootstrap @@ -18080,19 +22446,23 @@ all-stage4-libdecnumber: configure-stage4-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-libdecnumber) maybe-clean-stage4-libdecnumber: clean-stage4-libdecnumber clean-stage4: clean-stage4-libdecnumber clean-stage4-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libdecnumber-bootstrap @@ -18111,19 +22481,23 @@ all-stageprofile-libdecnumber: configure-stageprofile-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-libdecnumber) maybe-clean-stageprofile-libdecnumber: clean-stageprofile-libdecnumber clean-stageprofile: clean-stageprofile-libdecnumber clean-stageprofile-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif libdecnumber-bootstrap @@ -18142,19 +22516,23 @@ all-stagefeedback-libdecnumber: configure-stagefeedback-libdecnumber $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libdecnumber && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-libdecnumber) maybe-clean-stagefeedback-libdecnumber: clean-stagefeedback-libdecnumber clean-stagefeedback: clean-stagefeedback-libdecnumber clean-stagefeedback-libdecnumber: - @[ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libdecnumber/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libdecnumber/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/libdecnumber && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif libdecnumber-bootstrap @@ -18191,7 +22569,7 @@ install-libdecnumber: installdirs @endif libdecnumber -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libdecnumber info-libdecnumber maybe-info-libdecnumber: @@ -18243,6 +22621,31 @@ dvi-libdecnumber: \ @endif libdecnumber +.PHONY: maybe-pdf-libdecnumber pdf-libdecnumber +maybe-pdf-libdecnumber: +@if libdecnumber +maybe-pdf-libdecnumber: pdf-libdecnumber + +pdf-libdecnumber: \ + configure-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libdecnumber + .PHONY: maybe-html-libdecnumber html-libdecnumber maybe-html-libdecnumber: @if libdecnumber @@ -18319,6 +22722,32 @@ install-info-libdecnumber: \ @endif libdecnumber +.PHONY: maybe-install-pdf-libdecnumber install-pdf-libdecnumber +maybe-install-pdf-libdecnumber: +@if libdecnumber +maybe-install-pdf-libdecnumber: install-pdf-libdecnumber + +install-pdf-libdecnumber: \ + configure-libdecnumber \ + pdf-libdecnumber + @[ -f ./libdecnumber/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libdecnumber" ; \ + (cd $(HOST_SUBDIR)/libdecnumber && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libdecnumber + .PHONY: maybe-install-html-libdecnumber install-html-libdecnumber maybe-install-html-libdecnumber: @if libdecnumber @@ -18470,6 +22899,9 @@ maintainer-clean-libdecnumber: .PHONY: configure-libgui maybe-configure-libgui maybe-configure-libgui: +@if gcc-bootstrap +configure-libgui: stage_current +@endif gcc-bootstrap @if libgui maybe-configure-libgui: configure-libgui configure-libgui: @@ -18489,7 +22921,8 @@ configure-libgui: srcdiroption="--srcdir=$${topdir}/libgui"; \ libsrcdir="$$s/libgui"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libgui @@ -18499,6 +22932,9 @@ configure-libgui: .PHONY: all-libgui maybe-all-libgui maybe-all-libgui: +@if gcc-bootstrap +all-libgui: stage_current +@endif gcc-bootstrap @if libgui TARGET-libgui=all maybe-all-libgui: all-libgui @@ -18544,7 +22980,7 @@ install-libgui: installdirs @endif libgui -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libgui info-libgui maybe-info-libgui: @@ -18598,6 +23034,32 @@ dvi-libgui: \ @endif libgui +.PHONY: maybe-pdf-libgui pdf-libgui +maybe-pdf-libgui: +@if libgui +maybe-pdf-libgui: pdf-libgui + +pdf-libgui: \ + configure-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libgui + .PHONY: maybe-html-libgui html-libgui maybe-html-libgui: @if libgui @@ -18677,6 +23139,33 @@ install-info-libgui: \ @endif libgui +.PHONY: maybe-install-pdf-libgui install-pdf-libgui +maybe-install-pdf-libgui: +@if libgui +maybe-install-pdf-libgui: install-pdf-libgui + +install-pdf-libgui: \ + configure-libgui \ + pdf-libgui + @: $(MAKE); $(unstage) + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libgui" ; \ + (cd $(HOST_SUBDIR)/libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libgui + .PHONY: maybe-install-html-libgui install-html-libgui maybe-install-html-libgui: @if libgui @@ -18834,14 +23323,12 @@ maintainer-clean-libgui: .PHONY: configure-libiberty maybe-configure-libiberty maybe-configure-libiberty: +@if gcc-bootstrap +configure-libiberty: stage_current +@endif gcc-bootstrap @if libiberty maybe-configure-libiberty: configure-libiberty configure-libiberty: -@endif libiberty -@if libiberty-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libiberty-bootstrap -@if libiberty @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ @@ -18857,7 +23344,8 @@ configure-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libiberty @@ -18874,6 +23362,8 @@ configure-stage1-libiberty: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18885,8 +23375,10 @@ configure-stage1-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif libiberty-bootstrap .PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty @@ -18901,6 +23393,8 @@ configure-stage2-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18912,7 +23406,9 @@ configure-stage2-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -18928,6 +23424,8 @@ configure-stage3-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18939,7 +23437,9 @@ configure-stage3-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -18955,6 +23455,8 @@ configure-stage4-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18966,7 +23468,9 @@ configure-stage4-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -18982,6 +23486,8 @@ configure-stageprofile-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -18993,7 +23499,9 @@ configure-stageprofile-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -19009,6 +23517,8 @@ configure-stagefeedback-libiberty: test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ cd $(HOST_SUBDIR)/libiberty || exit 1; \ @@ -19020,7 +23530,9 @@ configure-stagefeedback-libiberty: srcdiroption="--srcdir=$${topdir}/libiberty"; \ libsrcdir="$$s/libiberty"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif libiberty-bootstrap @@ -19030,15 +23542,13 @@ configure-stagefeedback-libiberty: .PHONY: all-libiberty maybe-all-libiberty maybe-all-libiberty: +@if gcc-bootstrap +all-libiberty: stage_current +@endif gcc-bootstrap @if libiberty TARGET-libiberty=all maybe-all-libiberty: all-libiberty all-libiberty: configure-libiberty -@endif libiberty -@if libiberty-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif libiberty-bootstrap -@if libiberty @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -19062,18 +23572,22 @@ all-stage1-libiberty: configure-stage1-libiberty s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-libiberty) maybe-clean-stage1-libiberty: clean-stage1-libiberty clean-stage1: clean-stage1-libiberty clean-stage1-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif libiberty-bootstrap @@ -19092,19 +23606,23 @@ all-stage2-libiberty: configure-stage2-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-libiberty) maybe-clean-stage2-libiberty: clean-stage2-libiberty clean-stage2: clean-stage2-libiberty clean-stage2-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libiberty-bootstrap @@ -19123,19 +23641,23 @@ all-stage3-libiberty: configure-stage3-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-libiberty) maybe-clean-stage3-libiberty: clean-stage3-libiberty clean-stage3: clean-stage3-libiberty clean-stage3-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libiberty-bootstrap @@ -19154,19 +23676,23 @@ all-stage4-libiberty: configure-stage4-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-libiberty) maybe-clean-stage4-libiberty: clean-stage4-libiberty clean-stage4: clean-stage4-libiberty clean-stage4-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif libiberty-bootstrap @@ -19185,19 +23711,23 @@ all-stageprofile-libiberty: configure-stageprofile-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-libiberty) maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty clean-stageprofile: clean-stageprofile-libiberty clean-stageprofile-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif libiberty-bootstrap @@ -19216,19 +23746,23 @@ all-stagefeedback-libiberty: configure-stagefeedback-libiberty $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-libiberty) maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty clean-stagefeedback: clean-stagefeedback-libiberty clean-stagefeedback-libiberty: - @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif libiberty-bootstrap @@ -19265,7 +23799,7 @@ install-libiberty: installdirs @endif libiberty -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libiberty info-libiberty maybe-info-libiberty: @@ -19317,6 +23851,31 @@ dvi-libiberty: \ @endif libiberty +.PHONY: maybe-pdf-libiberty pdf-libiberty +maybe-pdf-libiberty: +@if libiberty +maybe-pdf-libiberty: pdf-libiberty + +pdf-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libiberty + .PHONY: maybe-html-libiberty html-libiberty maybe-html-libiberty: @if libiberty @@ -19393,6 +23952,32 @@ install-info-libiberty: \ @endif libiberty +.PHONY: maybe-install-pdf-libiberty install-pdf-libiberty +maybe-install-pdf-libiberty: +@if libiberty +maybe-install-pdf-libiberty: install-pdf-libiberty + +install-pdf-libiberty: \ + configure-libiberty \ + pdf-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libiberty" ; \ + (cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libiberty + .PHONY: maybe-install-html-libiberty install-html-libiberty maybe-install-html-libiberty: @if libiberty @@ -19544,6 +24129,9 @@ maintainer-clean-libiberty: .PHONY: configure-libtool maybe-configure-libtool maybe-configure-libtool: +@if gcc-bootstrap +configure-libtool: stage_current +@endif gcc-bootstrap @if libtool maybe-configure-libtool: configure-libtool configure-libtool: @@ -19563,7 +24151,8 @@ configure-libtool: srcdiroption="--srcdir=$${topdir}/libtool"; \ libsrcdir="$$s/libtool"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libtool @@ -19573,6 +24162,9 @@ configure-libtool: .PHONY: all-libtool maybe-all-libtool maybe-all-libtool: +@if gcc-bootstrap +all-libtool: stage_current +@endif gcc-bootstrap @if libtool TARGET-libtool=all maybe-all-libtool: all-libtool @@ -19618,7 +24210,7 @@ install-libtool: installdirs @endif libtool -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libtool info-libtool maybe-info-libtool: @@ -19672,6 +24264,32 @@ dvi-libtool: \ @endif libtool +.PHONY: maybe-pdf-libtool pdf-libtool +maybe-pdf-libtool: +@if libtool +maybe-pdf-libtool: pdf-libtool + +pdf-libtool: \ + configure-libtool + @: $(MAKE); $(unstage) + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libtool" ; \ + (cd $(HOST_SUBDIR)/libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libtool + .PHONY: maybe-html-libtool html-libtool maybe-html-libtool: @if libtool @@ -19751,6 +24369,33 @@ install-info-libtool: \ @endif libtool +.PHONY: maybe-install-pdf-libtool install-pdf-libtool +maybe-install-pdf-libtool: +@if libtool +maybe-install-pdf-libtool: install-pdf-libtool + +install-pdf-libtool: \ + configure-libtool \ + pdf-libtool + @: $(MAKE); $(unstage) + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libtool" ; \ + (cd $(HOST_SUBDIR)/libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libtool + .PHONY: maybe-install-html-libtool install-html-libtool maybe-install-html-libtool: @if libtool @@ -19908,6 +24553,9 @@ maintainer-clean-libtool: .PHONY: configure-m4 maybe-configure-m4 maybe-configure-m4: +@if gcc-bootstrap +configure-m4: stage_current +@endif gcc-bootstrap @if m4 maybe-configure-m4: configure-m4 configure-m4: @@ -19927,7 +24575,8 @@ configure-m4: srcdiroption="--srcdir=$${topdir}/m4"; \ libsrcdir="$$s/m4"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif m4 @@ -19937,6 +24586,9 @@ configure-m4: .PHONY: all-m4 maybe-all-m4 maybe-all-m4: +@if gcc-bootstrap +all-m4: stage_current +@endif gcc-bootstrap @if m4 TARGET-m4=all maybe-all-m4: all-m4 @@ -19982,7 +24634,7 @@ install-m4: installdirs @endif m4 -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-m4 info-m4 maybe-info-m4: @@ -20036,6 +24688,32 @@ dvi-m4: \ @endif m4 +.PHONY: maybe-pdf-m4 pdf-m4 +maybe-pdf-m4: +@if m4 +maybe-pdf-m4: pdf-m4 + +pdf-m4: \ + configure-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif m4 + .PHONY: maybe-html-m4 html-m4 maybe-html-m4: @if m4 @@ -20115,6 +24793,33 @@ install-info-m4: \ @endif m4 +.PHONY: maybe-install-pdf-m4 install-pdf-m4 +maybe-install-pdf-m4: +@if m4 +maybe-install-pdf-m4: install-pdf-m4 + +install-pdf-m4: \ + configure-m4 \ + pdf-m4 + @: $(MAKE); $(unstage) + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in m4" ; \ + (cd $(HOST_SUBDIR)/m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif m4 + .PHONY: maybe-install-html-m4 install-html-m4 maybe-install-html-m4: @if m4 @@ -20272,6 +24977,9 @@ maintainer-clean-m4: .PHONY: configure-make maybe-configure-make maybe-configure-make: +@if gcc-bootstrap +configure-make: stage_current +@endif gcc-bootstrap @if make maybe-configure-make: configure-make configure-make: @@ -20291,7 +24999,8 @@ configure-make: srcdiroption="--srcdir=$${topdir}/make"; \ libsrcdir="$$s/make"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif make @@ -20301,6 +25010,9 @@ configure-make: .PHONY: all-make maybe-all-make maybe-all-make: +@if gcc-bootstrap +all-make: stage_current +@endif gcc-bootstrap @if make TARGET-make=all maybe-all-make: all-make @@ -20346,7 +25058,7 @@ install-make: installdirs @endif make -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-make info-make maybe-info-make: @@ -20400,6 +25112,32 @@ dvi-make: \ @endif make +.PHONY: maybe-pdf-make pdf-make +maybe-pdf-make: +@if make +maybe-pdf-make: pdf-make + +pdf-make: \ + configure-make + @: $(MAKE); $(unstage) + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in make" ; \ + (cd $(HOST_SUBDIR)/make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif make + .PHONY: maybe-html-make html-make maybe-html-make: @if make @@ -20479,6 +25217,33 @@ install-info-make: \ @endif make +.PHONY: maybe-install-pdf-make install-pdf-make +maybe-install-pdf-make: +@if make +maybe-install-pdf-make: install-pdf-make + +install-pdf-make: \ + configure-make \ + pdf-make + @: $(MAKE); $(unstage) + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in make" ; \ + (cd $(HOST_SUBDIR)/make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif make + .PHONY: maybe-install-html-make install-html-make maybe-install-html-make: @if make @@ -20636,6 +25401,9 @@ maintainer-clean-make: .PHONY: configure-mmalloc maybe-configure-mmalloc maybe-configure-mmalloc: +@if gcc-bootstrap +configure-mmalloc: stage_current +@endif gcc-bootstrap @if mmalloc maybe-configure-mmalloc: configure-mmalloc configure-mmalloc: @@ -20655,7 +25423,8 @@ configure-mmalloc: srcdiroption="--srcdir=$${topdir}/mmalloc"; \ libsrcdir="$$s/mmalloc"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif mmalloc @@ -20665,6 +25434,9 @@ configure-mmalloc: .PHONY: all-mmalloc maybe-all-mmalloc maybe-all-mmalloc: +@if gcc-bootstrap +all-mmalloc: stage_current +@endif gcc-bootstrap @if mmalloc TARGET-mmalloc=all maybe-all-mmalloc: all-mmalloc @@ -20704,7 +25476,7 @@ install-mmalloc: installdirs @endif mmalloc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-mmalloc info-mmalloc maybe-info-mmalloc: @@ -20758,6 +25530,32 @@ dvi-mmalloc: \ @endif mmalloc +.PHONY: maybe-pdf-mmalloc pdf-mmalloc +maybe-pdf-mmalloc: +@if mmalloc +maybe-pdf-mmalloc: pdf-mmalloc + +pdf-mmalloc: \ + configure-mmalloc + @: $(MAKE); $(unstage) + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in mmalloc" ; \ + (cd $(HOST_SUBDIR)/mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif mmalloc + .PHONY: maybe-html-mmalloc html-mmalloc maybe-html-mmalloc: @if mmalloc @@ -20837,6 +25635,33 @@ install-info-mmalloc: \ @endif mmalloc +.PHONY: maybe-install-pdf-mmalloc install-pdf-mmalloc +maybe-install-pdf-mmalloc: +@if mmalloc +maybe-install-pdf-mmalloc: install-pdf-mmalloc + +install-pdf-mmalloc: \ + configure-mmalloc \ + pdf-mmalloc + @: $(MAKE); $(unstage) + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in mmalloc" ; \ + (cd $(HOST_SUBDIR)/mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif mmalloc + .PHONY: maybe-install-html-mmalloc install-html-mmalloc maybe-install-html-mmalloc: @if mmalloc @@ -20994,6 +25819,9 @@ maintainer-clean-mmalloc: .PHONY: configure-patch maybe-configure-patch maybe-configure-patch: +@if gcc-bootstrap +configure-patch: stage_current +@endif gcc-bootstrap @if patch maybe-configure-patch: configure-patch configure-patch: @@ -21013,7 +25841,8 @@ configure-patch: srcdiroption="--srcdir=$${topdir}/patch"; \ libsrcdir="$$s/patch"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif patch @@ -21023,6 +25852,9 @@ configure-patch: .PHONY: all-patch maybe-all-patch maybe-all-patch: +@if gcc-bootstrap +all-patch: stage_current +@endif gcc-bootstrap @if patch TARGET-patch=all maybe-all-patch: all-patch @@ -21068,7 +25900,7 @@ install-patch: installdirs @endif patch -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-patch info-patch maybe-info-patch: @@ -21122,6 +25954,32 @@ dvi-patch: \ @endif patch +.PHONY: maybe-pdf-patch pdf-patch +maybe-pdf-patch: +@if patch +maybe-pdf-patch: pdf-patch + +pdf-patch: \ + configure-patch + @: $(MAKE); $(unstage) + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in patch" ; \ + (cd $(HOST_SUBDIR)/patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif patch + .PHONY: maybe-html-patch html-patch maybe-html-patch: @if patch @@ -21201,6 +26059,33 @@ install-info-patch: \ @endif patch +.PHONY: maybe-install-pdf-patch install-pdf-patch +maybe-install-pdf-patch: +@if patch +maybe-install-pdf-patch: install-pdf-patch + +install-pdf-patch: \ + configure-patch \ + pdf-patch + @: $(MAKE); $(unstage) + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in patch" ; \ + (cd $(HOST_SUBDIR)/patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif patch + .PHONY: maybe-install-html-patch install-html-patch maybe-install-html-patch: @if patch @@ -21358,6 +26243,9 @@ maintainer-clean-patch: .PHONY: configure-perl maybe-configure-perl maybe-configure-perl: +@if gcc-bootstrap +configure-perl: stage_current +@endif gcc-bootstrap @if perl maybe-configure-perl: configure-perl configure-perl: @@ -21377,7 +26265,8 @@ configure-perl: srcdiroption="--srcdir=$${topdir}/perl"; \ libsrcdir="$$s/perl"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif perl @@ -21387,6 +26276,9 @@ configure-perl: .PHONY: all-perl maybe-all-perl maybe-all-perl: +@if gcc-bootstrap +all-perl: stage_current +@endif gcc-bootstrap @if perl TARGET-perl=all maybe-all-perl: all-perl @@ -21432,7 +26324,7 @@ install-perl: installdirs @endif perl -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-perl info-perl maybe-info-perl: @@ -21486,6 +26378,32 @@ dvi-perl: \ @endif perl +.PHONY: maybe-pdf-perl pdf-perl +maybe-pdf-perl: +@if perl +maybe-pdf-perl: pdf-perl + +pdf-perl: \ + configure-perl + @: $(MAKE); $(unstage) + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in perl" ; \ + (cd $(HOST_SUBDIR)/perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif perl + .PHONY: maybe-html-perl html-perl maybe-html-perl: @if perl @@ -21565,6 +26483,33 @@ install-info-perl: \ @endif perl +.PHONY: maybe-install-pdf-perl install-pdf-perl +maybe-install-pdf-perl: +@if perl +maybe-install-pdf-perl: install-pdf-perl + +install-pdf-perl: \ + configure-perl \ + pdf-perl + @: $(MAKE); $(unstage) + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in perl" ; \ + (cd $(HOST_SUBDIR)/perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif perl + .PHONY: maybe-install-html-perl install-html-perl maybe-install-html-perl: @if perl @@ -21722,6 +26667,9 @@ maintainer-clean-perl: .PHONY: configure-prms maybe-configure-prms maybe-configure-prms: +@if gcc-bootstrap +configure-prms: stage_current +@endif gcc-bootstrap @if prms maybe-configure-prms: configure-prms configure-prms: @@ -21741,7 +26689,8 @@ configure-prms: srcdiroption="--srcdir=$${topdir}/prms"; \ libsrcdir="$$s/prms"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif prms @@ -21751,6 +26700,9 @@ configure-prms: .PHONY: all-prms maybe-all-prms maybe-all-prms: +@if gcc-bootstrap +all-prms: stage_current +@endif gcc-bootstrap @if prms TARGET-prms=all maybe-all-prms: all-prms @@ -21796,7 +26748,7 @@ install-prms: installdirs @endif prms -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-prms info-prms maybe-info-prms: @@ -21850,6 +26802,32 @@ dvi-prms: \ @endif prms +.PHONY: maybe-pdf-prms pdf-prms +maybe-pdf-prms: +@if prms +maybe-pdf-prms: pdf-prms + +pdf-prms: \ + configure-prms + @: $(MAKE); $(unstage) + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in prms" ; \ + (cd $(HOST_SUBDIR)/prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif prms + .PHONY: maybe-html-prms html-prms maybe-html-prms: @if prms @@ -21929,6 +26907,33 @@ install-info-prms: \ @endif prms +.PHONY: maybe-install-pdf-prms install-pdf-prms +maybe-install-pdf-prms: +@if prms +maybe-install-pdf-prms: install-pdf-prms + +install-pdf-prms: \ + configure-prms \ + pdf-prms + @: $(MAKE); $(unstage) + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in prms" ; \ + (cd $(HOST_SUBDIR)/prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif prms + .PHONY: maybe-install-html-prms install-html-prms maybe-install-html-prms: @if prms @@ -22086,6 +27091,9 @@ maintainer-clean-prms: .PHONY: configure-rcs maybe-configure-rcs maybe-configure-rcs: +@if gcc-bootstrap +configure-rcs: stage_current +@endif gcc-bootstrap @if rcs maybe-configure-rcs: configure-rcs configure-rcs: @@ -22105,7 +27113,8 @@ configure-rcs: srcdiroption="--srcdir=$${topdir}/rcs"; \ libsrcdir="$$s/rcs"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif rcs @@ -22115,6 +27124,9 @@ configure-rcs: .PHONY: all-rcs maybe-all-rcs maybe-all-rcs: +@if gcc-bootstrap +all-rcs: stage_current +@endif gcc-bootstrap @if rcs TARGET-rcs=all maybe-all-rcs: all-rcs @@ -22160,7 +27172,7 @@ install-rcs: installdirs @endif rcs -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-rcs info-rcs maybe-info-rcs: @@ -22214,6 +27226,32 @@ dvi-rcs: \ @endif rcs +.PHONY: maybe-pdf-rcs pdf-rcs +maybe-pdf-rcs: +@if rcs +maybe-pdf-rcs: pdf-rcs + +pdf-rcs: \ + configure-rcs + @: $(MAKE); $(unstage) + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in rcs" ; \ + (cd $(HOST_SUBDIR)/rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif rcs + .PHONY: maybe-html-rcs html-rcs maybe-html-rcs: @if rcs @@ -22293,6 +27331,33 @@ install-info-rcs: \ @endif rcs +.PHONY: maybe-install-pdf-rcs install-pdf-rcs +maybe-install-pdf-rcs: +@if rcs +maybe-install-pdf-rcs: install-pdf-rcs + +install-pdf-rcs: \ + configure-rcs \ + pdf-rcs + @: $(MAKE); $(unstage) + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in rcs" ; \ + (cd $(HOST_SUBDIR)/rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif rcs + .PHONY: maybe-install-html-rcs install-html-rcs maybe-install-html-rcs: @if rcs @@ -22450,6 +27515,9 @@ maintainer-clean-rcs: .PHONY: configure-readline maybe-configure-readline maybe-configure-readline: +@if gcc-bootstrap +configure-readline: stage_current +@endif gcc-bootstrap @if readline maybe-configure-readline: configure-readline configure-readline: @@ -22469,7 +27537,8 @@ configure-readline: srcdiroption="--srcdir=$${topdir}/readline"; \ libsrcdir="$$s/readline"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif readline @@ -22479,6 +27548,9 @@ configure-readline: .PHONY: all-readline maybe-all-readline maybe-all-readline: +@if gcc-bootstrap +all-readline: stage_current +@endif gcc-bootstrap @if readline TARGET-readline=all maybe-all-readline: all-readline @@ -22524,7 +27596,7 @@ install-readline: installdirs @endif readline -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-readline info-readline maybe-info-readline: @@ -22578,6 +27650,32 @@ dvi-readline: \ @endif readline +.PHONY: maybe-pdf-readline pdf-readline +maybe-pdf-readline: +@if readline +maybe-pdf-readline: pdf-readline + +pdf-readline: \ + configure-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif readline + .PHONY: maybe-html-readline html-readline maybe-html-readline: @if readline @@ -22657,6 +27755,33 @@ install-info-readline: \ @endif readline +.PHONY: maybe-install-pdf-readline install-pdf-readline +maybe-install-pdf-readline: +@if readline +maybe-install-pdf-readline: install-pdf-readline + +install-pdf-readline: \ + configure-readline \ + pdf-readline + @: $(MAKE); $(unstage) + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in readline" ; \ + (cd $(HOST_SUBDIR)/readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif readline + .PHONY: maybe-install-html-readline install-html-readline maybe-install-html-readline: @if readline @@ -22814,6 +27939,9 @@ maintainer-clean-readline: .PHONY: configure-release maybe-configure-release maybe-configure-release: +@if gcc-bootstrap +configure-release: stage_current +@endif gcc-bootstrap @if release maybe-configure-release: configure-release configure-release: @@ -22833,7 +27961,8 @@ configure-release: srcdiroption="--srcdir=$${topdir}/release"; \ libsrcdir="$$s/release"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif release @@ -22843,6 +27972,9 @@ configure-release: .PHONY: all-release maybe-all-release maybe-all-release: +@if gcc-bootstrap +all-release: stage_current +@endif gcc-bootstrap @if release TARGET-release=all maybe-all-release: all-release @@ -22876,7 +28008,7 @@ install-release: @endif release -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-release info-release maybe-info-release: @@ -22930,6 +28062,32 @@ dvi-release: \ @endif release +.PHONY: maybe-pdf-release pdf-release +maybe-pdf-release: +@if release +maybe-pdf-release: pdf-release + +pdf-release: \ + configure-release + @: $(MAKE); $(unstage) + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in release" ; \ + (cd $(HOST_SUBDIR)/release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif release + .PHONY: maybe-html-release html-release maybe-html-release: @if release @@ -23009,6 +28167,33 @@ install-info-release: \ @endif release +.PHONY: maybe-install-pdf-release install-pdf-release +maybe-install-pdf-release: +@if release +maybe-install-pdf-release: install-pdf-release + +install-pdf-release: \ + configure-release \ + pdf-release + @: $(MAKE); $(unstage) + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in release" ; \ + (cd $(HOST_SUBDIR)/release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif release + .PHONY: maybe-install-html-release install-html-release maybe-install-html-release: @if release @@ -23166,6 +28351,9 @@ maintainer-clean-release: .PHONY: configure-recode maybe-configure-recode maybe-configure-recode: +@if gcc-bootstrap +configure-recode: stage_current +@endif gcc-bootstrap @if recode maybe-configure-recode: configure-recode configure-recode: @@ -23185,7 +28373,8 @@ configure-recode: srcdiroption="--srcdir=$${topdir}/recode"; \ libsrcdir="$$s/recode"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif recode @@ -23195,6 +28384,9 @@ configure-recode: .PHONY: all-recode maybe-all-recode maybe-all-recode: +@if gcc-bootstrap +all-recode: stage_current +@endif gcc-bootstrap @if recode TARGET-recode=all maybe-all-recode: all-recode @@ -23240,7 +28432,7 @@ install-recode: installdirs @endif recode -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-recode info-recode maybe-info-recode: @@ -23294,6 +28486,32 @@ dvi-recode: \ @endif recode +.PHONY: maybe-pdf-recode pdf-recode +maybe-pdf-recode: +@if recode +maybe-pdf-recode: pdf-recode + +pdf-recode: \ + configure-recode + @: $(MAKE); $(unstage) + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in recode" ; \ + (cd $(HOST_SUBDIR)/recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif recode + .PHONY: maybe-html-recode html-recode maybe-html-recode: @if recode @@ -23373,6 +28591,33 @@ install-info-recode: \ @endif recode +.PHONY: maybe-install-pdf-recode install-pdf-recode +maybe-install-pdf-recode: +@if recode +maybe-install-pdf-recode: install-pdf-recode + +install-pdf-recode: \ + configure-recode \ + pdf-recode + @: $(MAKE); $(unstage) + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in recode" ; \ + (cd $(HOST_SUBDIR)/recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif recode + .PHONY: maybe-install-html-recode install-html-recode maybe-install-html-recode: @if recode @@ -23530,6 +28775,9 @@ maintainer-clean-recode: .PHONY: configure-sed maybe-configure-sed maybe-configure-sed: +@if gcc-bootstrap +configure-sed: stage_current +@endif gcc-bootstrap @if sed maybe-configure-sed: configure-sed configure-sed: @@ -23549,7 +28797,8 @@ configure-sed: srcdiroption="--srcdir=$${topdir}/sed"; \ libsrcdir="$$s/sed"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif sed @@ -23559,6 +28808,9 @@ configure-sed: .PHONY: all-sed maybe-all-sed maybe-all-sed: +@if gcc-bootstrap +all-sed: stage_current +@endif gcc-bootstrap @if sed TARGET-sed=all maybe-all-sed: all-sed @@ -23604,7 +28856,7 @@ install-sed: installdirs @endif sed -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-sed info-sed maybe-info-sed: @@ -23658,6 +28910,32 @@ dvi-sed: \ @endif sed +.PHONY: maybe-pdf-sed pdf-sed +maybe-pdf-sed: +@if sed +maybe-pdf-sed: pdf-sed + +pdf-sed: \ + configure-sed + @: $(MAKE); $(unstage) + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sed" ; \ + (cd $(HOST_SUBDIR)/sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif sed + .PHONY: maybe-html-sed html-sed maybe-html-sed: @if sed @@ -23737,6 +29015,33 @@ install-info-sed: \ @endif sed +.PHONY: maybe-install-pdf-sed install-pdf-sed +maybe-install-pdf-sed: +@if sed +maybe-install-pdf-sed: install-pdf-sed + +install-pdf-sed: \ + configure-sed \ + pdf-sed + @: $(MAKE); $(unstage) + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sed" ; \ + (cd $(HOST_SUBDIR)/sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif sed + .PHONY: maybe-install-html-sed install-html-sed maybe-install-html-sed: @if sed @@ -23894,6 +29199,9 @@ maintainer-clean-sed: .PHONY: configure-send-pr maybe-configure-send-pr maybe-configure-send-pr: +@if gcc-bootstrap +configure-send-pr: stage_current +@endif gcc-bootstrap @if send-pr maybe-configure-send-pr: configure-send-pr configure-send-pr: @@ -23913,7 +29221,8 @@ configure-send-pr: srcdiroption="--srcdir=$${topdir}/send-pr"; \ libsrcdir="$$s/send-pr"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif send-pr @@ -23923,6 +29232,9 @@ configure-send-pr: .PHONY: all-send-pr maybe-all-send-pr maybe-all-send-pr: +@if gcc-bootstrap +all-send-pr: stage_current +@endif gcc-bootstrap @if send-pr TARGET-send-pr=all maybe-all-send-pr: all-send-pr @@ -23968,7 +29280,7 @@ install-send-pr: installdirs @endif send-pr -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-send-pr info-send-pr maybe-info-send-pr: @@ -24022,6 +29334,32 @@ dvi-send-pr: \ @endif send-pr +.PHONY: maybe-pdf-send-pr pdf-send-pr +maybe-pdf-send-pr: +@if send-pr +maybe-pdf-send-pr: pdf-send-pr + +pdf-send-pr: \ + configure-send-pr + @: $(MAKE); $(unstage) + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in send-pr" ; \ + (cd $(HOST_SUBDIR)/send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif send-pr + .PHONY: maybe-html-send-pr html-send-pr maybe-html-send-pr: @if send-pr @@ -24101,6 +29439,33 @@ install-info-send-pr: \ @endif send-pr +.PHONY: maybe-install-pdf-send-pr install-pdf-send-pr +maybe-install-pdf-send-pr: +@if send-pr +maybe-install-pdf-send-pr: install-pdf-send-pr + +install-pdf-send-pr: \ + configure-send-pr \ + pdf-send-pr + @: $(MAKE); $(unstage) + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in send-pr" ; \ + (cd $(HOST_SUBDIR)/send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif send-pr + .PHONY: maybe-install-html-send-pr install-html-send-pr maybe-install-html-send-pr: @if send-pr @@ -24258,6 +29623,9 @@ maintainer-clean-send-pr: .PHONY: configure-shellutils maybe-configure-shellutils maybe-configure-shellutils: +@if gcc-bootstrap +configure-shellutils: stage_current +@endif gcc-bootstrap @if shellutils maybe-configure-shellutils: configure-shellutils configure-shellutils: @@ -24277,7 +29645,8 @@ configure-shellutils: srcdiroption="--srcdir=$${topdir}/shellutils"; \ libsrcdir="$$s/shellutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif shellutils @@ -24287,6 +29656,9 @@ configure-shellutils: .PHONY: all-shellutils maybe-all-shellutils maybe-all-shellutils: +@if gcc-bootstrap +all-shellutils: stage_current +@endif gcc-bootstrap @if shellutils TARGET-shellutils=all maybe-all-shellutils: all-shellutils @@ -24332,7 +29704,7 @@ install-shellutils: installdirs @endif shellutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-shellutils info-shellutils maybe-info-shellutils: @@ -24386,6 +29758,32 @@ dvi-shellutils: \ @endif shellutils +.PHONY: maybe-pdf-shellutils pdf-shellutils +maybe-pdf-shellutils: +@if shellutils +maybe-pdf-shellutils: pdf-shellutils + +pdf-shellutils: \ + configure-shellutils + @: $(MAKE); $(unstage) + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in shellutils" ; \ + (cd $(HOST_SUBDIR)/shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif shellutils + .PHONY: maybe-html-shellutils html-shellutils maybe-html-shellutils: @if shellutils @@ -24465,6 +29863,33 @@ install-info-shellutils: \ @endif shellutils +.PHONY: maybe-install-pdf-shellutils install-pdf-shellutils +maybe-install-pdf-shellutils: +@if shellutils +maybe-install-pdf-shellutils: install-pdf-shellutils + +install-pdf-shellutils: \ + configure-shellutils \ + pdf-shellutils + @: $(MAKE); $(unstage) + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in shellutils" ; \ + (cd $(HOST_SUBDIR)/shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif shellutils + .PHONY: maybe-install-html-shellutils install-html-shellutils maybe-install-html-shellutils: @if shellutils @@ -24622,6 +30047,9 @@ maintainer-clean-shellutils: .PHONY: configure-sid maybe-configure-sid maybe-configure-sid: +@if gcc-bootstrap +configure-sid: stage_current +@endif gcc-bootstrap @if sid maybe-configure-sid: configure-sid configure-sid: @@ -24641,7 +30069,8 @@ configure-sid: srcdiroption="--srcdir=$${topdir}/sid"; \ libsrcdir="$$s/sid"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif sid @@ -24651,6 +30080,9 @@ configure-sid: .PHONY: all-sid maybe-all-sid maybe-all-sid: +@if gcc-bootstrap +all-sid: stage_current +@endif gcc-bootstrap @if sid TARGET-sid=all maybe-all-sid: all-sid @@ -24696,7 +30128,7 @@ install-sid: installdirs @endif sid -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-sid info-sid maybe-info-sid: @@ -24750,6 +30182,32 @@ dvi-sid: \ @endif sid +.PHONY: maybe-pdf-sid pdf-sid +maybe-pdf-sid: +@if sid +maybe-pdf-sid: pdf-sid + +pdf-sid: \ + configure-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif sid + .PHONY: maybe-html-sid html-sid maybe-html-sid: @if sid @@ -24829,6 +30287,33 @@ install-info-sid: \ @endif sid +.PHONY: maybe-install-pdf-sid install-pdf-sid +maybe-install-pdf-sid: +@if sid +maybe-install-pdf-sid: install-pdf-sid + +install-pdf-sid: \ + configure-sid \ + pdf-sid + @: $(MAKE); $(unstage) + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sid" ; \ + (cd $(HOST_SUBDIR)/sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif sid + .PHONY: maybe-install-html-sid install-html-sid maybe-install-html-sid: @if sid @@ -24986,6 +30471,9 @@ maintainer-clean-sid: .PHONY: configure-sim maybe-configure-sim maybe-configure-sim: +@if gcc-bootstrap +configure-sim: stage_current +@endif gcc-bootstrap @if sim maybe-configure-sim: configure-sim configure-sim: @@ -25005,7 +30493,8 @@ configure-sim: srcdiroption="--srcdir=$${topdir}/sim"; \ libsrcdir="$$s/sim"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif sim @@ -25015,6 +30504,9 @@ configure-sim: .PHONY: all-sim maybe-all-sim maybe-all-sim: +@if gcc-bootstrap +all-sim: stage_current +@endif gcc-bootstrap @if sim TARGET-sim=all maybe-all-sim: all-sim @@ -25060,7 +30552,7 @@ install-sim: installdirs @endif sim -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-sim info-sim maybe-info-sim: @@ -25114,6 +30606,32 @@ dvi-sim: \ @endif sim +.PHONY: maybe-pdf-sim pdf-sim +maybe-pdf-sim: +@if sim +maybe-pdf-sim: pdf-sim + +pdf-sim: \ + configure-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif sim + .PHONY: maybe-html-sim html-sim maybe-html-sim: @if sim @@ -25193,6 +30711,33 @@ install-info-sim: \ @endif sim +.PHONY: maybe-install-pdf-sim install-pdf-sim +maybe-install-pdf-sim: +@if sim +maybe-install-pdf-sim: install-pdf-sim + +install-pdf-sim: \ + configure-sim \ + pdf-sim + @: $(MAKE); $(unstage) + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in sim" ; \ + (cd $(HOST_SUBDIR)/sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif sim + .PHONY: maybe-install-html-sim install-html-sim maybe-install-html-sim: @if sim @@ -25350,6 +30895,9 @@ maintainer-clean-sim: .PHONY: configure-tar maybe-configure-tar maybe-configure-tar: +@if gcc-bootstrap +configure-tar: stage_current +@endif gcc-bootstrap @if tar maybe-configure-tar: configure-tar configure-tar: @@ -25369,7 +30917,8 @@ configure-tar: srcdiroption="--srcdir=$${topdir}/tar"; \ libsrcdir="$$s/tar"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif tar @@ -25379,6 +30928,9 @@ configure-tar: .PHONY: all-tar maybe-all-tar maybe-all-tar: +@if gcc-bootstrap +all-tar: stage_current +@endif gcc-bootstrap @if tar TARGET-tar=all maybe-all-tar: all-tar @@ -25424,7 +30976,7 @@ install-tar: installdirs @endif tar -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-tar info-tar maybe-info-tar: @@ -25478,6 +31030,32 @@ dvi-tar: \ @endif tar +.PHONY: maybe-pdf-tar pdf-tar +maybe-pdf-tar: +@if tar +maybe-pdf-tar: pdf-tar + +pdf-tar: \ + configure-tar + @: $(MAKE); $(unstage) + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tar" ; \ + (cd $(HOST_SUBDIR)/tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif tar + .PHONY: maybe-html-tar html-tar maybe-html-tar: @if tar @@ -25557,6 +31135,33 @@ install-info-tar: \ @endif tar +.PHONY: maybe-install-pdf-tar install-pdf-tar +maybe-install-pdf-tar: +@if tar +maybe-install-pdf-tar: install-pdf-tar + +install-pdf-tar: \ + configure-tar \ + pdf-tar + @: $(MAKE); $(unstage) + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tar" ; \ + (cd $(HOST_SUBDIR)/tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif tar + .PHONY: maybe-install-html-tar install-html-tar maybe-install-html-tar: @if tar @@ -25714,6 +31319,9 @@ maintainer-clean-tar: .PHONY: configure-texinfo maybe-configure-texinfo maybe-configure-texinfo: +@if gcc-bootstrap +configure-texinfo: stage_current +@endif gcc-bootstrap @if texinfo maybe-configure-texinfo: configure-texinfo configure-texinfo: @@ -25733,7 +31341,8 @@ configure-texinfo: srcdiroption="--srcdir=$${topdir}/texinfo"; \ libsrcdir="$$s/texinfo"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif texinfo @@ -25743,6 +31352,9 @@ configure-texinfo: .PHONY: all-texinfo maybe-all-texinfo maybe-all-texinfo: +@if gcc-bootstrap +all-texinfo: stage_current +@endif gcc-bootstrap @if texinfo TARGET-texinfo=all maybe-all-texinfo: all-texinfo @@ -25782,7 +31394,7 @@ install-texinfo: @endif texinfo -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-texinfo info-texinfo maybe-info-texinfo: @@ -25836,6 +31448,32 @@ dvi-texinfo: \ @endif texinfo +.PHONY: maybe-pdf-texinfo pdf-texinfo +maybe-pdf-texinfo: +@if texinfo +maybe-pdf-texinfo: pdf-texinfo + +pdf-texinfo: \ + configure-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif texinfo + .PHONY: maybe-html-texinfo html-texinfo maybe-html-texinfo: @if texinfo @@ -25915,6 +31553,33 @@ install-info-texinfo: \ @endif texinfo +.PHONY: maybe-install-pdf-texinfo install-pdf-texinfo +maybe-install-pdf-texinfo: +@if texinfo +maybe-install-pdf-texinfo: install-pdf-texinfo + +install-pdf-texinfo: \ + configure-texinfo \ + pdf-texinfo + @: $(MAKE); $(unstage) + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in texinfo" ; \ + (cd $(HOST_SUBDIR)/texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif texinfo + .PHONY: maybe-install-html-texinfo install-html-texinfo maybe-install-html-texinfo: @if texinfo @@ -26072,6 +31737,9 @@ maintainer-clean-texinfo: .PHONY: configure-textutils maybe-configure-textutils maybe-configure-textutils: +@if gcc-bootstrap +configure-textutils: stage_current +@endif gcc-bootstrap @if textutils maybe-configure-textutils: configure-textutils configure-textutils: @@ -26091,7 +31759,8 @@ configure-textutils: srcdiroption="--srcdir=$${topdir}/textutils"; \ libsrcdir="$$s/textutils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif textutils @@ -26101,6 +31770,9 @@ configure-textutils: .PHONY: all-textutils maybe-all-textutils maybe-all-textutils: +@if gcc-bootstrap +all-textutils: stage_current +@endif gcc-bootstrap @if textutils TARGET-textutils=all maybe-all-textutils: all-textutils @@ -26146,7 +31818,7 @@ install-textutils: installdirs @endif textutils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-textutils info-textutils maybe-info-textutils: @@ -26200,6 +31872,32 @@ dvi-textutils: \ @endif textutils +.PHONY: maybe-pdf-textutils pdf-textutils +maybe-pdf-textutils: +@if textutils +maybe-pdf-textutils: pdf-textutils + +pdf-textutils: \ + configure-textutils + @: $(MAKE); $(unstage) + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in textutils" ; \ + (cd $(HOST_SUBDIR)/textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif textutils + .PHONY: maybe-html-textutils html-textutils maybe-html-textutils: @if textutils @@ -26279,6 +31977,33 @@ install-info-textutils: \ @endif textutils +.PHONY: maybe-install-pdf-textutils install-pdf-textutils +maybe-install-pdf-textutils: +@if textutils +maybe-install-pdf-textutils: install-pdf-textutils + +install-pdf-textutils: \ + configure-textutils \ + pdf-textutils + @: $(MAKE); $(unstage) + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in textutils" ; \ + (cd $(HOST_SUBDIR)/textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif textutils + .PHONY: maybe-install-html-textutils install-html-textutils maybe-install-html-textutils: @if textutils @@ -26436,6 +32161,9 @@ maintainer-clean-textutils: .PHONY: configure-time maybe-configure-time maybe-configure-time: +@if gcc-bootstrap +configure-time: stage_current +@endif gcc-bootstrap @if time maybe-configure-time: configure-time configure-time: @@ -26455,7 +32183,8 @@ configure-time: srcdiroption="--srcdir=$${topdir}/time"; \ libsrcdir="$$s/time"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif time @@ -26465,6 +32194,9 @@ configure-time: .PHONY: all-time maybe-all-time maybe-all-time: +@if gcc-bootstrap +all-time: stage_current +@endif gcc-bootstrap @if time TARGET-time=all maybe-all-time: all-time @@ -26510,7 +32242,7 @@ install-time: installdirs @endif time -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-time info-time maybe-info-time: @@ -26564,6 +32296,32 @@ dvi-time: \ @endif time +.PHONY: maybe-pdf-time pdf-time +maybe-pdf-time: +@if time +maybe-pdf-time: pdf-time + +pdf-time: \ + configure-time + @: $(MAKE); $(unstage) + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in time" ; \ + (cd $(HOST_SUBDIR)/time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif time + .PHONY: maybe-html-time html-time maybe-html-time: @if time @@ -26643,6 +32401,33 @@ install-info-time: \ @endif time +.PHONY: maybe-install-pdf-time install-pdf-time +maybe-install-pdf-time: +@if time +maybe-install-pdf-time: install-pdf-time + +install-pdf-time: \ + configure-time \ + pdf-time + @: $(MAKE); $(unstage) + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in time" ; \ + (cd $(HOST_SUBDIR)/time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif time + .PHONY: maybe-install-html-time install-html-time maybe-install-html-time: @if time @@ -26800,6 +32585,9 @@ maintainer-clean-time: .PHONY: configure-uudecode maybe-configure-uudecode maybe-configure-uudecode: +@if gcc-bootstrap +configure-uudecode: stage_current +@endif gcc-bootstrap @if uudecode maybe-configure-uudecode: configure-uudecode configure-uudecode: @@ -26819,7 +32607,8 @@ configure-uudecode: srcdiroption="--srcdir=$${topdir}/uudecode"; \ libsrcdir="$$s/uudecode"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif uudecode @@ -26829,6 +32618,9 @@ configure-uudecode: .PHONY: all-uudecode maybe-all-uudecode maybe-all-uudecode: +@if gcc-bootstrap +all-uudecode: stage_current +@endif gcc-bootstrap @if uudecode TARGET-uudecode=all maybe-all-uudecode: all-uudecode @@ -26874,7 +32666,7 @@ install-uudecode: installdirs @endif uudecode -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-uudecode info-uudecode maybe-info-uudecode: @@ -26928,6 +32720,32 @@ dvi-uudecode: \ @endif uudecode +.PHONY: maybe-pdf-uudecode pdf-uudecode +maybe-pdf-uudecode: +@if uudecode +maybe-pdf-uudecode: pdf-uudecode + +pdf-uudecode: \ + configure-uudecode + @: $(MAKE); $(unstage) + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in uudecode" ; \ + (cd $(HOST_SUBDIR)/uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif uudecode + .PHONY: maybe-html-uudecode html-uudecode maybe-html-uudecode: @if uudecode @@ -27007,6 +32825,33 @@ install-info-uudecode: \ @endif uudecode +.PHONY: maybe-install-pdf-uudecode install-pdf-uudecode +maybe-install-pdf-uudecode: +@if uudecode +maybe-install-pdf-uudecode: install-pdf-uudecode + +install-pdf-uudecode: \ + configure-uudecode \ + pdf-uudecode + @: $(MAKE); $(unstage) + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in uudecode" ; \ + (cd $(HOST_SUBDIR)/uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif uudecode + .PHONY: maybe-install-html-uudecode install-html-uudecode maybe-install-html-uudecode: @if uudecode @@ -27164,6 +33009,9 @@ maintainer-clean-uudecode: .PHONY: configure-wdiff maybe-configure-wdiff maybe-configure-wdiff: +@if gcc-bootstrap +configure-wdiff: stage_current +@endif gcc-bootstrap @if wdiff maybe-configure-wdiff: configure-wdiff configure-wdiff: @@ -27183,7 +33031,8 @@ configure-wdiff: srcdiroption="--srcdir=$${topdir}/wdiff"; \ libsrcdir="$$s/wdiff"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif wdiff @@ -27193,6 +33042,9 @@ configure-wdiff: .PHONY: all-wdiff maybe-all-wdiff maybe-all-wdiff: +@if gcc-bootstrap +all-wdiff: stage_current +@endif gcc-bootstrap @if wdiff TARGET-wdiff=all maybe-all-wdiff: all-wdiff @@ -27238,7 +33090,7 @@ install-wdiff: installdirs @endif wdiff -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-wdiff info-wdiff maybe-info-wdiff: @@ -27292,6 +33144,32 @@ dvi-wdiff: \ @endif wdiff +.PHONY: maybe-pdf-wdiff pdf-wdiff +maybe-pdf-wdiff: +@if wdiff +maybe-pdf-wdiff: pdf-wdiff + +pdf-wdiff: \ + configure-wdiff + @: $(MAKE); $(unstage) + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in wdiff" ; \ + (cd $(HOST_SUBDIR)/wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif wdiff + .PHONY: maybe-html-wdiff html-wdiff maybe-html-wdiff: @if wdiff @@ -27371,6 +33249,33 @@ install-info-wdiff: \ @endif wdiff +.PHONY: maybe-install-pdf-wdiff install-pdf-wdiff +maybe-install-pdf-wdiff: +@if wdiff +maybe-install-pdf-wdiff: install-pdf-wdiff + +install-pdf-wdiff: \ + configure-wdiff \ + pdf-wdiff + @: $(MAKE); $(unstage) + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in wdiff" ; \ + (cd $(HOST_SUBDIR)/wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif wdiff + .PHONY: maybe-install-html-wdiff install-html-wdiff maybe-install-html-wdiff: @if wdiff @@ -27528,6 +33433,9 @@ maintainer-clean-wdiff: .PHONY: configure-zip maybe-configure-zip maybe-configure-zip: +@if gcc-bootstrap +configure-zip: stage_current +@endif gcc-bootstrap @if zip maybe-configure-zip: configure-zip configure-zip: @@ -27547,7 +33455,8 @@ configure-zip: srcdiroption="--srcdir=$${topdir}/zip"; \ libsrcdir="$$s/zip"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif zip @@ -27557,6 +33466,9 @@ configure-zip: .PHONY: all-zip maybe-all-zip maybe-all-zip: +@if gcc-bootstrap +all-zip: stage_current +@endif gcc-bootstrap @if zip TARGET-zip=all maybe-all-zip: all-zip @@ -27605,7 +33517,7 @@ install-zip: installdirs @endif zip -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-zip info-zip maybe-info-zip: @@ -27659,6 +33571,32 @@ dvi-zip: \ @endif zip +.PHONY: maybe-pdf-zip pdf-zip +maybe-pdf-zip: +@if zip +maybe-pdf-zip: pdf-zip + +pdf-zip: \ + configure-zip + @: $(MAKE); $(unstage) + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in zip" ; \ + (cd $(HOST_SUBDIR)/zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif zip + .PHONY: maybe-html-zip html-zip maybe-html-zip: @if zip @@ -27738,6 +33676,33 @@ install-info-zip: \ @endif zip +.PHONY: maybe-install-pdf-zip install-pdf-zip +maybe-install-pdf-zip: +@if zip +maybe-install-pdf-zip: install-pdf-zip + +install-pdf-zip: \ + configure-zip \ + pdf-zip + @: $(MAKE); $(unstage) + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in zip" ; \ + (cd $(HOST_SUBDIR)/zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif zip + .PHONY: maybe-install-html-zip install-html-zip maybe-install-html-zip: @if zip @@ -27895,14 +33860,12 @@ maintainer-clean-zip: .PHONY: configure-zlib maybe-configure-zlib maybe-configure-zlib: +@if gcc-bootstrap +configure-zlib: stage_current +@endif gcc-bootstrap @if zlib maybe-configure-zlib: configure-zlib configure-zlib: -@endif zlib -@if zlib-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif zlib-bootstrap -@if zlib @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ @@ -27918,7 +33881,8 @@ configure-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif zlib @@ -27935,6 +33899,8 @@ configure-stage1-zlib: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -27946,8 +33912,10 @@ configure-stage1-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" @endif zlib-bootstrap .PHONY: configure-stage2-zlib maybe-configure-stage2-zlib @@ -27962,6 +33930,8 @@ configure-stage2-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -27973,7 +33943,9 @@ configure-stage2-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -27989,6 +33961,8 @@ configure-stage3-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28000,7 +33974,9 @@ configure-stage3-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28016,6 +33992,8 @@ configure-stage4-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28027,7 +34005,9 @@ configure-stage4-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28043,6 +34023,8 @@ configure-stageprofile-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28054,7 +34036,9 @@ configure-stageprofile-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28070,6 +34054,8 @@ configure-stagefeedback-zlib: test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ cd $(HOST_SUBDIR)/zlib || exit 1; \ @@ -28081,7 +34067,9 @@ configure-stagefeedback-zlib: srcdiroption="--srcdir=$${topdir}/zlib"; \ libsrcdir="$$s/zlib"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ @stage2_werror_flag@ @endif zlib-bootstrap @@ -28091,15 +34079,13 @@ configure-stagefeedback-zlib: .PHONY: all-zlib maybe-all-zlib maybe-all-zlib: +@if gcc-bootstrap +all-zlib: stage_current +@endif gcc-bootstrap @if zlib TARGET-zlib=all maybe-all-zlib: all-zlib all-zlib: configure-zlib -@endif zlib -@if zlib-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif zlib-bootstrap -@if zlib @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ @@ -28123,18 +34109,22 @@ all-stage1-zlib: configure-stage1-zlib s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ $(TARGET-stage1-zlib) maybe-clean-stage1-zlib: clean-stage1-zlib clean-stage1: clean-stage1-zlib clean-stage1-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean + clean @endif zlib-bootstrap @@ -28153,19 +34143,23 @@ all-stage2-zlib: configure-stage2-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage2-zlib) maybe-clean-stage2-zlib: clean-stage2-zlib clean-stage2: clean-stage2-zlib clean-stage2-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif zlib-bootstrap @@ -28184,19 +34178,23 @@ all-stage3-zlib: configure-stage3-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage3-zlib) maybe-clean-stage3-zlib: clean-stage3-zlib clean-stage3: clean-stage3-zlib clean-stage3-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif zlib-bootstrap @@ -28215,19 +34213,23 @@ all-stage4-zlib: configure-stage4-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stage4-zlib) maybe-clean-stage4-zlib: clean-stage4-zlib clean-stage4: clean-stage4-zlib clean-stage4-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean + clean @endif zlib-bootstrap @@ -28246,19 +34248,23 @@ all-stageprofile-zlib: configure-stageprofile-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stageprofile-zlib) maybe-clean-stageprofile-zlib: clean-stageprofile-zlib clean-stageprofile: clean-stageprofile-zlib clean-stageprofile-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean + clean @endif zlib-bootstrap @@ -28277,19 +34283,23 @@ all-stagefeedback-zlib: configure-stagefeedback-zlib $(HOST_EXPORTS) \ $(POSTSTAGE1_HOST_EXPORTS) \ cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ $(TARGET-stagefeedback-zlib) maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib clean-stagefeedback: clean-stagefeedback-zlib clean-stagefeedback-zlib: - @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \ + else \ + [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean + clean @endif zlib-bootstrap @@ -28314,7 +34324,7 @@ install-zlib: @endif zlib -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-zlib info-zlib maybe-info-zlib: @@ -28366,6 +34376,31 @@ dvi-zlib: \ @endif zlib +.PHONY: maybe-pdf-zlib pdf-zlib +maybe-pdf-zlib: +@if zlib +maybe-pdf-zlib: pdf-zlib + +pdf-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif zlib + .PHONY: maybe-html-zlib html-zlib maybe-html-zlib: @if zlib @@ -28442,6 +34477,32 @@ install-info-zlib: \ @endif zlib +.PHONY: maybe-install-pdf-zlib install-pdf-zlib +maybe-install-pdf-zlib: +@if zlib +maybe-install-pdf-zlib: install-pdf-zlib + +install-pdf-zlib: \ + configure-zlib \ + pdf-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in zlib" ; \ + (cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif zlib + .PHONY: maybe-install-html-zlib install-html-zlib maybe-install-html-zlib: @if zlib @@ -28593,6 +34654,9 @@ maintainer-clean-zlib: .PHONY: configure-gdb maybe-configure-gdb maybe-configure-gdb: +@if gcc-bootstrap +configure-gdb: stage_current +@endif gcc-bootstrap @if gdb maybe-configure-gdb: configure-gdb configure-gdb: @@ -28612,7 +34676,8 @@ configure-gdb: srcdiroption="--srcdir=$${topdir}/gdb"; \ libsrcdir="$$s/gdb"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gdb @@ -28622,6 +34687,9 @@ configure-gdb: .PHONY: all-gdb maybe-all-gdb maybe-all-gdb: +@if gcc-bootstrap +all-gdb: stage_current +@endif gcc-bootstrap @if gdb TARGET-gdb=all maybe-all-gdb: all-gdb @@ -28667,7 +34735,7 @@ install-gdb: installdirs @endif gdb -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gdb info-gdb maybe-info-gdb: @@ -28721,6 +34789,32 @@ dvi-gdb: \ @endif gdb +.PHONY: maybe-pdf-gdb pdf-gdb +maybe-pdf-gdb: +@if gdb +maybe-pdf-gdb: pdf-gdb + +pdf-gdb: \ + configure-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gdb + .PHONY: maybe-html-gdb html-gdb maybe-html-gdb: @if gdb @@ -28800,6 +34894,33 @@ install-info-gdb: \ @endif gdb +.PHONY: maybe-install-pdf-gdb install-pdf-gdb +maybe-install-pdf-gdb: +@if gdb +maybe-install-pdf-gdb: install-pdf-gdb + +install-pdf-gdb: \ + configure-gdb \ + pdf-gdb + @: $(MAKE); $(unstage) + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gdb" ; \ + (cd $(HOST_SUBDIR)/gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gdb + .PHONY: maybe-install-html-gdb install-html-gdb maybe-install-html-gdb: @if gdb @@ -28957,6 +35078,9 @@ maintainer-clean-gdb: .PHONY: configure-expect maybe-configure-expect maybe-configure-expect: +@if gcc-bootstrap +configure-expect: stage_current +@endif gcc-bootstrap @if expect maybe-configure-expect: configure-expect configure-expect: @@ -28976,7 +35100,8 @@ configure-expect: srcdiroption="--srcdir=$${topdir}/expect"; \ libsrcdir="$$s/expect"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif expect @@ -28986,6 +35111,9 @@ configure-expect: .PHONY: all-expect maybe-all-expect maybe-all-expect: +@if gcc-bootstrap +all-expect: stage_current +@endif gcc-bootstrap @if expect TARGET-expect=all maybe-all-expect: all-expect @@ -29031,7 +35159,7 @@ install-expect: installdirs @endif expect -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-expect info-expect maybe-info-expect: @@ -29085,6 +35213,32 @@ dvi-expect: \ @endif expect +.PHONY: maybe-pdf-expect pdf-expect +maybe-pdf-expect: +@if expect +maybe-pdf-expect: pdf-expect + +pdf-expect: \ + configure-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif expect + .PHONY: maybe-html-expect html-expect maybe-html-expect: @if expect @@ -29164,6 +35318,33 @@ install-info-expect: \ @endif expect +.PHONY: maybe-install-pdf-expect install-pdf-expect +maybe-install-pdf-expect: +@if expect +maybe-install-pdf-expect: install-pdf-expect + +install-pdf-expect: \ + configure-expect \ + pdf-expect + @: $(MAKE); $(unstage) + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in expect" ; \ + (cd $(HOST_SUBDIR)/expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif expect + .PHONY: maybe-install-html-expect install-html-expect maybe-install-html-expect: @if expect @@ -29321,6 +35502,9 @@ maintainer-clean-expect: .PHONY: configure-guile maybe-configure-guile maybe-configure-guile: +@if gcc-bootstrap +configure-guile: stage_current +@endif gcc-bootstrap @if guile maybe-configure-guile: configure-guile configure-guile: @@ -29340,7 +35524,8 @@ configure-guile: srcdiroption="--srcdir=$${topdir}/guile"; \ libsrcdir="$$s/guile"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif guile @@ -29350,6 +35535,9 @@ configure-guile: .PHONY: all-guile maybe-all-guile maybe-all-guile: +@if gcc-bootstrap +all-guile: stage_current +@endif gcc-bootstrap @if guile TARGET-guile=all maybe-all-guile: all-guile @@ -29395,7 +35583,7 @@ install-guile: installdirs @endif guile -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-guile info-guile maybe-info-guile: @@ -29449,6 +35637,32 @@ dvi-guile: \ @endif guile +.PHONY: maybe-pdf-guile pdf-guile +maybe-pdf-guile: +@if guile +maybe-pdf-guile: pdf-guile + +pdf-guile: \ + configure-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif guile + .PHONY: maybe-html-guile html-guile maybe-html-guile: @if guile @@ -29528,6 +35742,33 @@ install-info-guile: \ @endif guile +.PHONY: maybe-install-pdf-guile install-pdf-guile +maybe-install-pdf-guile: +@if guile +maybe-install-pdf-guile: install-pdf-guile + +install-pdf-guile: \ + configure-guile \ + pdf-guile + @: $(MAKE); $(unstage) + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in guile" ; \ + (cd $(HOST_SUBDIR)/guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif guile + .PHONY: maybe-install-html-guile install-html-guile maybe-install-html-guile: @if guile @@ -29685,6 +35926,9 @@ maintainer-clean-guile: .PHONY: configure-tk maybe-configure-tk maybe-configure-tk: +@if gcc-bootstrap +configure-tk: stage_current +@endif gcc-bootstrap @if tk maybe-configure-tk: configure-tk configure-tk: @@ -29704,7 +35948,8 @@ configure-tk: srcdiroption="--srcdir=$${topdir}/tk"; \ libsrcdir="$$s/tk"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif tk @@ -29714,6 +35959,9 @@ configure-tk: .PHONY: all-tk maybe-all-tk maybe-all-tk: +@if gcc-bootstrap +all-tk: stage_current +@endif gcc-bootstrap @if tk TARGET-tk=all maybe-all-tk: all-tk @@ -29759,7 +36007,7 @@ install-tk: installdirs @endif tk -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-tk info-tk maybe-info-tk: @@ -29813,6 +36061,32 @@ dvi-tk: \ @endif tk +.PHONY: maybe-pdf-tk pdf-tk +maybe-pdf-tk: +@if tk +maybe-pdf-tk: pdf-tk + +pdf-tk: \ + configure-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif tk + .PHONY: maybe-html-tk html-tk maybe-html-tk: @if tk @@ -29892,6 +36166,33 @@ install-info-tk: \ @endif tk +.PHONY: maybe-install-pdf-tk install-pdf-tk +maybe-install-pdf-tk: +@if tk +maybe-install-pdf-tk: install-pdf-tk + +install-pdf-tk: \ + configure-tk \ + pdf-tk + @: $(MAKE); $(unstage) + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in tk" ; \ + (cd $(HOST_SUBDIR)/tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif tk + .PHONY: maybe-install-html-tk install-html-tk maybe-install-html-tk: @if tk @@ -30049,6 +36350,9 @@ maintainer-clean-tk: .PHONY: configure-libtermcap maybe-configure-libtermcap maybe-configure-libtermcap: +@if gcc-bootstrap +configure-libtermcap: stage_current +@endif gcc-bootstrap @if libtermcap maybe-configure-libtermcap: configure-libtermcap configure-libtermcap: @@ -30068,7 +36372,8 @@ configure-libtermcap: srcdiroption="--srcdir=$${topdir}/libtermcap"; \ libsrcdir="$$s/libtermcap"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif libtermcap @@ -30078,6 +36383,9 @@ configure-libtermcap: .PHONY: all-libtermcap maybe-all-libtermcap maybe-all-libtermcap: +@if gcc-bootstrap +all-libtermcap: stage_current +@endif gcc-bootstrap @if libtermcap TARGET-libtermcap=all maybe-all-libtermcap: all-libtermcap @@ -30117,7 +36425,7 @@ install-libtermcap: installdirs @endif libtermcap -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-libtermcap info-libtermcap maybe-info-libtermcap: @@ -30171,6 +36479,32 @@ dvi-libtermcap: \ @endif libtermcap +.PHONY: maybe-pdf-libtermcap pdf-libtermcap +maybe-pdf-libtermcap: +@if libtermcap +maybe-pdf-libtermcap: pdf-libtermcap + +pdf-libtermcap: \ + configure-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif libtermcap + .PHONY: maybe-html-libtermcap html-libtermcap maybe-html-libtermcap: @if libtermcap @@ -30250,6 +36584,33 @@ install-info-libtermcap: \ @endif libtermcap +.PHONY: maybe-install-pdf-libtermcap install-pdf-libtermcap +maybe-install-pdf-libtermcap: +@if libtermcap +maybe-install-pdf-libtermcap: install-pdf-libtermcap + +install-pdf-libtermcap: \ + configure-libtermcap \ + pdf-libtermcap + @: $(MAKE); $(unstage) + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in libtermcap" ; \ + (cd $(HOST_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif libtermcap + .PHONY: maybe-install-html-libtermcap install-html-libtermcap maybe-install-html-libtermcap: @if libtermcap @@ -30347,6 +36708,9 @@ maintainer-clean-libtermcap: .PHONY: configure-utils maybe-configure-utils maybe-configure-utils: +@if gcc-bootstrap +configure-utils: stage_current +@endif gcc-bootstrap @if utils maybe-configure-utils: configure-utils configure-utils: @@ -30366,7 +36730,8 @@ configure-utils: srcdiroption="--srcdir=$${topdir}/utils"; \ libsrcdir="$$s/utils"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif utils @@ -30376,6 +36741,9 @@ configure-utils: .PHONY: all-utils maybe-all-utils maybe-all-utils: +@if gcc-bootstrap +all-utils: stage_current +@endif gcc-bootstrap @if utils TARGET-utils=all maybe-all-utils: all-utils @@ -30415,7 +36783,7 @@ install-utils: installdirs @endif utils -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-utils info-utils maybe-info-utils: @@ -30469,6 +36837,32 @@ dvi-utils: \ @endif utils +.PHONY: maybe-pdf-utils pdf-utils +maybe-pdf-utils: +@if utils +maybe-pdf-utils: pdf-utils + +pdf-utils: \ + configure-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif utils + .PHONY: maybe-html-utils html-utils maybe-html-utils: @if utils @@ -30548,6 +36942,33 @@ install-info-utils: \ @endif utils +.PHONY: maybe-install-pdf-utils install-pdf-utils +maybe-install-pdf-utils: +@if utils +maybe-install-pdf-utils: install-pdf-utils + +install-pdf-utils: \ + configure-utils \ + pdf-utils + @: $(MAKE); $(unstage) + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in utils" ; \ + (cd $(HOST_SUBDIR)/utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif utils + .PHONY: maybe-install-html-utils install-html-utils maybe-install-html-utils: @if utils @@ -30705,6 +37126,9 @@ maintainer-clean-utils: .PHONY: configure-gnattools maybe-configure-gnattools maybe-configure-gnattools: +@if gcc-bootstrap +configure-gnattools: stage_current +@endif gcc-bootstrap @if gnattools maybe-configure-gnattools: configure-gnattools configure-gnattools: @@ -30724,7 +37148,8 @@ configure-gnattools: srcdiroption="--srcdir=$${topdir}/gnattools"; \ libsrcdir="$$s/gnattools"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif gnattools @@ -30734,6 +37159,9 @@ configure-gnattools: .PHONY: all-gnattools maybe-all-gnattools maybe-all-gnattools: +@if gcc-bootstrap +all-gnattools: stage_current +@endif gcc-bootstrap @if gnattools TARGET-gnattools=all maybe-all-gnattools: all-gnattools @@ -30779,7 +37207,7 @@ install-gnattools: installdirs @endif gnattools -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-gnattools info-gnattools maybe-info-gnattools: @@ -30833,6 +37261,32 @@ dvi-gnattools: \ @endif gnattools +.PHONY: maybe-pdf-gnattools pdf-gnattools +maybe-pdf-gnattools: +@if gnattools +maybe-pdf-gnattools: pdf-gnattools + +pdf-gnattools: \ + configure-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing pdf in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif gnattools + .PHONY: maybe-html-gnattools html-gnattools maybe-html-gnattools: @if gnattools @@ -30912,6 +37366,33 @@ install-info-gnattools: \ @endif gnattools +.PHONY: maybe-install-pdf-gnattools install-pdf-gnattools +maybe-install-pdf-gnattools: +@if gnattools +maybe-install-pdf-gnattools: install-pdf-gnattools + +install-pdf-gnattools: \ + configure-gnattools \ + pdf-gnattools + @: $(MAKE); $(unstage) + @[ -f ./gnattools/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-pdf in gnattools" ; \ + (cd $(HOST_SUBDIR)/gnattools && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif gnattools + .PHONY: maybe-install-html-gnattools install-html-gnattools maybe-install-html-gnattools: @if gnattools @@ -31076,6 +37557,9 @@ maintainer-clean-gnattools: .PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3: +@if gcc-bootstrap +configure-target-libstdc++-v3: stage_current +@endif gcc-bootstrap @if target-libstdc++-v3 maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3 configure-target-libstdc++-v3: @@ -31109,7 +37593,8 @@ configure-target-libstdc++-v3: libsrcdir="$$s/libstdc++-v3"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libstdc++-v3 @@ -31119,6 +37604,9 @@ configure-target-libstdc++-v3: .PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3 maybe-all-target-libstdc++-v3: +@if gcc-bootstrap +all-target-libstdc++-v3: stage_current +@endif gcc-bootstrap @if target-libstdc++-v3 TARGET-target-libstdc++-v3=all maybe-all-target-libstdc++-v3: all-target-libstdc++-v3 @@ -31165,7 +37653,7 @@ install-target-libstdc++-v3: installdirs @endif target-libstdc++-v3 -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libstdc++-v3 info-target-libstdc++-v3 maybe-info-target-libstdc++-v3: @@ -31219,6 +37707,32 @@ dvi-target-libstdc++-v3: \ @endif target-libstdc++-v3 +.PHONY: maybe-pdf-target-libstdc++-v3 pdf-target-libstdc++-v3 +maybe-pdf-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-pdf-target-libstdc++-v3: pdf-target-libstdc++-v3 + +pdf-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libstdc++-v3 + .PHONY: maybe-html-target-libstdc++-v3 html-target-libstdc++-v3 maybe-html-target-libstdc++-v3: @if target-libstdc++-v3 @@ -31298,6 +37812,33 @@ install-info-target-libstdc++-v3: \ @endif target-libstdc++-v3 +.PHONY: maybe-install-pdf-target-libstdc++-v3 install-pdf-target-libstdc++-v3 +maybe-install-pdf-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-install-pdf-target-libstdc++-v3: install-pdf-target-libstdc++-v3 + +install-pdf-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + pdf-target-libstdc++-v3 + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libstdc++-v3 + .PHONY: maybe-install-html-target-libstdc++-v3 install-html-target-libstdc++-v3 maybe-install-html-target-libstdc++-v3: @if target-libstdc++-v3 @@ -31457,6 +37998,9 @@ maintainer-clean-target-libstdc++-v3: .PHONY: configure-target-libmudflap maybe-configure-target-libmudflap maybe-configure-target-libmudflap: +@if gcc-bootstrap +configure-target-libmudflap: stage_current +@endif gcc-bootstrap @if target-libmudflap maybe-configure-target-libmudflap: configure-target-libmudflap configure-target-libmudflap: @@ -31490,7 +38034,8 @@ configure-target-libmudflap: libsrcdir="$$s/libmudflap"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libmudflap @@ -31500,6 +38045,9 @@ configure-target-libmudflap: .PHONY: all-target-libmudflap maybe-all-target-libmudflap maybe-all-target-libmudflap: +@if gcc-bootstrap +all-target-libmudflap: stage_current +@endif gcc-bootstrap @if target-libmudflap TARGET-target-libmudflap=all maybe-all-target-libmudflap: all-target-libmudflap @@ -31546,7 +38094,7 @@ install-target-libmudflap: installdirs @endif target-libmudflap -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libmudflap info-target-libmudflap maybe-info-target-libmudflap: @@ -31600,6 +38148,32 @@ dvi-target-libmudflap: \ @endif target-libmudflap +.PHONY: maybe-pdf-target-libmudflap pdf-target-libmudflap +maybe-pdf-target-libmudflap: +@if target-libmudflap +maybe-pdf-target-libmudflap: pdf-target-libmudflap + +pdf-target-libmudflap: \ + configure-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libmudflap + .PHONY: maybe-html-target-libmudflap html-target-libmudflap maybe-html-target-libmudflap: @if target-libmudflap @@ -31679,6 +38253,33 @@ install-info-target-libmudflap: \ @endif target-libmudflap +.PHONY: maybe-install-pdf-target-libmudflap install-pdf-target-libmudflap +maybe-install-pdf-target-libmudflap: +@if target-libmudflap +maybe-install-pdf-target-libmudflap: install-pdf-target-libmudflap + +install-pdf-target-libmudflap: \ + configure-target-libmudflap \ + pdf-target-libmudflap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libmudflap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libmudflap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libmudflap + .PHONY: maybe-install-html-target-libmudflap install-html-target-libmudflap maybe-install-html-target-libmudflap: @if target-libmudflap @@ -31838,6 +38439,9 @@ maintainer-clean-target-libmudflap: .PHONY: configure-target-libssp maybe-configure-target-libssp maybe-configure-target-libssp: +@if gcc-bootstrap +configure-target-libssp: stage_current +@endif gcc-bootstrap @if target-libssp maybe-configure-target-libssp: configure-target-libssp configure-target-libssp: @@ -31871,7 +38475,8 @@ configure-target-libssp: libsrcdir="$$s/libssp"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libssp @@ -31881,6 +38486,9 @@ configure-target-libssp: .PHONY: all-target-libssp maybe-all-target-libssp maybe-all-target-libssp: +@if gcc-bootstrap +all-target-libssp: stage_current +@endif gcc-bootstrap @if target-libssp TARGET-target-libssp=all maybe-all-target-libssp: all-target-libssp @@ -31927,7 +38535,7 @@ install-target-libssp: installdirs @endif target-libssp -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libssp info-target-libssp maybe-info-target-libssp: @@ -31981,6 +38589,32 @@ dvi-target-libssp: \ @endif target-libssp +.PHONY: maybe-pdf-target-libssp pdf-target-libssp +maybe-pdf-target-libssp: +@if target-libssp +maybe-pdf-target-libssp: pdf-target-libssp + +pdf-target-libssp: \ + configure-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libssp + .PHONY: maybe-html-target-libssp html-target-libssp maybe-html-target-libssp: @if target-libssp @@ -32060,6 +38694,33 @@ install-info-target-libssp: \ @endif target-libssp +.PHONY: maybe-install-pdf-target-libssp install-pdf-target-libssp +maybe-install-pdf-target-libssp: +@if target-libssp +maybe-install-pdf-target-libssp: install-pdf-target-libssp + +install-pdf-target-libssp: \ + configure-target-libssp \ + pdf-target-libssp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libssp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libssp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libssp + .PHONY: maybe-install-html-target-libssp install-html-target-libssp maybe-install-html-target-libssp: @if target-libssp @@ -32217,389 +38878,11 @@ maintainer-clean-target-libssp: -.PHONY: configure-target-libgcc-math maybe-configure-target-libgcc-math -maybe-configure-target-libgcc-math: -@if target-libgcc-math -maybe-configure-target-libgcc-math: configure-target-libgcc-math -configure-target-libgcc-math: - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - echo "Checking multilib configuration for libgcc-math..."; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc-math ; \ - $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc-math/multilib.tmp 2> /dev/null ; \ - if test -r $(TARGET_SUBDIR)/libgcc-math/multilib.out; then \ - if cmp -s $(TARGET_SUBDIR)/libgcc-math/multilib.tmp $(TARGET_SUBDIR)/libgcc-math/multilib.out; then \ - rm -f $(TARGET_SUBDIR)/libgcc-math/multilib.tmp; \ - else \ - rm -f $(TARGET_SUBDIR)/libgcc-math/Makefile; \ - mv $(TARGET_SUBDIR)/libgcc-math/multilib.tmp $(TARGET_SUBDIR)/libgcc-math/multilib.out; \ - fi; \ - else \ - mv $(TARGET_SUBDIR)/libgcc-math/multilib.tmp $(TARGET_SUBDIR)/libgcc-math/multilib.out; \ - fi; \ - test ! -f $(TARGET_SUBDIR)/libgcc-math/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc-math ; \ - $(NORMAL_TARGET_EXPORTS) \ - echo Configuring in $(TARGET_SUBDIR)/libgcc-math; \ - cd "$(TARGET_SUBDIR)/libgcc-math" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(TARGET_SUBDIR)/libgcc-math/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libgcc-math"; \ - libsrcdir="$$s/libgcc-math"; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - || exit 1 -@endif target-libgcc-math - - - - - -.PHONY: all-target-libgcc-math maybe-all-target-libgcc-math -maybe-all-target-libgcc-math: -@if target-libgcc-math -TARGET-target-libgcc-math=all -maybe-all-target-libgcc-math: all-target-libgcc-math -all-target-libgcc-math: configure-target-libgcc-math - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgcc-math)) -@endif target-libgcc-math - - - - - -.PHONY: check-target-libgcc-math maybe-check-target-libgcc-math -maybe-check-target-libgcc-math: -@if target-libgcc-math -maybe-check-target-libgcc-math: check-target-libgcc-math - -check-target-libgcc-math: - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) - -@endif target-libgcc-math - -.PHONY: install-target-libgcc-math maybe-install-target-libgcc-math -maybe-install-target-libgcc-math: -@if target-libgcc-math -maybe-install-target-libgcc-math: install-target-libgcc-math - -install-target-libgcc-math: installdirs - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) - -@endif target-libgcc-math - -# Other targets (info, dvi, etc.) - -.PHONY: maybe-info-target-libgcc-math info-target-libgcc-math -maybe-info-target-libgcc-math: -@if target-libgcc-math -maybe-info-target-libgcc-math: info-target-libgcc-math - -info-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing info in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - info) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-dvi-target-libgcc-math dvi-target-libgcc-math -maybe-dvi-target-libgcc-math: -@if target-libgcc-math -maybe-dvi-target-libgcc-math: dvi-target-libgcc-math - -dvi-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing dvi in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - dvi) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-html-target-libgcc-math html-target-libgcc-math -maybe-html-target-libgcc-math: -@if target-libgcc-math -maybe-html-target-libgcc-math: html-target-libgcc-math - -html-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing html in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - html) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-TAGS-target-libgcc-math TAGS-target-libgcc-math -maybe-TAGS-target-libgcc-math: -@if target-libgcc-math -maybe-TAGS-target-libgcc-math: TAGS-target-libgcc-math - -TAGS-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing TAGS in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - TAGS) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-install-info-target-libgcc-math install-info-target-libgcc-math -maybe-install-info-target-libgcc-math: -@if target-libgcc-math -maybe-install-info-target-libgcc-math: install-info-target-libgcc-math - -install-info-target-libgcc-math: \ - configure-target-libgcc-math \ - info-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing install-info in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - install-info) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-install-html-target-libgcc-math install-html-target-libgcc-math -maybe-install-html-target-libgcc-math: -@if target-libgcc-math -maybe-install-html-target-libgcc-math: install-html-target-libgcc-math - -install-html-target-libgcc-math: \ - configure-target-libgcc-math \ - html-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing install-html in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - install-html) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-installcheck-target-libgcc-math installcheck-target-libgcc-math -maybe-installcheck-target-libgcc-math: -@if target-libgcc-math -maybe-installcheck-target-libgcc-math: installcheck-target-libgcc-math - -installcheck-target-libgcc-math: \ - configure-target-libgcc-math - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing installcheck in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - installcheck) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-mostlyclean-target-libgcc-math mostlyclean-target-libgcc-math -maybe-mostlyclean-target-libgcc-math: -@if target-libgcc-math -maybe-mostlyclean-target-libgcc-math: mostlyclean-target-libgcc-math - -mostlyclean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - mostlyclean) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-clean-target-libgcc-math clean-target-libgcc-math -maybe-clean-target-libgcc-math: -@if target-libgcc-math -maybe-clean-target-libgcc-math: clean-target-libgcc-math - -clean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing clean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - clean) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-distclean-target-libgcc-math distclean-target-libgcc-math -maybe-distclean-target-libgcc-math: -@if target-libgcc-math -maybe-distclean-target-libgcc-math: distclean-target-libgcc-math - -distclean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing distclean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - distclean) \ - || exit 1 - -@endif target-libgcc-math - -.PHONY: maybe-maintainer-clean-target-libgcc-math maintainer-clean-target-libgcc-math -maybe-maintainer-clean-target-libgcc-math: -@if target-libgcc-math -maybe-maintainer-clean-target-libgcc-math: maintainer-clean-target-libgcc-math - -maintainer-clean-target-libgcc-math: - @: $(MAKE); $(unstage) - @[ -f $(TARGET_SUBDIR)/libgcc-math/Makefile ] || exit 0 ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(NORMAL_TARGET_EXPORTS) \ - echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgcc-math" ; \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - (cd $(TARGET_SUBDIR)/libgcc-math && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - maintainer-clean) \ - || exit 1 - -@endif target-libgcc-math - - - - - .PHONY: configure-target-newlib maybe-configure-target-newlib maybe-configure-target-newlib: +@if gcc-bootstrap +configure-target-newlib: stage_current +@endif gcc-bootstrap @if target-newlib maybe-configure-target-newlib: configure-target-newlib configure-target-newlib: @@ -32633,7 +38916,8 @@ configure-target-newlib: libsrcdir="$$s/newlib"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-newlib @@ -32643,6 +38927,9 @@ configure-target-newlib: .PHONY: all-target-newlib maybe-all-target-newlib maybe-all-target-newlib: +@if gcc-bootstrap +all-target-newlib: stage_current +@endif gcc-bootstrap @if target-newlib TARGET-target-newlib=all maybe-all-target-newlib: all-target-newlib @@ -32689,7 +38976,7 @@ install-target-newlib: installdirs @endif target-newlib -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-newlib info-target-newlib maybe-info-target-newlib: @@ -32743,6 +39030,32 @@ dvi-target-newlib: \ @endif target-newlib +.PHONY: maybe-pdf-target-newlib pdf-target-newlib +maybe-pdf-target-newlib: +@if target-newlib +maybe-pdf-target-newlib: pdf-target-newlib + +pdf-target-newlib: \ + configure-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-newlib + .PHONY: maybe-html-target-newlib html-target-newlib maybe-html-target-newlib: @if target-newlib @@ -32822,6 +39135,33 @@ install-info-target-newlib: \ @endif target-newlib +.PHONY: maybe-install-pdf-target-newlib install-pdf-target-newlib +maybe-install-pdf-target-newlib: +@if target-newlib +maybe-install-pdf-target-newlib: install-pdf-target-newlib + +install-pdf-target-newlib: \ + configure-target-newlib \ + pdf-target-newlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-newlib + .PHONY: maybe-install-html-target-newlib install-html-target-newlib maybe-install-html-target-newlib: @if target-newlib @@ -32979,8 +39319,914 @@ maintainer-clean-target-newlib: +.PHONY: configure-target-libgcc maybe-configure-target-libgcc +maybe-configure-target-libgcc: +@if gcc-bootstrap +configure-target-libgcc: stage_current +@endif gcc-bootstrap +@if target-libgcc +maybe-configure-target-libgcc: configure-target-libgcc +configure-target-libgcc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + $(NORMAL_TARGET_EXPORTS) \ + echo Configuring in $(TARGET_SUBDIR)/libgcc; \ + cd "$(TARGET_SUBDIR)/libgcc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 +@endif target-libgcc + + + +.PHONY: configure-stage1-target-libgcc maybe-configure-stage1-target-libgcc +maybe-configure-stage1-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage1-target-libgcc: configure-stage1-target-libgcc +configure-stage1-target-libgcc: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 1 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + \ + --disable-intermodule $(STAGE1_CHECKING) --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif target-libgcc-bootstrap + +.PHONY: configure-stage2-target-libgcc maybe-configure-stage2-target-libgcc +maybe-configure-stage2-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage2-target-libgcc: configure-stage2-target-libgcc +configure-stage2-target-libgcc: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 2 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stage3-target-libgcc maybe-configure-stage3-target-libgcc +maybe-configure-stage3-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage3-target-libgcc: configure-stage3-target-libgcc +configure-stage3-target-libgcc: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 3 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stage4-target-libgcc maybe-configure-stage4-target-libgcc +maybe-configure-stage4-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stage4-target-libgcc: configure-stage4-target-libgcc +configure-stage4-target-libgcc: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS)"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS)"; export LIBCFLAGS; \ + echo Configuring stage 4 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stageprofile-target-libgcc maybe-configure-stageprofile-target-libgcc +maybe-configure-stageprofile-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stageprofile-target-libgcc: configure-stageprofile-target-libgcc +configure-stageprofile-target-libgcc: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ + echo Configuring stage profile in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + +.PHONY: configure-stagefeedback-target-libgcc maybe-configure-stagefeedback-target-libgcc +maybe-configure-stagefeedback-target-libgcc: +@if target-libgcc-bootstrap +maybe-configure-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc +configure-stagefeedback-target-libgcc: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + echo "Checking multilib configuration for libgcc..."; \ + $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null ; \ + if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \ + rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \ + else \ + rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + else \ + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export CFLAGS; \ + LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ + echo Configuring stage feedback in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgcc"; \ + libsrcdir="$$s/libgcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ + --with-build-libsubdir=$(HOST_SUBDIR) \ + @stage2_werror_flag@ +@endif target-libgcc-bootstrap + + + + + +.PHONY: all-target-libgcc maybe-all-target-libgcc +maybe-all-target-libgcc: +@if gcc-bootstrap +all-target-libgcc: stage_current +@endif gcc-bootstrap +@if target-libgcc +TARGET-target-libgcc=all +maybe-all-target-libgcc: all-target-libgcc +all-target-libgcc: configure-target-libgcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgcc)) +@endif target-libgcc + + + +.PHONY: all-stage1-target-libgcc maybe-all-stage1-target-libgcc +.PHONY: clean-stage1-target-libgcc maybe-clean-stage1-target-libgcc +maybe-all-stage1-target-libgcc: +maybe-clean-stage1-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage1-target-libgcc: all-stage1-target-libgcc +all-stage1: all-stage1-target-libgcc +TARGET-stage1-target-libgcc = $(TARGET-target-libgcc) +all-stage1-target-libgcc: configure-stage1-target-libgcc + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-target-libgcc) + +maybe-clean-stage1-target-libgcc: clean-stage1-target-libgcc +clean-stage1: clean-stage1-target-libgcc +clean-stage1-target-libgcc: + @if [ $(current_stage) = stage1 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage1-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage1-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage2-target-libgcc maybe-all-stage2-target-libgcc +.PHONY: clean-stage2-target-libgcc maybe-clean-stage2-target-libgcc +maybe-all-stage2-target-libgcc: +maybe-clean-stage2-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage2-target-libgcc: all-stage2-target-libgcc +all-stage2: all-stage2-target-libgcc +TARGET-stage2-target-libgcc = $(TARGET-target-libgcc) +all-stage2-target-libgcc: configure-stage2-target-libgcc + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \ + $(TARGET-stage2-target-libgcc) + +maybe-clean-stage2-target-libgcc: clean-stage2-target-libgcc +clean-stage2: clean-stage2-target-libgcc +clean-stage2-target-libgcc: + @if [ $(current_stage) = stage2 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage2-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage3-target-libgcc maybe-all-stage3-target-libgcc +.PHONY: clean-stage3-target-libgcc maybe-clean-stage3-target-libgcc +maybe-all-stage3-target-libgcc: +maybe-clean-stage3-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage3-target-libgcc: all-stage3-target-libgcc +all-stage3: all-stage3-target-libgcc +TARGET-stage3-target-libgcc = $(TARGET-target-libgcc) +all-stage3-target-libgcc: configure-stage3-target-libgcc + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \ + $(TARGET-stage3-target-libgcc) + +maybe-clean-stage3-target-libgcc: clean-stage3-target-libgcc +clean-stage3: clean-stage3-target-libgcc +clean-stage3-target-libgcc: + @if [ $(current_stage) = stage3 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage3-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage3-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stage4-target-libgcc maybe-all-stage4-target-libgcc +.PHONY: clean-stage4-target-libgcc maybe-clean-stage4-target-libgcc +maybe-all-stage4-target-libgcc: +maybe-clean-stage4-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stage4-target-libgcc: all-stage4-target-libgcc +all-stage4: all-stage4-target-libgcc +TARGET-stage4-target-libgcc = $(TARGET-target-libgcc) +all-stage4-target-libgcc: configure-stage4-target-libgcc + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS)" LIBCFLAGS="$(BOOT_CFLAGS)" \ + $(TARGET-stage4-target-libgcc) + +maybe-clean-stage4-target-libgcc: clean-stage4-target-libgcc +clean-stage4: clean-stage4-target-libgcc +clean-stage4-target-libgcc: + @if [ $(current_stage) = stage4 ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stage4-libgcc/Makefile ] || exit 0; \ + $(MAKE) stage4-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stageprofile-target-libgcc maybe-all-stageprofile-target-libgcc +.PHONY: clean-stageprofile-target-libgcc maybe-clean-stageprofile-target-libgcc +maybe-all-stageprofile-target-libgcc: +maybe-clean-stageprofile-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stageprofile-target-libgcc: all-stageprofile-target-libgcc +all-stageprofile: all-stageprofile-target-libgcc +TARGET-stageprofile-target-libgcc = $(TARGET-target-libgcc) +all-stageprofile-target-libgcc: configure-stageprofile-target-libgcc + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(TARGET-stageprofile-target-libgcc) + +maybe-clean-stageprofile-target-libgcc: clean-stageprofile-target-libgcc +clean-stageprofile: clean-stageprofile-target-libgcc +clean-stageprofile-target-libgcc: + @if [ $(current_stage) = stageprofile ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stageprofile-libgcc/Makefile ] || exit 0; \ + $(MAKE) stageprofile-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + +.PHONY: all-stagefeedback-target-libgcc maybe-all-stagefeedback-target-libgcc +.PHONY: clean-stagefeedback-target-libgcc maybe-clean-stagefeedback-target-libgcc +maybe-all-stagefeedback-target-libgcc: +maybe-clean-stagefeedback-target-libgcc: +@if target-libgcc-bootstrap +maybe-all-stagefeedback-target-libgcc: all-stagefeedback-target-libgcc +all-stagefeedback: all-stagefeedback-target-libgcc +TARGET-stagefeedback-target-libgcc = $(TARGET-target-libgcc) +all-stagefeedback-target-libgcc: configure-stagefeedback-target-libgcc + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" LIBCFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(TARGET-stagefeedback-target-libgcc) + +maybe-clean-stagefeedback-target-libgcc: clean-stagefeedback-target-libgcc +clean-stagefeedback: clean-stagefeedback-target-libgcc +clean-stagefeedback-target-libgcc: + @if [ $(current_stage) = stagefeedback ]; then \ + [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \ + else \ + [ -f $(TARGET_SUBDIR)/stagefeedback-libgcc/Makefile ] || exit 0; \ + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + \ + clean +@endif target-libgcc-bootstrap + + + + + + +.PHONY: check-target-libgcc maybe-check-target-libgcc +maybe-check-target-libgcc: +@if target-libgcc +maybe-check-target-libgcc: check-target-libgcc + +# Dummy target for uncheckable module. +check-target-libgcc: + +@endif target-libgcc + +.PHONY: install-target-libgcc maybe-install-target-libgcc +maybe-install-target-libgcc: +@if target-libgcc +maybe-install-target-libgcc: install-target-libgcc + +install-target-libgcc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + +@endif target-libgcc + +# Other targets (info, dvi, pdf, etc.) + +.PHONY: maybe-info-target-libgcc info-target-libgcc +maybe-info-target-libgcc: +@if target-libgcc +maybe-info-target-libgcc: info-target-libgcc + +info-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing info in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-dvi-target-libgcc dvi-target-libgcc +maybe-dvi-target-libgcc: +@if target-libgcc +maybe-dvi-target-libgcc: dvi-target-libgcc + +dvi-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-pdf-target-libgcc pdf-target-libgcc +maybe-pdf-target-libgcc: +@if target-libgcc +maybe-pdf-target-libgcc: pdf-target-libgcc + +pdf-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-html-target-libgcc html-target-libgcc +maybe-html-target-libgcc: +@if target-libgcc +maybe-html-target-libgcc: html-target-libgcc + +html-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing html in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-TAGS-target-libgcc TAGS-target-libgcc +maybe-TAGS-target-libgcc: +@if target-libgcc +maybe-TAGS-target-libgcc: TAGS-target-libgcc + +TAGS-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-info-target-libgcc install-info-target-libgcc +maybe-install-info-target-libgcc: +@if target-libgcc +maybe-install-info-target-libgcc: install-info-target-libgcc + +install-info-target-libgcc: \ + configure-target-libgcc \ + info-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-pdf-target-libgcc install-pdf-target-libgcc +maybe-install-pdf-target-libgcc: +@if target-libgcc +maybe-install-pdf-target-libgcc: install-pdf-target-libgcc + +install-pdf-target-libgcc: \ + configure-target-libgcc \ + pdf-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-install-html-target-libgcc install-html-target-libgcc +maybe-install-html-target-libgcc: +@if target-libgcc +maybe-install-html-target-libgcc: install-html-target-libgcc + +install-html-target-libgcc: \ + configure-target-libgcc \ + html-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-html in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-installcheck-target-libgcc installcheck-target-libgcc +maybe-installcheck-target-libgcc: +@if target-libgcc +maybe-installcheck-target-libgcc: installcheck-target-libgcc + +installcheck-target-libgcc: \ + configure-target-libgcc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-mostlyclean-target-libgcc mostlyclean-target-libgcc +maybe-mostlyclean-target-libgcc: +@if target-libgcc +maybe-mostlyclean-target-libgcc: mostlyclean-target-libgcc + +mostlyclean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-clean-target-libgcc clean-target-libgcc +maybe-clean-target-libgcc: +@if target-libgcc +maybe-clean-target-libgcc: clean-target-libgcc + +clean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-distclean-target-libgcc distclean-target-libgcc +maybe-distclean-target-libgcc: +@if target-libgcc +maybe-distclean-target-libgcc: distclean-target-libgcc + +distclean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif target-libgcc + +.PHONY: maybe-maintainer-clean-target-libgcc maintainer-clean-target-libgcc +maybe-maintainer-clean-target-libgcc: +@if target-libgcc +maybe-maintainer-clean-target-libgcc: maintainer-clean-target-libgcc + +maintainer-clean-target-libgcc: + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgcc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif target-libgcc + + + + + .PHONY: configure-target-libgfortran maybe-configure-target-libgfortran maybe-configure-target-libgfortran: +@if gcc-bootstrap +configure-target-libgfortran: stage_current +@endif gcc-bootstrap @if target-libgfortran maybe-configure-target-libgfortran: configure-target-libgfortran configure-target-libgfortran: @@ -33014,7 +40260,8 @@ configure-target-libgfortran: libsrcdir="$$s/libgfortran"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libgfortran @@ -33024,6 +40271,9 @@ configure-target-libgfortran: .PHONY: all-target-libgfortran maybe-all-target-libgfortran maybe-all-target-libgfortran: +@if gcc-bootstrap +all-target-libgfortran: stage_current +@endif gcc-bootstrap @if target-libgfortran TARGET-target-libgfortran=all maybe-all-target-libgfortran: all-target-libgfortran @@ -33070,7 +40320,7 @@ install-target-libgfortran: installdirs @endif target-libgfortran -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libgfortran info-target-libgfortran maybe-info-target-libgfortran: @@ -33124,6 +40374,32 @@ dvi-target-libgfortran: \ @endif target-libgfortran +.PHONY: maybe-pdf-target-libgfortran pdf-target-libgfortran +maybe-pdf-target-libgfortran: +@if target-libgfortran +maybe-pdf-target-libgfortran: pdf-target-libgfortran + +pdf-target-libgfortran: \ + configure-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgfortran + .PHONY: maybe-html-target-libgfortran html-target-libgfortran maybe-html-target-libgfortran: @if target-libgfortran @@ -33203,6 +40479,33 @@ install-info-target-libgfortran: \ @endif target-libgfortran +.PHONY: maybe-install-pdf-target-libgfortran install-pdf-target-libgfortran +maybe-install-pdf-target-libgfortran: +@if target-libgfortran +maybe-install-pdf-target-libgfortran: install-pdf-target-libgfortran + +install-pdf-target-libgfortran: \ + configure-target-libgfortran \ + pdf-target-libgfortran + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgfortran" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgfortran && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgfortran + .PHONY: maybe-install-html-target-libgfortran install-html-target-libgfortran maybe-install-html-target-libgfortran: @if target-libgfortran @@ -33362,6 +40665,9 @@ maintainer-clean-target-libgfortran: .PHONY: configure-target-libobjc maybe-configure-target-libobjc maybe-configure-target-libobjc: +@if gcc-bootstrap +configure-target-libobjc: stage_current +@endif gcc-bootstrap @if target-libobjc maybe-configure-target-libobjc: configure-target-libobjc configure-target-libobjc: @@ -33395,7 +40701,8 @@ configure-target-libobjc: libsrcdir="$$s/libobjc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libobjc @@ -33405,6 +40712,9 @@ configure-target-libobjc: .PHONY: all-target-libobjc maybe-all-target-libobjc maybe-all-target-libobjc: +@if gcc-bootstrap +all-target-libobjc: stage_current +@endif gcc-bootstrap @if target-libobjc TARGET-target-libobjc=all maybe-all-target-libobjc: all-target-libobjc @@ -33451,7 +40761,7 @@ install-target-libobjc: installdirs @endif target-libobjc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libobjc info-target-libobjc maybe-info-target-libobjc: @@ -33505,6 +40815,32 @@ dvi-target-libobjc: \ @endif target-libobjc +.PHONY: maybe-pdf-target-libobjc pdf-target-libobjc +maybe-pdf-target-libobjc: +@if target-libobjc +maybe-pdf-target-libobjc: pdf-target-libobjc + +pdf-target-libobjc: \ + configure-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libobjc + .PHONY: maybe-html-target-libobjc html-target-libobjc maybe-html-target-libobjc: @if target-libobjc @@ -33584,6 +40920,33 @@ install-info-target-libobjc: \ @endif target-libobjc +.PHONY: maybe-install-pdf-target-libobjc install-pdf-target-libobjc +maybe-install-pdf-target-libobjc: +@if target-libobjc +maybe-install-pdf-target-libobjc: install-pdf-target-libobjc + +install-pdf-target-libobjc: \ + configure-target-libobjc \ + pdf-target-libobjc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libobjc + .PHONY: maybe-install-html-target-libobjc install-html-target-libobjc maybe-install-html-target-libobjc: @if target-libobjc @@ -33743,6 +41106,9 @@ maintainer-clean-target-libobjc: .PHONY: configure-target-libtermcap maybe-configure-target-libtermcap maybe-configure-target-libtermcap: +@if gcc-bootstrap +configure-target-libtermcap: stage_current +@endif gcc-bootstrap @if target-libtermcap maybe-configure-target-libtermcap: configure-target-libtermcap configure-target-libtermcap: @@ -33776,7 +41142,8 @@ configure-target-libtermcap: libsrcdir="$$s/libtermcap"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libtermcap @@ -33786,6 +41153,9 @@ configure-target-libtermcap: .PHONY: all-target-libtermcap maybe-all-target-libtermcap maybe-all-target-libtermcap: +@if gcc-bootstrap +all-target-libtermcap: stage_current +@endif gcc-bootstrap @if target-libtermcap TARGET-target-libtermcap=all maybe-all-target-libtermcap: all-target-libtermcap @@ -33827,7 +41197,7 @@ install-target-libtermcap: installdirs @endif target-libtermcap -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libtermcap info-target-libtermcap maybe-info-target-libtermcap: @@ -33881,6 +41251,32 @@ dvi-target-libtermcap: \ @endif target-libtermcap +.PHONY: maybe-pdf-target-libtermcap pdf-target-libtermcap +maybe-pdf-target-libtermcap: +@if target-libtermcap +maybe-pdf-target-libtermcap: pdf-target-libtermcap + +pdf-target-libtermcap: \ + configure-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libtermcap + .PHONY: maybe-html-target-libtermcap html-target-libtermcap maybe-html-target-libtermcap: @if target-libtermcap @@ -33960,6 +41356,33 @@ install-info-target-libtermcap: \ @endif target-libtermcap +.PHONY: maybe-install-pdf-target-libtermcap install-pdf-target-libtermcap +maybe-install-pdf-target-libtermcap: +@if target-libtermcap +maybe-install-pdf-target-libtermcap: install-pdf-target-libtermcap + +install-pdf-target-libtermcap: \ + configure-target-libtermcap \ + pdf-target-libtermcap + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libtermcap + .PHONY: maybe-install-html-target-libtermcap install-html-target-libtermcap maybe-install-html-target-libtermcap: @if target-libtermcap @@ -34059,6 +41482,9 @@ maintainer-clean-target-libtermcap: .PHONY: configure-target-winsup maybe-configure-target-winsup maybe-configure-target-winsup: +@if gcc-bootstrap +configure-target-winsup: stage_current +@endif gcc-bootstrap @if target-winsup maybe-configure-target-winsup: configure-target-winsup configure-target-winsup: @@ -34092,7 +41518,8 @@ configure-target-winsup: libsrcdir="$$s/winsup"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-winsup @@ -34102,6 +41529,9 @@ configure-target-winsup: .PHONY: all-target-winsup maybe-all-target-winsup maybe-all-target-winsup: +@if gcc-bootstrap +all-target-winsup: stage_current +@endif gcc-bootstrap @if target-winsup TARGET-target-winsup=all maybe-all-target-winsup: all-target-winsup @@ -34148,7 +41578,7 @@ install-target-winsup: installdirs @endif target-winsup -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-winsup info-target-winsup maybe-info-target-winsup: @@ -34202,6 +41632,32 @@ dvi-target-winsup: \ @endif target-winsup +.PHONY: maybe-pdf-target-winsup pdf-target-winsup +maybe-pdf-target-winsup: +@if target-winsup +maybe-pdf-target-winsup: pdf-target-winsup + +pdf-target-winsup: \ + configure-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-winsup + .PHONY: maybe-html-target-winsup html-target-winsup maybe-html-target-winsup: @if target-winsup @@ -34281,6 +41737,33 @@ install-info-target-winsup: \ @endif target-winsup +.PHONY: maybe-install-pdf-target-winsup install-pdf-target-winsup +maybe-install-pdf-target-winsup: +@if target-winsup +maybe-install-pdf-target-winsup: install-pdf-target-winsup + +install-pdf-target-winsup: \ + configure-target-winsup \ + pdf-target-winsup + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-winsup + .PHONY: maybe-install-html-target-winsup install-html-target-winsup maybe-install-html-target-winsup: @if target-winsup @@ -34440,6 +41923,9 @@ maintainer-clean-target-winsup: .PHONY: configure-target-libgloss maybe-configure-target-libgloss maybe-configure-target-libgloss: +@if gcc-bootstrap +configure-target-libgloss: stage_current +@endif gcc-bootstrap @if target-libgloss maybe-configure-target-libgloss: configure-target-libgloss configure-target-libgloss: @@ -34473,7 +41959,8 @@ configure-target-libgloss: libsrcdir="$$s/libgloss"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libgloss @@ -34483,6 +41970,9 @@ configure-target-libgloss: .PHONY: all-target-libgloss maybe-all-target-libgloss maybe-all-target-libgloss: +@if gcc-bootstrap +all-target-libgloss: stage_current +@endif gcc-bootstrap @if target-libgloss TARGET-target-libgloss=all maybe-all-target-libgloss: all-target-libgloss @@ -34524,7 +42014,7 @@ install-target-libgloss: installdirs @endif target-libgloss -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libgloss info-target-libgloss maybe-info-target-libgloss: @@ -34578,6 +42068,32 @@ dvi-target-libgloss: \ @endif target-libgloss +.PHONY: maybe-pdf-target-libgloss pdf-target-libgloss +maybe-pdf-target-libgloss: +@if target-libgloss +maybe-pdf-target-libgloss: pdf-target-libgloss + +pdf-target-libgloss: \ + configure-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgloss + .PHONY: maybe-html-target-libgloss html-target-libgloss maybe-html-target-libgloss: @if target-libgloss @@ -34657,6 +42173,33 @@ install-info-target-libgloss: \ @endif target-libgloss +.PHONY: maybe-install-pdf-target-libgloss install-pdf-target-libgloss +maybe-install-pdf-target-libgloss: +@if target-libgloss +maybe-install-pdf-target-libgloss: install-pdf-target-libgloss + +install-pdf-target-libgloss: \ + configure-target-libgloss \ + pdf-target-libgloss + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgloss + .PHONY: maybe-install-html-target-libgloss install-html-target-libgloss maybe-install-html-target-libgloss: @if target-libgloss @@ -34816,6 +42359,9 @@ maintainer-clean-target-libgloss: .PHONY: configure-target-libiberty maybe-configure-target-libiberty maybe-configure-target-libiberty: +@if gcc-bootstrap +configure-target-libiberty: stage_current +@endif gcc-bootstrap @if target-libiberty maybe-configure-target-libiberty: configure-target-libiberty configure-target-libiberty: @@ -34849,7 +42395,8 @@ configure-target-libiberty: libsrcdir="$$s/libiberty"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libiberty @@ -34859,6 +42406,9 @@ configure-target-libiberty: .PHONY: all-target-libiberty maybe-all-target-libiberty maybe-all-target-libiberty: +@if gcc-bootstrap +all-target-libiberty: stage_current +@endif gcc-bootstrap @if target-libiberty TARGET-target-libiberty=all maybe-all-target-libiberty: all-target-libiberty @@ -34905,7 +42455,7 @@ install-target-libiberty: installdirs @endif target-libiberty -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libiberty info-target-libiberty maybe-info-target-libiberty: @@ -34959,6 +42509,32 @@ dvi-target-libiberty: \ @endif target-libiberty +.PHONY: maybe-pdf-target-libiberty pdf-target-libiberty +maybe-pdf-target-libiberty: +@if target-libiberty +maybe-pdf-target-libiberty: pdf-target-libiberty + +pdf-target-libiberty: \ + configure-target-libiberty + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libiberty + .PHONY: maybe-html-target-libiberty html-target-libiberty maybe-html-target-libiberty: @if target-libiberty @@ -35038,6 +42614,33 @@ install-info-target-libiberty: \ @endif target-libiberty +.PHONY: maybe-install-pdf-target-libiberty install-pdf-target-libiberty +maybe-install-pdf-target-libiberty: +@if target-libiberty +maybe-install-pdf-target-libiberty: install-pdf-target-libiberty + +install-pdf-target-libiberty: \ + configure-target-libiberty \ + pdf-target-libiberty + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libiberty + .PHONY: maybe-install-html-target-libiberty install-html-target-libiberty maybe-install-html-target-libiberty: @if target-libiberty @@ -35197,6 +42800,9 @@ maintainer-clean-target-libiberty: .PHONY: configure-target-gperf maybe-configure-target-gperf maybe-configure-target-gperf: +@if gcc-bootstrap +configure-target-gperf: stage_current +@endif gcc-bootstrap @if target-gperf maybe-configure-target-gperf: configure-target-gperf configure-target-gperf: @@ -35230,7 +42836,8 @@ configure-target-gperf: libsrcdir="$$s/gperf"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-gperf @@ -35240,6 +42847,9 @@ configure-target-gperf: .PHONY: all-target-gperf maybe-all-target-gperf maybe-all-target-gperf: +@if gcc-bootstrap +all-target-gperf: stage_current +@endif gcc-bootstrap @if target-gperf TARGET-target-gperf=all maybe-all-target-gperf: all-target-gperf @@ -35286,7 +42896,7 @@ install-target-gperf: installdirs @endif target-gperf -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-gperf info-target-gperf maybe-info-target-gperf: @@ -35340,6 +42950,32 @@ dvi-target-gperf: \ @endif target-gperf +.PHONY: maybe-pdf-target-gperf pdf-target-gperf +maybe-pdf-target-gperf: +@if target-gperf +maybe-pdf-target-gperf: pdf-target-gperf + +pdf-target-gperf: \ + configure-target-gperf + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-gperf + .PHONY: maybe-html-target-gperf html-target-gperf maybe-html-target-gperf: @if target-gperf @@ -35419,6 +43055,33 @@ install-info-target-gperf: \ @endif target-gperf +.PHONY: maybe-install-pdf-target-gperf install-pdf-target-gperf +maybe-install-pdf-target-gperf: +@if target-gperf +maybe-install-pdf-target-gperf: install-pdf-target-gperf + +install-pdf-target-gperf: \ + configure-target-gperf \ + pdf-target-gperf + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-gperf + .PHONY: maybe-install-html-target-gperf install-html-target-gperf maybe-install-html-target-gperf: @if target-gperf @@ -35578,6 +43241,9 @@ maintainer-clean-target-gperf: .PHONY: configure-target-examples maybe-configure-target-examples maybe-configure-target-examples: +@if gcc-bootstrap +configure-target-examples: stage_current +@endif gcc-bootstrap @if target-examples maybe-configure-target-examples: configure-target-examples configure-target-examples: @@ -35611,7 +43277,8 @@ configure-target-examples: libsrcdir="$$s/examples"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-examples @@ -35621,6 +43288,9 @@ configure-target-examples: .PHONY: all-target-examples maybe-all-target-examples maybe-all-target-examples: +@if gcc-bootstrap +all-target-examples: stage_current +@endif gcc-bootstrap @if target-examples TARGET-target-examples=all maybe-all-target-examples: all-target-examples @@ -35657,7 +43327,7 @@ install-target-examples: @endif target-examples -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-examples info-target-examples maybe-info-target-examples: @@ -35711,6 +43381,32 @@ dvi-target-examples: \ @endif target-examples +.PHONY: maybe-pdf-target-examples pdf-target-examples +maybe-pdf-target-examples: +@if target-examples +maybe-pdf-target-examples: pdf-target-examples + +pdf-target-examples: \ + configure-target-examples + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-examples + .PHONY: maybe-html-target-examples html-target-examples maybe-html-target-examples: @if target-examples @@ -35790,6 +43486,33 @@ install-info-target-examples: \ @endif target-examples +.PHONY: maybe-install-pdf-target-examples install-pdf-target-examples +maybe-install-pdf-target-examples: +@if target-examples +maybe-install-pdf-target-examples: install-pdf-target-examples + +install-pdf-target-examples: \ + configure-target-examples \ + pdf-target-examples + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-examples + .PHONY: maybe-install-html-target-examples install-html-target-examples maybe-install-html-target-examples: @if target-examples @@ -35949,6 +43672,9 @@ maintainer-clean-target-examples: .PHONY: configure-target-libffi maybe-configure-target-libffi maybe-configure-target-libffi: +@if gcc-bootstrap +configure-target-libffi: stage_current +@endif gcc-bootstrap @if target-libffi maybe-configure-target-libffi: configure-target-libffi configure-target-libffi: @@ -35982,7 +43708,8 @@ configure-target-libffi: libsrcdir="$$s/libffi"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libffi @@ -35992,6 +43719,9 @@ configure-target-libffi: .PHONY: all-target-libffi maybe-all-target-libffi maybe-all-target-libffi: +@if gcc-bootstrap +all-target-libffi: stage_current +@endif gcc-bootstrap @if target-libffi TARGET-target-libffi=all maybe-all-target-libffi: all-target-libffi @@ -36038,7 +43768,7 @@ install-target-libffi: installdirs @endif target-libffi -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libffi info-target-libffi maybe-info-target-libffi: @@ -36092,6 +43822,32 @@ dvi-target-libffi: \ @endif target-libffi +.PHONY: maybe-pdf-target-libffi pdf-target-libffi +maybe-pdf-target-libffi: +@if target-libffi +maybe-pdf-target-libffi: pdf-target-libffi + +pdf-target-libffi: \ + configure-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libffi + .PHONY: maybe-html-target-libffi html-target-libffi maybe-html-target-libffi: @if target-libffi @@ -36171,6 +43927,33 @@ install-info-target-libffi: \ @endif target-libffi +.PHONY: maybe-install-pdf-target-libffi install-pdf-target-libffi +maybe-install-pdf-target-libffi: +@if target-libffi +maybe-install-pdf-target-libffi: install-pdf-target-libffi + +install-pdf-target-libffi: \ + configure-target-libffi \ + pdf-target-libffi + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libffi + .PHONY: maybe-install-html-target-libffi install-html-target-libffi maybe-install-html-target-libffi: @if target-libffi @@ -36330,6 +44113,9 @@ maintainer-clean-target-libffi: .PHONY: configure-target-libjava maybe-configure-target-libjava maybe-configure-target-libjava: +@if gcc-bootstrap +configure-target-libjava: stage_current +@endif gcc-bootstrap @if target-libjava maybe-configure-target-libjava: configure-target-libjava configure-target-libjava: @@ -36363,7 +44149,8 @@ configure-target-libjava: libsrcdir="$$s/libjava"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libjava @@ -36373,6 +44160,9 @@ configure-target-libjava: .PHONY: all-target-libjava maybe-all-target-libjava maybe-all-target-libjava: +@if gcc-bootstrap +all-target-libjava: stage_current +@endif gcc-bootstrap @if target-libjava TARGET-target-libjava=all maybe-all-target-libjava: all-target-libjava @@ -36419,7 +44209,7 @@ install-target-libjava: installdirs @endif target-libjava -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libjava info-target-libjava maybe-info-target-libjava: @@ -36473,6 +44263,32 @@ dvi-target-libjava: \ @endif target-libjava +.PHONY: maybe-pdf-target-libjava pdf-target-libjava +maybe-pdf-target-libjava: +@if target-libjava +maybe-pdf-target-libjava: pdf-target-libjava + +pdf-target-libjava: \ + configure-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libjava + .PHONY: maybe-html-target-libjava html-target-libjava maybe-html-target-libjava: @if target-libjava @@ -36552,6 +44368,33 @@ install-info-target-libjava: \ @endif target-libjava +.PHONY: maybe-install-pdf-target-libjava install-pdf-target-libjava +maybe-install-pdf-target-libjava: +@if target-libjava +maybe-install-pdf-target-libjava: install-pdf-target-libjava + +install-pdf-target-libjava: \ + configure-target-libjava \ + pdf-target-libjava + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libjava + .PHONY: maybe-install-html-target-libjava install-html-target-libjava maybe-install-html-target-libjava: @if target-libjava @@ -36711,6 +44554,9 @@ maintainer-clean-target-libjava: .PHONY: configure-target-zlib maybe-configure-target-zlib maybe-configure-target-zlib: +@if gcc-bootstrap +configure-target-zlib: stage_current +@endif gcc-bootstrap @if target-zlib maybe-configure-target-zlib: configure-target-zlib configure-target-zlib: @@ -36744,7 +44590,8 @@ configure-target-zlib: libsrcdir="$$s/zlib"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-zlib @@ -36754,6 +44601,9 @@ configure-target-zlib: .PHONY: all-target-zlib maybe-all-target-zlib maybe-all-target-zlib: +@if gcc-bootstrap +all-target-zlib: stage_current +@endif gcc-bootstrap @if target-zlib TARGET-target-zlib=all maybe-all-target-zlib: all-target-zlib @@ -36800,7 +44650,7 @@ install-target-zlib: installdirs @endif target-zlib -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-zlib info-target-zlib maybe-info-target-zlib: @@ -36854,6 +44704,32 @@ dvi-target-zlib: \ @endif target-zlib +.PHONY: maybe-pdf-target-zlib pdf-target-zlib +maybe-pdf-target-zlib: +@if target-zlib +maybe-pdf-target-zlib: pdf-target-zlib + +pdf-target-zlib: \ + configure-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-zlib + .PHONY: maybe-html-target-zlib html-target-zlib maybe-html-target-zlib: @if target-zlib @@ -36933,6 +44809,33 @@ install-info-target-zlib: \ @endif target-zlib +.PHONY: maybe-install-pdf-target-zlib install-pdf-target-zlib +maybe-install-pdf-target-zlib: +@if target-zlib +maybe-install-pdf-target-zlib: install-pdf-target-zlib + +install-pdf-target-zlib: \ + configure-target-zlib \ + pdf-target-zlib + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-zlib + .PHONY: maybe-install-html-target-zlib install-html-target-zlib maybe-install-html-target-zlib: @if target-zlib @@ -37092,6 +44995,9 @@ maintainer-clean-target-zlib: .PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc maybe-configure-target-boehm-gc: +@if gcc-bootstrap +configure-target-boehm-gc: stage_current +@endif gcc-bootstrap @if target-boehm-gc maybe-configure-target-boehm-gc: configure-target-boehm-gc configure-target-boehm-gc: @@ -37125,7 +45031,8 @@ configure-target-boehm-gc: libsrcdir="$$s/boehm-gc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-boehm-gc @@ -37135,6 +45042,9 @@ configure-target-boehm-gc: .PHONY: all-target-boehm-gc maybe-all-target-boehm-gc maybe-all-target-boehm-gc: +@if gcc-bootstrap +all-target-boehm-gc: stage_current +@endif gcc-bootstrap @if target-boehm-gc TARGET-target-boehm-gc=all maybe-all-target-boehm-gc: all-target-boehm-gc @@ -37181,7 +45091,7 @@ install-target-boehm-gc: installdirs @endif target-boehm-gc -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-boehm-gc info-target-boehm-gc maybe-info-target-boehm-gc: @@ -37235,6 +45145,32 @@ dvi-target-boehm-gc: \ @endif target-boehm-gc +.PHONY: maybe-pdf-target-boehm-gc pdf-target-boehm-gc +maybe-pdf-target-boehm-gc: +@if target-boehm-gc +maybe-pdf-target-boehm-gc: pdf-target-boehm-gc + +pdf-target-boehm-gc: \ + configure-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-boehm-gc + .PHONY: maybe-html-target-boehm-gc html-target-boehm-gc maybe-html-target-boehm-gc: @if target-boehm-gc @@ -37314,6 +45250,33 @@ install-info-target-boehm-gc: \ @endif target-boehm-gc +.PHONY: maybe-install-pdf-target-boehm-gc install-pdf-target-boehm-gc +maybe-install-pdf-target-boehm-gc: +@if target-boehm-gc +maybe-install-pdf-target-boehm-gc: install-pdf-target-boehm-gc + +install-pdf-target-boehm-gc: \ + configure-target-boehm-gc \ + pdf-target-boehm-gc + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-boehm-gc + .PHONY: maybe-install-html-target-boehm-gc install-html-target-boehm-gc maybe-install-html-target-boehm-gc: @if target-boehm-gc @@ -37473,6 +45436,9 @@ maintainer-clean-target-boehm-gc: .PHONY: configure-target-qthreads maybe-configure-target-qthreads maybe-configure-target-qthreads: +@if gcc-bootstrap +configure-target-qthreads: stage_current +@endif gcc-bootstrap @if target-qthreads maybe-configure-target-qthreads: configure-target-qthreads configure-target-qthreads: @@ -37506,7 +45472,8 @@ configure-target-qthreads: libsrcdir="$$s/qthreads"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-qthreads @@ -37516,6 +45483,9 @@ configure-target-qthreads: .PHONY: all-target-qthreads maybe-all-target-qthreads maybe-all-target-qthreads: +@if gcc-bootstrap +all-target-qthreads: stage_current +@endif gcc-bootstrap @if target-qthreads TARGET-target-qthreads=all maybe-all-target-qthreads: all-target-qthreads @@ -37562,7 +45532,7 @@ install-target-qthreads: installdirs @endif target-qthreads -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-qthreads info-target-qthreads maybe-info-target-qthreads: @@ -37616,6 +45586,32 @@ dvi-target-qthreads: \ @endif target-qthreads +.PHONY: maybe-pdf-target-qthreads pdf-target-qthreads +maybe-pdf-target-qthreads: +@if target-qthreads +maybe-pdf-target-qthreads: pdf-target-qthreads + +pdf-target-qthreads: \ + configure-target-qthreads + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-qthreads + .PHONY: maybe-html-target-qthreads html-target-qthreads maybe-html-target-qthreads: @if target-qthreads @@ -37695,6 +45691,33 @@ install-info-target-qthreads: \ @endif target-qthreads +.PHONY: maybe-install-pdf-target-qthreads install-pdf-target-qthreads +maybe-install-pdf-target-qthreads: +@if target-qthreads +maybe-install-pdf-target-qthreads: install-pdf-target-qthreads + +install-pdf-target-qthreads: \ + configure-target-qthreads \ + pdf-target-qthreads + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-qthreads + .PHONY: maybe-install-html-target-qthreads install-html-target-qthreads maybe-install-html-target-qthreads: @if target-qthreads @@ -37854,6 +45877,9 @@ maintainer-clean-target-qthreads: .PHONY: configure-target-rda maybe-configure-target-rda maybe-configure-target-rda: +@if gcc-bootstrap +configure-target-rda: stage_current +@endif gcc-bootstrap @if target-rda maybe-configure-target-rda: configure-target-rda configure-target-rda: @@ -37887,7 +45913,8 @@ configure-target-rda: libsrcdir="$$s/rda"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-rda @@ -37897,6 +45924,9 @@ configure-target-rda: .PHONY: all-target-rda maybe-all-target-rda maybe-all-target-rda: +@if gcc-bootstrap +all-target-rda: stage_current +@endif gcc-bootstrap @if target-rda TARGET-target-rda=all maybe-all-target-rda: all-target-rda @@ -37943,7 +45973,7 @@ install-target-rda: installdirs @endif target-rda -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-rda info-target-rda maybe-info-target-rda: @@ -37997,6 +46027,32 @@ dvi-target-rda: \ @endif target-rda +.PHONY: maybe-pdf-target-rda pdf-target-rda +maybe-pdf-target-rda: +@if target-rda +maybe-pdf-target-rda: pdf-target-rda + +pdf-target-rda: \ + configure-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-rda + .PHONY: maybe-html-target-rda html-target-rda maybe-html-target-rda: @if target-rda @@ -38076,6 +46132,33 @@ install-info-target-rda: \ @endif target-rda +.PHONY: maybe-install-pdf-target-rda install-pdf-target-rda +maybe-install-pdf-target-rda: +@if target-rda +maybe-install-pdf-target-rda: install-pdf-target-rda + +install-pdf-target-rda: \ + configure-target-rda \ + pdf-target-rda + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-rda + .PHONY: maybe-install-html-target-rda install-html-target-rda maybe-install-html-target-rda: @if target-rda @@ -38235,6 +46318,9 @@ maintainer-clean-target-rda: .PHONY: configure-target-libada maybe-configure-target-libada maybe-configure-target-libada: +@if gcc-bootstrap +configure-target-libada: stage_current +@endif gcc-bootstrap @if target-libada maybe-configure-target-libada: configure-target-libada configure-target-libada: @@ -38268,7 +46354,8 @@ configure-target-libada: libsrcdir="$$s/libada"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libada @@ -38278,6 +46365,9 @@ configure-target-libada: .PHONY: all-target-libada maybe-all-target-libada maybe-all-target-libada: +@if gcc-bootstrap +all-target-libada: stage_current +@endif gcc-bootstrap @if target-libada TARGET-target-libada=all maybe-all-target-libada: all-target-libada @@ -38324,7 +46414,7 @@ install-target-libada: installdirs @endif target-libada -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libada info-target-libada maybe-info-target-libada: @@ -38378,6 +46468,32 @@ dvi-target-libada: \ @endif target-libada +.PHONY: maybe-pdf-target-libada pdf-target-libada +maybe-pdf-target-libada: +@if target-libada +maybe-pdf-target-libada: pdf-target-libada + +pdf-target-libada: \ + configure-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libada + .PHONY: maybe-html-target-libada html-target-libada maybe-html-target-libada: @if target-libada @@ -38457,6 +46573,33 @@ install-info-target-libada: \ @endif target-libada +.PHONY: maybe-install-pdf-target-libada install-pdf-target-libada +maybe-install-pdf-target-libada: +@if target-libada +maybe-install-pdf-target-libada: install-pdf-target-libada + +install-pdf-target-libada: \ + configure-target-libada \ + pdf-target-libada + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libada + .PHONY: maybe-install-html-target-libada install-html-target-libada maybe-install-html-target-libada: @if target-libada @@ -38616,6 +46759,9 @@ maintainer-clean-target-libada: .PHONY: configure-target-libgomp maybe-configure-target-libgomp maybe-configure-target-libgomp: +@if gcc-bootstrap +configure-target-libgomp: stage_current +@endif gcc-bootstrap @if target-libgomp maybe-configure-target-libgomp: configure-target-libgomp configure-target-libgomp: @@ -38649,7 +46795,8 @@ configure-target-libgomp: libsrcdir="$$s/libgomp"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ + --target=${target_alias} $${srcdiroption} \ || exit 1 @endif target-libgomp @@ -38659,6 +46806,9 @@ configure-target-libgomp: .PHONY: all-target-libgomp maybe-all-target-libgomp maybe-all-target-libgomp: +@if gcc-bootstrap +all-target-libgomp: stage_current +@endif gcc-bootstrap @if target-libgomp TARGET-target-libgomp=all maybe-all-target-libgomp: all-target-libgomp @@ -38705,7 +46855,7 @@ install-target-libgomp: installdirs @endif target-libgomp -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) .PHONY: maybe-info-target-libgomp info-target-libgomp maybe-info-target-libgomp: @@ -38759,6 +46909,32 @@ dvi-target-libgomp: \ @endif target-libgomp +.PHONY: maybe-pdf-target-libgomp pdf-target-libgomp +maybe-pdf-target-libgomp: +@if target-libgomp +maybe-pdf-target-libgomp: pdf-target-libgomp + +pdf-target-libgomp: \ + configure-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing pdf in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + pdf) \ + || exit 1 + +@endif target-libgomp + .PHONY: maybe-html-target-libgomp html-target-libgomp maybe-html-target-libgomp: @if target-libgomp @@ -38838,6 +47014,33 @@ install-info-target-libgomp: \ @endif target-libgomp +.PHONY: maybe-install-pdf-target-libgomp install-pdf-target-libgomp +maybe-install-pdf-target-libgomp: +@if target-libgomp +maybe-install-pdf-target-libgomp: install-pdf-target-libgomp + +install-pdf-target-libgomp: \ + configure-target-libgomp \ + pdf-target-libgomp + @: $(MAKE); $(unstage) + @[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + echo "Doing install-pdf in $(TARGET_SUBDIR)/libgomp" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgomp && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-pdf) \ + || exit 1 + +@endif target-libgomp + .PHONY: maybe-install-html-target-libgomp install-html-target-libgomp maybe-install-html-target-libgomp: @if target-libgomp @@ -38998,60 +47201,6 @@ maintainer-clean-target-libgomp: # ---------- @if gcc-no-bootstrap -# GCC has some more recursive targets, which trigger the old -# (but still current, until the toplevel bootstrap project -# is finished) compiler bootstrapping rules. - -GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap -.PHONY: $(GCC_STRAP_TARGETS) -$(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Bootstrapping the compiler"; \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - case "$@" in \ - *bootstrap4-lean ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3-lean ;; \ - *bootstrap4 ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3 ;; \ - *-lean ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare-lean ;; \ - * ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare ;; \ - esac; \ - $(HOST_EXPORTS) \ - echo "$$msg"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - -profiledbootstrap: all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - echo "Bootstrapping training compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Building feedback based compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - .PHONY: cross cross: all-build all-gas all-ld @r=`${PWD_COMMAND}`; export r; \ @@ -39121,7 +47270,7 @@ stage = : current_stage = "" @if gcc-bootstrap -unstage = [ -f stage_current ] || $(MAKE) `cat stage_last`-start +unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi current_stage = "`cat stage_current 2> /dev/null`" @endif gcc-bootstrap @@ -39149,36 +47298,9 @@ LEAN = false # 'touch' doesn't work right on some platforms. STAMP = echo timestamp > -# Only build the C compiler for stage1, because that is the only one that -# we can guarantee will build with the native compiler, and also it is the -# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), -# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them -# overrideable (for a bootstrap build stage1 also builds gcc.info). - -STAGE1_CFLAGS=@stage1_cflags@ -STAGE1_LANGUAGES=@stage1_languages@ - # We only want to compare .o files, so set this! objext = .o -# Flags to pass to stage2 and later makes. -POSTSTAGE1_FLAGS_TO_PASS = \ - CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ - STAGE_PREFIX=$$r/prev-gcc/ \ - CFLAGS="$(BOOT_CFLAGS)" \ - LIBCFLAGS="$(BOOT_CFLAGS)" \ - LDFLAGS="$(BOOT_LDFLAGS)" \ - ADAC="\$$(CC)" - -# For stage 1: -# * We force-disable intermodule optimizations, even if -# --enable-intermodule was passed, since the installed compiler probably -# can't handle them. Luckily, autoconf always respects -# the last argument when conflicting --enable arguments are passed. -# * Likewise, we force-disable coverage flags, since the installed compiler -# probably has never heard of them. -# * We build only C (and possibly Ada). - .PHONY: stage1-start stage1-end @@ -39212,6 +47334,16 @@ stage1-start:: mkdir stage1-gcc; \ mv stage1-gcc gcc @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage1-gmp ] || \ + mkdir stage1-gmp; \ + mv stage1-gmp gmp +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage1-mpfr ] || \ + mkdir stage1-mpfr; \ + mv stage1-mpfr mpfr +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage1-intl ] || \ mkdir stage1-intl; \ @@ -39272,6 +47404,16 @@ stage1-end:: cd $(HOST_SUBDIR); mv gcc stage1-gcc ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage1-gmp ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage1-mpfr ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage1-intl ; \ @@ -39307,7 +47449,7 @@ stage1-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 1. They are +# Bubble a bug fix through all the stages up to stage 1. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage1-bubble @@ -39336,6 +47478,7 @@ do-clean: clean-stage1 .PHONY: distclean-stage1 distclean-stage1:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage1 || rm -f stage_last rm -rf stage1-* @@ -39379,6 +47522,18 @@ stage2-start:: mv stage2-gcc gcc ; \ mv stage1-gcc prev-gcc || test -f stage1-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage2-gmp ] || \ + mkdir stage2-gmp; \ + mv stage2-gmp gmp ; \ + mv stage1-gmp prev-gmp || test -f stage1-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage2-mpfr ] || \ + mkdir stage2-mpfr; \ + mv stage2-mpfr mpfr ; \ + mv stage1-mpfr prev-mpfr || test -f stage1-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage2-intl ] || \ mkdir stage2-intl; \ @@ -39451,6 +47606,18 @@ stage2-end:: mv prev-gcc stage1-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage2-gmp ; \ + mv prev-gmp stage1-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage2-mpfr ; \ + mv prev-mpfr stage1-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage2-intl ; \ @@ -39493,7 +47660,7 @@ stage2-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 2. They are +# Bubble a bug fix through all the stages up to stage 2. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage2-bubble @@ -39543,6 +47710,7 @@ distclean-stage1:: distclean-stage2 .PHONY: distclean-stage2 distclean-stage2:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage2 || rm -f stage_last rm -rf stage2-* @@ -39586,6 +47754,18 @@ stage3-start:: mv stage3-gcc gcc ; \ mv stage2-gcc prev-gcc || test -f stage2-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage3-gmp ] || \ + mkdir stage3-gmp; \ + mv stage3-gmp gmp ; \ + mv stage2-gmp prev-gmp || test -f stage2-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage3-mpfr ] || \ + mkdir stage3-mpfr; \ + mv stage3-mpfr mpfr ; \ + mv stage2-mpfr prev-mpfr || test -f stage2-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage3-intl ] || \ mkdir stage3-intl; \ @@ -39658,6 +47838,18 @@ stage3-end:: mv prev-gcc stage2-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage3-gmp ; \ + mv prev-gmp stage2-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage3-mpfr ; \ + mv prev-mpfr stage2-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage3-intl ; \ @@ -39700,7 +47892,7 @@ stage3-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 3. They are +# Bubble a bug fix through all the stages up to stage 3. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage3-bubble @@ -39793,11 +47985,20 @@ distclean-stage2:: distclean-stage3 .PHONY: distclean-stage3 distclean-stage3:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage3 || rm -f stage_last rm -rf stage3-* compare .PHONY: cleanstrap -cleanstrap: distclean bootstrap +cleanstrap: do-distclean local-clean + echo stage3 > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target @endif gcc-bootstrap @@ -39839,6 +48040,18 @@ stage4-start:: mv stage4-gcc gcc ; \ mv stage3-gcc prev-gcc || test -f stage3-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stage4-gmp ] || \ + mkdir stage4-gmp; \ + mv stage4-gmp gmp ; \ + mv stage3-gmp prev-gmp || test -f stage3-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stage4-mpfr ] || \ + mkdir stage4-mpfr; \ + mv stage4-mpfr mpfr ; \ + mv stage3-mpfr prev-mpfr || test -f stage3-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stage4-intl ] || \ mkdir stage4-intl; \ @@ -39911,6 +48124,18 @@ stage4-end:: mv prev-gcc stage3-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stage4-gmp ; \ + mv prev-gmp stage3-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stage4-mpfr ; \ + mv prev-mpfr stage3-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stage4-intl ; \ @@ -39953,7 +48178,7 @@ stage4-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage 4. They are +# Bubble a bug fix through all the stages up to stage 4. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage4-bubble @@ -40046,6 +48271,7 @@ distclean-stage3:: distclean-stage4 .PHONY: distclean-stage4 distclean-stage4:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage4 || rm -f stage_last rm -rf stage4-* compare3 @@ -40089,6 +48315,18 @@ stageprofile-start:: mv stageprofile-gcc gcc ; \ mv stage1-gcc prev-gcc || test -f stage1-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stageprofile-gmp ] || \ + mkdir stageprofile-gmp; \ + mv stageprofile-gmp gmp ; \ + mv stage1-gmp prev-gmp || test -f stage1-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stageprofile-mpfr ] || \ + mkdir stageprofile-mpfr; \ + mv stageprofile-mpfr mpfr ; \ + mv stage1-mpfr prev-mpfr || test -f stage1-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stageprofile-intl ] || \ mkdir stageprofile-intl; \ @@ -40161,6 +48399,18 @@ stageprofile-end:: mv prev-gcc stage1-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stageprofile-gmp ; \ + mv prev-gmp stage1-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stageprofile-mpfr ; \ + mv prev-mpfr stage1-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stageprofile-intl ; \ @@ -40203,7 +48453,7 @@ stageprofile-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage profile. They are +# Bubble a bug fix through all the stages up to stage profile. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stageprofile-bubble @@ -40232,6 +48482,7 @@ distclean-stage1:: distclean-stageprofile .PHONY: distclean-stageprofile distclean-stageprofile:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stageprofile || rm -f stage_last rm -rf stageprofile-* @@ -40275,6 +48526,18 @@ stagefeedback-start:: mv stagefeedback-gcc gcc ; \ mv stageprofile-gcc prev-gcc || test -f stageprofile-lean @endif gcc +@if gmp + @cd $(HOST_SUBDIR); [ -d stagefeedback-gmp ] || \ + mkdir stagefeedback-gmp; \ + mv stagefeedback-gmp gmp ; \ + mv stageprofile-gmp prev-gmp || test -f stageprofile-lean +@endif gmp +@if mpfr + @cd $(HOST_SUBDIR); [ -d stagefeedback-mpfr ] || \ + mkdir stagefeedback-mpfr; \ + mv stagefeedback-mpfr mpfr ; \ + mv stageprofile-mpfr prev-mpfr || test -f stageprofile-lean +@endif mpfr @if intl @cd $(HOST_SUBDIR); [ -d stagefeedback-intl ] || \ mkdir stagefeedback-intl; \ @@ -40347,6 +48610,18 @@ stagefeedback-end:: mv prev-gcc stageprofile-gcc ; : ; \ fi @endif gcc +@if gmp + @if test -d $(HOST_SUBDIR)/gmp ; then \ + cd $(HOST_SUBDIR); mv gmp stagefeedback-gmp ; \ + mv prev-gmp stageprofile-gmp ; : ; \ + fi +@endif gmp +@if mpfr + @if test -d $(HOST_SUBDIR)/mpfr ; then \ + cd $(HOST_SUBDIR); mv mpfr stagefeedback-mpfr ; \ + mv prev-mpfr stageprofile-mpfr ; : ; \ + fi +@endif mpfr @if intl @if test -d $(HOST_SUBDIR)/intl ; then \ cd $(HOST_SUBDIR); mv intl stagefeedback-intl ; \ @@ -40389,7 +48664,7 @@ stagefeedback-end:: fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage feedback. They are +# Bubble a bug fix through all the stages up to stage feedback. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stagefeedback-bubble @@ -40439,6 +48714,7 @@ distclean-stageprofile:: distclean-stagefeedback .PHONY: distclean-stagefeedback distclean-stagefeedback:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stagefeedback || rm -f stage_last rm -rf stagefeedback-* @@ -40466,13 +48742,18 @@ do-distclean: distclean-stage1 # not work as a dependency, just as the minimum necessary to avoid errors. stage_last: $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble -@endif gcc-bootstrap + +# Same as unstage, but not phony and defaulting to stage1-start. We place +# it in the dependency so that for example `make -j3 all-gcc' works. +stage_current: + @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi .PHONY: restrap restrap: @: $(MAKE); $(stage) - rm -rf stage1-$(TARGET_SUBDIR) stage2 stage3 stage4 stageprofile stagefeedback + rm -rf stage1-$(TARGET_SUBDIR) stage2-* stage3-* stage4-* stageprofile-* stagefeedback-* $(MAKE) $(RECURSE_FLAGS_TO_PASS) all +@endif gcc-bootstrap # -------------------------------------- # Dependencies between different modules @@ -40483,8 +48764,13 @@ restrap: configure-target-libstdc++-v3: stage_last configure-target-libmudflap: stage_last configure-target-libssp: stage_last -configure-target-libgcc-math: stage_last configure-target-newlib: stage_last +configure-stage1-target-libgcc: maybe-all-stage1-gcc +configure-stage2-target-libgcc: maybe-all-stage2-gcc +configure-stage3-target-libgcc: maybe-all-stage3-gcc +configure-stage4-target-libgcc: maybe-all-stage4-gcc +configure-stageprofile-target-libgcc: maybe-all-stageprofile-gcc +configure-stagefeedback-target-libgcc: maybe-all-stagefeedback-gcc configure-target-libgfortran: stage_last configure-target-libobjc: stage_last configure-target-libtermcap: stage_last @@ -40507,8 +48793,8 @@ configure-target-libgomp: stage_last configure-target-libstdc++-v3: maybe-all-gcc configure-target-libmudflap: maybe-all-gcc configure-target-libssp: maybe-all-gcc -configure-target-libgcc-math: maybe-all-gcc configure-target-newlib: maybe-all-gcc +configure-target-libgcc: maybe-all-gcc configure-target-libgfortran: maybe-all-gcc configure-target-libobjc: maybe-all-gcc configure-target-libtermcap: maybe-all-gcc @@ -40528,42 +48814,6 @@ configure-target-libgomp: maybe-all-gcc @endif gcc-no-bootstrap - -configure-target-boehm-gc: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-gperf: maybe-all-target-newlib maybe-all-target-libgloss -configure-target-gperf: maybe-all-target-libstdc++-v3 - -configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libgfortran: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss -configure-target-libjava: maybe-all-target-libstdc++-v3 - -configure-target-libmudflap: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libobjc: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libssp: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libstdc++-v3: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-zlib: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-examples: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-libtermcap: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-rda: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss - -configure-target-qthreads: maybe-all-target-newlib maybe-all-target-libgloss - - # There are two types of dependencies here: 'hard' dependencies, where one # module simply won't build without the other; and 'soft' dependencies, where # if the depended-on module is missing, the depending module will do without @@ -40630,6 +48880,14 @@ all-stage3-gcc: all-stage3-libiberty all-stage4-gcc: all-stage4-libiberty all-stageprofile-gcc: all-stageprofile-libiberty all-stagefeedback-gcc: all-stagefeedback-libiberty +all-gcc: maybe-all-gmp + +all-stage1-gcc: maybe-all-stage1-gmp +all-stage2-gcc: maybe-all-stage2-gmp +all-stage3-gcc: maybe-all-stage3-gmp +all-stage4-gcc: maybe-all-stage4-gmp +all-stageprofile-gcc: maybe-all-stageprofile-gmp +all-stagefeedback-gcc: maybe-all-stagefeedback-gmp all-gcc: maybe-all-intl all-stage1-gcc: maybe-all-stage1-intl @@ -40638,6 +48896,14 @@ all-stage3-gcc: maybe-all-stage3-intl all-stage4-gcc: maybe-all-stage4-intl all-stageprofile-gcc: maybe-all-stageprofile-intl all-stagefeedback-gcc: maybe-all-stagefeedback-intl +all-gcc: maybe-all-mpfr + +all-stage1-gcc: maybe-all-stage1-mpfr +all-stage2-gcc: maybe-all-stage2-mpfr +all-stage3-gcc: maybe-all-stage3-mpfr +all-stage4-gcc: maybe-all-stage4-mpfr +all-stageprofile-gcc: maybe-all-stageprofile-mpfr +all-stagefeedback-gcc: maybe-all-stagefeedback-mpfr all-gcc: maybe-all-build-texinfo all-stage1-gcc: maybe-all-build-texinfo @@ -40646,7 +48912,6 @@ all-stage3-gcc: maybe-all-build-texinfo all-stage4-gcc: maybe-all-build-texinfo all-stageprofile-gcc: maybe-all-build-texinfo all-stagefeedback-gcc: maybe-all-build-texinfo -all-prebootstrap: maybe-all-build-texinfo all-gcc: maybe-all-build-bison all-stage1-gcc: maybe-all-build-bison @@ -40655,7 +48920,6 @@ all-stage3-gcc: maybe-all-build-bison all-stage4-gcc: maybe-all-build-bison all-stageprofile-gcc: maybe-all-build-bison all-stagefeedback-gcc: maybe-all-build-bison -all-prebootstrap: maybe-all-build-bison all-gcc: maybe-all-build-byacc all-stage1-gcc: maybe-all-build-byacc @@ -40664,7 +48928,6 @@ all-stage3-gcc: maybe-all-build-byacc all-stage4-gcc: maybe-all-build-byacc all-stageprofile-gcc: maybe-all-build-byacc all-stagefeedback-gcc: maybe-all-build-byacc -all-prebootstrap: maybe-all-build-byacc all-gcc: maybe-all-build-flex all-stage1-gcc: maybe-all-build-flex @@ -40673,7 +48936,6 @@ all-stage3-gcc: maybe-all-build-flex all-stage4-gcc: maybe-all-build-flex all-stageprofile-gcc: maybe-all-build-flex all-stagefeedback-gcc: maybe-all-build-flex -all-prebootstrap: maybe-all-build-flex all-gcc: maybe-all-build-libiberty all-stage1-gcc: maybe-all-build-libiberty @@ -40682,7 +48944,6 @@ all-stage3-gcc: maybe-all-build-libiberty all-stage4-gcc: maybe-all-build-libiberty all-stageprofile-gcc: maybe-all-build-libiberty all-stagefeedback-gcc: maybe-all-build-libiberty -all-prebootstrap: maybe-all-build-libiberty all-gcc: maybe-all-build-fixincludes all-stage1-gcc: maybe-all-build-fixincludes @@ -40691,7 +48952,6 @@ all-stage3-gcc: maybe-all-build-fixincludes all-stage4-gcc: maybe-all-build-fixincludes all-stageprofile-gcc: maybe-all-build-fixincludes all-stagefeedback-gcc: maybe-all-build-fixincludes -all-prebootstrap: maybe-all-build-fixincludes all-gcc: maybe-all-zlib all-stage1-gcc: maybe-all-stage1-zlib @@ -40760,10 +49020,20 @@ all-stageprofile-libcpp: maybe-all-stageprofile-intl all-stagefeedback-libcpp: maybe-all-stagefeedback-intl all-fixincludes: maybe-all-libiberty all-gnattools: maybe-all-target-libada +configure-mpfr: maybe-all-gmp + +configure-stage1-mpfr: maybe-all-stage1-gmp +configure-stage2-mpfr: maybe-all-stage2-gmp +configure-stage3-mpfr: maybe-all-stage3-gmp +configure-stage4-mpfr: maybe-all-stage4-gmp +configure-stageprofile-mpfr: maybe-all-stageprofile-gmp +configure-stagefeedback-mpfr: maybe-all-stagefeedback-gmp +configure-gdb: maybe-configure-intl configure-gdb: maybe-configure-sim +configure-gdb: maybe-all-bfd +all-gdb: maybe-all-intl all-gdb: maybe-all-libiberty all-gdb: maybe-all-opcodes -all-gdb: maybe-all-bfd all-gdb: maybe-all-readline all-gdb: maybe-all-build-bison all-gdb: maybe-all-build-byacc @@ -40781,6 +49051,14 @@ configure-stage3-bfd: configure-stage3-libiberty configure-stage4-bfd: configure-stage4-libiberty configure-stageprofile-bfd: configure-stageprofile-libiberty configure-stagefeedback-bfd: configure-stagefeedback-libiberty +configure-bfd: maybe-configure-intl + +configure-stage1-bfd: maybe-configure-stage1-intl +configure-stage2-bfd: maybe-configure-stage2-intl +configure-stage3-bfd: maybe-configure-stage3-intl +configure-stage4-bfd: maybe-configure-stage4-intl +configure-stageprofile-bfd: maybe-configure-stageprofile-intl +configure-stagefeedback-bfd: maybe-configure-stagefeedback-intl all-bfd: maybe-all-libiberty all-stage1-bfd: maybe-all-stage1-libiberty @@ -40797,6 +49075,14 @@ all-stage3-bfd: maybe-all-stage3-intl all-stage4-bfd: maybe-all-stage4-intl all-stageprofile-bfd: maybe-all-stageprofile-intl all-stagefeedback-bfd: maybe-all-stagefeedback-intl +configure-binutils: maybe-configure-intl + +configure-stage1-binutils: maybe-configure-stage1-intl +configure-stage2-binutils: maybe-configure-stage2-intl +configure-stage3-binutils: maybe-configure-stage3-intl +configure-stage4-binutils: maybe-configure-stage4-intl +configure-stageprofile-binutils: maybe-configure-stageprofile-intl +configure-stagefeedback-binutils: maybe-configure-stagefeedback-intl all-binutils: maybe-all-libiberty all-stage1-binutils: maybe-all-stage1-libiberty @@ -40829,7 +49115,6 @@ all-stage3-binutils: maybe-all-build-flex all-stage4-binutils: maybe-all-build-flex all-stageprofile-binutils: maybe-all-build-flex all-stagefeedback-binutils: maybe-all-build-flex -all-prebootstrap: maybe-all-build-flex all-binutils: maybe-all-build-bison all-stage1-binutils: maybe-all-build-bison @@ -40838,7 +49123,6 @@ all-stage3-binutils: maybe-all-build-bison all-stage4-binutils: maybe-all-build-bison all-stageprofile-binutils: maybe-all-build-bison all-stagefeedback-binutils: maybe-all-build-bison -all-prebootstrap: maybe-all-build-bison all-binutils: maybe-all-build-byacc all-stage1-binutils: maybe-all-build-byacc @@ -40847,7 +49131,6 @@ all-stage3-binutils: maybe-all-build-byacc all-stage4-binutils: maybe-all-build-byacc all-stageprofile-binutils: maybe-all-build-byacc all-stagefeedback-binutils: maybe-all-build-byacc -all-prebootstrap: maybe-all-build-byacc all-binutils: maybe-all-intl all-stage1-binutils: maybe-all-stage1-intl @@ -40858,6 +49141,14 @@ all-stageprofile-binutils: maybe-all-stageprofile-intl all-stagefeedback-binutils: maybe-all-stagefeedback-intl install-binutils: maybe-install-opcodes install-opcodes: maybe-install-bfd +configure-gas: maybe-configure-intl + +configure-stage1-gas: maybe-configure-stage1-intl +configure-stage2-gas: maybe-configure-stage2-intl +configure-stage3-gas: maybe-configure-stage3-intl +configure-stage4-gas: maybe-configure-stage4-intl +configure-stageprofile-gas: maybe-configure-stageprofile-intl +configure-stagefeedback-gas: maybe-configure-stagefeedback-intl all-gas: maybe-all-libiberty all-stage1-gas: maybe-all-stage1-libiberty @@ -40890,10 +49181,19 @@ all-stage3-gas: maybe-all-stage3-intl all-stage4-gas: maybe-all-stage4-intl all-stageprofile-gas: maybe-all-stageprofile-intl all-stagefeedback-gas: maybe-all-stagefeedback-intl +configure-gprof: maybe-configure-intl all-gprof: maybe-all-libiberty all-gprof: maybe-all-bfd all-gprof: maybe-all-opcodes all-gprof: maybe-all-intl +configure-ld: maybe-configure-intl + +configure-stage1-ld: maybe-configure-stage1-intl +configure-stage2-ld: maybe-configure-stage2-intl +configure-stage3-ld: maybe-configure-stage3-intl +configure-stage4-ld: maybe-configure-stage4-intl +configure-stageprofile-ld: maybe-configure-stageprofile-intl +configure-stagefeedback-ld: maybe-configure-stagefeedback-intl all-ld: maybe-all-libiberty all-stage1-ld: maybe-all-stage1-libiberty @@ -40926,7 +49226,6 @@ all-stage3-ld: maybe-all-build-bison all-stage4-ld: maybe-all-build-bison all-stageprofile-ld: maybe-all-build-bison all-stagefeedback-ld: maybe-all-build-bison -all-prebootstrap: maybe-all-build-bison all-ld: maybe-all-build-byacc all-stage1-ld: maybe-all-build-byacc @@ -40935,7 +49234,6 @@ all-stage3-ld: maybe-all-build-byacc all-stage4-ld: maybe-all-build-byacc all-stageprofile-ld: maybe-all-build-byacc all-stagefeedback-ld: maybe-all-build-byacc -all-prebootstrap: maybe-all-build-byacc all-ld: maybe-all-build-flex all-stage1-ld: maybe-all-build-flex @@ -40944,7 +49242,6 @@ all-stage3-ld: maybe-all-build-flex all-stage4-ld: maybe-all-build-flex all-stageprofile-ld: maybe-all-build-flex all-stagefeedback-ld: maybe-all-build-flex -all-prebootstrap: maybe-all-build-flex all-ld: maybe-all-intl all-stage1-ld: maybe-all-stage1-intl @@ -40953,6 +49250,14 @@ all-stage3-ld: maybe-all-stage3-intl all-stage4-ld: maybe-all-stage4-intl all-stageprofile-ld: maybe-all-stageprofile-intl all-stagefeedback-ld: maybe-all-stagefeedback-intl +configure-opcodes: maybe-configure-intl + +configure-stage1-opcodes: maybe-configure-stage1-intl +configure-stage2-opcodes: maybe-configure-stage2-intl +configure-stage3-opcodes: maybe-configure-stage3-intl +configure-stage4-opcodes: maybe-configure-stage4-intl +configure-stageprofile-opcodes: maybe-configure-stageprofile-intl +configure-stagefeedback-opcodes: maybe-configure-stagefeedback-intl all-opcodes: maybe-all-bfd all-stage1-opcodes: maybe-all-stage1-bfd @@ -40969,6 +49274,14 @@ all-stage3-opcodes: maybe-all-stage3-libiberty all-stage4-opcodes: maybe-all-stage4-libiberty all-stageprofile-opcodes: maybe-all-stageprofile-libiberty all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty +all-opcodes: maybe-all-intl + +all-stage1-opcodes: maybe-all-stage1-intl +all-stage2-opcodes: maybe-all-stage2-intl +all-stage3-opcodes: maybe-all-stage3-intl +all-stage4-opcodes: maybe-all-stage4-intl +all-stageprofile-opcodes: maybe-all-stageprofile-intl +all-stagefeedback-opcodes: maybe-all-stagefeedback-intl all-dejagnu: maybe-all-tcl all-dejagnu: maybe-all-expect all-dejagnu: maybe-all-tk @@ -40990,6 +49303,8 @@ all-sid: maybe-all-tcl all-sid: maybe-all-tk install-sid: maybe-install-tcl install-sid: maybe-install-tk +configure-sim: maybe-configure-intl +all-sim: maybe-all-intl all-sim: maybe-all-libiberty all-sim: maybe-all-bfd all-sim: maybe-all-opcodes @@ -41044,29 +49359,88 @@ all-target-libjava: maybe-all-target-zlib all-target-libjava: maybe-all-target-boehm-gc all-target-libjava: maybe-all-target-qthreads all-target-libjava: maybe-all-target-libffi +configure-target-libobjc: maybe-configure-target-boehm-gc all-target-libobjc: maybe-all-target-libiberty +all-target-libobjc: maybe-all-target-boehm-gc all-target-libstdc++-v3: maybe-all-target-libiberty all-target-libgloss: maybe-configure-target-newlib all-target-winsup: maybe-all-target-libiberty all-target-winsup: maybe-all-target-libtermcap -# Non-toplevel bootstrap rules must depend on several packages, to be built -# before gcc. Another wart that will go away, hopefully soon. -@if gcc-no-bootstrap +# Dependencies for target modules on other target modules are +# described by lang_env_dependencies; the defaults apply to anything +# not mentioned there. -all-prebootstrap: maybe-all-bfd -all-prebootstrap: maybe-all-opcodes -all-prebootstrap: maybe-all-binutils -all-prebootstrap: maybe-all-gas -all-prebootstrap: maybe-all-intl -all-prebootstrap: maybe-all-ld -all-prebootstrap: maybe-all-libcpp -all-prebootstrap: maybe-all-libdecnumber -all-prebootstrap: maybe-all-libiberty -all-prebootstrap: maybe-all-zlib + +@if gcc-bootstrap +@endif gcc-bootstrap + +@if gcc-no-bootstrap +configure-target-libstdc++-v3: maybe-all-target-libgcc +configure-target-libmudflap: maybe-all-target-libgcc +configure-target-libssp: maybe-all-target-libgcc +configure-target-newlib: maybe-all-target-libgcc +configure-target-libgfortran: maybe-all-target-libgcc +configure-target-libobjc: maybe-all-target-libgcc +configure-target-libtermcap: maybe-all-target-libgcc +configure-target-winsup: maybe-all-target-libgcc +configure-target-libgloss: maybe-all-target-libgcc +configure-target-libiberty: maybe-all-target-libgcc +configure-target-gperf: maybe-all-target-libgcc +configure-target-examples: maybe-all-target-libgcc +configure-target-libffi: maybe-all-target-libgcc +configure-target-libjava: maybe-all-target-libgcc +configure-target-zlib: maybe-all-target-libgcc +configure-target-boehm-gc: maybe-all-target-libgcc +configure-target-qthreads: maybe-all-target-libgcc +configure-target-rda: maybe-all-target-libgcc +configure-target-libada: maybe-all-target-libgcc +configure-target-libgomp: maybe-all-target-libgcc @endif gcc-no-bootstrap + +configure-target-libstdc++-v3: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libmudflap: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libssp: maybe-all-target-newlib maybe-all-target-libgloss + + + +configure-target-libgfortran: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libobjc: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libtermcap: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss + + + +configure-target-gperf: maybe-all-target-newlib maybe-all-target-libgloss +configure-target-gperf: maybe-all-target-libstdc++-v3 + +configure-target-examples: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss +configure-target-libjava: maybe-all-target-libstdc++-v3 + +configure-target-zlib: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-boehm-gc: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-qthreads: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-rda: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss + +configure-target-libgomp: maybe-all-target-newlib maybe-all-target-libgloss + + CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ GDB_TK = @GDB_TK@ INSTALL_GDB_TK = @INSTALL_GDB_TK@ @@ -41097,7 +49471,7 @@ config.status: configure # Rebuilding configure. AUTOCONF = autoconf -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 cd $(srcdir) && $(AUTOCONF) # ------------------------------ diff --git a/contrib/binutils/Makefile.tpl b/contrib/binutils/Makefile.tpl index b83d8d5abd9..6164a4164c6 100644 --- a/contrib/binutils/Makefile.tpl +++ b/contrib/binutils/Makefile.tpl @@ -28,11 +28,17 @@ in # ------------------------------- VPATH=@srcdir@ -build_alias=@build_alias@ +build_alias=@build_noncanonical@ +build_vendor=@build_vendor@ +build_os=@build_os@ build=@build@ -host_alias=@host_alias@ +host_alias=@host_noncanonical@ +host_vendor=@host_vendor@ +host_os=@host_os@ host=@host@ -target_alias=@target_alias@ +target_alias=@target_noncanonical@ +target_vendor=@target_vendor@ +target_os=@target_os@ target=@target@ program_transform_name = @program_transform_name@ @@ -55,6 +61,7 @@ oldincludedir = @oldincludedir@ infodir = @infodir@ datarootdir = @datarootdir@ docdir = @docdir@ +pdfdir = @pdfdir@ htmldir = @htmldir@ mandir = @mandir@ man1dir = $(mandir)/man1 @@ -73,6 +80,9 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ LN = @LN@ LN_S = @LN_S@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ # ------------------------------------------------- # Miscellaneous non-standard autoconf-set variables @@ -180,7 +190,8 @@ POSTSTAGE1_HOST_EXPORTS = \ CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \ $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ \ - -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; + -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \ + LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS; # Target libraries are put under this directory: TARGET_SUBDIR = @target_subdir@ @@ -288,13 +299,26 @@ RANLIB = @RANLIB@ STRIP = @STRIP@ WINDRES = @WINDRES@ +GNATBIND = @GNATBIND@ +GNATMAKE = @GNATMAKE@ + CFLAGS = @CFLAGS@ -LDFLAGS = +LDFLAGS = @LDFLAGS@ LIBCFLAGS = $(CFLAGS) CXXFLAGS = @CXXFLAGS@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates PICFLAG = +# Only build the C compiler for stage1, because that is the only one that +# we can guarantee will build with the native compiler, and also it is the +# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). + +STAGE1_CFLAGS=@stage1_cflags@ +STAGE1_CHECKING=@stage1_checking@ +STAGE1_LANGUAGES=@stage1_languages@ + # ----------------------------------------------- # Programs producing files for the TARGET machine # ----------------------------------------------- @@ -426,6 +450,14 @@ X11_FLAGS_TO_PASS = \ 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' +# Flags to pass to stage2 and later makes. + +POSTSTAGE1_FLAGS_TO_PASS = \ + CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ + GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \ + LDFLAGS="$(BOOT_LDFLAGS)" \ + "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" + # Flags to pass down to makes which are built with the target environment. # The double $ decreases the length of the command line; those variables # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The @@ -506,9 +538,10 @@ all-host: maybe-all-[+module+][+ IF bootstrap +] .PHONY: all-target [+ FOR target_modules +][+ IF bootstrap +] -@if [+module+]-no-bootstrap[+ ENDIF bootstrap +] +@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +] all-target: maybe-all-target-[+module+][+ IF bootstrap +] -@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR target_modules +] +@endif target-[+module+]-no-bootstrap[+ + ENDIF bootstrap +][+ ENDFOR target_modules +] # Do a target for all the subdirectories. A ``make do-X'' will do a # ``make X'' in all subdirectories (because, in general, there is a @@ -535,12 +568,14 @@ do-[+make_target+]: # Here are the targets which correspond to the do-X targets. -.PHONY: info installcheck dvi html install-info install-html +.PHONY: info installcheck dvi pdf html +.PHONY: install-info install-pdf install-html .PHONY: clean distclean mostlyclean maintainer-clean realclean .PHONY: local-clean local-distclean local-maintainer-clean info: do-info installcheck: do-installcheck dvi: do-dvi +pdf: do-pdf html: do-html # Make sure makeinfo is built before we do a `make info', if we're @@ -553,6 +588,8 @@ install-info: do-install-info dir.info $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ else true ; fi +install-pdf: do-install-pdf + install-html: do-install-html local-clean: @@ -585,11 +622,6 @@ maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean maintainer-clean: local-distclean realclean: maintainer-clean -# Extra dependency for clean-target, owing to the mixed nature of gcc. -clean-target: clean-target-libgcc -clean-target-libgcc: - test ! -d gcc || (cd gcc && $(MAKE) $@) - # Check target. .PHONY: check do-check @@ -720,14 +752,12 @@ TAGS: do-TAGS [+ DEFINE configure +] .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]: +@if gcc-bootstrap +configure-[+prefix+][+module+]: stage_current +@endif gcc-bootstrap @if [+prefix+][+module+] maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+] -configure-[+prefix+][+module+]: [+ IF bootstrap +] -@endif [+prefix+][+module+] -@if [+prefix+][+module+]-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif [+prefix+][+module+]-bootstrap -@if [+prefix+][+module+][+ ELSE bootstrap +] +configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +] @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ @@ -759,7 +789,8 @@ configure-[+prefix+][+module+]: [+ IF bootstrap +] libsrcdir="$$s/[+module+]"; \ [+ IF no-config-site +]rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \ - [+args+] $${srcdiroption} [+extra_configure_flags+] \ + [+args+] --build=${build_alias} --host=[+host_alias+] \ + --target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \ || exit 1 @endif [+prefix+][+module+] @@ -790,6 +821,8 @@ configure-stage[+id+]-[+prefix+][+module+]: [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ [+exports+][+ IF prev +] \ [+poststage1_exports+][+ ENDIF prev +] \ + CFLAGS="[+stage_cflags+]"; export CFLAGS; \ + LIBCFLAGS="[+stage_cflags+]"; export LIBCFLAGS; \ echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \ $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ cd [+subdir+]/[+module+] || exit 1; \ @@ -801,7 +834,9 @@ configure-stage[+id+]-[+prefix+][+module+]: srcdiroption="--srcdir=$${topdir}/[+module+]"; \ libsrcdir="$$s/[+module+]"; \ $(SHELL) $${libsrcdir}/configure \ - [+args+] $${srcdiroption} \ + [+args+] --build=${build_alias} --host=[+host_alias+] \ + --target=[+target_alias+] $${srcdiroption} \ + [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \ [+stage_configure_flags+] [+extra_configure_flags+] @endif [+prefix+][+module+]-bootstrap [+ ENDFOR bootstrap_stage +] @@ -811,16 +846,14 @@ configure-stage[+id+]-[+prefix+][+module+]: [+ DEFINE all +] .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]: +@if gcc-bootstrap +all-[+prefix+][+module+]: stage_current +@endif gcc-bootstrap @if [+prefix+][+module+] TARGET-[+prefix+][+module+]=[+ - IF target +][+target+][+ ELSE +]all[+ ENDIF target +] + IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +] maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+] -all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +] -@endif [+prefix+][+module+] -@if [+prefix+][+module+]-bootstrap - @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi -@endif [+prefix+][+module+]-bootstrap -@if [+prefix+][+module+][+ ELSE bootstrap +] +all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +] @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ @@ -846,21 +879,25 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] [+exports+][+ IF prev +] \ [+poststage1_exports+][+ ENDIF prev +] \ cd [+subdir+]/[+module+] && \ - $(MAKE) [+args+] [+ IF prev - +][+poststage1_args+][+ ENDIF prev - +] [+stage_make_flags+] [+extra_make_flags+] \ + $(MAKE) [+args+] \ + CFLAGS="[+stage_cflags+]" LIBCFLAGS="[+stage_cflags+]" [+ + IF prev +][+poststage1_args+][+ ENDIF prev + +] [+extra_make_flags+] \ $(TARGET-stage[+id+]-[+prefix+][+module+]) maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+] clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+] clean-stage[+id+]-[+prefix+][+module+]: - @[ -f [+subdir+]/[+module+]/Makefile ] || [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] \ - || exit 0 ; \ - [ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start; \ + @if [ $(current_stage) = stage[+id+] ]; then \ + [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \ + else \ + [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \ + $(MAKE) stage[+id+]-start; \ + fi; \ cd [+subdir+]/[+module+] && \ $(MAKE) [+args+] [+ IF prev +] \ [+poststage1_args+] [+ ENDIF prev +] \ - [+stage_make_flags+] [+extra_make_flags+] clean + [+extra_make_flags+] clean @endif [+prefix+][+module+]-bootstrap [+ ENDFOR bootstrap_stage +] @@ -872,6 +909,8 @@ clean-stage[+id+]-[+prefix+][+module+]: # -------------------------------------- [+ FOR build_modules +] [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" + host_alias=(get "host" "${build_alias}") + target_alias=(get "target" "${target_alias}") args="$(BUILD_CONFIGARGS)" no-config-site=true +] [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +] @@ -884,6 +923,8 @@ clean-stage[+id+]-[+prefix+][+module+]: [+ configure prefix="" subdir="$(HOST_SUBDIR)" exports="$(HOST_EXPORTS)" poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" + host_alias=(get "host" "${host_alias}") + target_alias=(get "target" "${target_alias}") args="$(HOST_CONFIGARGS)" +] [+ all prefix="" subdir="$(HOST_SUBDIR)" @@ -937,7 +978,7 @@ install-[+module+]: installdirs [+ ENDIF no_install +] @endif [+module+] -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) [+ FOR recursive_targets +] .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] maybe-[+make_target+]-[+module+]: @@ -981,6 +1022,8 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" check_multilibs=true exports="$(RAW_CXX_TARGET_EXPORTS)" + host_alias=(get "host" "${target_alias}") + target_alias=(get "target" "${target_alias}") args="$(TARGET_CONFIGARGS)" no-config-site=true +] [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" @@ -990,6 +1033,8 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" check_multilibs=true exports="$(NORMAL_TARGET_EXPORTS)" + host_alias=(get "host" "${target_alias}") + target_alias=(get "target" "${target_alias}") args="$(TARGET_CONFIGARGS)" no-config-site=true +] [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" @@ -1045,7 +1090,7 @@ ENDIF raw_cxx +] [+ ENDIF no_install +] @endif target-[+module+] -# Other targets (info, dvi, etc.) +# Other targets (info, dvi, pdf, etc.) [+ FOR recursive_targets +] .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] maybe-[+make_target+]-target-[+module+]: @@ -1089,60 +1134,6 @@ ENDIF raw_cxx +] # ---------- @if gcc-no-bootstrap -# GCC has some more recursive targets, which trigger the old -# (but still current, until the toplevel bootstrap project -# is finished) compiler bootstrapping rules. - -GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap -.PHONY: $(GCC_STRAP_TARGETS) -$(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Bootstrapping the compiler"; \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - case "$@" in \ - *bootstrap4-lean ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3-lean ;; \ - *bootstrap4 ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3 ;; \ - *-lean ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare-lean ;; \ - * ) \ - msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare ;; \ - esac; \ - $(HOST_EXPORTS) \ - echo "$$msg"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - -profiledbootstrap: all-prebootstrap configure-gcc - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ - echo "Bootstrapping training compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo "Building feedback based compiler"; \ - cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - echo "Building runtime libraries"; \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) all - .PHONY: cross cross: all-build all-gas all-ld @r=`${PWD_COMMAND}`; export r; \ @@ -1212,7 +1203,7 @@ stage = : current_stage = "" @if gcc-bootstrap -unstage = [ -f stage_current ] || $(MAKE) `cat stage_last`-start +unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi current_stage = "`cat stage_current 2> /dev/null`" @endif gcc-bootstrap @@ -1240,36 +1231,9 @@ LEAN = false # 'touch' doesn't work right on some platforms. STAMP = echo timestamp > -# Only build the C compiler for stage1, because that is the only one that -# we can guarantee will build with the native compiler, and also it is the -# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), -# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them -# overrideable (for a bootstrap build stage1 also builds gcc.info). - -STAGE1_CFLAGS=@stage1_cflags@ -STAGE1_LANGUAGES=@stage1_languages@ - # We only want to compare .o files, so set this! objext = .o -# Flags to pass to stage2 and later makes. -POSTSTAGE1_FLAGS_TO_PASS = \ - CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ - STAGE_PREFIX=$$r/prev-gcc/ \ - CFLAGS="$(BOOT_CFLAGS)" \ - LIBCFLAGS="$(BOOT_CFLAGS)" \ - LDFLAGS="$(BOOT_LDFLAGS)" \ - ADAC="\$$(CC)" - -# For stage 1: -# * We force-disable intermodule optimizations, even if -# --enable-intermodule was passed, since the installed compiler probably -# can't handle them. Luckily, autoconf always respects -# the last argument when conflicting --enable arguments are passed. -# * Likewise, we force-disable coverage flags, since the installed compiler -# probably has never heard of them. -# * We build only C (and possibly Ada). - [+ FOR bootstrap-stage +] .PHONY: stage[+id+]-start stage[+id+]-end @@ -1303,7 +1267,7 @@ stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +] fi rm -f stage_current -# Bubble a bugfix through all the stages up to stage [+id+]. They are +# Bubble a bug fix through all the stages up to stage [+id+]. They are # remade, but not reconfigured. The next stage (if any) will not be # reconfigured as well. .PHONY: stage[+id+]-bubble @@ -1397,12 +1361,21 @@ do-clean: clean-stage[+id+] .PHONY: distclean-stage[+id+] distclean-stage[+id+]:: @: $(MAKE); $(stage) + @test "`cat stage_last`" != stage[+id+] || rm -f stage_last rm -rf stage[+id+]-* [+ IF compare-target +][+compare-target+] [+ ENDIF compare-target +] [+ IF cleanstrap-target +] .PHONY: [+cleanstrap-target+] -[+cleanstrap-target+]: distclean [+bootstrap-target+] +[+cleanstrap-target+]: do-distclean local-clean + echo stage[+id+] > stage_final + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target [+ ENDIF cleanstrap-target +] @endif gcc-bootstrap @@ -1428,14 +1401,19 @@ do-distclean: distclean-stage1 # not work as a dependency, just as the minimum necessary to avoid errors. stage_last: $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble -@endif gcc-bootstrap + +# Same as unstage, but not phony and defaulting to stage1-start. We place +# it in the dependency so that for example `make -j3 all-gcc' works. +stage_current: + @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi .PHONY: restrap restrap: @: $(MAKE); $(stage) rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev - +]stage[+id+] [+ ENDIF prev +][+ ENDFOR bootstrap-stage +] + +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +] $(MAKE) $(RECURSE_FLAGS_TO_PASS) all +@endif gcc-bootstrap # -------------------------------------- # Dependencies between different modules @@ -1450,18 +1428,12 @@ configure-target-[+module+]: stage_last[+ ENDIF bootstrap +][+ ENDFOR target_modules +] @endif gcc-bootstrap -@if gcc-no-bootstrap[+ FOR target_modules +][+ IF bootstrap - +][+ ELSE +] +@if gcc-no-bootstrap[+ FOR target_modules +] configure-target-[+module+]: maybe-all-gcc[+ - ENDIF bootstrap +][+ ENDFOR target_modules +] + ENDFOR target_modules +] @endif gcc-no-bootstrap -[+ FOR lang_env_dependencies +] -configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss -[+ IF cxx +]configure-target-[+module+]: maybe-all-target-libstdc++-v3 -[+ ENDIF cxx +][+ ENDFOR lang_env_dependencies +] - # There are two types of dependencies here: 'hard' dependencies, where one # module simply won't build without the other; and 'soft' dependencies, where # if the depended-on module is missing, the depending module will do without @@ -1550,7 +1522,6 @@ configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss +][+ FOR bootstrap_stage +] [+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +] -all-prebootstrap: [+ (dep-target "" "on" (exist? "hard")) +] [+ == "bootstrap" +][+ FOR bootstrap_stage +] [+ (make-dep (dep-stage) (dep-stage)) +][+ @@ -1558,17 +1529,48 @@ all-prebootstrap: [+ (dep-target "" "on" (exist? "hard")) +] [+ ESAC +][+ ENDFOR dependencies +] -# Non-toplevel bootstrap rules must depend on several packages, to be built -# before gcc. Another wart that will go away, hopefully soon. -@if gcc-no-bootstrap -[+ FOR host_modules +][+ - IF (and (not (= (get "module") "gcc")) - (hash-ref boot-modules (get "module"))) +] -all-prebootstrap: maybe-all-[+module+][+ - ENDIF +][+ -ENDFOR host_modules +] +# Dependencies for target modules on other target modules are +# described by lang_env_dependencies; the defaults apply to anything +# not mentioned there. +[+ + ;; Predicate for whether LANG was specified in lang_env_dependencies. + (define lang-dep (lambda (lang) + (hash-ref lang-env-deps (string-append (get "module") "-" lang)))) + + ;; Build the hash table we will need. + (define lang-env-deps (make-hash-table 7)) ++][+ FOR lang_env_dependencies +][+ + (if (exist? "cxx") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "cxx") #t)) + + (if (exist? "no_c") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_c") #t)) + + (if (exist? "no_gcc") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_gcc") #t)) + "" +][+ ENDFOR lang_env_dependencies +] + +@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) + +][+ IF bootstrap +][+ FOR bootstrap_stage +] +configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+ + ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +] +@endif gcc-bootstrap + +@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +] +configure-target-[+module+]: maybe-all-target-libgcc[+ + ENDIF +][+ ENDFOR target_modules +] @endif gcc-no-bootstrap +[+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +] +configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+ + ENDIF +][+ IF (lang-dep "cxx") +] +configure-target-[+module+]: maybe-all-target-libstdc++-v3[+ + ENDIF +] +[+ ENDFOR target_modules +] + CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ GDB_TK = @GDB_TK@ INSTALL_GDB_TK = @INSTALL_GDB_TK@ @@ -1599,7 +1601,7 @@ config.status: configure # Rebuilding configure. AUTOCONF = autoconf -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 cd $(srcdir) && $(AUTOCONF) # ------------------------------ diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog index 5bb5bb2a600..e006595f969 100644 --- a/contrib/binutils/bfd/ChangeLog +++ b/contrib/binutils/bfd/ChangeLog @@ -1,1359 +1,1788 @@ -2006-12-11 Eric Botcazou +2007-07-02 Joseph Myers - * elflink.c (bfd_elf_gc_sections): Also search for corresponding - sections with .gnu.linkonce.t. prefix. + * elfxx-mips.c (mips_elf_calculate_relocation): Handle + R_MIPS_TLS_DTPREL32 and R_MIPS_TLS_DTPREL64. + * elf64-mips.c (mips_elf64_howto_table_rela): Support + R_MIPS_TLS_DTPREL64. -2006-08-08 Nick Clifton +2007-07-02 Alan Modra - PR binutils/2724 - * coffcode.h (coff_new_section_hook): Only modify the section - symbol of sections which were created by the user. - -2006-07-19 Alan Modra - - * bfd-in.h (enum notice_asneeded_action): Define. - * bfd-in2.h: Regenerate. - * elflink.c (elf_link_add_object_symbols): Call linker "notice" - function with NULL name for as-needed handling. - -2006-07-12 Matthew R. Dempsky - - * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32. - -2006-06-23 Daniel Jacobowitz - - * Makefile.am: Clear RELEASE. - * Makefile.in: Regenerated. - -2006-06-23 Daniel Jacobowitz - - * configure.in: Update version to 2.17. - * Makefile.am: Set RELEASE. - * configure, Makefile.in: Regenerated. - -2006-06-12 Daniel Jacobowitz - - * configure.in: Update version to 2.16.94. - * configure: Regenerated. - -2006-06-11 Richard Sandiford - Thiemo Seufer - - * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size. - (STUB_ORI): New macro. - (STUB_LI16U): Fix formatting. - (MIPS_FUNCTION_STUB_SIZE): Delete. - (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise. - (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro. - (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise. - (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size - instead of MIPS_FUNCTION_STUB_SIZE. - (count_section_dynsyms): New function, split out from - _bfd_mips_elf_final_link. - (_bfd_mips_elf_always_size_sections): Get a worst-case estimate - of the number of dynamic symbols needed and use it to set up - function_stub_size. Use function_stub_size rather than - MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section. - Use 16-byte stubs for 0x10000 dynamic symbols. - (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size - instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting. - (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the - size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to - MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes. - Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20. - Use STUB_ORI rather than STUB_LI16U for big stubs. - (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size. - (_bfd_mips_elf_final_link): Use count_section_dynsyms. - -2006-06-08 David Daney - - * elfxx-mips.c (STUB_LI16): Removed. - (STUB_LUI): New macro. - (STUB_LI16U): Ditto. - (STUB_LI16S): Ditto. - (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter. - (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to - MIPS_FUNCTION_STUB_SIZE. - (_bfd_mips_elf_always_size_sections): Ditto. - (_bfd_mips_elf_size_dynamic_sections): Ditto. - (_bfd_mips_elf_finish_dynamic_sections): Ditto. - (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation - to allow larger symbol table indexes. - -2006-06-07 Joseph S. Myers - - * po/Make-in (pdf, ps): New dummy targets. - -2006-06-01 Daniel Jacobowitz - - Backport: - 2006-05-23 H.J. Lu - PR ld/2655 - PR ld/2657 - * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly - update CIE/FDE length. Don't pad to the section alignment. - -2006-05-30 Nick Clifton - - * po/es.po: Updated Spanish translation. - -2006-05-23 Alan Modra - - * elf64-ppc.c (compare_symbols): Prefer strong dynamic global - function syms over other syms. - -2006-05-22 Daniel Jacobowitz - - * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL - check. - (bfd_elf_final_link): Add a late DT_TEXTREL check. - * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define. - (mips_elf_create_dynamic_relocation): Set DF_TEXTREL. - (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION. - Use MIPS_ELF_READONLY_SECTION. - (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after - creating DT_TEXTREL. - (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers - if no text relocations were generated. - -2006-05-17 Daniel Jacobowitz - - * configure.in: Update version to 2.16.93. - * configure: Regenerated. - -2006-05-17 Alan Modra - - * elflink.c (elf_gc_sweep): Don't specially keep non-alloc, - non-load sections if they have relocs. - -2006-05-16 Andreas Schwab - - * aoutf1.h (struct external_sparc_core): Declare c_regs as struct - regs instead of an array of int. - (struct external_solaris_bcp_core): Likewise. - (swapcore_sun3): Use offsetof instead of computing the offset - manually. - (swapcore_sparc): Likewise. Simplify reference to c_regs. - (swapcore_solaris_bcp): Likewise. - -2006-05-15 Alan Modra - - PR 2658 - * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic - -shared link. - -2006-05-11 Michael Matz - - * elflink.c (match_group_member): Correctly iterate group - members. - -2006-05-11 Nick Clifton - - PR ld/2607 - * elfcode.h (valid_section_index_p): New function: Checks for a - valid section index. Allows indicies in the range SHN_LOPROC to - SHN_HIOS. - (elf_object_p): Use valid_section_index_p. - -2006-05-11 Nick Clifton - - PR ld/2257 - * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx - fields to still be handled as ELF files. - -2006-05-10 Alan Modra - - PR 2342 - * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16. - -2006-05-10 Alan Modra - - * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize - R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in - the .toc and referenced by a TLS code sequence. - (ppc64_elf_edit_toc): Cater for the unlikely situation that - .toc is the first section in a file. - -2006-05-03 Kaz Kojima - - PR binutils/2584 - * tekhex.c (getvalue): Change return type to bfd_boolean and - add the new parameter. Return false if the unexpected character - is found. - (getsym): Likewise. - (first_phase): Change return type to bfd_boolean and return - false if the unexpected character is found. Replace abort - with returning false. - (pass_over): Change return type to bfd_boolean and the type of - the second argument to bfd_boolean (*) (bfd *, int, char *). - Return false if FUNC returns false. - (tekhex_object_p): Return NULL if pass_over fails. - -2006-05-02 Paul Brook - - * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit - for R_ARM_REL32. - -2006-04-27 Alan Modra - - * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix. - -2006-04-16 Daniel Jacobowitz - - * configure.in: Update version to 2.16.92. - * configure: Regenerated. - -2006-04-16 Daniel Jacobowitz - - * po/SRC-POTFILES.in: Regenerated. - -2006-04-14 David Heine - - * elf32-xtensa.c (build_reloc_opcodes): New. - (compute_text_actions): Use it to decode opcodes outside inner loop. - (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if - it is set, use it to get the opcodes for relocations. - (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit. - -2006-04-08 H.J. Lu - - PR ld/2513 - * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type. - (GOT_TLS_IE_IE): Likewise. - (GOT_TLS_IE_GD): Likewise. - (GOT_TLS_IE_MASK): Likewise. - (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD - and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE - respectively. - (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD - are set, treat tls_type as GOT_TLS_IE_BOTH. - (elf_i386_relocate_section): Likewise. - -2006-04-07 Randolph Chung - - * elf64-hppa.c (elf64_hppa_grok_prstatus): New function. - (elf64_hppa_grok_psinfo): Likewise. - (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define. - -2006-04-06 DJ Delorie - - * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for - each plt entry we create. - -2006-04-06 Carlos O'Donell - - * po/Make-in: Add install-html target. - * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir - htmldir. Add install-html and install-html-recursive targets. + * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. - * configure.in: AC_SUBST for datarootdir, docdir and htmldir. - * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. -2006-04-06 H.J. Lu +2007-07-02 Alan Modra - * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes - with the skip_relax_pass_0 and skip_relax_pass_1 bits in the - section structure. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Tidy + symsec != NULL tests. -2006-04-05 Bernd Schmidt +2007-07-02 Alan Modra - * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to - eliminate warnings. + PR 4712 + * elf.c (assign_file_positions_for_load_sections): Adjust lma + by p_vaddr_offset. -2006-04-05 H.J. Lu - James E Wilson +2007-06-30 H.J. Lu - PR ld/2442 - * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next. - (elfNN_ia64_local_hash_entry): Add count, sorted_count and - size. - (elfNN_ia64_link_hash_entry): Likewise. - (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count - and size. - (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info - processing. - (elfNN_ia64_hash_hide_symbol): Likewise. - (elfNN_ia64_global_dyn_sym_thunk): Likewise. - (elfNN_ia64_local_dyn_sym_thunk): Likewise. - (elfNN_ia64_global_dyn_info_free): New function. - (elfNN_ia64_local_dyn_info_free): Likewise. - (elfNN_ia64_hash_table_free): Free local and global - elfNN_ia64_dyn_sym_info. - (addend_compare): New function. - (sort_dyn_sym_info): Likewise. - (get_dyn_sym_info): Updated to use binary search for addend. - (elfNN_ia64_check_relocs): Scan relocations to create dynamic - relocation arrays first. + * aclocal.m4: Regenerated. + * Makefile.in: Likewise. -2006-04-05 Bernd Schmidt +2007-06-29 Joseph Myers - * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp - symbol. + * elf32-ppc.c (ppc_elf_merge_obj_attributes): New. + (ppc_elf_merge_private_bfd_data): Call it. -2006-04-05 H.J. Lu +2007-06-29 Joseph Myers - PR ld/2411 - * elflink.c (check_dynsym): New. - (elf_link_output_extsym): Use it. - (bfd_elf_final_link): Likewise. + * elfxx-mips.c (mips_elf_merge_obj_attributes): New. + (_bfd_mips_elf_merge_private_bfd_data): Call it. -2006-04-05 H.J. Lu +2007-06-29 Joseph Myers - PR ld/2404 - * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect - symbol from the dynamic definition with the default version if - its type and the type of existing regular definition mismatch. - -2006-04-05 Richard Sandiford - Daniel Jacobowitz - - * config.bfd (sparc-*-vxworks*): New stanza. - * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza. - (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo. - * configure: Regenerate. - * elf32-sparc.c: Include elf-vxworks.h. - (elf32_sparc_vxworks_link_hash_table_create: New. - (elf32_sparc_vxworks_final_write_processing): New. - (TARGET_BIG_SYM): Override for VxWorks. - (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise. - (bfd_elf32_bfd_link_hash_table_create): Likewise. - (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise. - (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise. - (elf_backend_link_output_symbol_hook): Likewise. - (elf_backend_emit_relocs): Likewise. - (elf_backend_final_write_processing, elf32_bed): Likewise. - * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h. - (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New. - (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New. - (_bfd_sparc_elf_link_hash_table_create): Don't initialize - build_plt_entry here. - (create_got_section): Initialize sgotplt for VxWorks. - (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry, - plt_header_size and plt_entry_size, with new VxWorks-specific settings. - Call elf_vxworks_create_dynamic_sections for VxWorks. - (allocate_dynrelocs): Use plt_header_size and plt_entry_size. - Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks. - (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt - for VxWorks. Check for the .got.plt section. - (sparc_vxworks_build_plt_entry): New function. - (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs. - Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_ - absolute on VxWorks. - (sparc32_finish_dyn): Add special handling for DT_RELASZ - and DT_PLTGOT on VxWorks. - (sparc_vxworks_finish_exec_plt): New. - (sparc_vxworks_finish_shared_plt): New. - (_bfd_sparc_elf_finish_dynamic_sections): Call them. - Use plt_header_size and plt_entry_size. - * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks, - srelplt2, sgotplt, plt_header_size and plt_entry_size fields. - * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h. - (elf32-sparc.lo): Likewise. + * elf-attrs.c: New. + * Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo. + (BFD32_BACKENDS_CFILES): Add elf-attrs.c. + (elf-attrs.lo): Generate dependencies. * Makefile.in: Regenerate. - * targets.c (bfd_elf32_sparc_vxworks_vec): Declare. - (_bfd_target_vector): Add a pointer to it. - -2006-03-30 Ben Elliston - - PR ld/2267 - * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a - special section number that exceeds the number of ELF sections - (eg. SHN_MIPS_SCOMMON). - -2006-03-27 Richard Sandiford - - * elfxx-mips.c (mips_got_entry): Add more commentary. - (mips_elf_local_got_index): Use the hash table entry to record - the GOT index of forced-local symbols. - (mips_elf_initialize_tls_index): Rearrange code. Store the index - in either the hash table entry or the mips_got_entry, not both. - Add more commentary. - (mips_elf_multi_got): Make sure the g->next is nonnull when calling - mips_elf_initialize_tls_index. - -2006-03-25 Bernd Schmidt - - * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc, - RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty, - reloc_stack_push, reloc_stack_pop, reloc_stack_operate, - bfin_areloc_howto_table): Delete. All - uses deleted as well. - (bfin_reloc_map): Delete all stack relocs. - (bfin_info_to_howto, bfin_bfd_reloc_type_lookup, - bfin_reloc_type_lookup): Don't support them. - (bfin_relocate_section): Don't try to handle them. - - * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec. - * configure.in: Likewise. + * configure.in (elf): Add elf-attrs.lo. * configure: Regenerate. - * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h". - (BFIN_RELOC_MAX): Now 0x21. - (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs. - (bfd_elf32_bfinfdpic_vec): Declare. - (IS_FDPIC): New macro. - (struct bfinfdpic_elf_link_hash_table): New struct. - (bfinfdpic_hash_table, bfinfdpic_got_section, - bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section, - bfinfdpic_plt_setion, bfinfdpic_pltrel_section, - bfinfdpic_relocs_info, bfinfdpic_got_initial_offset, - bfinfdpic_plt_initial_offset): Accessor macros for it. - (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros. - (struct bfinfdpic_relocs_info): New struct. - (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES, - BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC, - DEFAULT_STACK_SIZE): New macros. - (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash, - bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find, - bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local, - bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc, - _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment, - _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section, - bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook, - _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section, - elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry, - _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry, - _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries, - _bfinfdpic_resolve_final_relocs_info, - elf32_bfinfdpic_size_dynamic_sections, - elf32_bfinfdpic_always_size_sections, - elf32_bfinfdpic_modify_segment_map, - _bfinfdpic_count_got_plt_entries, - elf32_bfinfdpic_finish_dynamic_sections, - elf32_bfinfdpic_adjust_dynamic_symbol, - elf32_bfinfdpic_finish_dynamic_symbol, - elf32_bfinfdpic_elf_use_relative_eh_frame, - elf32_bfinfdpic_elf_encode_eh_address, - elf32_bfin_object_p, bfin_elf_copy_private_bfd_data, - elf32_bfinfdpic_copy_private_bfd_data, - (struct _bfinfdpic_dynamic_got_info, - struct _bfinfdpic_dynamic_got_plt_info): New structs. - (elf32_bfin_print_private_bfd_data): Print PIC flags. - (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC. - (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed, - elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create, - elf_backend_always_size_sectinos, elf_backend_modify_segment_map, - bfd_elf32_bfd_copy_private_bfd_data, - elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, - elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol, - elf_backend_finish_dynamic_sections, elf_backend_relocate_section, - elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs, - elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p, - elf_backend_may_use_rela_p, elf_backend_default_use_rela_p, - elf_backend_omit_section_dynsym): Redefine these macros and include - "elf32-target.h" again to create the elf32-bfinfdpic target. - * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI, - BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC, - BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI, - BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE, - BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, - BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI, - BFD_RELOC_BFIN_GOTOFFLO): New. - * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target. - (_bfd_target_vector): Add it. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add entries for object + attributes. + (NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list, + OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST, + Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility): + New. + (struct elf_obj_tdata): Add entries for object attributes. + (elf_known_obj_attributes, elf_other_obj_attributes, + elf_known_obj_attributes_proc, elf_other_obj_attributes_proc): + New. + (bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents, + bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int, + bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string, + bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat, + bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup, + _bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type, + _bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New. + * elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes. + (bfd_section_from_shdr): Handle attributes sections. + * elflink.c (bfd_elf_final_link): Handle attributes sections. + * elfxx-target.h (elf_backend_obj_attrs_vendor, + elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type): New. + (elfNN_bed): Update. + * elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute, + aeabi_attribute_list): Remove. + (struct elf32_arm_obj_tdata): Remove object attributes fields. + (check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2, + elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes): + Update for new object attributes interfaces. + (uleb128_size, is_default_attr, eabi_attr_size, + elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute, + elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link, + elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int, + elf32_arm_add_eabi_attr_int, attr_strdup, + elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat, + copy_eabi_attributes, elf32_arm_parse_attributes): Remove. Moved + to generic code in elf-attrs.c. + (elf32_arm_obj_attrs_arg_type): New. + (elf32_arm_fake_sections): Do not handle .ARM.attributes. + (elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES. + (bfd_elf32_bfd_final_link): Remove. + (elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section, + elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type): New. + * elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object + attributes. + * elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise. + * elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise. + * elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise. + * elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise. + * elf32-sh.c (sh_elf_copy_private_data): Likewise. + * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise. -2006-03-25 Richard Sandiford +2007-06-29 Paul Brook - * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as - incompatible. Likewise MAC and EMAC code. - * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use - bfd_get_compatible to set the new bfd architecture. Rely on it - to detect incompatibilities. + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress + call veneers for call relocations against undefined symbols. + (elf32_arm_final_link_relocate): Turn call to undefined symbol + into a jump to the next instruction. -2006-03-22 Bob Wilson +2007-06-29 Michael Snyder - * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that - rel->r_addend is zero. + * bfd.c (bfd_demangle): Plug memory leak (Coverity). -2006-03-22 Richard Sandiford +2007-06-29 M R Swami Reddy - * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type - of "loc". + * Makefile.am: Add cr16 related entry + * Makefile.in: Regenerate + * archures.c: Add bfd_cr16_arch + * bfd-in2.h: Regenerate + * config.bfd: Add cr16-elf + * configure.in: Add bfd_elf32_cr16_vec + * configure: Regenerate. + * targets.c: Added cr16 related information + * cpu-cr16.c: New file. + * elf32-cr16.c: New file. + * reloc.c: Added cr16 relocs. -2006-03-22 Richard Sandiford - Daniel Jacobowitz - Phil Edwards - Zack Weinberg - Mark Mitchell - Nathan Sidwell +2007-06-29 Alan Modra - * bfd-in2.h: Regenerate. - * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas. - * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza. - (bfd_elf32_littlemips_vxworks_vec): Likewise. - (bfd_elf32_bigmips_vec): Add elf-vxworks.lo. - (bfd_elf32_littlemips_vec): Likewise. - (bfd_elf32_nbigmips_vec): Likewise. - (bfd_elf32_nlittlemips_vec): Likewise. - (bfd_elf32_ntradbigmips_vec): Likewise. - (bfd_elf32_ntradlittlemips_vec): Likewise. - (bfd_elf32_tradbigmips_vec): Likewise. - (bfd_elf32_tradlittlemips_vec): Likewise. - (bfd_elf64_bigmips_vec): Likewise. - (bfd_elf64_littlemips_vec): Likewise. - (bfd_elf64_tradbigmips_vec): Likewise. - (bfd_elf64_tradlittlemips_vec): Likewise. - * elf32-mips.c: Include elf-vxworks.h. - (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto - instead of calling mips_elf32_rtype_to_howto directly. - (mips_vxworks_copy_howto_rela): New reloc howto. - (mips_vxworks_jump_slot_howto_rela): Likewise. - (mips_vxworks_bfd_reloc_type_lookup): New function. - (mips_vxworks_rtype_to_howto): Likewise. - (mips_vxworks_final_write_processing): Likewise. - (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks. - (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise. - (elf_backend_want_got_plt): Likewise. - (elf_backend_want_plt_sym): Likewise. - (elf_backend_got_symbol_offset): Likewise. - (elf_backend_want_dynbss): Likewise. - (elf_backend_may_use_rel_p): Likewise. - (elf_backend_may_use_rela_p): Likewise. - (elf_backend_default_use_rela_p): Likewise. - (elf_backend_got_header_size: Likewise. - (elf_backend_plt_readonly): Likewise. - (bfd_elf32_bfd_reloc_type_lookup): Likewise. - (elf_backend_mips_rtype_to_howto): Likewise. - (elf_backend_adjust_dynamic_symbol): Likewise. - (elf_backend_finish_dynamic_symbol): Likewise. - (bfd_elf32_bfd_link_hash_table_create): Likewise. - (elf_backend_add_symbol_hook): Likewise. - (elf_backend_link_output_symbol_hook): Likewise. - (elf_backend_emit_relocs): Likewise. - (elf_backend_final_write_processing: Likewise. - (elf_backend_additional_program_headers): Likewise. - (elf_backend_modify_segment_map): Likewise. - (elf_backend_symbol_processing): Likewise. - * elfxx-mips.c: Include elf-vxworks.h. - (mips_elf_link_hash_entry): Add is_relocation_target and - is_branch_target fields. - (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt, - srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields. - (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros. - (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument. - Return 3 for VxWorks. - (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a - mips_elf_link_hash_table. Return 0 for VxWorks. - (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a - mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET. - (mips_vxworks_exec_plt0_entry): New variable. - (mips_vxworks_exec_plt_entry): Likewise. - (mips_vxworks_shared_plt0_entry): Likewise. - (mips_vxworks_shared_plt_entry): Likewise. - (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields. - (mips_elf_rel_dyn_section): Change the bfd argument to a - mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get - the name of the section. - (mips_elf_initialize_tls_slots): Update the call to - mips_elf_rel_dyn_section. - (mips_elf_gotplt_index): New function. - (mips_elf_local_got_index): Add an input_section argument. - Update the call to mips_elf_create_local_got_entry. - (mips_elf_got_page): Likewise. - (mips_elf_got16_entry): Likewise. - (mips_elf_create_local_got_entry): Add bfd_link_info and input_section - arguments. Create dynamic relocations for each entry on VxWorks. - (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE. - (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE - and MIPS_RESERVED_GOTNO. - (mips_elf_create_got_section): Update the uses of - MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks. - (is_gott_symbol): New function. - (mips_elf_calculate_relocation): Use a dynobj local variable. - Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and - mips_elf_got_page_entry. Set G to the .got.plt entry when calculating - VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT - relocations on VxWorks. Add dynamic relocations for references - to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't - create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 - in VxWorks executables. - (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument. - Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry. - Don't allocate a null entry on VxWorks. - (mips_elf_create_dynamic_relocation): Update the call to - mips_elf_rel_dyn_section. Use absolute rather than relative - relocations for VxWorks, and make them RELA rather than REL. - (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic - read-only on VxWorks. Update the call to mips_elf_rel_dyn_section. - Create the .plt, .rela.plt, .dynbss and .rela.bss sections on - VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol. - Call elf_vxworks_create_dynamic_sections for VxWorks and - initialize the plt_header_size and plt_entry_size fields. - (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be - used in VxWorks executables. Don't allocate dynamic relocations - for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables. - Set is_relocation_target for each symbol referenced by a relocation. - Allocate .rela.dyn entries for relocations against the special - VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT - entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate - a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*, - R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls - to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations. - Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26 - relocations. Don't set no_fn_stub on VxWorks. - (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to - mips_elf_allocate_dynamic_relocations. - (_bfd_mips_vxworks_adjust_dynamic_symbol): New function. - (_bfd_mips_elf_always_size_sections): Do not allocate GOT page - entries for VxWorks, and do not create multiple GOTs. - (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME. - Handle .got specially for VxWorks. Update the uses of - MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations. - Check for sgotplt and splt. Allocate the .rel(a).dyn contents last, - once its final size is known. Set DF_TEXTREL for VxWorks. Add - DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL - tags on VxWorks. Do not add the MIPS-specific tags for VxWorks. - (_bfd_mips_vxworks_finish_dynamic_symbol): New function. - (mips_vxworks_finish_exec_plt): Likewise. - (mips_vxworks_finish_shared_plt): Likewise. - (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call - to mips_elf_rel_dyn_section. Use a VxWorks-specific value of - DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, - DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO - and mips_elf_rel_dyn_section. Use a different GOT header for - VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks. - (_bfd_mips_elf_link_hash_table_create): Initialize the new - mips_elf_link_hash_table fields. - (_bfd_mips_vxworks_link_hash_table_create): New function. - (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_ - on VxWorks. Update the call to ELF_MIPS_GP_OFFSET. - * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare. - (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. - (_bfd_mips_vxworks_link_hash_table_create): Likewise. - * libbfd.h: Regenerate. - * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h. - (elf32-mips.lo): Likewise. - * Makefile.in: Regenerate. - * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare. - * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare. - (bfd_elf32_littlemips_vxworks_vec): Likewise. - (_bfd_target_vector): Add entries for them. + * elflink.c (_bfd_elf_link_assign_sym_version): Improve error + message for undefined version nodes. + (elf_gc_sweep): Don't warn when zero size sections are + removed. -2006-03-19 John David Anglin +2007-06-29 Nathan Froyd - * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss - section from SHF_PARISC_WEAKORDER to SHF_HP_TLS. - (elf_backend_special_sections): Remove #undef. + * elf32-ppc.c (ppc_elf_info_to_howto): Check for invalid relocation + types. -2006-03-18 John David Anglin +2007-06-29 Alan Modra - * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry - for undefined weak symbols. + * elf32-spu.c (spu_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. -2006-03-17 Daniel Jacobowitz +2007-06-29 Alan Modra - PR ld/2462 - * elflink.c (bfd_elf_final_link): Remove - bed->elf_backend_emit_relocs from emit_relocs. + * elf.c (assign_file_positions_for_load_sections): Use elf + section header sh_size rather than bfd section size, simplifying + .tbss handling. -2006-03-17 Alexandre Oliva +2007-06-29 Alan Modra - * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from - first relocation to the second when relaxing TLS GD to LE; - zero it out when relaxing to IE. + PR ld/4701 + * elf.c (assign_file_positions_for_load_sections): Ensure bss + segments meet gABI alignment requirements. Don't allocate + file space for bss sections in a segment also containing file + or program headers. -2006-03-17 Alan Modra +2007-06-27 Alan Modra - PR 2434 - * elflink.c (elf_link_add_object_symbols): Save and restore - warning sym's linked sym. - -2006-03-16 Alan Modra - - PR 2434 - * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. - (elf_link_add_object_symbols): Delete unnecessary locals. Rename - hash_table -> htab. Formatting. Save entire symbol table - before loading as-needed syms, and restore afterwards if lib not - needed. Use bfd_hash_allocate rather than bfd_alloc for sym - name. Free some buffers earlier. - * bfd-in.h (struct bfd_hash_table): Add entsize. - (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. - * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise - * hash.c (bfd_hash_table_init_n): Add entsize param, save to - hash table. - (bfd_hash_table_init): Add param, adjust calls. - * aoutx.h: Adjust all hash_table_init functions and calls. - * bfd.c: Likewise. - * coff-arm.c: Likewise. - * coff-h8300.c: Likewise. - * coff-ppc.c: Likewise. - * cofflink.c: Likewise. + * bfd.c (struct bfd): Rename "next" to "archive_next". + * archive.c: Rename uses throughout file. + * archive64.c: Likewise. + * coff-rs6000.c: Likewise. * ecoff.c: Likewise. - * ecofflink.c: Likewise. - * elf-m10300.c: Likewise. - * elf-strtab.c: Likewise. - * elf.c: Likewise. - * elf32-arm.c: Likewise. - * elf32-bfin.c: Likewise. - * elf32-cris.c: Likewise. - * elf32-frv.c: Likewise. - * elf32-hppa.c: Likewise. - * elf32-i386.c: Likewise. - * elf32-m32r.c: Likewise. - * elf32-m68hc1x.c: Likewise. - * elf32-m68k.c: Likewise. - * elf32-ppc.c: Likewise. - * elf32-s390.c: Likewise. - * elf32-sh.c: Likewise. - * elf32-vax.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-hppa.c: Likewise. - * elf64-ppc.c: Likewise. - * elf64-s390.c: Likewise. - * elf64-sh64.c: Likewise. - * elf64-x86-64.c: Likewise. - * elfxx-ia64.c: Likewise. - * elfxx-mips.c: Likewise. - * elfxx-sparc.c: Likewise. - * i386linux.c: Likewise. - * libaout.h: Likewise. - * libbfd-in.h: Likewise. - * libcoff-in.h: Likewise. - * linker.c: Likewise. - * m68klinux.c: Likewise. - * merge.c: Likewise. - * opncls.c: Likewise. - * pdp11.c: Likewise. - * sparclinux.c: Likewise. - * stabs.c: Likewise. - * sunos.c: Likewise. - * vms.c: Likewise. - * xcofflink.c: Likewise. - * section.c (struct section_hash_entry): Move to.. - * libbfd-in.h: ..here. - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. + * som.c: Likewise. * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * libcoff.h: Regenerate. -2006-03-16 Alan Modra + * elf32-ppc.c (ppc_elf_select_plt_layout): Properly iterate over + input bfds. + * elf32-spu.c (spu_elf_create_sections): Likewise. - * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs - against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak - last change to REL32 relocs so that they are counted as - possibly dynamic as per REL24 and REL14. +2007-06-26 H.J. Lu -2006-03-16 Alan Modra + * dwarf2.c (find_line): New. Contains the duplicated code from: + (_bfd_dwarf2_find_nearest_line): Use it. + (_bfd_dwarf2_find_line): Use it. - * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24 - checks from REL32. +2007-06-26 Joseph Myers -2006-03-15 Ben Elliston + * elf32-arm.c (copy_eabi_attributes): Copy type of attributes. - * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all - in_list elements, not just the first. - -2006-03-14 Richard Sandiford +2007-06-25 Richard Sandiford - * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split - out from... - (_bfd_mips_elf_relocate_section): ...here. Use it to adjust r_addend - for final links too. + * elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs + to be used for calls from MIPS16 code. -2006-03-13 Richard Sandiford +2007-06-23 Andreas Schwab - * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot. - -2006-03-11 H.J. Lu - - PR ld/2443 - * dwarf2.c (concat_filename): Don't issue an error if file is - 0. - -2006-03-10 Paul Brook - - * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5. - (elf32_arm_print_private_bfd_data): Ditto. - -2006-03-09 Paul Brook - - * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional - mapping symbols. - -2006-03-09 Khem Raj - - * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned - char type. - -2006-03-08 H.J. Lu - - * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. - -2006-03-07 Richard Sandiford - Daniel Jacobowitz - Zack Weinberg - Nathan Sidwell - Paul Brook - Ricardo Anguiano - Phil Edwards - - * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo. - (bfd_elf32_bigarm_symbian_vec): Likewise. - (bfd_elf32_bigarm_vxworks_vec): Likewise. - (bfd_elf32_littlearm_vec): Likewise. - (bfd_elf32_littlearm_symbian_vec): Likewise. - (bfd_elf32_littlearm_vxworks_vec): Likewise. + * configure.in (--with-separate-debug-dir): New option. * configure: Regenerate. - * elf32-arm.c: Include libiberty.h and elf-vxworks.h. - (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros. - (elf32_arm_vxworks_bed): Add forward declaration. - (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12. - (elf32_arm_vxworks_exec_plt0_entry): New table. - (elf32_arm_vxworks_exec_plt_entry): Likewise. - (elf32_arm_vxworks_shared_plt_entry): Likewise. - (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields. - (reloc_section_p): New function. - (create_got_section): Use RELOC_SECTION. - (elf32_arm_create_dynamic_sections): Likewise. Call - elf_vxworks_create_dynamic_sections for VxWorks targets. - Choose between the two possible values of plt_header_size - and plt_entry_size. - (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2. - (elf32_arm_abs12_reloc): New function. - (elf32_arm_final_link_relocate): Call it. Allow the creation of - dynamic R_ARM_ABS12 relocs on VxWorks. Use reloc_section_p, - RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION. Initialize the - r_addend fields of relocs. On rela targets, skip any code that - adjusts in-place addends. When using _bfd_link_final_relocate - to perform a final relocation, pass rel->r_addend as the addend - argument. - (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks - object, ignore flags that are not standard on VxWorks. - (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12 - relocs on VxWorks. Use reloc_section_p. - (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE. - (allocate_dynrelocs): Use RELOC_SIZE. Account for the size of - .rela.plt.unloaded relocs on VxWorks targets. - (elf32_arm_size_dynamic_sections): Use RELOC_SIZE. Check for - .rela.plt.unloaded as well as .rel(a).plt. Add DT_RELA* tags - instead of DT_REL* tags on RELA targets. - (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE - and SWAP_RELOC_OUT. Initialize r_addend fields. Handle VxWorks - PLT entries. Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. - (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE - and SWAP_RELOC_OUT. Initialize r_addend fields. Handle DT_RELASZ - like DT_RELSZ. Handle the VxWorks form of initial PLT entry. - Correct the .rela.plt.unreloaded symbol indexes. - (elf32_arm_output_symbol_hook): Call the VxWorks version of this - hook on VxWorks targets. - (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true. - Minor formatting tweak. - (elf32_arm_vxworks_final_write_processing): New function. - (elf_backend_add_symbol_hook): Override for VxWorks and reset - for Symbian. - (elf_backend_final_write_processing): Likewise. - (elf_backend_emit_relocs): Likewise. - (elf_backend_want_plt_sym): Likewise. - (ELF_MAXPAGESIZE): Likewise. - (elf_backend_may_use_rel_p): Minor formatting tweak. - (elf_backend_may_use_rela_p): Likewise. - (elf_backend_default_use_rela_p): Likewise. - (elf_backend_rela_normal): Likewise. - * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h. - -2006-03-06 Nathan Sidwell - - * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp): - New. Adjust other variants. - (bfd_default_scan): Update. - * bfd-in2.h: Rebuilt. - * cpu-m68k.c: Adjust. - (bfd_m68k_compatible): New. Use it for architectures. - * elf32-m68k.c (elf32_m68k_object_p): Adjust. - (elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b - mismatch. - (elf32_m68k_print_private_bfd_data): Adjust. - * ieee.c (ieee_write_processor): Adjust. - -2006-03-06 Alan Modra - - * dwarf2.c: Formatting. - (add_line_info): Remove outer loop. - -2006-03-05 H.J. Lu - Alan Modra - - PR binutils/2338 - * dwarf2.c (loadable_section): New struct. - (dwarf2_debug): Add loadable_section_count and - loadable_sections. - (new_line_sorts_after): New. - (add_line_info): Use new_line_sorts_after to compare line - addresses. - (check_function_name): Removed. - (unset_sections): New. - (place_sections): New. - (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections - and unset_sections on relocatable files. + * Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR. + * Makefile.in: Regenerate. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to + bfd_follow_gnu_debuglink. (_bfd_dwarf2_find_line): Likewise. -2006-03-03 Nick Clifton +2007-06-22 Nick Clifton - * cpu-avr.c: Update to ISO-C90 formatting. - * elf32-avr.c: Likewise. + * dwarf2.c: Add support for reading in debug information via a + .gnu_debuglink section: + (struct dwarf2_debug): Add bfd field to record the bfd containing + the debug info. + (parse_comp_unit): Remove ABFD parameter. Instead use the bfd + field in the dwarf2_debug structure. + (_bfd_dwarf2_find_nearest_line): If a debug info section could not + be found in the current bfd call bfd_follow_gnu_debuglink to see + if another file contains the debug information. If it does, open + it and continue. + (_bfd_dwarf2_find_line): Likewise. -2006-03-03 Bjoern Haase +2007-06-19 H.J. Lu - * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI - and R_AVR_MS8_LDI - (bfd_elf_avr_final_write_processing): Set - EF_AVR_LINKRELAX_PREPARED in e_flags field. - (elf32_avr_relax_section): New function. - (elf32_avr_relax_delete_bytes): New function. - (elf32_avr_get_relocated_section_contents): New function. - (avr_pc_wrap_around): New function. - (avr_relative_distance_considering_wrap_around): New function. - (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI. - * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. + PR ld/4590 + * elfxx-ia64.c (sort_dyn_sym_info): Keep the valid got_offset + when removing duplicated entries. + (get_dyn_sym_info): Initialize the got_offset field to -1. + Update call to sort_dyn_sym_info. + (elfNN_ia64_relocate_section): Call sort_dyn_sym_info to sort + array of addend and remove duplicates. -2006-03-02 DJ Delorie +2007-06-18 H.J. Lu - * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol - calculations. + * libpei.h (_bfd_XXi_final_link_postscript): Remove + duplication. + (bfd_target_pei_p): New. + (bfd_target_pei_arch): New + (bfd_target_efi_p): Likewise. + (bfd_target_efi_arch): New + (bfd_pe_executable_p): Use bfd_target_pei_p and + bfd_target_efi_p. -2006-03-02 Richard Sandiford + * peicode.h (arch_type): New enum. + (pe_arch): New function. + (pe_bfd_object_p): Don't match PE/EFI target with EFI/PE file + if there is an EFI/PE target. - * elf32-ppc.c (is_ppc_elf_target): Return true if the target is - bfd_elf32_powerpc_vxworks_vec. +2007-06-14 H.J. Lu -2006-03-02 Nick Clifton + * Makefile.am (ACLOCAL_AMFLAGS): Add -I . -I ../config. - * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'. + * acinclude.m4: Don't include m4 files. Remove libtool + kludge. -2006-03-02 Richard Sandiford + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. - * elf32-i386.c (elf_i386_create_dynamic_sections): Use - elf_vxworks_create_dynamic_sections. - (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT - symbol handling. - * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use - elf_vxworks_create_dynamic_sections. - (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT - symbol handling. - * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function. - * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare. +2007-06-11 Sterling Augustine + Bob Wilson -2006-03-02 Richard Sandiford + * elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed + XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM. + (extend_ebb_bounds_backward, compute_text_actions): Likewise. + (compute_ebb_proposed_actions, coalesce_shared_literal): Likewise. + (xtensa_get_property_predef_flags): Likewise. + (compute_removed_literals): Pass new arguments to is_removable_literal. + (is_removable_literal): Add sec, prop_table and ptblsize arguments. + Do not remove literal if the NO_TRANSFORM property flag is set. - * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete. - (elf_backend_link_output_symbol_hook): Use - elf_vxworks_link_output_symbol_hook instead. - * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete. - (elf_backend_link_output_symbol_hook): Use - elf_vxworks_link_output_symbol_hook instead. - * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the - same interface as elf_backend_link_output_symbol_hook. - * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update - prototype accordingly. +2007-05-31 Richard Sandiford -2006-03-02 Richard Sandiford + * elfxx-mips.c (mips_elf_initialize_tls_index): When processing a + type (3) single-GOT entry, read tls_type from the hash table entry + rather than the GOT entry. - * elf32-ppc.c (ppc_elf_plt_type): New enumeration. - (ppc_elf_link_hash_table): Replace old_got and new_got with - plt_type and can_use_new_plt. - (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS, - SEC_LOAD and SEC_READONLY to the VxWorks .plt flags. - (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt. - Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt. - (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to - either plt_type == PLT_OLD or plt_type == PLT_NEW. Assert that - this function should not be called for VxWorks targets. - (ppc_elf_tls_setup): Use plt_type instead of old_got. - (allocate_got): Likewise. Rearrange so that max_before_header - is only used for PLT_OLD and PLT_NEW. - (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks. - (ppc_elf_size_dynamic_sections): Likewise. - (ppc_elf_relax_section): Likewise. - (ppc_elf_relocate_section): Likewise. - (ppc_elf_finish_dynamic_symbol): Likewise. - (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type. +2007-06-01 Alan Modra -2006-02-28 Richard Sandiford + * simple.c (bfd_simple_get_relocated_section_contents): Init + input_bfds_tail. - * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index. - (elf_i386_link_hash_table_create): Initialize it. - (elf_i386_compute_jump_table_size): Use it instead of - srelplt->reloc_count. - (allocate_dynrelocs): Likewise. - (elf_i386_size_dynamic_sections): Likewise. - (elf_i386_relocate_section): Likewise. - -2006-02-27 Jakub Jelinek +2007-05-30 Alan Modra - * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag. - (_bfd_elf_write_section_eh_frame): Likewise. + * elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections + created by objcopy --only-keep-debug. + (_bfd_elf_init_private_section_data): Only change elf_section_type + if it is SHT_NULL. -2006-02-27 Carlos O'Donell + * elf.c (assign_file_positions_for_load_sections): Correct sh_type + to SHT_NOBITS earlier. Base actions in rest of function on sh_type + and sh_flags instead of bfd section flags. Delete voff and code + keeping nobits segments aligned. - * po/Make-in: Add html target. +2007-05-25 Eric Christopher -2006-02-27 Richard Sandiford + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): + Check that sym_sec isn't NULL before accessing. - * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the - cached hgot entry to check for _GLOBAL_OFFSET_TABLE_. - * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. - * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise. - * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. - * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. - * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise. - * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. - * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise. - * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. - * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. - * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. - * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. - * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise. - * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. - * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. Also use - the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_. - * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. - * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. - * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. - * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. +2007-05-24 Steve Ellcey -2006-02-25 Richard Sandiford - - * elf-bfd.h (elf_link_hash_table): Add hplt field. - * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it. - * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. - * elf32-frv.c (_frv_create_got_section): Likewise. - * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise. - * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. - * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. - * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise. - * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt. - (elf_i386_link_hash_table_create): Don't initialize them. - (elf_i386_size_dynamic_sections): Use the generic ELF hplt and - hgot fields. - (elf_i386_finish_dynamic_symbol): Likewise. - * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt. - (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields. - (ppc_elf_finish_dynamic_symbol): Likewise. - -2006-02-24 DJ Delorie - - * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs. - (m32c_elf_relocate_section): Don't relocate them. - (compare_reloc): New. - (relax_reloc): Remove. - (m32c_offset_for_reloc): New. - (m16c_addr_encodings): New. - (m16c_jmpaddr_encodings): New. - (m32c_addr_encodings): New. - (m32c_elf_relax_section): Relax jumps and address displacements. - (m32c_elf_relax_delete_bytes): Adjust for internal syms. Fix up - short jumps. - - * reloc.c: Add m32c relax relocs. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - -2006-02-24 H.J. Lu - - PR ld/2218 - * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol. - (_bfd_elf_link_hash_fixup_symbol): New. - - * elflink.c (_bfd_elf_link_hash_fixup_symbol): New. - (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if - it isn't NULL. - - * elfxx-ia64.c (elf_backend_fixup_symbol): Defined. - - * elfxx-target.h (elf_backend_fixup_symbol): New. - (elfNN_bed): Initialize elf_backend_fixup_symbol. - -2006-02-23 H.J. Lu - - * cpu-ia64-opc.c (ins_immu5b): New. - (ext_immu5b): Likewise. - (elf64_ia64_operands): Add IMMU5b. - -2006-02-21 Alan Modra - - PR ld/2218 - * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie - is dynamic. - * elf32-hppa.c (allocate_dynrelocs): Likewise. - * elf32-i386.c (allocate_dynrelocs): Likewise. - * elf32-s390.c (allocate_dynrelocs): Likewise. - * elf32-sh.c (allocate_dynrelocs): Likewise. - * elf64-s390.c (allocate_dynrelocs): Likewise. - * elf64-x86-64.c (allocate_dynrelocs): Likewise. - * elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs - on undef weak with non-default visibility too. - * elfxx-sparc.c (allocate_dynrelocs): Ditto. - -2006-02-21 Alan Modra - - * bfd.c: (_bfd_default_error_handler): Don't call abort on - error, instead call _exit. - (_bfd_abort): Call _exit not xexit. - -2006-02-17 Kevin Buettner - - * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo): - New functions. - * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. - -2006-02-17 Shrirang Khisti - Anil Paranjape - Shilin Shakti - - * Makefile.am: Add xc16x related entry - * Makefile.in: Regenerate - * archures.c: Add bfd_xc16x_arch - * bfd-in2.h: Regenerate - * config.bfd: Add xc16x-*-elf - * configure.in: Add bfd_elf32_xc16x_vec + * Makefile.in: Regnerate. * configure: Regenerate. - * targets.c: Added xc16x related information - * cpu-xc16x.c: New file - * reloc.c: Add new relocations specific to xc16x: - BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG, - BFD_RELOC_XC16X_SOF - * elf32-xc16x.c: New file. + * aclocal.m4: Regenerate. + * doc/Makefile.in: Regenerate. -2006-02-17 Alan Modra +2007-05-22 Paul Brook - * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling. - * elf64-ppc.c (allocate_dynrelocs): Likewise. + * elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset + with sec and sec_shndx. + (elf32_arm_ouput_plt_map_sym): Use them. + (elf32_arm_output_arch_local_syms): Output mapping symbols for + interworking glue. -2006-02-17 Alan Modra +2007-05-18 Paul Brook - PR ld/2218 - * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is - dynamic. - (ppc64_elf_relocate_section): Check output reloc section size. - * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test. + * elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define. + (a2t1v5_ldr_insn, a2t1v5_ldr_insn): New. + (record_arm_to_thumb_glue): Add v5t non-pic glue. + (elf32_arm_create_thumb_stub): Ditto. -2006-02-16 H.J. Lu +2007-05-16 H.J. Lu + Alan Modra - PR ld/2322 - * elf.c (get_segment_type): New function. - (_bfd_elf_print_private_bfd_data): Use it. - (print_segment_map): New function. - (assign_file_positions_for_segments): Call print_segment_map - when there are not enough room for program headers. + * elflink.c (_bfd_elf_adjust_dynamic_copy): Align dynamic bss + section to the minimum alignment. -2006-02-16 Nick Hudson +2007-05-15 H.J. Lu + Alan Modra - * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use - traditional MIPS ELF targets. + PR ld/4504 + * elf-bfd.h (_bfd_elf_adjust_dynamic_copy): New. + * elflink.c (_bfd_elf_adjust_dynamic_copy): New. -2006-02-15 H.J. Lu + * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Call + _bfd_elf_adjust_dynamic_copy to adjust for the copy in dynamic + bss section. + * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. - PR binutils/2338 - * dwarf2.c (check_function_name): New function. - (_bfd_dwarf2_find_nearest_line): Use check_function_name to - check if function is correct. +2007-05-15 Richard Sandiford -2006-02-16 Alan Modra + * elfxx-mips.c (mips_elf_create_local_got_entry): Remove + input_section argument. Create .rela.dyn relocations against + symbol 0 rather than the section symbol. + (mips_elf_local_got_index): Remove input_section argument. + Update call to mips_elf_create_local_got_entry. + (mips_elf_got_page, mips_elf_got16_entry): Likewise. + (mips_elf_calculate_relocation): Update calls to + mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page. - * elflink.c (_bfd_elf_default_action_discarded): Return 0 for - debug sections. - (elf_link_input_bfd): Adjust comments. +2007-05-15 Mark Shinwell -2006-02-10 H.J. Lu + * elf32-arm.c (elf32_arm_final_link_relocate): Correctly + handle the Thumb-2 JUMP19 relocation. - * elf.c (copy_private_bfd_data): Minor update. +2007-05-15 Alan Modra -2006-02-10 H.J. Lu + PR 4479 + * elf.c (elf_fake_sections): Don't allow backend to change + SHT_NOBITS if called for strip/objcopy --only-keep-debug. + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove similar + fix from here. - PR binutils/2258 - * elf.c (copy_private_bfd_data): Renamed to ... - (rewrite_elf_program_header): This. - (copy_elf_program_header): New function. - (copy_private_bfd_data): Likewise. +2007-05-14 Alan Modra -2006-02-07 Nathan Sidwell + * elf.c (bfd_elf_string_from_elf_section): Return NULL on + invalid shstrndx. + (bfd_elf_get_str_section): Likewise. - * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e, - bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x, - bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249, - bfd_mach_mcf547x, bfd_mach_mcf548x): Remove. - (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div, - bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac, - bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, - bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp, - bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac, - bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac, - bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac, - bfd_mach_mcf_isa_b_usp_float_emac): New. - (bfd_default_scan): Update coldfire mapping. - * bfd-in.h (bfd_m68k_mach_to_features, - bfd_m68k_features_to_mach): Declare. - * bfd-in2.h: Rebuilt. - * cpu-m68k.c (arch_info_struct): Add new coldfire machines, - adjust legacy names. - (m68k_arch_features): New. - (bfd_m68k_mach_to_features, - bfd_m68k_features_to_mach): Define. - * elf32-m68k.c (elf32_m68k_object_p): New. - (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags. - (elf32_m68k_print_private_bfd_data): Print the CF EF flags. - (elf_backend_object_p): Define. - * ieee.c (ieee_write_processor): Update coldfire machines. - * libbfd.h: Rebuilt. +2007-05-12 Alan Modra -2006-02-06 Steve Ellcey + PR 4497 + * elf-eh-frame.c (struct cie): Add "local_personality". Make + "personality" a union. + (cie_eq): Compare local_personality too. Adjust personality + comparison. + (_bfd_elf_discard_section_eh_frame): Check binding on personality + reloc sym to allow for bad symtab. Use stashed local syms rather + than reading personality local sym. Handle discarded sections. - * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS - if SHF_TLS is set. +2007-05-12 Alan Modra -2006-02-05 Arnold Metselaar + * elf32-spu.c (elf_howto_table): Add howto for R_SPU_ADDR16X. - * coff-z80.c (r_imm24): New howto. - (rtype2howto): New case R_IMM24. - (coff_z80_reloc_type_lookup): New case BFD_RELOC_24. - (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24. +2007-05-11 Alan Modra -2006-02-04 Richard Sandiford + * elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype. + (enum ppc_elf_plt_type): Move from.. + * elf32-ppc.c: ..here. + (struct ppc_elf_obj_tdata): Add makes_plt_call and has_rel16. + (struct ppc_elf_link_hash_table): Reorder. Add old_bfd. Delete + can_use_new_plt. Make is_vxworks a bitfield. + (ppc_elf_link_hash_table_create): Don't clear is_vxworks (again). + (ppc_elf_check_relocs): Update setting of reloc flags. Set old_bfd. + (ppc_elf_select_plt_layout): Modify parameters. Use bfd reloc + flags to better detect object files needing old bss-style plt. + Allow secure plt to be used without rel16 relocs being detected. + Warn if secure plt request cannot be allowed. - * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol - has already been assigned a GOT index, copy that index to the - current hash table entry. +2007-05-11 Alan Modra -2006-02-01 Eric Botcazou + * reloc.c (BFD_RELOC_SPU_PPU32, BFD_RELOC_SPU_PPU64): Define. + * elf-bfd.h (struct elf_backend_data): Change return type of + elf_backend_relocate_section to int. + * elf32-spu.c (elf_howto_table): Add howtos for R_SPU_PPU32 and + R_SPU_PPU64. + (spu_elf_bfd_to_reloc_type): Convert new relocs. + (spu_elf_count_relocs): New function. + (elf_backend_count_relocs): Define. + (spu_elf_relocate_section): Arrange to emit R_SPU_PPU32 and + R_SPU_PPU64 relocs. + * elflink.c (elf_link_input_bfd): Emit relocs if relocate_section + returns 2. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. - * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass - for call-to-undefweak reloc overflow. +2007-05-10 Richard Sandiford -2006-01-31 Eric Botcazou + * elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries + for R_ARM_ABS12 relocs. + (elf32_arm_finish_dynamic_symbol): Fix the loop that creates + non-shared VxWorks PLT entries. - * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass - for 32-bit relocs overflow. +2007-05-11 Alan Modra -2006-01-27 Paul Brook + PR 4454 + * elf-eh-frame.c (struct cie): Make "personality" a bfd_vma. + (_bfd_elf_discard_section_eh_frame): Handle local syms on + personality relocation. - * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb - objects. +2007-05-10 Richard Sandiford -2006-01-18 Alexandre Oliva + * elf.c (assign_file_positions_for_load_sections): Use p_memsz + rather than p_filesz to calculate the LMA of the end of a segment. - Introduce TLS descriptors for i386 and x86_64. - * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC, - BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC, - BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New. - * libbfd.h, bfd-in2.h: Rebuilt. - * elf32-i386.c (elf_howto_table): New relocations. - (R_386_tls): Adjust. - (elf_i386_reloc_type_lookup): Map new relocations. - (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. - (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. - (struct elf_i386_link_hash_entry): Add tlsdesc_got field. - (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field. - (elf_i386_local_tlsdesc_gotent): New macro. - (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size. - (elf_i386_compute_jump_table_size): New macro. - (link_hash_newfunc): Initialize tlsdesc_got. - (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size. - (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (elf_i386_check_relocs): Likewise. Allocate space for - local_tlsdesc_gotent. - (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (allocate_dynrelocs): Count function PLT relocations. Reserve - space for TLS descriptors and relocations. - (elf_i386_size_dynamic_sections): Reserve space for TLS - descriptors and relocations. Set up sgotplt_jump_table_size. - Don't zero reloc_count in srelplt. - (elf_i386_always_size_sections): New. Set up _TLS_MODULE_BASE_. - (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. - (elf_backend_always_size_sections): Define. - * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC, - R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL. - (R_X86_64_standard): Adjust. - (x86_64_reloc_map): Map new relocs. - (elf64_x86_64_rtype_to_howto): New, split out of... - (elf64_x86_64_info_to_howto): ... this function, and... - (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val. - (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. - (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. - (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field. - (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field. - (elf64_x86_64_local_tlsdesc_gotent): New macro. - (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt, - tlsdesc_got and sgotplt_jump_table_size fields. - (elf64_x86_64_compute_jump_table_size): New macro. - (link_hash_newfunc): Initialize tlsdesc_got. - (elf64_x86_64_link_hash_table_create): Initialize new fields. - (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and - R_X86_64_TLSDESC_CALL. - (elf64_x86_64_check_relocs): Likewise. Allocate space for - local_tlsdesc_gotent. - (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and - R_X86_64_TLSDESC_CALL. - (allocate_dynrelocs): Count function PLT relocations. Reserve - space for TLS descriptors and relocations. - (elf64_x86_64_size_dynamic_sections): Reserve space for TLS - descriptors and relocations. Set up sgotplt_jump_table_size, - tlsdesc_plt and tlsdesc_got. Make room for them. Don't zero - reloc_count in srelplt. Add dynamic entries for DT_TLSDESC_PLT - and DT_TLSDESC_GOT. - (elf64_x86_64_always_size_sections): New. Set up - _TLS_MODULE_BASE_. - (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and - R_386_TLS_DESC_CALL. - (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. - (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and - DT_TLSDESC_GOT. Set up TLS descriptor lazy resolver PLT entry. - (elf_backend_always_size_sections): Define. +2007-05-10 Jakub Jelinek -2006-01-17 H.J. Lu + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc + processing if symbol is defined in the executable. - PR binutils/2096 - * dwarf2.c (comp_unit_contains_address): Update comment. - (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of - lma. Return TRUE only if both comp_unit_contains_address and - comp_unit_find_nearest_line return TRUE. - (_bfd_dwarf2_find_line): Use section's vma, instead of lma. +2007-05-10 Alexandre Oliva -2006-01-18 Alan Modra + * elf32-frv.c (_frvfdpic_check_discarded_relocs): New. + (frvfdpic_elf_discard_info): New. + (elf_backend_discard_info): Define for FDPIC. - * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref. - (bfd_elf_gc_mark_dynamic_ref_symbol): Declare. - * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from - elf_gc_mark_dynamic_ref_symbol. Make global. - (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref. - * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define. +2007-05-09 Mark Shinwell + + * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Don't + attempt to scan if the bfd doesn't correspond to an ELF image. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise. + +2007-05-08 Alexandre Oliva + + * elf32-frv.c (elf32_frv_relocate_section): Discard dynamic relocs + for which _bfd_elf_section_offset returns -1. + +2007-05-08 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Use "void *" for psyms. + (mark_functions_via_relocs): Likewise. + +2007-05-07 Alan Modra + + * elflink.c (bfd_elf_final_link): Correct reloc handling for + elf_backend_count_relocs. + (bfd_elf_discard_info): Print an error if we can't read syms. + +2007-05-07 Alan Modra + + * elf32-spu.c (spu_elf_reloc_type_lookup): Return NULL on + invalid reloc code. + (spu_elf_gc_mark_hook, spu_elf_section_processing): Delete functions. + (elf_backend_gc_mark_hook, elf_backend_section_processing): Don't + define. + +2007-05-07 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Don't check + core segment. + +2007-05-04 H.J. Lu + + * elflink.c (elf_link_sort_relocs): Return if both .rela.dyn + and .rel.dyn aren't present. + +2007-05-04 Nick Clifton + + * elflink.c (elf_link_sort_relocs): If both .rela.dyn and .rel.dyn + sections are present examine the indirect sections in an attempt + to compute the correct relocation size. If there is any + ambiguity, produce an error and refuse to sort. + +2007-05-03 Sandra Loosemore + + * elf32-arm.c (allocate_dynrelocs): Fix typo in comment. + +2007-05-03 Vincent Riviere + Nick Clifton + + PR gas/3041 + * aoutx.h (swap_std_reloc_out): Treat relocs against weak symbols + in the same way as relocs against external symbols. + +2007-05-02 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Set sh_offset + here. Set sh_type to SHT_NOBITS if we won't be allocating + file space. Don't bump p_memsz for non-alloc sections. Adjust + section-in-segment check. + (assign_file_positions_for_non_load_sections): Don't set sh_offset + here for sections that have already been handled above. + +2007-04-30 Alan Modra + + * elf32-spu.c (struct spu_link_hash_table): Add stack_analysis + and emit_stack_syms bitfields. + (get_sym_h): Read all symbols if stack analysis will be done. + (spu_elf_create_sections): Add stack_analysis and emit_stack_syms + params, and stash in hash table. + (is_hint): Split off from.. + (is_branch): ..here. Adjust callers. + (spu_elf_size_stubs): Add stack_analysis param. Arrange to read + and keep all syms. + (write_one_stub): Fix mem leak. + (find_function_stack_adjust): New function. + (sort_syms_syms, sort_syms_psecs): New vars. + (sort_syms): New function. + (struct call_info, struct function_info): New. + (struct spu_elf_stack_info): New. + (alloc_stack_info, maybe_insert_function, func_name): New functions. + (is_nop, insns_at_end, check_function_ranges): Likewise. + (find_function, insert_callee, mark_functions_via_relocs): Likewise. + (pasted_function, interesting_section, discover_functions): Likewise. + (mark_non_root, call_graph_traverse, build_call_tree): Likewise. + (sum_stack, spu_elf_stack_analysis, spu_elf_final_link): Likewise. + (bfd_elf32_bfd_final_link): Define. + * elf32-spu.h (struct _spu_elf_section_data): Add stack_info field. + (spu_elf_create_sections, spu_elf_size_stubs): Update prototypes. + +2007-04-28 Sergey Rogozhkin + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access + memory which we might not own. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function. + (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Likewise. + (elf_xtensa_allocate_dynrelocs): Use elf_xtensa_make_sym_local. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Step through table + contents and relocs in parallel. + +2007-04-27 Bob Wilson + + * elf32-xtensa.c (relax_property_section): Remove extra irel increment. + +2007-04-27 Alan Modra + + * cpu-rs6000.c: Write Mimi's name in ASCII. + * coff-rs6000.c: Likewise. + * rs6000-core.c: Likewise. + +2007-04-27 Alan Modra + + * sysdep.h: Include config.h first. + Many files: Include sysdep.h before bfd.h. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-25 Alan Modra + + * sysdep.h: Revert last change. + +2007-04-24 Nick Clifton + + * coffcode.h (coff_slurp_reloc_table): Initialise dst.r_offset. + * coff-m68k.c (m68kcoff_rtype_to_howto): Initialize relent.howto. + +2007-04-24 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Warn if + eh_frame_hdr table won't be created. + +2007-04-24 Alan Modra + + * acinclude.m4: Include config/stdint.m4. + * configure.in: Invoke GCC_HEADER_STDINT. + * sysdep.h: Don't include ansidecl.h here. + * configure: Regenerate. + * config.in: Regenerate. + * Makefile.in: Regenerate. + +2007-04-23 Nathan Sidwell + + * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac, + bfd_mach_mcf_isa_c_emac): New. + * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry, + elf_isac_plt_entry, elf_isac_plt_info): New. + (elf32_m68k_object_p): Add ISA_C. + (elf32_m68k_print_private_bfd_data): Print ISA_C. + (elf32_m68k_get_plt_info): Detect ISA_C. + * cpu-m68k.c (arch_info): Add ISAC. + (m68k_arch_features): Likewise, + (bfd_m68k_compatible): ISAs B & C are not compatible. + +2007-04-21 Nick Clifton + + * ecoff.c (_bfd_ecoff_write_armap): Initialise rehash. + (ecoff_link_add_archive_symbols): Likewise. + * coff-m68k.c (m68kcoff_common_addend_rtype_to_howto): Initialise + relent.howto. + * ieee.c (parse_int): Initialise x. + (must_parse_int): Initialise result. + (ieee_slurp_external_symbols): Initialise value. + +2007-04-21 Alan Modra + + * config.bfd (spu-*-elf): Delete targ_selvecs. + +2007-04-19 Nick Clifton + + * coffcode.h (coff_rtype_to_howto): Initialise genrel.howto. + +2007-04-19 Alan Modra + + * bfd.c (bfd_demangle): New function. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + +2007-04-18 Matthias Klose + + * Makefile.am (libbfd_la_LDFLAGS): Use bfd soversion. + (bfdver.h): Use the date in non-release builds for the soversion. + * Makefile.in: Regenerate. + +2007-04-17 Paul Brook + + * elf.c (_bfd_elf_is_function_type): New function. + * elflink.c (_bfd_elf_merge_symbol): Use bed->is_function_type. + (_bfd_elf_dynamic_symbol_p, _bfd_elf_symbol_refs_local_p, + is_global_data_symbol_definition, elf_link_add_object_symbols): Ditto. + * elf-bfd.h (elf_backend_data): Add is_function_type. + (_bfd_elf_is_function_type): Add prototype. + * elfxx-target.h (elf_backend_is_function_type): Add default + definition. + (elfNN_bed): Add elf_backend_is_function_type. + * elf32-arm.c (elf32_arm_is_function_type): New function. + (elf_backend_is_function_type): Define. + +2007-04-17 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Put + DT_MIPS_RLD_MAP before DT_DEBUG again. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * configure.in: Change macro call order. + * Makefile.in: Regnerate. + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + +2007-04-14 Jakub Jelinek + + * elflink.c (bfd_elf_final_link): Don't free symbuf for + non-elf input bfds. + (bfd_elf_size_dynamic_sections): Don't access elf_section_data + for non-elf input bfds. + +2007-04-12 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add + DT_MIPS_RTLD_MAP for PIEs. + +2007-04-12 Richard Sandiford + + * elfxx-mips.c (mips_elf_calculate_relocation): Set DT_TEXTREL + when creating a __GOTT_BASE__ or __GOTT_INDEX__ relocation + in a read-only section. + (_bfd_mips_elf_check_relocs): Likewise. + +2007-04-12 Bob Wilson + + * elf32-xtensa.c (xtensa_is_insntable_section): New. + (xtensa_is_proptable_section): New. + (elf_xtensa_discard_info_for_section): Handle "full" .xt.prop property + tables with 12-byte entries, as well as tables with 8-byte entries. + Sort the relocations before examining them. + (relax_property_section): Use xtensa_is_proptable_section and + xtensa_is_littable_section. Rewrite code for combining table entries + to be more robust in case of unexpected relocations. Do not set offset + of unused relocations to less than zero. + (xtensa_is_property_section): Use other functions instead of + duplicating section name comparisons. + (xtensa_is_littable_section): Use CONST_STRNEQ for ".gnu.linkonce.p.". + (xtensa_get_property_predef_flags): Use xtensa_is_insntable_section. + +2007-04-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Don't follow references + from Xtensa property sections. + +2007-04-12 Alan Modra + + * elf32-spu.c (needs_ovl_stub): Test that spu_elf_section_data + is non-NULL before dereferencing. + +2007-04-11 Nathan Sidwell + + * elf-vxworks.c (elf_vxworks_emit_relocs): Remap weakdef PLT slot + relocs too. + +2007-04-10 Richard Henderson + + * elf64-alpha.c (struct alpha_elf_link_hash_table): Add relax_trip. + (elf64_alpha_size_got_sections): Remove unused something_changed local. + (elf64_alpha_size_plt_section): Return void. + (elf64_alpha_size_rela_got_section): Likewise. + (elf64_alpha_relax_section): Only regenerate got+plt if the + relax_trip counter has changed. + +2007-04-09 Daniel Jacobowitz + + * Makefile.am (bfdver.h): Do not generate doc/bfdver.texi. + * doc/Makefile.am (DOCFILES): Add bfdver.texi. + (bfdver.texi): New rule. + * Makefile.in, doc/Makefile.in: Regenerated. + +2007-04-03 Matt Thomas + + * elf32-vax.c (elf_vax_relocate_section): Do not emit a PCREL reloc + in a shared object if it is not in a CODE section or if it is against + a section symbol. This allows DWARF2 to use pcrel format. + +2007-04-05 H.J. Lu + + PR ld/4304 + * elflink.c (bfd_elf_final_link): Call einfo callback in + bfd_link_info instead of _bfd_error_handler for DT_TEXTREL + warning. + +2007-04-05 Alan Modra + + * elf32-spu.c (spu_elf_output_symbol_hook): New function. + (elf_backend_link_output_symbol_hook): Define. + +2007-04-02 Nick Clifton + + PR binutils/4292 + * bfd.c (bfd_fprintf_vma): Do not print addresses of 32-bit + targets as 64-bit values, even if running on a 64-bit host. + * coffgen.c (coff_print_symbol): Likewise. + +2007-03-29 Nick Clifton + + PR binutils/4110 + * elf.c (IS_VALID_GROUP_SECTION_HEADER): New macro. + (setup_group): Use it. Report corrupt group section headers. + (bfd_section_from_shdr): Use new macro. Replace constant 4 with + GRP_ENTRY_SIZE. Cope with NULLs in the group section table. + (elf_fake_section): Replace constant 4 with GRP_ENTRY_SIZE. + +2007-03-29 Alan Modra + + PR ld/4267 + * elflink.c (evaluate_complex_relocation_symbols): Use bfd_vma + for rel->r_info values. + (bfd_elf_perform_complex_relocation): Likewise. + * elf32-ppc.c (allocate_dynrelocs): Set plt.offset to -1 for + unused entries. Don't clear plt.plist in loop. + +2007-03-28 Richard Sandiford + + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove append_rela. + * elfxx-sparc.c (sparc_elf_append_rela_64, sparc_elf_append_rela_32): + Merge into... + (sparc_elf_append_rela): ...this new function. + (SPARC_ELF_APPEND_RELA): Delete. + (_bfd_sparc_elf_link_hash_table_create): Don't initialize + the deleted append_rela field. + (_bfd_sparc_elf_relocate_section): Use sparc_elf_append_rela + instead of SPARC_ELF_APPEND_RELA. + (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. Use the + elf_size_info structure to find the size of a RELA entry and + the associated swap-out function. + (sparc64_finish_dyn, sparc64_finish_dyn): Merge into... + (sparc_finish_dyn): ...this new function. + (_bfd_sparc_elf_finish_dynamic_sections): Update calls accordingly. + +2007-03-28 Richard Sandiford + Phil Edwards + + * doc/bfd.texinfo: Put the contents after the title page rather + than at the end of the document. + +2007-03-27 Andreas Schwab + + * elfxx-ia64.c (elf_backend_default_execstack): Define to 0. + +2007-03-26 H.J. Lu + + * configure: Regenerated. + +2007-03-26 Alan Modra + + * elf32-spu.c (struct stubarr): Add stub_hash_table and err fields. + (allocate_spuear_stubs): New function. + (spu_elf_size_stubs): Call allocate_spuear_stubs. + +2007-03-26 Alan Modra + + * aout-adobe.c (aout_32_bfd_reloc_name_lookup): Define. + * aout-arm.c (MY_bfd_reloc_name_lookup): Define. + (MY (bfd_reloc_name_lookup)): New function. + * aout-ns32k.c (MY (bfd_reloc_name_lookup)): New function. + * aout-target.h (NAME (aout, reloc_name_lookup)): Declare. + (MY_bfd_reloc_name_lookup): Define. + * aout-tic30.c (tic30_aout_reloc_name_lookup): New function. + (MY_bfd_reloc_name_lookup): Define. + * aoutx.h (NAME (aout, reloc_type_lookup)): Don't declare. + (NAME (aout, reloc_name_lookup)): New function. + * bout.c (b_out_bfd_reloc_name_lookup): New function. + * coff-alpha.c (alpha_bfd_reloc_name_lookup): New function. + (_bfd_ecoff_bfd_reloc_name_lookup): Define. + * coff-arm.c (coff_arm_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-i386.c (coff_bfd_reloc_name_lookup): Define. + (coff_i386_reloc_name_lookup): New function. + * coff-i860.c (coff_i860_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-i960.c (coff_i960_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-m68k.c (m68k_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-maxq.c (maxq_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-mcore.c (mcore_coff_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-mips.c (mips_bfd_reloc_name_lookup): New function. + (_bfd_ecoff_bfd_reloc_name_lookup): Define. + * coff-ppc.c (ppc_coff_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-rs6000.c (coff_bfd_reloc_name_lookup): Define. + (_bfd_xcoff_reloc_name_lookup): New function. + (rs6000coff_vec, pmac_xcoff_vec): Init new field. + * coff-sh.c (coff_bfd_reloc_name_lookup): Define. + (sh_coff_reloc_name_lookup): New function. + * coff-sparc.c (coff_sparc_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-tic30.c (coff_bfd_reloc_name_lookup): Define. + (tic30_coff_reloc_name_lookup): New function. + * coff-tic4x.c (coff_bfd_reloc_name_lookup): Define. + (tic4x_coff_reloc_name_lookup): New function. + * coff-tic54x.c (coff_bfd_reloc_name_lookup): Define. + (tic54x_coff_reloc_name_lookup): New function. + * coff-x86_64.c (coff_bfd_reloc_name_lookup): Define. + (coff_amd64_reloc_name_lookup): New function. + * coff-z80.c (coff_z80_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff-z8k.c (coff_z8k_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * coff64-rs6000.c (coff_bfd_reloc_name_lookup): Define. + (xcoff64_reloc_name_lookup): New function. + (rs6000coff64_vec, aix5coff64_vec): Init new field. + * coffcode.h (coff_bfd_reloc_name_lookup): Define. + * elf-hppa.h (elf_hppa_reloc_name_lookup): New function. + * elf-m10200.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf-m10300.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-arc.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-arm.c (elf32_arm_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-avr.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-bfin.c (bfin_bfd_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-cr16c.c (elf_cr16c_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-cris.c (cris_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-crx.c (elf_crx_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-d10v.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-d30v.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-dlx.c (elf32_dlx_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-fr30.c (fr30_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-frv.c (frv_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-gen.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-h8300.c (elf32_h8_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-hppa.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i370.c (i370_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i386.c (elf_i386_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i860.c (elf32_i860_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-i960.c (elf32_i960_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-ip2k.c (ip2k_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-iq2000.c (iq2000_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m32c.c (m32c_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m32r.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68hc11.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68hc12.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-m68k.c (reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-m88k.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mcore.c (mcore_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mep.c (mep_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. + (mips_vxworks_bfd_reloc_name_lookup): Likewise. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-msp430.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-mt.c (mt_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-openrisc.c (openrisc_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-or32.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elf32-pj.c (pj_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-ppc.c (ppc_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-s390.c (elf_s390_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-score.c (elf32_score_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-sh.c (sh_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-sparc.c (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-spu.c (spu_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-v850.c (v850_elf_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-vax.c (reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xc16x.c (xc16x_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xstormy16.c (xstormy16_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf32-xtensa.c (elf_xtensa_reloc_name_lookup): New function. + (bfd_elf32_bfd_reloc_name_lookup): Define. + * elf64-alpha.c (elf64_alpha_bfd_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-gen.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-hppa.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-mips.c (bfd_elf64_bfd_reloc_name_lookup): New function. + * elf64-mmix.c (bfd_elf64_bfd_reloc_name_lookup): New function. + * elf64-ppc.c (ppc64_elf_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-s390.c (elf_s390_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-sh64.c (sh_elf64_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-sparc.c (bfd_elf64_bfd_reloc_name_lookup): Define. + * elf64-x86-64.c (elf64_x86_64_reloc_name_lookup): New function. + (bfd_elf64_bfd_reloc_name_lookup): Define. + * elfn32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function. + * elfxx-ia64.c (elfNN_ia64_reloc_name_lookup): New function. + (bfd_elfNN_bfd_reloc_name_lookup): Define. + * elfxx-sparc.c (_bfd_sparc_elf_reloc_name_lookup): New function. + * elfxx-sparc.h (_bfd_sparc_elf_reloc_name_lookup): Declare. + * i386msdos.c (msdos_bfd_reloc_name_lookup): Define. + * i386os9k.c (aout_32_bfd_reloc_name_lookup): Define. + * ieee.c (ieee_bfd_reloc_name_lookup): Define. + * libaout.h (NAME (aout, reloc_name_lookup)): Declare. + * libbfd-in.h (_bfd_norelocs_bfd_reloc_name_lookup): Declare. + * mipsbsd.c (MY_bfd_reloc_name_lookup): Define. + (MY(reloc_type_lookup)): Rename from MY(reloc_howto_type_lookup). + (MY(reloc_name_lookup)): New function. + * nlm-target.h (nlm_bfd_reloc_name_lookup): Define. + * oasys.c (oasys_bfd_reloc_name_lookup): Define. + * pdp11.c (NAME (aout, reloc_name_lookup)): New function. + * pe-mips.c (coff_mips_reloc_name_lookup): New function. + (coff_bfd_reloc_name_lookup): Define. + * reloc.c (bfd_reloc_name_lookup): New function. + * riscix.c (riscix_reloc_name_lookup): New function. + (MY_bfd_reloc_name_lookup): Define. + * som.c (som_bfd_reloc_name_lookup): New function. + * targets.c (struct bfd_target): Add reloc_name_lookup. + (BFD_JUMP_TABLE_RELOCS): Add NAME##_bfd_reloc_name_lookup. + * versados.c (versados_bfd_reloc_name_lookup): Define. + * vms.c (vms_bfd_reloc_name_lookup): New function. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2007-03-26 Thiemo Seufer + + PR ld/4208 + * elfxx-mips.c (mips_elf_next_relocation): Don't signal an error if no + matching relocation is found. + (_bfd_mips_elf_relocate_section): Only warn about missing relocations. + +2007-03-23 H.J. Lu + + * configure: Regenerated. + +2007-03-23 Joseph Myers + + * configure.in: Use ACX_PKGVERSION and ACX_BUGURL. + * configure: Regenerate. + +2007-03-23 Alan Modra + + * elf32-spu.c (spu_stub_name): Don't put input section in stub name. + Remove input_sec param. Adjust all calls. + (write_one_stub): Adjust stub symbol. + (needs_ovl_stub): New function, extracted from.. + (spu_elf_size_stubs): ..here. + (spu_elf_relocate_section): Use needs_ovl_stub. + +2007-03-22 Joseph Myers + + * Makefile.am (bfdver.h): Only set VERSION_PACKAGE in bfdver.texi + if nonempty. + * configure.in (REPORT_BUGS_TO): Do not use "URL:" prefix. + * Makefile.in, configure, doc/Makefile.in: Regenerate. + +2007-03-22 H.J. Lu + + PR ld/4210 + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the virtual + address and virtual size of the last section for the image + size. + +2007-03-22 H.J. Lu + + PR ld/4007 + * elf.c (assign_file_positions_for_load_sections): Check if + all sections are in the segment. + +2007-03-20 H.J. Lu + + PR ld/4208 + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Report missing + matching LO16 relocation for HI16 relocation. + +2007-03-20 Paul Brook + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_link_hash_table): Add pic_veneer. + (record_arm_to_thumb_glue): Use globals->pic_veneer. + (elf32_arm_create_thumb_stub): Ditto. + (bfd_elf32_arm_set_target_relocs): Set globals->pic_veneer. + +2007-03-18 Mark Shinwell + + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add "bfd *" + argument and extra last argument. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_obj_tdata): Add no_enum_size_warning + member. + (bfd_elf32_arm_set_target_relocs): Add "bfd *" argument and + extra last argument. Set no_enum_size_warning appropriately. + (elf32_arm_merge_eabi_attributes): Improve enum sizes + diagnostic, suppressing it when no_enum_size_warning dictates. + +2007-03-20 Nick Clifton + + PR binutils/3535 + * elf.c (copy_private_bfd_data): Widen the scope of Solaris + specific conditions that need the program headers to be + rewritten. + +2007-03-19 H.J. Lu + + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Store Magic, + MajorLinkerVersion, MinorLinkerVersion, SizeOfCode, + SizeOfInitializedData, SizeOfUninitializedData, + AddressOfEntryPoint, BaseOfCode and BaseOfData in internal + extra PE a.out header. + (IMAGE_NT_OPTIONAL_HDR_MAGIC): Defined as 0x10b if not defined. + (IMAGE_NT_OPTIONAL_HDR64_MAGIC): Defined as 0x20b if not + defined. + (IMAGE_NT_OPTIONAL_HDRROM_MAGIC): Defined as 0x107 if not + defined. + (_bfd_XX_print_private_bfd_data_common): Also print Magic, + MajorLinkerVersion, MinorLinkerVersion, SizeOfCode, + SizeOfInitializedData, SizeOfUninitializedData, + AddressOfEntryPoint, BaseOfCode and BaseOfData from internal + extra PE a.out header. + +2007-03-18 H.J. Lu + + * targets.c (_bfd_target_vector): Add bfd_efi_app_x86_64_vec + only if BFD64 is defined. + +2007-03-17 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Always use an overlay stub + on setjmp calls. + +2007-03-15 H.J. Lu + + * doc/Makefile.in: Regenerated. + +2007-03-15 H.J. Lu + + * Makefile.am (bfdver.h): Substitute report_bugs_to. Also + create doc/bfdver.texi. + * Makefile.in: Regenerated. + + * configure.in (--with-bugurl): New option. + * configure: Regenerated. + + * version.h (REPORT_BUGS_TO): New. + +2007-03-13 H.J. Lu + + PR binutils/3826 + * elf-bfd.h (elf_backend_data): Add elf_osabi. + (_bfd_elf_set_osabi): New. + + * elf.c (_bfd_elf_set_osabi): New. + + * elf32-hppa.c (elf32_hppa_post_process_headers): Removed. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + (ELF_OSABI): Properly defined for each target. + + * elf32-i370.c (i370_elf_post_process_headers): Removed. + (ELF_OSABI): Defined. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for + freebsd. + (elf_i386_post_process_headers): Set EI_OSABI with elf_osabi. + + * elf32-msp430.c (elf32_msp430_post_process_headers): Removed. + (ELF_OSABI): Defined. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for + freebsd. + (elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with + elf_osabi. + + * elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI + with elf_osabi. + (ELF_OSABI): Properly defined for each target. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi for Linux. + + * elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed. + (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed. + (ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd. + (elf_backend_post_process_headers): Defined with + _bfd_elf_set_osabi. + + * elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target + with any ELF target of the compatible machine for which we do not + have a specific backend. + + * elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI + with elf_osabi. + + * elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE. + (elfNN_bed): Initialize elf_osabi with ELF_OSABI. + +2007-03-08 Alan Modra + + * elf32-v850.c (v850_elf_link_output_symbol_hook): Clean out + V850_OTHER_* bits. + +2007-03-08 Alan Modra + + * Makefile.am (BFD64_BACKENDS): Add efi-app-x86_64.lo. + (BFD64_BACKENDS_CFILES): Add efi-app-x86_64.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2007-03-07 H.J. Lu + + * config.bfd (x86_64-*-freebsd*): Add bfd_efi_app_x86_64_vec. + (x86_64-*-kfreebsd*-gnu): Likewise. + (x86_64-*-netbsd*): Likewise. + (x86_64-*-openbsd*): Likewise. + (x86_64-*-linux-*): Likewise. + + * configure.in: Support bfd_efi_app_x86_64_vec. + * configure: Regenerated. + + * efi-app-x86_64.c: New file. + + * targets.c (bfd_efi_app_x86_64_vec): New. + (_bfd_target_vector): Add bfd_efi_app_x86_64_vec. + +2007-03-07 Kai Tietz + + * reloc.c (bfd_generic_get_relocated_section_contents): Remove + const for type reloc_howto_type. + +2007-03-07 Alan Modra + + PR 3958 + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): No error on relocatable link. + (elf_discarded_section): Move.. + * bfd-in.h: ..to here. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_input_bfd): Don't zap relocs against symbols + from discarded sections before relocate_section has done its job. + * reloc.c (bfd_generic_get_relocated_section_contents): Handle + relocs against symbols from discarded sections. + * elf-hppa.h (elf_hppa_howto_table): Set size. Set dst_mask on + SECREL32. + (elf_hppa_relocate_section): Handle relocatable link after setting + sec, sym, h etc. for final link. Squash error messages for + relocatable link. Clear section contents for relocs against + symbols in discarded sections, and zero reloc. Remove existing + zero r_symndx code. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.c (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. + (bfin_relocate_section): Likewise. + * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-crx.c (elf32_crx_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m32c.c (m32c_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mep.c (mep_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-mt.c (mt_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-score.c (_bfd_score_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise. + (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elf32-arm.c (elf32_arm_relocate_section): Always adjust section + symbols for relocatable link. Don't use always-zero st_value. + (elf_backend_rela_normal): Don't define. + * elf32-bfin.c (bfinfdpic_relocate_section): Use + RELOC_FOR_GLOBAL_SYMBOL. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Combine SEC_MERGE + section symbol adjustments with same for relocatable link. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m68hc1x.c (m68hc11_get_relocation_value): Move.. + (elf32_m68hc11_check_relocs): ..to here. + * elf32-score.c (score_elf_final_link_relocate): Remove zero + r_symndx code. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2007-03-07 Alan Modra + + PR 4144 + * elf.c (assign_file_positions_for_load_sections): Don't + adjust p_memsz for !SEC_LOAD section vma modulo page size. + Instead, use the same lma based adjustment for SEC_LOAD + sections. + +2007-03-01 Bob Wilson + + * elf32-xtensa.c (analyze_relocations): Zero src_count if not relaxing. + (find_relaxable_sections): Do not increment src_count for unknown + opcodes. Decode only once instead of calling is_l32r_relocation. + (compute_text_actions): Remove unused no_insn_move flag. Assert that + src_next matches src_count in relax_info. + +2007-03-01 Joseph Myers + + * Makefile.am (bfdver.h): Use "." not " " between version number + and date. + * Makefile.in: Regenerate. + * configure.in (PKGVERSION): Default to "(GNU Binutils) ". + * configure: Regenerate. + +2007-02-28 Nathan Sidwell + + * config.bfd (sh-*-uclinux, sh[12]-*-uclinux): New stanza. + +2007-02-27 Alan Modra + + * elf32-spu.h (struct _ovl_stream): Make "start" and "end" const. + * elf32-spu.c (ovl_mgr_pread): Add const to casts. + +2007-02-23 Carlos O'Donell + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit + DWARF even with 64-bit addresses. + (_bfd_dwarf2_find_nearest_line): Likewise. + +2007-02-23 Nick Clifton + + PR binutils/3535 + * elf.c (copy_private_bfd_data): Always rewrite the program + headers when a Solaris interpreter segment is involved. + +2007-02-22 Paul Brook + + * elflink.c (gc_mark_hook_fn): Remove. + (_bfd_elf_gc_mark): Rename gc_mark_hook_fn to elf_gc_mark_hook_fn. + (bfd_elf_gc_sections): Ditto. Call gc_mark_extra_sections. + * elf-bfd.h (elf_gc_mark_hook_fn): Define. + (elf_backend_data): Add gc_mark_extra_sections. + * elfxx-target.h (elf_backend_gc_mark_extra_sections): Provide default + definition. + (elfNN_bed): Add elf_backend_gc_mark_extra_sections. + * elf32-arm.c (elf32_arm_gc_mark_extra_sections): New function. + (elf_backend_gc_mark_extra_sections): Define. + +2007-02-21 Nick Clifton + + * elf.c (_bfd_elf_map_sections_to_segments): If the + override_segment_assignment callback is defined then call it. + +2007-02-21 Alan Modra + + * elf32-spu.c (spu_elf_size_stubs): Correct order of warning args. + +2007-02-19 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Remove + translation marker from untranslatable strings. + +2007-02-19 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add default_execstack. + * elflink.c (bfd_elf_size_dynamic_sections): Heed default_execstack. + * elfxx-target.h (elf_backend_default_execstack): Define to 1. (elfNN_bed): Init new field. - * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define. - (ppc64_elf_gc_mark_dynamic_ref): New function. + * elf64-ppc.c (elf_backend_default_execstack): Define to 0. -2006-01-17 Alan Modra +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus - * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop. + * configure.in (--with-pkgversion): New option. + * configure: Regenerate. + * Makefile.am (bfdver.h): Substitute for @bfd_version_package@. + * Makefile.in: Regenerate. + * version.h (BFD_VERSION_STRING): Define using + @bfd_version_package@. -2006-01-17 Nick Clifton +2007-02-16 Carlos O'Donell - PR binutils/2159 - * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused - parameters. + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): + Print EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_XGOT + and EF_MIPS_UCODE. -2006-01-11 Nick Clifton +2007-02-15 Alan Modra - * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry - into the newly (re)allocated map array. + * libbfd-in.h (_bfd_norelocs_get_reloc_upper_bound): Don't define, + declare. + (_bfd_norelocs_canonicalize_reloc): Likewise. + * libbfd.h: Regenerate. + * libbfd.c (_bfd_norelocs_get_reloc_upper_bound): New function. + (_bfd_norelocs_canonicalize_reloc): Likewise. + * binary.c (binary_bfd_reloc_type_lookup): Don't define. + (binary_get_reloc_upper_bound, binary_canonicalize_reloc): Likewise. + (binary_vec): Use _bfd_norelocs in BFD_JUMP_TABLE_RELOCS. + * ihex.c: Similarly. + * mach-o-target.c: Similarly. + * mach-o.c: Similarly. + * mmo.c: Similarly. + * pef.c: Similarly. + * ppcboot.c: Similarly. + * srec.c: Similarly. + * xsym.c: Similarly. -2006-01-09 Alexis Wilke +2007-02-14 H.J. Lu - * peXXigen.c (tbl): Add comma after "HIGH3ADJ". + PR ld/3953 + * elflink.c (_bfd_elf_add_default_symbol): Check warning symbol + when adding default symbol. -2006-01-01 Jakub Jelinek +2007-02-13 Alan Modra - * elf64-ppc.c (ppc64_elf_action_discarded): Return 0 - for .toc1 section. + * elf64-ppc.c (create_linkage_sections): Use section ".branch_lt" + for branch lookup table. -For older changes see ChangeLog-2005 +2007-02-12 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Don't create + .rela.rodata.brlt for --emit-relocs. + (ppc_build_one_stub): Create relocs for brlt --emit-relocs here. + (ppc_size_one_stub): Count them. Simplify test of stub type + when counting stub relocs. Set SEC_RELOC too. + (ppc64_elf_size_stubs): Clear reloc_count and SEC_RELOC. + (ppc64_elf_finish_dynamic_sections): Output brlt relocs. + +2007-02-12 Alan Modra + + * elflink.c (evaluate_complex_relocation_symbols): Ignore relocs + with a zero symbol index. + +2007-02-12 Alan Modra + + * elflink.c (bfd_elf_discard_info): Tidy setting of "eh". + +2007-02-05 Dave Brolley + Stan Cox + + PR ld/3972 + * elflink.c (elf_link_input_bfd): Always setup finfo->internal_syms. + +2007-02-05 Dave Brolley + Richard Sandiford + Stan Cox + Nick Clifton + DJ Delorie + Frank Ch. Eigler + Ben Elliston + Richard Henderson + + * Makefile.am (ALL_MACHINES): Add cpu-mep.lo. + (ALL_MACHINES_CFILES): Add CPU_MEP.c. + (BFD32_BACKENDS): Add elf32-mep.lo. + (BFD32_BACKENDS_CFILES): Add elf32-mep.c. + (cpu-mep.lo,elf32-mep.lo): New targets. + * archures.c (bfd_arch_mep): New enumerator. + (bfd_mach_mep, bfd_mach_mep_h1): New macros. + (bfd_mep_arch): New external variable. + (bfd_archures_list): Add bfd_mep_arch. + * config.bfd: Support mep-*-elf. + * configure.in: Support bfd_elf32_mep_vec and bfd_elf32_mep_little_vec. + * reloc.c (BFD_RELOC_MEP_*): New relocation numbers. + * targets.c (bfd_elf32_mep_vec,bfd_elf32_mep_little_vec): New extern + declarations. + (_bfd_target_vector): Add bfd_elf32_mep_vec and + bfd_elf32_mep_little_vec. + * mep-relocs.pl: New file. + * cpu-mep.c: New file. + * elf32-mep.c: New file. + * bfd-in2.h: Regenerate. + * po/POTFILES.in: Regenerate. + * libbfd.h: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-05 Dave Brolley + + * elflink.c (evaluate_complex_relocation_symbols): Check for + STT_SRELC for global symbols. + (perform_complex_relocations): Renamed to + perform_complex_relocation and now examines only one relocation. + (elf_link_input_bfd): Don't call perform_complex_relocations. + * elf-bfd.h (bfd_elf_perform_complex_relocation_: New prototype. + * elf32-mep.c (mep_elf_howto_table): Add R_RELC. + (OD,OS,OU): #undefs corrected to N, S and U repectively. + (mep_reloc_type_lookup): Handle BFD_RELOC_RELC. + (complex_reloc_installation_howto): Removed. + (mep_info_to_howto_rela): Remove special case for r_type==0xff. + (mep_elf_relocate_section): Call bfd_elf_perform_complex_relocation. + +2007-02-05 Dave Brolley + Richard Sandiford + DJ Delorie + Graydon Hoare + Nick Clifton + Jeff Holcomb + Frank Ch. Eigler + + * elf-bfd.h (bfd_elf_perform_complex_relocations): New prototype. + * elf.c (swap_out_syms): Handle BSF_RELC and BSF_SRELC. + * elfcode.h (elf_slurp_symbol_table): Handle STT_RELC and STT_SRELC. + * elflink.c (set_symbolValue): New static function. + (resolve_symbol): Likewise. + (resolve_section): Likewise. + (undefined_reference): Likewise. + (eval_symbol): Likewise. + (evaluate_complex_relocation_symbols): Likewise. + (put_value): Likewise. + (get_value): Likewise. + (decode_complex_addend): + (bfd_elf_perform_complex_relocation): New function. + (elf_link_input_bfd): Call evaluate_complex_relocation_symbols. + * reloc.c (BFD_RELOC_RELC): New relocation number. + * syms.c (BSF_RELC,BSF_SRELC): New macros. + +2007-02-05 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_make_sym_local): Delete. + (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Delete. + (elf_xtensa_fix_refcounts, elf_xtensa_allocate_plt_size) + (elf_xtensa_allocate_got_size): Replace these with... + (elf_xtensa_allocate_dynrelocs): ...this new function. + (elf_xtensa_size_dynamic_sections): Use it. + +2007-02-05 Bob Wilson + + * elf32-xtensa.c (elf_howto_table) + : + Set src_mask to zero. + : Likewise. Also fix dst_mask. + : Set pcrel_offset to TRUE. + +2007-02-02 Bob Wilson + + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Renamed to... + (elf_xtensa_dynamic_symbol_p): ...this. + +2007-02-02 Bob Wilson + + * elf32-xtensa.c (plt_reloc_count): Move into link hash table. + (struct elf_xtensa_link_hash_table): New. + (elf_xtensa_hash_table): New. + (elf_xtensa_link_hash_table_create): New. + (elf_xtensa_check_relocs): Update plt_reloc_count references. + Update arguments to add_extra_plt_sections. + (elf_xtensa_create_dynamic_sections): Record new sections in the hash + table. Update for plt_reloc_count and add_extra_plt_sections. + (add_extra_plt_sections, elf_xtensa_create_plt_entry): Replace dynobj + argument with link info. Update calls to elf_xtensa_get_plt_section + and elf_xtensa_get_gotplt_section. + (elf_xtensa_allocate_local_got_size, elf_xtensa_size_dynamic_sections) + (elf_xtensa_relocate_section, elf_xtensa_finish_dynamic_sections) + (elf_xtensa_discard_info_for_section, shrink_dynamic_reloc_sections) + (relax_property_section): Get sections from the hash table and update + function calls. + (elf_xtensa_get_plt_section, elf_xtensa_get_gotplt_section): Replace + dynobj argument with link info. Get sections for first plt chunk from + the hash table. + (bfd_elf32_bfd_link_hash_table_create): Define. + +2007-02-02 Jakub Jelinek + + * elf-bfd.h (struct elf_obj_tdata): Change symbuf type to void *. + * elf.c (struct elf_symbuf_symbol, struct elf_symbuf_head): New types. + (struct elf_symbol): Change first member into union. + (elf_sort_elf_symbol): Compare pointers to internal syms rather than + internal syms. Only compare st_shndx fields. + (elf_create_symbuf): New function. + (bfd_elf_match_symbols_in_sections): Use it. If symbufs are available + for bfds, use a binary search, otherwise don't qsort symbols + unnecessarily only to select which symbols are for the particular + shndx. + +2007-02-01 Nick Clifton + + PR ld/3852 + * elf.c (_bfd_elf_link_hash_table_init): Initialize all the fields + in the elf_link_hash_table structure. + +2007-02-01 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add elf_backend_write_core_note. + * elfxx-target.h (elf_backend_write_core_note): Define and use. + * elf.c (elfcore_write_prpsinfo): Call the above. Add support for + 32-bit core note on 64-bit target. + (elfcore_write_prstatus): Likewise. + (elfcore_write_lwpstatus): Make note_name const. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_pstatus): Add support for 32-bit core note on 64-bit + target. + * elf32-ppc.c (ppc_elf_write_core_note): New function. + (elf_backend_write_core_note): Define. + * elf64-ppc.c (ppc64_elf_write_core_note): New function. + (elf_backend_write_core_note): Define. + +2007-01-31 H.J. Lu + + * elf32-cris.c (INCLUDED_TARGET_FILE): Removed. + (elf32_bed): Defined for elf32-us-cris. + + * elf64-sh64.c (elf64_bed): Defined for Linux. + (INCLUDED_TARGET_FILE): Removed. + + * elfxx-target.h (elfNN_bed): Always define. Don't check + INCLUDED_TARGET_FILE. + +2007-01-31 DJ Delorie + + * elf-m10300.c (mn10300_elf_relocate_section): Clarify the warning + message for dangerous relocs, special case the common user error. + +2007-01-30 H.J. Lu + + * elf.c (copy_elf_program_header): Start from the first section + in a segment and stop when all sections in a segment are + accounted for. + +2007-01-29 Julian Brown + + * bfd-in2.h: Regenerate. + * bfd-in.h (bfd_arm_vfp11_fix): New enum. Specify how VFP11 + instruction scanning should be done. + (bfd_elf32_arm_init_maps, bfd_elf32_arm_vfp11_erratum_scan) + (bfd_elf32_arm_vfp11_fix_veneer_locations): Add prototypes. + (bfd_elf32_arm_set_target_relocs): Add vfp11 fix type argument to + prototype. + * elf-bfd.h (elf_backend_write_section): Add struct bfd_link_info + argument. + * elf32-arm.c (VFP11_ERRATUM_VENEER_SECTION_NAME) + (VFP11_ERRATUM_VENEER_ENTRY_NAME): Define macros. + (elf32_vfp11_erratum_type): New enum. + (elf32_vfp11_erratum_list): New struct. List of veneers or jumps to + veneers. + (_arm_elf_section_data): Add mapsize, erratumcount, erratumlist. + (elf32_arm_link_hash_table): Add vfp11_erratum_glue_size, + vfp11_fix and num_vfp11_fixes fields. + (elf32_arm_link_hash_table_create): Initialise vfp11_fix, + vfp11_erratum_glue_size, num_vfp11_fixes fields. + (VFP11_ERRATUM_VENEER_SIZE): Define. Size of an (ARM) veneer. + (bfd_elf32_arm_allocate_interworking_sections): Initialise erratum + glue section. + (elf32_arm_section_map_add): Add an code/data mapping symbol entry + to a section's map. + (record_vfp11_erratum_veneer): Create a single veneer, and its + associated symbols. + (bfd_elf32_arm_add_glue_sections_to_bfd): Add vfp11 erratum glue. + (bfd_elf32_arm_init_maps): Initialise mapping symbol table for input + BFDs. + (bfd_elf32_arm_set_vfp11_fix): Set the type of erratum workaround + required. + (bfd_arm_vfp11_pipe): Define VFP11 instruction pipes. + (bfd_arm_vfp11_regno): Recode a register number from a VFP11 insn. + (bfd_arm_vfp11_write_mask): Update write mask according to coded + register number. + (bfd_arm_vfp11_antidependency): New function. + (bfd_arm_vfp11_insn_decode): Decode a VFP11 insn. + (elf32_arm_compare_mapping): Declare. + (bfd_elf32_arm_vfp11_erratum_scan): Scan the sections of an input + BFD for potential erratum-triggering insns. Record results. + (bfd_elf32_arm_vfp11_fix_veneer_locations): Find out where veneers + and branches to veneers have been placed in virtual memory after + layout. + (bfd_elf32_arm_set_target_relocs): Set vfp11_fix field in global + hash table. + (elf32_arm_output_symbol_hook): Remove. + (elf32_arm_write_section): Output veneers, and branches to veneers. + Use maps from input sections, not output sections, for code + byte-swapping. + * elf32-ppc.c (ppc_elf_write_section): Add dummy link_info argument. + * elf32-score.c (_bfd_score_elf_write_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_write_section): Likewise. + * elfxx-mips.h (_bfd_mips_elf_write_section): Likewise. + +2007-01-27 H.J. Lu + + * elf64-hppa.c (elf64_bed): Defined for HPUX and Linux. + (INCLUDED_TARGET_FILE): Removed. + +2007-01-27 Mike Frysinger + + * elf32-hppa.c (elf32_bed): Define for hpux, linux and netbsd. + (INCLUDED_TARGET_FILE): Remove. + +2007-01-25 DJ Delorie + + * elf32-m32c.c (m32c_elf_howto_table): Don't complain about + R_M32C_16 or R_M32C_24 relocs. + +2007-01-25 Nick Clifton + + PR binutils/3874 + * elf32-avr.c (avr_link_hash_table): Check to make sure that the + hash table was created by elf32_avr_link_hash_table_create before + using it. + (elf32_avr_link_hash_newfunc): New function. Just pass the call + through to _bfd_elf_link_hash_newfunc. + (elf32_avr_link_hash_table_create): Use + elf32_avr_link_hash_newfunc instead of + _bfd_elf_link_hash_newfunc. + (elf32_avr_relocate_section): Check for the hash table pointer + being NULL. + (elf32_avr_relax_section, avr_build_one_stub, + elf32_avr_setup_params, get_local_syms, elf32_avr_size_stubs, + elf32_avr_build_stubs): Likewise. + +2007-01-16 H.J. Lu + + PR ld/3831 + * elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an + argument, Elf_Internal_Sym *. + + * elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data + symbol dynamic if info->dynamic_data is TRUE. + (bfd_elf_record_link_assignment): Updated call to + bfd_elf_record_link_assignment. + (_bfd_elf_merge_symbol): Likewise. Always call + bfd_elf_link_mark_dynamic_symbol. + +2007-01-12 H.J. Lu + + * Makefile.am (BFD_LIBS): Removed. + * Makefile.in: Regenerated. + +2007-01-11 H.J. Lu + + PR binutils/3631 + * Makefile.am (OFILES): Add @bfd64_libs@. + (libbfd_la_SOURCES): Remove $(BFD64_LIBS_CFILES). + * Makefile.in: Regenerated. + + * configure.in (bfd_libs): Replaced by ... + (bfd64_libs): This. + * configure: Regenerated. + +2007-01-11 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): We can + require fewer phdrs than expected. + +2007-01-08 Kazu Hirata + + * archures.c (bfd_mach_cpu32_fido): Rename to bfd_mach_fido. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Use bfd_mach_fido instead of + bfd_mach_cpu32_fido. + (m68k_arch_features): Use fido_a instead of cpu32. + (bfd_m68k_compatible): Reject the combination of Fido and + ColdFire. Accept the combination of CPU32 and Fido with a + warning. + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_merge_private_bfd_data, + elf32_m68k_print_private_bfd_data): Treat Fido as an + architecture by itself. + +2007-01-08 Kai Tietz + + * config.bfd: Renamed target x86_64-*-mingw64 to x86_64-*-mingw*. + +2007-01-05 Jakub Jelinek + + * texhex.c (first_phase): Don't fall through into the default + case. + (pass_over): Replace abort () calls with return FALSE. Fix + buffer overflow. + +2007-01-04 Jie Zhang + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't set + SEC_EXCLUDE on zero size .eh_frame. + +For older changes see ChangeLog-2006 Local Variables: mode: change-log diff --git a/contrib/binutils/bfd/ChangeLog-0203 b/contrib/binutils/bfd/ChangeLog-0203 index f99029a87ae..1b1abb149da 100644 --- a/contrib/binutils/bfd/ChangeLog-0203 +++ b/contrib/binutils/bfd/ChangeLog-0203 @@ -858,7 +858,7 @@ Bernardo Innocenti * archures.c: Add MCF528x (MCFv4) support. - * bfd/cpu-m68k.c (arch_info_struct): Likewise. + * cpu-m68k.c (arch_info_struct): Likewise. * bfd-in2.h: Regenerate. 2003-10-20 Andrew Cagney @@ -1953,10 +1953,10 @@ 2003-07-12 Jeff Baker - * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures. - * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino. - * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. - * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * config.bfd (__QNXTARGET__): Define for Neutrino architectures. + * elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. 2003-07-12 Jeff Muizelaar @@ -2196,13 +2196,13 @@ 2003-07-09 Richard Sandiford - * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat forced-local symbols like other locals. Don't create relocations against STN_UNDEF in irix objects. 2003-07-09 Richard Sandiford - * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI- + * elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI- compatible objects, add the values of defined external symbols to the addend. diff --git a/contrib/binutils/bfd/ChangeLog-2006 b/contrib/binutils/bfd/ChangeLog-2006 new file mode 100644 index 00000000000..82216d69382 --- /dev/null +++ b/contrib/binutils/bfd/ChangeLog-2006 @@ -0,0 +1,3601 @@ +2006-12-31 H.J. Lu + + * bfd.c (bfd_record_phdr): Call bfd_zalloc instead of bfd_alloc + to allocate elf_segment_map. + +2006-12-29 H.J. Lu + + * elflink.c (elf_link_add_object_symbols): Remember the symbol + size only if it is defined. + +2006-12-25 Kazu Hirata + + * archures.c (bfd_mach_cpu32_fido): New. + (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_a, + bfd_mach_mcf_isa_a_mac, bfd_mach_mcf_isa_a_emac, + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_b_nousp, + bfd_mach_mcf_isa_b_nousp_mac, bfd_mach_mcf_isa_b_nousp_emac, + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, + bfd_mach_mcf_isa_b_emac, bfd_mach_mcf_isa_b_float, + bfd_mach_mcf_isa_b_float_mac, bfd_mach_mcf_isa_b_float_emac): + Increment the defined values. + * bfd-in2.h: Regenerate. + * cpu-m68k.c (arch_info_struct): Add en entry for + bfd_mach_cpu32_fido. + * elf32-m68k.c (elf32_m68k_object_p): Handle + EF_M68K_CPU32_FIDO_A. + (elf32_m68k_merge_private_bfd_data): Use EF_M68K_CPU32_MASK. + (elf32_m68k_print_private_bfd_data): Handle + EF_M68K_CPU32_FIDO_A. + +2006-12-25 Mei Ligang + + * elf32-score.c (score_elf_got_lo16_reloc): Change some variables + type from unsigned to signed. + (score_elf_final_link_relocate): Fix bugs of handling relocation + type R_SCORE_GOT15, R_SCORE_GOT_LO16, and R_SCORE_REL32. + (_bfd_score_elf_relocate_section): Handle R_SCORE_GOT_LO16 + specially. + +2006-12-23 Jakub Jelinek + + * elf-bfd.h (struct elf_backend_data): Add as_needed_cleanup hook. + * elfxx-target.h (elf_backend_as_needed_cleanup): Define. + (elfNN_bed): Add as_needed_cleanup hook. + * elflink.c (elf_link_add_object_symbols): Call it when reverting + hash table changes for unneeded --as-needed input. + * elf64-ppc64.c (elf_backend_as_needed_cleanup): Define. + (ppc64_elf_as_needed_cleanup): New function. + +2006-12-19 Kazu Hirata + + * elf32-m68k.c (elf32_m68k_object_p, + elf32_m68k_print_private_bfd_data): Use EF_M68K_ARCH_MASK to + extract architecture mask. + +2006-12-19 Nathan Sidwell + + * elf.c (assign_file_positions_for_load_sections): Adjust p_vaddr + by p_vaddr_offset. Copy alignment & use if it is valid. + (rewrite_elf_program_headers): Cope with leading padding in a + segment that does not contain file or program headers. + (copy_elf_program_header): Likewise. + +2006-12-15 Mark Kettenis + + * config.bfd: (sh*-*-openbsd*): Add target. + * configure.in (sh*-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2006-12-15 Alan Modra + + * opncls.c (bfd_openr_iovec): Add "stat" parameter. + (struct opncls): Add "stat" field. + (opncls_bstat): Call vec->stat. + * bfd-in2.h: Regenerate. + * elf32-spu.c (spu_elf_open_builtin_lib): Adjust. + +2006-12-14 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Clarify sec_group + and next_in_group usage. + +2006-12-14 Alan Modra + + PR 3704 + * bfdio.c (bfd_bread): Don't read past end of archive elements. + +2006-12-12 Daniel Jacobowitz + + * doc/Makefile.am (bfd_TEXINFOS): Set. + (bfd.info bfd.dvi bfd.html): Delete rule. + * doc/Makefile.in: Regenerated. + +2006-12-11 Daniel Jacobowitz + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (bfd.info): Remove srcdir prefix. + (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-11 Eric Botcazou + + * elflink.c (bfd_elf_gc_sections): Also search for corresponding + sections with .gnu.linkonce.t. prefix. + +2006-12-07 Kazu Hirata + + * elf32-m68k.c: Update uses of EF_M68K_*. + +2006-12-07 H.J. Lu + + PR ld/3666 + * elflink.c (elf_link_add_object_symbols): Keep symbol + visibility for symbols from discarded section. + +2006-12-06 Alan Modra + + * elf64-alpha.c (elf64_alpha_merge_symbol_attribute): New function. + (elf_backend_merge_symbol_attribute): Define. + +2006-12-04 Jan Beulich + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create + .eh_frame_hdr section from here anymore. + (bfd_elf_size_dynamic_sections): Call _bfd_elf_maybe_strip_eh_frame_hdr + a little earlier. + +2006-12-01 H.J. Lu + + PR binutils/3609 + * elf.c (rewrite_elf_program_header): Preserve segment physical + address in the output segment if the first section in the + corresponding input segment is null. + +2006-12-01 Nick Clifton + + PR 3609 + * elf.c (rewrite_elf_program_header): Do not use the first_section + pointer if it is null. + +2006-11-29 Paul Brook + + * elf32-arm.c (elf32_arm_to_thumb_export_stub): Assert that output + section is present. + (allocate_dynrelocs): Only add export stub for symbols defined in + this object. + +2006-11-29 Paul Brook + + * elf32-arm.c (elf32_arm_to_thumb_export_stub): Assert that output + section is present. + (allocate_dynrelocs): Only add export stub for symbols defined in + this object. + +2006-11-29 Paul Brook + Julian Brown + + * elf32-arm.c (copy_eabi_attributes): Correct starting offset. + (elf32_arm_merge_eabi_attributes): Mark output as initialized. + Only set Tag_CPU_name and Tag_ABI_PCS_R9_use if input attribute + is present. + +2006-11-27 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_special_sections): Add .xtensa.info. + +2006-11-24 H.J. Lu + + * elf.c (IS_SECTION_IN_INPUT_SEGMENT): New. + (INCLUDE_SECTION_IN_SEGMENT): Use IS_SECTION_IN_INPUT_SEGMENT. + (rewrite_elf_program_header): Don't preserve segment physical + address in the output segment if the first section in the + corresponding input segment is removed. + +2006-11-22 Alan Modra + + * pef.c (bfd_pef_make_empty_symbol): Delete function. Define instead. + * xsym.c (bfd_sym_make_empty_symbol): Likewise. + * xsym.h (bfd_sym_make_empty_symbol): Delete. + +2006-11-21 Greg McGary + + * elf32-ppc.c (ppc_elf_relocate_section): Fixup D field + at proper offset in little-endian mode. + * elf64-ppc.c (ppc_elf_relocate_section): Likewise. + +2006-11-21 Jakub Jelinek + + * elf-eh-frame.c (struct cie): New type. + (cie_compare): Removed. + (cie_eq, cie_hash, cie_compute_hash): New functions. + (_bfd_elf_discard_section_eh_frame): Rewrite not to rely on FDEs + pointing only to last CIE and allow merging of any duplicate CIEs, + not just duplicate consecutive CIEs. + (_bfd_elf_discard_section_eh_frame_hdr): Delete cies hash table. + * elf-bfd.h (struct cie_header, struct cie): Removed. + (struct eh_frame_sec_info): Remove alloced field. + (struct eh_frame_hdr_info): Remove last_cie, last_cie_sec + and last_cie_inf fields. Add cies field. + +2006-11-20 Alan Modra + + * bfd-in.h (struct stat): Don't typedef. + * bfdio.c (bfd_get_size): Return a file_ptr. + * cisco-core.c (cisco_core_file_validate): Use bfd_size_type for nread. + * mmo.c (mmo_scan): Use file_ptr for curpos. + * trad-core.c (trad_unix_core): Don't cast statbuf.st_size to + unsigned long. + * bfd-in2.h: Regenerate. + +2006-11-20 Alan Modra + + PR 3532 + * bfd-in.h (struct bfd_hash_table): Reorganize. Add "frozen". + * hash.c (bfd_hash_table_init_n): Init frozen. + (bfd_hash_lookup): Don't grow if frozen. + (bfd_hash_traverse): Freeze hash table during traversal. + * bfd-in2.h: Regenerate. + +2006-11-18 Alan Modra + + * elflink.c (_bfd_elf_check_kept_section): Test for kept group + section. Save result of checks in kept_section. + (_bfd_elf_section_already_linked): Tidy. Correct comments. + Ignore all group member sections. Handle special matching of + single-member groups against linkonce sections via their group + section. When such a match is found, set kept_section to the + group member section rather than to the group. + +2006-11-14 Phil Lello + + * peXXigen.c: Updates for PE/COFF V8.0, and clarification + (dir_names): Added CLR Runtime Header to dir_names[]. + (_bfd_XX_print_private_bfd_data_common): Added EFI_ROM and XBOX + subsystem names + (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out) + (pe_print_idata, pe_print_edata) + (_bfd_XX_bfd_copy_private_bfd_data_common) + (_bfd_XXi_final_link_postscript): Use #DEFINEs for index into + DataDirectory. + +2006-11-13 Daniel Jacobowitz + + * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update + prototype. + (bfd_elf32_arm_set_byteswap_code): New prototype. + * bfd-in2.h: Regenerate. + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Don't take + byteswap_code as an argument. Revert 2006-11-01 change. + (bfd_elf32_arm_set_byteswap_code): New. + (elf32_arm_size_dynamic_sections): Call + bfd_elf32_arm_process_before_allocation. + +2006-11-10 Thiemo Seufer + + * config.bfd (mips*el-sde-elf*, mips*-sde-elf*): Drop ECOFF support + for SDE configs. + +2006-11-10 Nick Clifton + + * config.bfd: Move previously obsoleted targets to the REMOVED + list. + Add maxq-*-coff to the obsolete list. + +2006-11-10 Pedro Alves + + * pe-arm-wince.c (LOCAL_LABEL_PREFIX): Define as ".". + * pei-arm-wince.c (LOCAL_LABEL_PREFIX): Likewise. + * coff-arm.c (LOCAL_LABEL_PREFIX): Only define if not defined before. + +2006-11-07 Daniel Jacobowitz + + * elf32-arm.c (find_thumb_glue): Add ERROR_MESSAGE argument; set it + on error. + (find_arm_glue): Likewise. + (elf32_thumb_to_arm_stub, elf32_arm_create_thumb_stub) + (elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate): Add + ERROR_MESSAGE argument and pass it through. + (elf32_arm_to_thumb_export_stub): Update. + (elf32_arm_relocate_section): Use ERROR_MESSAGE and reloc_dangerous. + +2006-11-07 Alan Modra + + * elf64-ppc.c (enum _ppc64_sec_type): New. + (struct _ppc64_elf_section_data): Move "t_symndx" into opd union, + and rename fields. Add sec_type and has_14bit_branch. + (struct ppc_link_hash_table): Remove has_14bit_branch. + (get_opd_info, get_tls_mask, ppc64_elf_edit_opd): Adjust. + (ppc64_elf_relocate_section): Likewise. + (ppc64_elf_check_relocs): Likewise. Set per-section has_14bit_branch. + (ppc64_elf_size_stubs): Don't set default group size here. + (group_sections): Instead do so here, and group sections using + their individual requirements. + +2006-11-07 Alan Modra + + * elf64-ppc.c (struct ppc64_elf_obj_tdata): Remove "has_dotsym" + and union. + (struct ppc_link_hash_entry): Add "next_dot_sym". + (struct ppc_link_hash_table): Add "dot_syms". + (link_hash_newfunc): Make list of syms starting with a dot. + (ppc_get_stub_entry, adjust_opd_syms): Adjust. + (ppc64_elf_add_symbol_hook): Don't set has_dotsym. + (struct add_symbol_adjust_data): Delete. + (add_symbol_adjust): Simplify params and return. + (ppc64_elf_check_directives): Just process the "dot_syms" lists, + not all syms. + +2006-11-02 Daniel Jacobowitz + + * libbfd-in.h (_bfd_clear_contents): New prototype. + * reloc.c (_bfd_clear_contents): New. + * libbfd.h: Regenerated. + + * elf32-arm.c (elf32_arm_final_link_relocate): Use + _bfd_clear_contents. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Set value to + zero for discarded symbols. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + +2006-11-01 Thiemo Seufer + David Ung + + * elf-bfd.h (local_call_stubs): New member. + * elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros. + (mips_elf_calculate_relocation): Handle local mips16 call stubs. + (mips16_stub_section_p): Rename from mips_elf_stub_section_p, use + the new stub macros. + (_bfd_mips_elf_check_relocs): Handle call stubs for code which + mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark + used stubs with SEC_KEEP. Use the new stub macros. + +2006-11-01 Alan Modra + + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct + check for PLT usage. + +2006-11-01 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_merge_gots): Always use maxcnt. + +2006-10-31 Alan Modra + + * elf.c (elfcore_write_note): Pad note descriptor to 4-byte + boundary. Tidy. Comment. + +2006-10-30 H.J. Lu + + PR ld/3111 + * elf-bfd.h (elf_obj_tdata): Add symbuf. + (_bfd_elf_section_already_linked): Add struct bfd_link_info *. + (_bfd_elf_check_kept_section): Likewise. + (bfd_elf_match_symbols_in_sections): Likewise. + + * elf.c (assign_section_numbers): Updated to add + struct bfd_link_info *. + (bfd_elf_match_symbols_in_sections): Updated. Cache symbol + buffer if info->reduce_memory_overheads is false. + + * elflink.c (match_group_member): Updated to add + struct bfd_link_info *. + (_bfd_elf_check_kept_section): Likewise. + (elf_link_input_bfd): Likewise. + (_bfd_elf_section_already_linked): Likewise. + (bfd_elf_final_link): Free symbol buffer if + info->reduce_memory_overheads is false. + + * libbfd-in.h (_bfd_nolink_section_already_linked): Add + struct bfd_link_info *. + (_bfd_generic_section_already_linked): Likewise. + * libbfd.h: Regenerated. + + * linker.c (bfd_section_already_linked): Add + struct bfd_link_info *. + (_bfd_generic_section_already_linked): Likewise. + * targets.c (bfd_target): Add struct bfd_link_info * to + _section_already_linked. + * bfd-in2.h: Regenerated. + +2006-10-30 Alan Modra + + * bfd.c (bfd_error_type): Add bfd_error_on_input. + (input_bfd, input_error): New static vars. + (bfd_set_error): Handle bfd_error_on_input. + (bfd_errmsg): Likewise. + (bfd_perror): Simplify. + * archive.c (_bfd_write_archive_contents): Report errors on input. + * bfd-in2.h: Regenerate. + +2006-10-30 Alan Modra + + * elf.c (elfcore_write_note): Pad to 4-byte boundary. + +2006-10-28 Richard Sandiford + + * elf32-mips.c (elf_mips_howto_table_rel): Add R_MIPS_GLOB_DAT. + * elfn32-mips.c (elf_mips_howto_table_rel): Likewise. + (elf_mips_howto_table_rela): Likewise. + * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. + (mips_elf64_howto_table_rela): Likewise. + +2006-10-26 H.J. Lu + + * elf.c (_bfd_elf_init_private_section_data): Assert output + section ELF type instead of check if it is SHT_NULL. Copy + OS/PROC specific flags from input section to output section. + +2006-10-27 Alan Modra + + * section.c (SEC_KEEP): Update comment. + * bfd-in2.h: Regenerate. + * elflink.c (bfd_elf_gc_sections): Ignore SEC_EXCLUDE sections. + * merge.c (_bfd_merge_sections): Set SEC_KEEP on excluded sections. + * stabs.c (_bfd_discard_section_stabs): Likewise. + (_bfd_link_section_stabs): Likewise. Simplify abs_section check. + +2006-10-26 Ben Elliston + + * reloc.c (_bfd_relocate_contents): Remove explicit case 0. + + * elf.c (bfd_section_from_shdr): Remove extraneous breaks. + * targets.c (find_target): Remove extraneous break. + +2006-10-26 Ben Elliston + + * coff-maxq.c (coff_maxq20_reloc): Remove unused variable `howto'. + (struct maxq_reloc_map): Unused; remove. + (maxq_reloc_map): Likewise. + (maxq_reloc_type_lookup): Remove loop over maxq_reloc_map. + +2006-10-26 Ben Elliston + + * elf.c (bfd_elf_set_dyn_lib_class): Change second argument type + from int to enum dynamic_lib_link_class lib_class. + * bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise. + * bfd-in2.h: Regenerate. + +2006-10-25 Alan Modra + Trevor Smigiel + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + + * cpu-spu.c: New file. + * elf32-spu.c: New file. + * elf32-spu.h: New file. + * archures.c: Add SPU support. + * config.bfd: Likewise. + * configure.in: Likewise. + * reloc.c: Likewise. + * targets.c: Likewise. + * Makefile.am: Likewise. Run "make dep-am". + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2006-10-23 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Clarify comment. + +2006-10-23 Alan Modra + + * elf32-score.c: Formatting. + (elf_backend_omit_section_dynsym): Define. + (score_elf_create_dynamic_relocation): Remove code copied from mips. + Don't use section syms in dynamic relocs. Remove unused param. + (score_elf_final_link_relocate): Remove unused param. + +2006-10-23 Alan Modra + + * linker.c (fix_syms): Choose best of previous and next + section based on section flags and vma. + +2006-10-21 Kaz Kojima + + * elf32-sh64.c (sh64_elf_merge_symbol_attribute): Do merging + only when the non visibility part of st_other is non-zero. + * elf64-sh64.c (sh64_elf64_merge_symbol_attribute): Likewise. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend + PT_DYNAMIC on GNU/Linux targets. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the + size of .rel.dyn reflect the value of DT_RELSZ. + +2006-10-20 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Allocate + a PT_NULL header for dynamic objects. + (_bfd_mips_elf_modify_segment_map): Add it. + +2006-10-19 Mei Ligang + + * elf32-score.c (score_elf_rel_dyn_section): Replace + bfd_make_section with bfd_make_section_with_flags. + (_bfd_score_elf_create_dynamic_sections): Ditto. + (score_elf_create_got_section): Ditto. + (score_elf_final_link_relocate): Delete referrence to + EF_SCORE_HASENTRY. + +2006-10-19 Richard Sandiford + + * elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the + same symbol by increasing r_offset. + (sort_dynamic_relocs_64): Likewise. Fix comparisons between very + large and very small symbol indexes. + +2006-10-19 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG + and DT_MIPS_RLD_MAP tags for position-independent executables. + Do not add DT_DEBUG to shared libraries for any MIPS target. + +2006-10-18 H.J. Lu + + PR ld/3290 + * elflink.c (elf_link_add_object_symbols): Hide definitions in + debug sections. + +2006-10-19 Alan Modra + + * elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check, + don't set, glue section size. + (record_arm_to_thumb_glue): Set glue section size here. + (record_thumb_to_arm_glue): Likewise. + (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting. + (bfd_elf32_arm_process_before_allocation): Ignore exluded sections. + +2006-10-18 Roy Marples + + * elf64-sparc.c: Add FreeBSD support. + (elf64_sparc_fbsd_post_process_headers): New function. + * targets.c (_bfd_target_vector): Add bfd_elf64_sparc_freebsd_vec. + * config.bfd (sparc64-*-freebsd*): Set targ_defvec to bfd_elf64_sparc_freebsd_vec. + * configure.in: Add entry for bfd_elf64_sparc_freebsd_vec. + * configure: Regenerate. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Add support for + R_ARM_MOVW_BREL_NC, R_ARM_MOVW_BREL, R_ARM_MOVT_BREL, + R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVW_BREL and + R_ARM_THM_MOVT_BREL relocations. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_howto_table_1): Change offset for + R_THM_CALL to 25 and remove FIXME comment. + (using_thumb2): New function. + (elf32_arm_final_link_relocate): Cope with Thumb-2 BL encoding. + +2006-10-17 Mark Shinwell + + * elf32-arm.c (elf32_arm_final_link_relocate): Add cases + for R_ARM_ABS32_NOI and R_ARM_REL32_NOI. + (elf32_arm_gc_sweep_hook): Likewise. + (elf32_arm_check_relocs): Likewise. + (allocate_dynrelocs): Likewise. + +2006-10-17 Alan Modra + + * elf-bfd.h (struct elf_link_hash_table): Reorder. Add + text_index_section and data_index_section. + (struct elf_backend_data): Add elf_backend_init_index_section. + (_bfd_elf_init_1_index_section): Declare. + (_bfd_elf_init_2_index_sections): Declare. + * elfxx-target.h (elf_backend_init_index_section): Define. + (elfNN_bed): Init new field. + * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls + section and text_index_section plus data_index_section. + (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. + (_bfd_elf_init_1_index_section): New function. + (_bfd_elf_init_2_index_sections): New function. + (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. + (elf_link_input_bfd): When emitting relocs, use text_index_section + and data_index_section for removed sections. + * elf-m10300.c (elf_backend_omit_section_dynsym): Define. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section + and data_index_section sym for relocs against sections with no dynamic + section sym. + (elf_backend_init_index_section): Define. + * elf32-cris.c: Similarly. + * elf32-hppa.c: Similarly. + * elf32-i370.c: Similarly. + * elf32-m68k.c: Similarly. + * elf32-mips.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-s390.c: Similarly. + * elf32-sparc.c: Similarly. + * elf32-vax.c: Similarly. + * elf64-mips.c: Similarly. + * elf64-ppc.c: Similarly. + * elf64-s390.c: Similarly. + * elf64-sparc.c: Similarly. + * elf64-x86-64.c: Similarly. + * elfn32-mips.c: Similarly. + * elfxx-mips.c: Similarly. + * elfxx-sparc.c: Similarly. + * linker.c (fix_syms): Base symbols in removed sections on + previous section in preference to using absolute section. + +2006-10-16 Andreas Schwab + + * elfxx-ia64.c (addend_compare): Properly compute return value. + +2006-10-15 H.J. Lu + + PR ld/3314 + * elf.c (assign_file_positions_for_non_load_sections): Don't + page align empty SHF_ALLOC sections. + +2006-10-13 Jakub Jelinek + + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): Set + .plt sh_entsize to 0 if plt header size isn't multiple of + plt entry size or for 32-bit which adds a nop insn at the + end of the .plt section. + +2006-10-12 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_action_discarded): New. + (elf_backend_action_discarded): Define. + +2006-10-11 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Return after + unresolvable relocation error. + (elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak + symbols to zero. + +2006-10-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Add DT_DEBUG + for PIE executables. + +2006-10-03 Jakub Jelinek + + * elf-bfd.h (struct eh_cie_fde): Add set_loc pointer. + * elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc. + Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save, + DW_CFA_val_{offset{,_sf},expression}. + (skip_non_nops): Record number of DW_CFA_set_loc ops. + (_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes + all ops. If there are any DW_CFA_set_loc ops and they are pcrel + or going to be pcrel, compute set_loc array. + (_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations + against DW_CFA_set_loc operands. + (_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting. + +2006-10-02 Daniel Jacobowitz + + * elflink.c (_bfd_elf_merge_symbol): Discard references to TLS + symbols from the --just-syms file. + +2006-10-01 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Test glink size for + existence of PLT. + +2006-09-29 H.J. Lu + + PR ld/3283 + * elf64-x86-64.c (elf64_x86_64_relocate_section): Don't ignore + relocation overflow on branches to undefweaks. + +2006-09-29 Alan Modra + + * po/BLD-POTFILES.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2006-09-29 Danny Smith + + PR 3276 + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .data$, .rdata$ and .text$ sections so that sse + and sse2 code will work for linkonce sections too. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2006-09-28 Alan Modra + + * elflink.c (_bfd_elf_gc_mark_hook): New function. + * elf-bfd.h (_bfd_elf_gc_mark_hook): Declare. + * elfxx-target.h (elf_backend_gc_mark_hook): Default to above. + * elf-m10300.c (mn10300_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + * elf32-arm.c (elf32_arm_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-score.c (_bfd_score_elf_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-vax.c (elf_vax_gc_mark_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise. + * elf32-bfin.c (bfin_gc_mark_hook): Likewise. + (bfinfdpic_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define for elf32-bfinfdpic. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (elf32_d10v_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (fr30_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-frv.c (elf32_frv_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (elf32_frv_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-iq2000.c (iq2000_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (iq2000_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Use + _bfd_elf_gc_mark_hook. + (openrisc_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-v850.c (v850_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (v850_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Use + _bfd_elf_gc_mark_hook. + (xstormy16_elf_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Use _bfd_elf_gc_mark_hook. + (sh_elf64_gc_sweep_hook): Delete. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-avr.c (elf32_avr_gc_mark_hook): Delete. + (elf32_avr_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-cr16c.c (elf32_cr16c_gc_mark_hook): Delete. + (elf32_cr16c_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-crx.c (elf32_crx_gc_mark_hook): Delete. + (elf32_crx_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-h8300.c (elf32_h8_gc_mark_hook): Delete. + (elf32_h8_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-ip2k.c (ip2k_elf_gc_mark_hook): Delete. + (ip2k_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-m32c.c (m32c_elf_gc_mark_hook, m32c_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-m68hc11.c (elf_backend_gc_mark_hook): Don't define. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-m68hc12.c (elf_backend_gc_mark_hook): Don't define. + (elf_backend_gc_sweep_hook): Don't define. + * elf32-m68hc1x.c (elf32_m68hc11_gc_mark_hook): Delete. + (elf32_m68hc11_gc_sweep_hook): Delete. + * elf32-m68hc1x.h (elf32_m68hc11_gc_mark_hook): Delete. + (elf32_m68hc11_gc_sweep_hook): Delete. + * elf32-msp430.c (elf32_msp430_gc_mark_hook): Delete. + (elf32_msp430_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + * elf32-mt.c (mt_elf_gc_mark_hook, mt_elf_gc_sweep_hook): Delete. + (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define. + +2006-09-25 Pedro Alves + + * bfd-in.h (CONST_STRNCPY) : Delete. + (LITSTRCPY) : New. + (LITMEMCPY) : New. + * bfd-in2.h : Regenerate. + * elflink.c (bfd_elf_gc_sections) : Use LITMEMCPY. Don't manually + calculate string lengths. + * nlmcode.h (nlm_swap_auxiliary_headers_in) : Use LITMEMCPY. + +2006-09-26 H.J. Lu + + PR ld/3223 + PR ld/3267 + * elf.c (assign_file_positions_for_non_load_sections): Don't + warn zero size allocated sections. + +2006-09-27 Alan Modra + + * elf32-score.c (_bfd_score_elf_relocate_section): Move assignment + to "name" so that compiler realizes it is never uninitialized. + Use bfd_elf_sym_name. + +2006-09-26 H.J. Lu + + PR binutils/3262 + * elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of + bfd_alloc to allocate segment map. + (copy_elf_program_header): Likewise. + +2006-09-26 Mark Shinwell + Joseph Myers + Ian Lance Taylor + Ben Elliston + + * archures.c: Add definition for bfd_mach_arm_iWMMXt2. + * cpu-arm.c (processors): Add bfd_mach_arm_iWMMXt2. + (arch_info_struct, bfd_arm_update_notes): Likewise. + (architectures): Likewise. + (bfd_arm_merge_machines): Check for iWMMXt2. + * bfd-in2.h: Rebuild. + +2006-09-24 H.J. Lu + + * configure: Regenerated. + +2006-09-22 Alan Modra + + * elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abort + on error. + * elf-bfd.h (elf_size_info ): Adjust decl. + (bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise. + * elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in, + and report error. + * elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean. + +2006-09-20 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Remove check for code + section in LD to LE linker relaxation for R_390_TLS_LDO32. + * elf64-s390.c (elf_s390_relocate_section): Likewise for + R_390_TLS_LDO64. + +2006-09-20 Kai Tietz + + * configure.in: Added new target-vectors x86_64coff_vec, + x86_64pe_vec, and x86_64pei_vec. + * configure: Regenerate. + * config.bfd: Adjusted x86_64 target architecture detection. + * bfd.c: Add for new target "coff-x86-64" + (bfd_get_sign_extend): Add target vector idents for pe-x86-64. and pei-x86-64. + * coff-x86_64.c: Add new file for x86_64 (AMD64) coff support. + * libpei.h: Adjustments for COFF_WITH_pex64. + * coffcode.h: Add for new target machine, architecture, signature, and internal + signature handler. + * Makefile.am: Add new files to target-all and define make-rule for pex64igen.c + * Makefile.in: Regenerate. + * pe-x86_64.c: Add for new target "pe-x86-64". + * pei-x86_64.c: Add for new target "pei-x86-64". + * peicode.h: Adjusts for new targets. + (coff_swap_filehdr_out): Set for this target to + _bfd_pex64_only_swap_filehdr_out. + (SIZEOF_IDATA4): Define it as 8 byte size for this target. + (SIZEOF_IDATA5): Define it as 8 byte size for this target. + (jump_table jtab): Add for AMD64MAGIC. + (pe_ILF_build_a_bfd): Adjusts for new size of SIZEOF_IDATA4 and SIZE_IDATA5. + (pe_ILF_object_p): Add coff image-file signature to internal + signature translation. + * peXXigen.c: Adjust proper include of target coff-header and + introduced target specific code + (COFF_WITH_pex64): New macro for this target. + (pe_print_idata): New dumping method for import section of PE+ files. + * targets.c: Add new target vectors declarations for x86_64 coff targets. + * coffcode.h: Support code to support the x86_64 PE magic number. + * coff-x86_64.c: New file. + +2006-09-17 Hans-Peter Nilsson + + * elf.c (special_sections_s): Revert last STRING_COMMA_LEN change + for .stabstr entry, explain why. + +2006-09-17 Anton Blanchard + Alan Modra + + * dwarf2.c (concat_filename): Apply DW_AT_comp_dir if dir table + entry isn't absolute. + +2006-09-17 Mei Ligang + + * cpu-score.c: New file. + * elf32-score.c: New file. + * config.bfd: Add Score target. + * Makefile.am: Add Score files. + * Makefile.in: Regenerate. + * archures.c: Add Score architecture. + * reloc.c: Add Score relocs. + * targets.c: Add Score target vectors. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * configure.in: Add Score target. + * configure: Regenerate. + +2006-09-16 Nick Clifton + Pedro Alves + + * bfd-in.h (STRING_COMMA_LEN): New macro. Takes one constant + string as its argument and emits the string followed by a comma + and then the length of the string. + (CONST_STRNEQ): New macro. Checks to see if a variable string + has a constant string as its initial characters. + (CONST_STRNCPY): New macro. Copies a constant string to the start + of a variable string. + * bfd-in2.h: Regenerate. + * archive.c: Make use of the new macros. + * archive64.c: Likewise. + * bfd.c: Likewise. + * coff-ppc.c: Likewise. + * coff-stgo32.c: Likewise. + * coffcode.h: Likewise. + * cofflink.c: Likewise. + * cpu-i960.c: Likewise. + * dwarf2.c: Likewise. + * ecoff.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh-symbian.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elflink.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * hpux-core.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * libpei.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * mmo.c: Likewise. + * nlmcode.h: Likewise. + * osf-core.c: Likewise. + * pef.c: Likewise. + * som.c: Likewise. + * sparclinux.c: Likewise. + * vms-hdr.c: Likewise. + +2006-09-14 Alan Modra + + PR 3181 + * elf.c (_bfd_elf_copy_private_header_data): Fix group members + that have had their SHT_GROUP section removed. + +2006-09-12 H.J. Lu + + PR ld/3197 + * elflink.c (elf_link_output_extsym): Compute bucket only if + needed. + +2006-09-10 H.J. Lu + + PR binutils/3186 + * elf.c (_bfd_elf_make_section_from_shdr): Correct length of + "gnu.linkonce.wi.". + +2006-09-08 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Remove + unconditional setting of low bit for Thumb symbol + mistakenly left behind after check for external + symbols was added. Fix comment typo. + +2006-09-07 H.J. Lu + + * elf-bfd.h (elf_link_hash_entry): Add a dynamic field. + (bfd_elf_link_mark_dynamic_symbol): New. + (SYMBOLIC_BIND): New. + + * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic + with SYMBOLIC_BIND (info, h). + (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. + + * elflink.c (bfd_elf_link_mark_dynamic_symbol): New. + (bfd_elf_record_link_assignment): Call + bfd_elf_link_mark_dynamic_symbol on new entry. + (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_export_symbol): Return if the symbol isn't exported. + (_bfd_elf_fix_symbol_flags): Replace info->symbolic with + SYMBOLIC_BIND (info, h). + (_bfd_elf_dynamic_symbol_p): Likewise. + (_bfd_elf_symbol_refs_local_p): Likewise. + (bfd_elf_size_dynamic_sections): Updated. + +2006-09-05 Bibo Mao + + PR binutils/3171 + * coffcode.h (coff_write_object_contents): Set the optional + header magic number to PE32PMAGIC instead of ZMAGIC for ia64. + +2006-09-04 Mark Shinwell + + * elf32-arm.c (elf32_arm_howto_table_1): Adjust entries for + R_ARM_THM_ALU_PREL_11_0 and R_ARM_THM_PC12 relocations. + (elf32_arm_final_link_relocate): Handle R_ARM_THM_ALU_PREL_11_0 + and R_ARM_THM_PC12 relocations. + +2006-08-24 Bob Wilson + + * elf32-xtensa.c (xtensa_get_property_section_name): Delete. + (xtensa_get_property_section): New. + (xtensa_read_table_entries): Use xtensa_get_property_section. + (relax_property_section, xtensa_get_property_predef_flags): Handle + group name suffixes in property section names. + (match_section_group): New. + +2006-08-23 Frediano Ziglio + + * archive.c (hpux_uid_gid_encode): Fix thinko decrementing "cnt" + variable. + +2006-08-22 Daniel Jacobowitz + + * elf32-arm.c (elf32_arm_copy_indirect_symbol): Only copy + plt_thumb_refcount from indirect symbols. + +2006-08-22 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA + reloc handling. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2006-08-21 Mark Shinwell + + * elf32-arm.c (elf32_arm_link_hash_table): Correct typo in + comment for target1_is_rel. + +2006-08-21 Pedro Alves + + * Makefile.am: Add rules to build pe-arm-wince.lo + and pei-arm-wince.lo objects. + * Makefile.in: Regenerate. + * pe-arm-wince.c: New file. + * pei-arm-wince.c: New file. + * pei-arm.c: Remove ARM_WINCE block. + * pe-arm.c: Remove ARM_WINCE block. Rename + bfd_arm_pe_allocate_interworking_sections, + bfd_arm_pe_get_bfd_for_interworking, and + bfd_arm_pe_process_before_allocation to + bfd_armpe_allocate_interworking_sections, + bfd_armpe_get_bfd_for_interworking, and + bfd_armpe_process_before_allocation. Move them before + including bfd.h. + * bfd.c: ARM wince bfd format names were renamed. Adjust. + * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up + with unexpected/conflicting relocs. + * targets.c: The arm-wince-pe target got its own new vector. + Adjust. + * config.bfd: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + +2006-08-18 Paul Brook + + * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue. + (elf32_arm_link_hash_newfunc): Initialize export_glue. + (record_arm_to_thumb_glue): Return stub symbol. + (elf32_arm_create_thumb_stub): New function. + (elf32_arm_to_thumb_stub): Use it. + (elf32_arm_to_thumb_export_stub): New function. + (elf32_arm_begin_write_processing): New function. + (allocate_dynrelocs): Allocate Arm stubs. + (elf_backend_begin_write_processing): Define. + (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED. + Call elf32_arm_begin_write_processing. + +2006-08-17 Alan Modra + + * elf64-ppc.c (create_linkage_sections): Align .glink to 8 bytes. + (ppc64_elf_build_stubs): Use new lazy linking stub. + +2006-08-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Ignore non-code sections. + +2006-08-16 H.J. Lu + + PR ld/3015 + * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment + only if there is a PT_DYNAMIC segment. + (_bfd_elf_map_sections_to_segments): Likewise. + (assign_file_positions_for_load_sections): Set PT_GNU_RELRO + segment alignment to 1. + +2006-08-15 Thiemo Seufer + Nigel Stephens + + * elf32-mips.c, elf64-mips.c, elfn32-mips.c + (elf_backend_merge_symbol_attribute): Define. + * elflink.c (elf_link_add_object_symbols): Merge only the ELF + visibility flags. + * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * config.bfd: Add configurations for mips*el-sde-elf* and + mips*-sde-elf*. + +2006-08-14 DJ Delorie + + * elf-m10300.c (elf32_mn10300_link_hash_entry): Add value. + (elf32_mn10300_count_hash_table_entries): New. + (elf32_mn10300_list_hash_table_entries): New. + (sort_by_value): New. + (mn10300_elf_relax_section): Don't skip data sections; restrict + code-specific tests to code-specific areas so that potential + indirect calls can be detected. Check for multiple local symbols + at the same address and merge their flags. + (elf32_mn10300_link_hash_newfunc): Initialize value. + +2006-08-14 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_symbol_processing, + _bfd_mips_elf_add_symbol_hook): Don't try to place small common TLS + symbols in .scommon. + +2006-08-11 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set + sh_entsize only when sgot was already initialized. + +2006-08-08 DJ Delorie + + * elf32-sh.c (sh_elf_relax_section): Allow for branches across + non-moving .align directives. Preserve any DIR32 offset when + converting bsr's to jsr's. + +2006-08-08 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Clear relbrlt reloc_count + after stubs have been built. + +2006-08-07 Nick Clifton + + * elf32-sh.c (vxworks_object_p): Only check for vxworks target + vectors if they are going to be created. + +2006-08-07 Nick Clifton + + * configure.in (bfd_elf32_shnbsd_vec): Fix typo. + * configure: Regenerate. + +2006-08-07 Nick Clifton + + * coff-arm.c (coff_arm_rtype_to_howto): Only check for ARM_SECREL + relocation types if the target is ARM_WINCE. + +2006-08-05 Pedro Alves + + * bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little + and pei-arm-little. + * coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle + ARM_SECREL. + (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to + ARM_SECREL. + * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. + * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in + pe-arm.c. + [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. + +2006-08-04 Marcelo Tosatti + + * elflink.c (elf_gc_sweep): If info.print_gc_sections is true, + list removed sections to stderr. + +2006-08-04 Richard Sandiford + Kazu Hirata + Phil Edwards + Nathan Sidwell + + * config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and + bfd_elf32_shlvxworks_vec. + * configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo. + (bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise. + (bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise. + (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise. + (bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise. + (bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise. + (bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise. + (bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas. + * configure: Regenerate. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + * elf-vxworks.c (elf_vxworks_gott_symbol_p): New function. + (elf_vxworks_add_symbol_hook): Use it. + (elf_vxworks_link_output_symbol_hook): Likewise. Use the hash + table entry to check for weak undefined symbols and to obtain + the original bfd. + (elf_vxworks_emit_relocs): Use target_index instead of this_idx. + * elf32-sh-relocs.h: New file, split from elf32-sh.c. + (R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field, + SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the + special_function field. + (R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too. + (R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise. + (R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise. + (R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise. + (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise. + (R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise. + (SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file. + * elf32-sh.c: Include elf32-vxworks.h. + (MINUS_ONE): Define. + (sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32 + set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set + to sh_elf_reloc. + (sh_vxworks_howto_table): New variable. Include elf32-sh-relocs.h + with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and + SH_ELF_RELOC set to bfd_elf_generic_reloc. + (vxworks_object_p, get_howto_table): New functions. + (sh_elf_reloc_type_lookup): Fix typo. Use get_howto_table. + (sh_elf_info_to_howto): Use get_howto_table. + (sh_elf_relax_section): Honor the partial_inplace field of the + R_SH_DIR32 howto. + (sh_elf_relax_delete_bytes): Likewise. + (elf_sh_plt_info): New structure. + (PLT_ENTRY_SIZE): Replace both definitions with... + (ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for + INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_entry_be): Update sizes of both definitions accordingly. + (elf_sh_plt0_entry_le): Likewise. + (elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise. + (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise. + (elf_sh_plts): New structure, with separate definitions for + INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_entry): Delete both definitions. + (elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise. + (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise. + (elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise. + (elf_sh_plt_reloc_offset): Likewise. + (movi_shori_putval): Delete in favor of... + (install_plt_field): ...this new function, with separate definitions + for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (get_plt_info): New function, with separate definitions + for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA. + (elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete. + (VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros. + (vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants. + (vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise. + (vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise. + (get_plt_index, get_plt_offset): New functions. + (elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields. + (sh_elf_link_hash_table_create): Initialize them. + (sh_elf_create_dynamic_sections): Call + elf_vxworks_create_dynamic_sections for VxWorks. + (allocate_dynrelocs): Use htab->plt_info to get the size of PLT + entries. Allocate relocation entries in .rela.plt.unloaded if + generating a VxWorks executable. + (sh_elf_always_size_sections): New function. + (sh_elf_size_dynamic_sections): Extend .rela.plt handling to + .rela.plt.unloaded. + (sh_elf_relocate_section): Use get_howto_table. Honor + partial_inplace when calculating the addend for dynamic + relocations. Use get_plt_index. + (sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field + and htab->plt_info. Fill in the bra .plt offset for VxWorks + executables. Populate .rela.plt.unloaded. Do not make + _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. + (sh_elf_finish_dynamic_sections): Use install_plt_field and + htab->plt_info. Handle cases where there is no special PLT header. + Populate the first relocation in .rela.plt.unloaded and fix up + the remaining entries. + (sh_elf_plt_sym_val): Use get_plt_info. + (elf_backend_always_size_sections): Define. + (TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks. + (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise. + (elf32_bed, elf_backend_want_plt_sym): Likewise. + (elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise. + (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing): Likewise. + (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise. + * targets.c (bfd_elf32_shlvxworks_vec): Declare. + (bfd_elf32_shvxworks_vec): Likewise. + (_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and + bfd_elf32_shvxworks_vec. + +2006-08-02 Mark Kettenis + + * configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2006-08-02 Petr Salinger + + PR binutils/2983 + * elf64-x86-64.c: Add FreeBSD support. + (elf64_x86_64_fbsd_post_process_headers): New function. + * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec. + * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec + to the targ_selvecs. + * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec. + * configure: Regenerate. + +2006-07-26 Andreas Schwab + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set. + +2006-07-26 Alan Modra + + * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments. + * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete. + (define elf_backend_modify_segment_map): Don't define. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Allow + linking of objects for compatible machine types. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (mips_elf_next_relocation): Tighten check to test + also for same symbol. + +2006-07-25 Thiemo Seufer + + * elfxx-mips.c (mips_elf_calculate_relocation): Remove magic constant. + +2006-07-24 Michael Wetherell + + * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific + sections only if the SHF_OS_NONCONFORMING flag is present. + +2006-07-24 Nick Clifton + + PR ld/2729 + * peXXigen.c (_bfd_XXi_final_link_postscript): Check for the + existance of output sections before putting their entries into the + DataDictionary. + +2006-07-20 Thiemo Seufer + + * elf32-mips.c (mips16_jump_reloc): Remove function. + (elf_mips16_howto_table_rel): Use _bfd_mips_elf_generic_reloc + instead of mips16_jump_reloc. + * elf64_mips.c, wlfn32-mips.c (mips16_jump_reloc): Remove function. + (elf_mips16_howto_table_rel, elf_mips16_howto_table_rela): Use + _bfd_mips_elf_generic_reloc instead of mips16_jump_reloc. + +2006-07-19 Alan Modra + + * bfd-in.h (enum notice_asneeded_action): Define. + * bfd-in2.h: Regenerate. + * elflink.c (elf_link_add_object_symbols): Call linker "notice" + function with NULL name for as-needed handling. + +2006-07-18 Paul Brook + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_ARM_T32_ADD_IMM. + +2006-07-18 Nick Clifton + + * elfxx-mips.c (_bfd_mips_elf_common_definition): New function. + Consider SHN_MIPS_ACOMMON and SHN_MIPS_SCOMMON as being common + sections. + * elfxx-mips.h (_bfd_mips_elf_common_definition): Prototype. + +2006-07-14 Jakub Jelinek + + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Fix cinfo.shift2 value. + +2006-07-14 Mark Kettenis + + * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Move declarations + to the start of a block. + +2006-07-13 Nick Clifton + + * coff-sh.c (_bfd_sh_align_load_span): Catch sh_insn_info() + returning a NULL value. + +2006-07-12 H.J. Lu + + PR ld/2884 + * elflink.c (_bfd_elf_merge_symbol): Copy the symbol info from + the old versioned dynamic definition to the new one with + non-default visibility. Hide the symbol if it is hidden or + internal. + +2006-07-12 Matthew R. Dempsky + + * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32. + +2006-07-10 Jakub Jelinek + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH. + (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers): + Handle SHT_GNU_HASH. + (special_sections_g): Include .gnu.hash section. + (bfd_elf_gnu_hash): New function. + * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes. + (struct elf_backend_data): Add elf_hash_symbol method. + * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash + only if info->emit_hash, create .gnu.hash section if + info->emit_gnu_hash. + (struct collect_gnu_hash_codes): New type. + (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, + _bfd_elf_hash_symbol): New functions. + (compute_bucket_count): Don't compute HASHCODES array, instead add + that and NSYMS as arguments. Use bed->s->sizeof_hash_entry + instead of bed->s->arch_size / 8. Fix .hash size estimation. + When not optimizing, use the number of hashed symbols rather than + dynsymcount. + (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash, + and ADD DT_GNU_HASH if info->emit_gnu_hash. + (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash, + adjust compute_bucket_count caller. Create and populate .gnu.hash + section if info->emit_gnu_hash. + (elf_link_output_extsym): Only populate .hash section if + finfo->hash_sec != NULL. + (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH. + * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined. + (elfNN_bed): Add elf_backend_hash_symbol. + * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + * elf32-i386.c (elf_i386_hash_symbol): New function. + (elf_backend_hash_symbol): Define. + +2006-07-05 Nick Clifton + + PR ld/2659 + * cofflink.c (_bfd_coff_link_input_bfd): Fix selection of aux + entry when multiple definitions of a symbol are encountered. + +2006-06-30 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax + instead of 2 nops. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops. + +2006-06-29 Jakub Jelinek + + PR ld/2513 + * elf32-i386.c (GOT_TLS_MASK, GOT_TLS_IE_IE, GOT_TLS_IE_GD, + GOT_TLS_IE_MASK, elf_i386_check_relocs, allocate_dynrelocs): Revert + 2006-04-08 changes. + (elf_i386_relocate_section): Likewise. For GD->IE transition + change subl into addl whenever tls_type is GOT_TLS_IE_POS. + +2006-06-23 Alan Modra + + PR ld/2754 + * elf.c (bfd_elf_mkobject): Don't alloc if already done. Set + program_header_size to -1. + (_bfd_elf_map_sections_to_segments): Adjust program_header_size check. + (assign_file_positions_for_load_sections ): Likewise. + (_bfd_elf_sizeof_headers): Use saved program_header_size if + available. + * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't + alloc if already done. + * elf32-i386.c (elf_i386_mkobject): Likewise. + * elf32-ppc.c (ppc_elf_mkobject): Likewise. + * elf32-s390.c (elf_s390_mkobject): Likewise. + * elf32-sh.c (sh_elf_mkobject): Likewise. + * elf64-alpha.c (elf64_alpha_mkobject): Likewise. + * elf64-ppc.c (ppc64_elf_mkobject): Likewise. + * elf64-s390.c (elf_s390_mkobject): Likewise. + * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise. + +2006-06-20 Jakub Jelinek + + * elflink.c (elf_link_add_object_symbols): Don't create .tcommon + section for relocatable link. + +2006-06-21 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add + elf_backend_modify_program_headers. + * elfxx-target.h (elf_backend_modify_program_headers): Define. + (elfNN_bed): Init new field. + * elf.c (elf_modify_segment_map): Remove comment. + (assign_file_positions_for_load_sections): Only call + elf_modify_segment_map for objcopy/strip. + (assign_file_positions_except_relocs): Call + elf_backend_modify_program_headers. + * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make + .stack section. + (elf32_frvfdpic_modify_segment_map): Delete. + (elf32_frvfdpic_modify_program_headers): New. + (elf_backend_modify_segment_map): Don't define. + (elf_backend_modify_program_headers): Define. + * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make + .stack section. + (elf32_bfinfdpic_modify_segment_map): Delete. + (elf32_bfinfdpic_modify_program_headers): New. + (elf_backend_modify_segment_map): Don't define. + (elf_backend_modify_program_headers): Define. + * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function. + Split out from.. + (elfNN_ia64_modify_segment_map): ..here. + (elf_backend_modify_program_headers): Define. + +2006-06-20 Jakub Jelinek + + * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields. + * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field. + +2006-06-20 Alan Modra + + * elf-bfd.h: Formatting. + (_bfd_elf_map_sections_to_segments): Declare. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't + clear program_header_size. + * elf.c (get_program_header_size): Move. Don't use or set saved + program_header_size here. + (elf_modify_segment_map): New function. Split out from.. + (assign_file_positions_for_load_sections): ..here. Assert + header size is correct. Remove dead code. + (_bfd_elf_map_sections_to_segments): Rename from + map_sections_to_segments. Make global. Use get_program_header_size + when we need estimate of header size. Call elf_modify_segment_map. + Set program_header_size. + (print_segment_map): Delete. + (_bfd_elf_sizeof_headers): If segment_map available, get the + actual size. + * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe + for calling more than once. + * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise. + * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise. + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. + * elf32-i370.c (elf_backend_add_symbol_hook): Delete. + (elf_backend_additional_program_headers): Delete. + (elf_backend_modify_segment_map): Delete. + * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C. + * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. + * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties. + +2006-06-19 Vladimir Prus + + * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low + bit for undefined symbols. + +2006-06-19 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer + parameter. + (_bfd_elf_sizeof_headers): Replace bfd_boolean param with + bfd_link_info pointer. + * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise. + * bfd.c (bfd_sizeof_headers): Tweak param name. + * aout-adobe.c (aout_adobe_sizeof_headers): Adjust. + * aoutx.h (NAME (aout, sizeof_headers)): Adjust. + * binary.c (binary_sizeof_headers): Adjust. + * bout.c (b_out_sizeof_headers): Adjust. + * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust. + * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust. + * coffgen.c (coff_sizeof_headers): Adjust. + * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust. + (ecoff_compute_section_file_positions): Adjust. + (_bfd_ecoff_write_object_contents): Adjust. + * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust. + * elf32-arm.c (elf32_arm_additional_program_headers): Adjust. + * elf32-i370.c (elf_backend_additional_program_headers): Adjust. + * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust. + * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust. + * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust. + * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust. + * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust. + * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust. + * i386msdos.c: Convert to ISO C. + (msdos_sizeof_headers): Adjust. + * i386os9k.c: Convert to ISO C. + (os9k_sizeof_headers): Adjust. + * ieee.c (ieee_sizeof_headers): Adjust. + * ihex.c (ihex_sizeof_headers): Adjust. + * libaout.h (NAME (aout, sizeof_headers)): Adjust. + * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust. + * libcoff-in.h (coff_sizeof_headers): Adjust. + * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust. + * mach-o.c (bfd_mach_o_sizeof_headers): Adjust. + * mmo.c (mmo_sizeof_headers): Adjust. + * oasys.c (oasys_sizeof_headers): Adjust. + * pdp11.c (NAME (aout, sizeof_headers)): Adjust. + * pef.c (bfd_pef_sizeof_headers): Adjust. + * ppcboot.c (ppcboot_sizeof_headers): Adjust. + * som.c (som_sizeof_headers): Adjust. + * srec.c (srec_sizeof_headers): Adjust. + * tekhex.c (tekhex_sizeof_headers): Adjust. + * versados.c (versados_sizeof_headers): Adjust. + * vms.c (vms_sizeof_headers): Adjust. + * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust. + * xsym.c (bfd_sym_sizeof_headers): Adjust. + * xsym.h (bfd_sym_sizeof_headers): Adjust. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-06-15 Mark Shinwell + + * bfd-in2.h: Regenerate. + * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0, + R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2, + R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0, + R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0, + R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC, + R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1, + R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1, + R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1, + R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1, + R_ARM_LDC_SB_G2): New relocation types. + (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and + adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1 + and friends. + (elf32_arm_howto_table_3): Delete; contents merged into + elf32_arm_howto_table_2. + (elf32_arm_howto_from_type): Adjust correspondingly. + (elf32_arm_reloc_map): Extend with the above relocations. + (calculate_group_reloc_mask): New function. + (identify_add_or_sub): New function. + (elf32_arm_final_link_relocate): Support for the above + relocations. + * reloc.c: Add enumeration entries for BFD_RELOC_ARM_... + codes to correspond to the above relocations. + +2006-06-14 Richard Sandiford + + * elf32-m68k.c (elf_m68k_plt_info): New structure. + (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends. + (elf_m68k_plt_entry): Likewise. + (elf_m68k_plt_info): New table. + (CFV4E_PLT_ENTRY_SIZE): Rename to... + (ISAB_PLT_ENTRY_SIZE): ...this. + (CFV4E_FLAG): Delete. + (elf_cfv4e_plt0_entry): Rename to... + (elf_isab_plt0_entry): ...this. Adjust comments. Use (-6,%pc,%d0) + for the second instruction too. + (elf_cfv4e_plt_entry): Rename to... + (elf_isab_plt_entry): ...this. Adjust comments and use (-6,%pc,%d0). + (elf_isab_plt_info): New table. + (CPU32_FLAG): Delete. + (PLT_CPU32_ENTRY_SIZE): Rename to... + (CPU32_PLT_ENTRY_SIZE): ...this. + (elf_cpu32_plt0_entry): Update bounds accordingly. Add R_68K_PC32- + style in-place addends. + (elf_cpu32_plt_entry): Likewise. + (elf_cpu32_plt_info): New table. + (elf_m68k_link_hash_table): Add a plt_info field. + (elf_m68k_link_hash_table_create): Initialize it. + (elf_m68k_get_plt_info): New function. + (elf_m68k_always_size_sections): Likewise. + (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field. + (elf_m68k_install_pc32): New function. + (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and + elf_m68k_install_pc32. + (elf_m68k_finish_dynamic_sections): Likewise. + (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info. + (elf_backend_always_size_sections): Define. + +2006-06-14 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Save and restore + struct bfd_hash_table table, size and count fields for + as-needed libs. + +2006-06-12 Thiemo Seufer + + * elf32-mips.c: Expand comment about ABI-mandated pagesize values. + (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way. + * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6. + Delete old comments. + (ELF_COMMONPAGESIZE): Define in a more obvious way. + +2006-06-12 Nick Clifton + + PR binutils/2735 + * elflink.c (elf_link_add_object_symbols): Fix the warning message + about mismatched alignments to allow for the case where the common + alignment has been deduced from the section alignment. + * bfd.c (_bfd_default_error_handler): Update comment to explain + why bfd and asection varargs are out of order. Explicitly catch + and abort on NULL bfd and asection arguments. + +2006-06-11 Richard Sandiford + Thiemo Seufer + + * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size. + (STUB_ORI): New macro. + (STUB_LI16U): Fix formatting. + (MIPS_FUNCTION_STUB_SIZE): Delete. + (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise. + (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro. + (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise. + (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size + instead of MIPS_FUNCTION_STUB_SIZE. + (count_section_dynsyms): New function, split out from + _bfd_mips_elf_final_link. + (_bfd_mips_elf_always_size_sections): Get a worst-case estimate + of the number of dynamic symbols needed and use it to set up + function_stub_size. Use function_stub_size rather than + MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section. + Use 16-byte stubs for 0x10000 dynamic symbols. + (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size + instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the + size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to + MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes. + Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20. + Use STUB_ORI rather than STUB_LI16U for big stubs. + (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size. + (_bfd_mips_elf_final_link): Use count_section_dynsyms. + +2006-06-09 David Ung + + * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub + calling relocations. + +2006-06-08 David Daney + + * elfxx-mips.c (STUB_LI16): Removed. + (STUB_LUI): New macro. + (STUB_LI16U): Ditto. + (STUB_LI16S): Ditto. + (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter. + (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to + MIPS_FUNCTION_STUB_SIZE. + (_bfd_mips_elf_always_size_sections): Ditto. + (_bfd_mips_elf_size_dynamic_sections): Ditto. + (_bfd_mips_elf_finish_dynamic_sections): Ditto. + (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation + to allow larger symbol table indexes. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-06 Alan Modra + + * hash.c (bfd_hash_lookup): Correct stray line. + + * elf.c (_bfd_elf_init_private_section_data): Comment typo. + (elfcore_grok_nto_status): Use long instead of pid_t. + (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-05 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * config.in: Regenerate. + +2006-06-02 Alan Modra + H.J. Lu + + PR ld/2723 + * elflink.c (bfd_elf_final_link): Don't output section symbols + for special ELF sections. + +2006-06-01 Alan Modra + + * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags + instead of bfd_make_section*. + * aix386-core.c: Likewise. + * aix5ppc-core.c: Likewise. + * aout-adobe.c: Likewise. + * aoutf1.h: Likewise. + * binary.c: Likewise. + * cisco-core.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * elf.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-m32c.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * irix-core.c: Likewise. + * lynx-core.c: Likewise. + * m68klinux.c: Likewise. + * mach-o.c: Likewise. + * netbsd-core.c: Likewise. + * nlmcode.h: Likewise. + * opncls.c: Likewise. + * osf-core.c: Likewise. + * peXXigen.c: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + * rs6000-core.c: Likewise. + * sco5-core.c: Likewise. + * sparclinux.c: Likewise. + * srec.c: Likewise. + * sunos.c: Likewise. + * trad-core.c: Likewise. + * xcofflink.c: Likewise. + * xsym.c: Likewise. + +2006-05-31 Daniel Jacobowitz + + * Makefile.am (INCLUDES): Use @INCINTL@. + * acinclude.m4: Include new gettext macros. + * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS. + Manually substitute POFILES and GMOFILES. + * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated. + +2006-05-30 H.J. Lu + + * bfd.c (bfd_emul_get_maxpagesize): New. + (bfd_elf_set_pagesize): Likewise. + (bfd_emul_set_maxpagesize): Likewise. + (bfd_emul_get_commonpagesize): Likewise. + (bfd_emul_set_commonpagesize): Likewise. + * bfd-in2.h: Regenerated. + + * elf-bfd.h (elf_backend_data): Add commonpagesize. + (xvec_get_elf_backend_data): New. + (get_elf_backend_data): Use xvec_get_elf_backend_data. + + * elf32-arm.c (elf32_arm_vxworks_bed): Remove const. + * elfxx-target.h (elfNN_bed): Likewise. + + * elf32-arm.c (ELF_COMMONPAGESIZE): Defined. + * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise. + * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise. + * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise. + * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise. + * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise. + + * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined. + (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE. + + * targets.c (bfd_find_target): Support NULL abfd. + +2006-05-30 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2006-05-27 Alan Modra + H.J. Lu + + * elf.c (assign_file_positions_for_load_sections): Retrieve + maxpagesize from m->p_align if it is valid. Set p_vaddr, + p_paddr and p_align earlier. Revert 2006-05-19 change to p_align. + (copy_elf_program_header): Copy p_align. Set p_align_valid. + +2006-05-26 H.J. Lu + + * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000. + +2006-05-25 H.J. Lu + + * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000. + +2006-05-25 H.J. Lu + + * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000. + +2006-05-26 Alan Modra + + * elf.c (sym_is_global): Return a bfd_boolean. + (ignore_section_sym): New function. + (elf_map_symbols): Use ignore_section_sym to discard some syms. + (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to + bfd before using elf_section_syms. + +2006-05-25 H.J. Lu + + * config.bfd: (sh-*-linux*): Treat as 64bit target. + (sh*l*-*-netbsdelf*): Likewise. + (sh-*-netbsdelf*): Likewise. + (shl*-*-elf*): Likewise. + (sh[1234]l*-*-elf*): Likewise. + (sh3el*-*-elf*): Likewise. + (shl*-*-kaos*): Likewise. + (sh-*-elf*): Likewise. + (sh[1234]*-elf*): Likewise. + (sh-*-rtems*): Likewise. + (sh-*-kaos*): Likewise. + +2006-05-24 H.J. Lu + + PR ld/1485 + * config.bfd: Set want64 to true if 64bit bfd is used. + (sh-*-linux*): Use targ64_selvecs for 64bit targets. + (sh*l*-*-netbsdelf*): Likewise. + (sh-*-netbsdelf*): Likewise. + (shl*-*-elf*): Likewise. + (sh[1234]l*-*-elf*): Likewise. + (sh3el*-*-elf*): Likewise. + (shl*-*-kaos*): Likewise. + (sh-*-elf*): Likewise. + (sh[1234]*-elf*): Likewise. + (sh-*-rtems*): Likewise. + (sh-*-kaos*): Likewise. + +2006-05-24 Paul Brook + + * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms + * elf32-arm.c (output_arch_syminfo): Define. + (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map, + elf32_arm_output_arch_local_syms): New functions. + (elf_backend_output_arch_local_syms): Define. + * elflink.c (bfd_elf_final_link): Call + elf_backend_output_arch_local_syms. + * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default + definition. + (elfNN_bed): Add elf_backend_output_arch_local_syms. + +2006-05-24 Paul Brook + + * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions. + (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, + elf32_arm_finish_dynamic_symbol): Use them. + +2006-05-24 Carlos O'Donell + Randolph Chung + + * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for + TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations. + Add handling for TLS relocations. + (elf_hpp_reloc_final_type): Handle TLS relocs. + * elf32-hppa.c: Add authors for cleanup and TLS support. + (hppa_elf_local_got_tls_type, hh_name, eh_name): Define. + (elf32_hppa_link_hash_entry): Add tls_type. + (elf32_hppa_link_hash_table): Add tld_ldm_got. + (hppa_link_has_newfunc): Set tls_type. + (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount. + (hppa_stub_name): Use hh_name macro. + (elf32_hppa_copy_indirect_symbol): Copy TLS information. + (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc. + Handle TLS relocs. + (elf32_hppa_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Handle TLS relocs. + (elf32_hppa_size_dynamic_sections): Count space required by TLS + relocs. Use hh_name macro. + (dtpoff_base): New function. + (tpoff): Likewise. + (elf32_hppa_optimized_tls_reloc): Likewise. + (final_link_relocate): Handle TLS relocs. + (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name + and hh_name macros. + (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use + hh_name and eh_name macros. + (elf32_hppa_reloc_type_clas): Handle TLS relocs. + +2006-05-24 Bjoern Haase + + * archures.c: Add bfd_mach_avr6. + * cpu-avr.c: Likewise. + * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS): + New relocations. + * libbfd.h: Regenerate. + * bfd-in2.h:Regenerate. + * elf32-avr.h: New file. Protoypes for functions accessed from ld. + * elf32-avr.c: Add elf32-avr.h to include list. + (elf32_avr_stub_hash_entry): New function. + (elf32_avr_link_hash_table): New struct. + (avr_link_hash_table): Likewise. + (avr_stub_hash_entry): Likewise. + (avr_stub_hash_lookup): New function. + (stub_hash_newfunc): New function. + (elf32_avr_link_hash_table_create): New function. + (elf32_avr_link_hash_table_free): New function. + (avr_get_stub_addr): New function. + (debug_relax, debug_stubs): Add new global variables controlling + debugging printout to stdout. + (avr_pc_wrap_around): Change the type to bfd_vma. + (avr_replace_call_ret_sequences): Add a new variable controling + linkrelax optimizations. + (avr_stub_is_required_for_16_bit_reloc): New function. + (avr_final_link_relocate): + Add linker hash table to parameter list. Use stub addr. if necessary. + (elf32_avr_relocate_section): + Add linker hashtable to parameter list of avr_final_link_relocate. + (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6. + (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6. + (elf32_avr_relax_delete_bytes): + Iterate over all sections of a bfd when adjusting relocs addends. + (elf32_avr_relax_section): + Evaluate avr_replace_call_ret_sequences and recalculate the size of + stub section. + (avr_stub_name): New function. + (avr_get_stub_entry): New function. + (avr_add_stub): New function. + (avr_build_one_stub): New function. + (avr_size_one_stub): New function. + (elf32_avr_setup_params): New function. + (elf32_avr_setup_section_lists): New function. + (get_local_syms): New function. + (elf32_avr_size_stubs): New function. + (bfd_elf32_bfd_link_hash_table_create): New function. + (bfd_elf32_bfd_link_hash_table_free): New function. + +2006-05-23 H.J. Lu + + PR ld/2655 + PR ld/2657 + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly + update CIE/FDE length. Don't pad to the section alignment. + +2006-05-23 Jie Zhang + + * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for + deteted entries in .eh_frame section. + +2006-05-23 Jie Zhang + + * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_ + instead of _GLOBAL_OFFSET_TABLE_. + (bfin_relocate_section): Ditto. + (_bfin_create_got_section): Ditto. + (elf32_bfinfdpic_create_dynamic_sections): Use + __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_. + (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC. + +2006-05-23 Alan Modra + + * elf64-ppc.c (compare_symbols): Prefer strong dynamic global + function syms over other syms. + +2006-05-22 Daniel Jacobowitz + + * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL + check. + (bfd_elf_final_link): Add a late DT_TEXTREL check. + * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define. + (mips_elf_create_dynamic_relocation): Set DF_TEXTREL. + (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION. + Use MIPS_ELF_READONLY_SECTION. + (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after + creating DT_TEXTREL. + (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers + if no text relocations were generated. + +2006-05-19 H.J. Lu + + * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment. + +2006-05-19 Alan Modra + + * elf.c (elf_fake_sections): Formatting. + (assign_file_positions_for_load_sections): Only add SEC_ALLOC + sections to p_memsz. Remove hack for PT_NOTE sections. Allow + section alignment to increase p_align for PT_LOAD. + (assign_file_positions_for_non_load_sections): Remove ARM BPABI + hack for PT_DYNAMIC. Instead, set p_filesz for all segments + other than PT_LOAD, and PT_NOTE in core. + +2006-05-17 Alan Modra + + * elf.c (assign_file_positions_for_segments): Split into.. + (assign_file_positions_for_load_sections): ..this, and.. + (assign_file_positions_for_non_load_sections): ..this new function,.. + (assign_file_positions_except_relocs): ..writing program headers here. + +2006-05-17 Alan Modra + + * elflink.c (elf_gc_sweep): Don't specially keep non-alloc, + non-load sections if they have relocs. + +2006-05-15 Paul Brook + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ... + (bfd_is_arm_special_symbol_name): ... to this. Add type argument. + Check symbol name is of specified type. + * elf32-arm.c (elf32_arm_is_target_special_symbol, + arm_elf_find_function, elf32_arm_output_symbol_hook): Use + bfd_is_arm_special_symbol_name. + * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP, + BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER, + BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define. + (bfd_is_arm_mapping_symbol_name): Remove prototype. + (bfd_is_arm_special_symbol_name): Add prototype. + * bfd-in2.h: Regenerate. + +2006-05-15 David Heine + Bob Wilson + + * elf32-xtensa.c (check_loop_aligned): Fix reversed check for + undefined opcode. Clean up assertions. + (narrow_instruction, widen_instruction): Remove "do_it" parameters. + Factor most of the code into separate functions.... + (can_narrow_instruction, can_widen_instruction): New. + (prev_instr_is_a_loop): New. + (compute_ebb_proposed_actions): Combine error handling code for + decode errors. Replace call to insn_decode_len with inline code. + Use can_narrow_instruction and can_widen_instruction. Handle errors + from call to xtensa_opcode_is_loop. + (relax_section): Adjust calls to narrow_instruction and + widen_instruction. + +2006-05-15 Alan Modra + + PR 2658 + * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic + -shared link. + +2006-05-11 Michael Matz + + * elflink.c (match_group_member): Correctly iterate group + members. + +2006-05-11 Paul Brook + + * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs. + (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs. + (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto. + * reloc.c: Ditto. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-05-11 Mike Bland + + * elf.c (_bfd_elf_init_private_section_data): Don't change + section type if already set. + +2006-05-10 Nick Clifton + + PR ld/2607 + * elfcode.h (valid_section_index_p): New function: Checks for a + valid section index. Allows indicies in the range SHN_LOPROC to + SHN_HIOS. + (elf_object_p): Use valid_section_index_p. + +2006-05-11 Pedro Alves + + * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION, + ARM_SECREL): Mark WinCE versions of these relocs as partial + inplace. + (coff_arm_relocate_section): Adjust addend for WinCE. + +2006-05-10 Alan Modra + + PR 2342 + * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16. + +2006-05-09 Nick Clifton + + * coffcode.h (coff_write_relocs): Produce an error message if a an + out-of-range symbol index is detected in a reloc. + +2006-05-09 Ben Elliston + + * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused + local variable `dynobj'. + +2006-05-05 Bjoern Haase + + * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all + of the bfd's sections for the reloc-addend adjustments. + +2006-05-05 Martin Schwidefsky + + * elf32-s390.c (invalid_tls_insn): Call bfd_set_error. + (elf_s390_relocate_section): Add code to do the GD->LE and + LD->LE TLS linker optimizations if a brasl instruction is used + for the __tls_get_offset function call. + * elf64-s390.c (invalid_tls_insn): Call bfd_set_error. + +2006-05-05 Alan Modra + + * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize + R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in + the .toc and referenced by a TLS code sequence. + (ppc64_elf_edit_toc): Cater for the unlikely situation that + .toc is the first section in a file. + +2006-05-04 Andreas Schwab + + * aoutf1.h (struct external_sparc_core): Declare c_regs as struct + regs instead of an array of int. + (struct external_solaris_bcp_core): Likewise. + (swapcore_sun3): Use offsetof instead of computing the offset + manually. + (swapcore_sparc): Likewise. Simplify reference to c_regs. + (swapcore_solaris_bcp): Likewise. + +2006-05-04 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling + for missing GOTs. + +2006-05-04 Daniel Jacobowitz + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more + mapping symbols. + +2006-05-04 Ben Elliston + + * coff-or32.c (bfd_section_from_shdr): Remove unused local + variable `ptr'. + * cofflink.c (process_embedded_commands): Remove unused local + variables `had_read' and `had_shared'. + * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local + variable `fdr_adr'. + * ihex.c (ihex_read_section): Remove unused local variable `addr'. + +2006-05-03 Alan Modra + + * libbfd-in.h (_bfd_generic_new_section_hook): Declare. + * section.c (bfd_abs_symbol, bfd_com_symbol): Delete. + (bfd_und_symbol, bfd_ind_symbol): Delete. + (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to + &SEC.symbol. + (STD_SECTION): Adjust. + (_bfd_generic_new_section_hook): New function, extracted from.. + (bfd_section_init): ..here. + (bfd_make_section_old_way): Call new_section_hook for abs, com, + und and ind sections. + * elf.c (_bfd_elf_large_com_section): Adjust. + * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook. + * pdp11.c (new_section_hook): Likewise. + * coffcode.h (coff_new_section_hook): Likewise. + * ecoff.c (_bfd_ecoff_new_section_hook): Likewise. + * elf.c (_bfd_elf_new_section_hook): Likewise. + * vms.c (vms_new_section_hook): Likwise. + * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't + already set. + * elf32-sh64.c (sh64_elf_new_section_hook): Likewise. + * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise. + * elf64-mmix.c (mmix_elf_new_section_hook): Likewise. + * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise. + * ieee.c (ieee_new_section_hook): Likewise. Call + _bfd_generic_new_section_hook too. + * mmo.c (mmo_new_section_hook): Likewise. + * oasys.c (oasys_new_section_hook): Likewise. + * som.c (som_new_section_hook): Likewise. + * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2006-05-03 Alan Modra + + * hash.c (DEFAULT_SIZE): Revert last change. + (higher_prime_number): Correct test for no larger prime. Don't + abort on error, instead return 0. Depopulate primes[]. + (bfd_hash_lookup): If we overflow size, refuse to grow table. + +2006-05-02 Paul Brook + + * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit + for R_ARM_REL32. + +2006-05-02 Ben Elliston + + * archive.c (bfd_generic_archive_p): Remove unused local variable + `fail'. + * dwarf2.c (decode_line_info): Remove unused local variable + `basic_block'. + * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused + local variable `s'. + * tekhex.c (tekhex_write_object_contents): Remove unused local + variable `bytes_written'. + * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local + variable `r_addend'. + * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns. + * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns. + (_bfd_ns32k_relocate_contents): Remove break after return. + * elf.c (bfd_section_from_shdr): Remove breaks after returns. + +2006-05-02 Nick Clifton + + * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG + in order to avoid conflicts with the global DEBUG define. + +2006-05-02 Alan Modra + + * dwarf2.c: Formatting. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify + output section check. + * elf32-i370.c: Warning fixes inside #ifdef DEBUG. + * elf32-m32c.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-v850.c: Similarly. + * nlm32-sparc.c: Similarly. + * elfcode.h: Similarly. + (elf_symbol_flags): Delete. + * elflink.c (elf_link_input_bfd): Comment typo. + +2006-05-01 DJ Delorie + + * bfd-in.h (bfd_hash_table): Add count field. + * bfd-in2.h: Regenerate. + * hash.c (higher_prime_number): New. + (bfd_hash_table_inint_n): Init count field. + (bfd_hash_lookup): Grow table as needed. + +2006-04-27 Kaz Kojima + + PR binutils/2584 + * tekhex.c (getvalue): Change return type to bfd_boolean and + add the new parameter. Return false if the unexpected character + is found. + (getsym): Likewise. + (first_phase): Change return type to bfd_boolean and return + false if the unexpected character is found. Replace abort + with returning false. + (pass_over): Change return type to bfd_boolean and the type of + the second argument to bfd_boolean (*) (bfd *, int, char *). + Return false if FUNC returns false. + (tekhex_object_p): Return NULL if pass_over fails. + +2006-04-27 Alan Modra + + * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix. + +2006-04-26 H.J. Lu + + PR binutils/2593 + * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type + and flags if its BFD flags have been set. + (_bfd_elf_init_private_section_data): Don't copy the output ELF + section type from input if it has been set to something + different. + +2006-04-25 H.J. Lu + + PR binutils/2467 + * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd) + is NULL first. + + * elf32-arm.c (elf32_arm_close_and_cleanup): Check if + abfd->sections is NULL. + (elf32_arm_bfd_free_cached_info): New. + (bfd_elf32_bfd_free_cached_info): Defined. + + * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it + to _bfd_free_cached_info. + + * libbfd-in.h (_bfd_free_cached_info): New. + * libbfd: Regenerated. + + * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL. + (_bfd_free_cached_info): New. + +2006-04-21 Alan Modra + + * elf.c (assign_file_positions_except_relocs): Move code setting + file position of non-loaded sections.. + (assign_file_positions_for_segments): ..to here. + +2006-04-20 H.J. Lu + + PR ld/2537 + * elf.c (bfd_section_from_shdr): Allow sections reserved for + applications. Issue an error on sections we don't know how + to handle. + +2006-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * warning.m4 (--enable-werror): Format help message. + (--enable-build-warnings): Likewise. + * configure: Regenerate. + +2006-04-18 Nick Clifton + + PR 2257 + * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx + fields to still be handled as ELF files. + +2006-04-16 Daniel Jacobowitz + + * po/SRC-POTFILES.in: Regenerated. + +2006-04-16 Daniel Jacobowitz + + * configure.in: Update version to 2.17.50. + * configure: Regenerated. + +2006-04-14 David Heine + + * elf32-xtensa.c (build_reloc_opcodes): New. + (compute_text_actions): Use it to decode opcodes outside inner loop. + (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if + it is set, use it to get the opcodes for relocations. + (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit. + +2006-04-08 H.J. Lu + + PR ld/2513 + * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type. + (GOT_TLS_IE_IE): Likewise. + (GOT_TLS_IE_GD): Likewise. + (GOT_TLS_IE_MASK): Likewise. + (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD + and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE + respectively. + (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD + are set, treat tls_type as GOT_TLS_IE_BOTH. + (elf_i386_relocate_section): Likewise. + +2006-04-07 Randolph Chung + + * elf64-hppa.c (elf64_hppa_grok_prstatus): New function. + (elf64_hppa_grok_psinfo): Likewise. + (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define. + +2006-04-06 DJ Delorie + + * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for + each plt entry we create. + +2006-04-06 Carlos O'Donell + + * po/Make-in: Add install-html target. + * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir + htmldir. Add install-html and install-html-recursive targets. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST for datarootdir, docdir and htmldir. + * configure: Regenerate. + +2006-04-06 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes + with the skip_relax_pass_0 and skip_relax_pass_1 bits in the + section structure. + +2006-04-05 Bernd Schmidt + + * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to + eliminate warnings. + +2006-04-05 H.J. Lu + James E Wilson + + PR ld/2442 + * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next. + (elfNN_ia64_local_hash_entry): Add count, sorted_count and + size. + (elfNN_ia64_link_hash_entry): Likewise. + (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count + and size. + (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info + processing. + (elfNN_ia64_hash_hide_symbol): Likewise. + (elfNN_ia64_global_dyn_sym_thunk): Likewise. + (elfNN_ia64_local_dyn_sym_thunk): Likewise. + (elfNN_ia64_global_dyn_info_free): New function. + (elfNN_ia64_local_dyn_info_free): Likewise. + (elfNN_ia64_hash_table_free): Free local and global + elfNN_ia64_dyn_sym_info. + (addend_compare): New function. + (sort_dyn_sym_info): Likewise. + (get_dyn_sym_info): Updated to use binary search for addend. + (elfNN_ia64_check_relocs): Scan relocations to create dynamic + relocation arrays first. + +2006-04-05 Bernd Schmidt + + * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp + symbol. + +2006-04-05 H.J. Lu + + PR ld/2411 + * elflink.c (check_dynsym): New. + (elf_link_output_extsym): Use it. + (bfd_elf_final_link): Likewise. + +2006-04-05 H.J. Lu + + PR ld/2404 + * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect + symbol from the dynamic definition with the default version if + its type and the type of existing regular definition mismatch. + +2006-04-05 Richard Sandiford + Daniel Jacobowitz + + * config.bfd (sparc-*-vxworks*): New stanza. + * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza. + (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo. + * configure: Regenerate. + * elf32-sparc.c: Include elf-vxworks.h. + (elf32_sparc_vxworks_link_hash_table_create: New. + (elf32_sparc_vxworks_final_write_processing): New. + (TARGET_BIG_SYM): Override for VxWorks. + (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise. + (bfd_elf32_bfd_link_hash_table_create): Likewise. + (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise. + (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing, elf32_bed): Likewise. + * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h. + (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New. + (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New. + (_bfd_sparc_elf_link_hash_table_create): Don't initialize + build_plt_entry here. + (create_got_section): Initialize sgotplt for VxWorks. + (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry, + plt_header_size and plt_entry_size, with new VxWorks-specific settings. + Call elf_vxworks_create_dynamic_sections for VxWorks. + (allocate_dynrelocs): Use plt_header_size and plt_entry_size. + Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks. + (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt + for VxWorks. Check for the .got.plt section. + (sparc_vxworks_build_plt_entry): New function. + (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs. + Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_ + absolute on VxWorks. + (sparc32_finish_dyn): Add special handling for DT_RELASZ + and DT_PLTGOT on VxWorks. + (sparc_vxworks_finish_exec_plt): New. + (sparc_vxworks_finish_shared_plt): New. + (_bfd_sparc_elf_finish_dynamic_sections): Call them. + Use plt_header_size and plt_entry_size. + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks, + srelplt2, sgotplt, plt_header_size and plt_entry_size fields. + * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h. + (elf32-sparc.lo): Likewise. + * Makefile.in: Regenerate. + * targets.c (bfd_elf32_sparc_vxworks_vec): Declare. + (_bfd_target_vector): Add a pointer to it. + +2006-03-30 Ben Elliston + + PR ld/2267 + * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a + special section number that exceeds the number of ELF sections + (eg. SHN_MIPS_SCOMMON). + +2006-03-27 Richard Sandiford + + * elfxx-mips.c (mips_got_entry): Add more commentary. + (mips_elf_local_got_index): Use the hash table entry to record + the GOT index of forced-local symbols. + (mips_elf_initialize_tls_index): Rearrange code. Store the index + in either the hash table entry or the mips_got_entry, not both. + Add more commentary. + (mips_elf_multi_got): Make sure the g->next is nonnull when calling + mips_elf_initialize_tls_index. + +2006-03-25 Bernd Schmidt + + * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc, + RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty, + reloc_stack_push, reloc_stack_pop, reloc_stack_operate, + bfin_areloc_howto_table): Delete. All + uses deleted as well. + (bfin_reloc_map): Delete all stack relocs. + (bfin_info_to_howto, bfin_bfd_reloc_type_lookup, + bfin_reloc_type_lookup): Don't support them. + (bfin_relocate_section): Don't try to handle them. + + * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec. + * configure.in: Likewise. + * configure: Regenerate. + * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h". + (BFIN_RELOC_MAX): Now 0x21. + (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs. + (bfd_elf32_bfinfdpic_vec): Declare. + (IS_FDPIC): New macro. + (struct bfinfdpic_elf_link_hash_table): New struct. + (bfinfdpic_hash_table, bfinfdpic_got_section, + bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section, + bfinfdpic_plt_setion, bfinfdpic_pltrel_section, + bfinfdpic_relocs_info, bfinfdpic_got_initial_offset, + bfinfdpic_plt_initial_offset): Accessor macros for it. + (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros. + (struct bfinfdpic_relocs_info): New struct. + (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES, + BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC, + DEFAULT_STACK_SIZE): New macros. + (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash, + bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find, + bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local, + bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc, + _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment, + _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section, + bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook, + _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section, + elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry, + _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry, + _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries, + _bfinfdpic_resolve_final_relocs_info, + elf32_bfinfdpic_size_dynamic_sections, + elf32_bfinfdpic_always_size_sections, + elf32_bfinfdpic_modify_segment_map, + _bfinfdpic_count_got_plt_entries, + elf32_bfinfdpic_finish_dynamic_sections, + elf32_bfinfdpic_adjust_dynamic_symbol, + elf32_bfinfdpic_finish_dynamic_symbol, + elf32_bfinfdpic_elf_use_relative_eh_frame, + elf32_bfinfdpic_elf_encode_eh_address, + elf32_bfin_object_p, bfin_elf_copy_private_bfd_data, + elf32_bfinfdpic_copy_private_bfd_data, + (struct _bfinfdpic_dynamic_got_info, + struct _bfinfdpic_dynamic_got_plt_info): New structs. + (elf32_bfin_print_private_bfd_data): Print PIC flags. + (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed, + elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create, + elf_backend_always_size_sectinos, elf_backend_modify_segment_map, + bfd_elf32_bfd_copy_private_bfd_data, + elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_relocate_section, + elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs, + elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p, + elf_backend_may_use_rela_p, elf_backend_default_use_rela_p, + elf_backend_omit_section_dynsym): Redefine these macros and include + "elf32-target.h" again to create the elf32-bfinfdpic target. + * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI, + BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC, + BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI, + BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE, + BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, + BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI, + BFD_RELOC_BFIN_GOTOFFLO): New. + * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target. + (_bfd_target_vector): Add it. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2006-03-25 Richard Sandiford + + * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as + incompatible. Likewise MAC and EMAC code. + * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use + bfd_get_compatible to set the new bfd architecture. Rely on it + to detect incompatibilities. + +2006-03-23 Michael Matz + + * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64, + BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64, + BFD_RELOC_X86_64_PLTOFF64. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment. + Add howtos for above relocs. + (x86_64_reloc_map): Add mappings for new relocs. + (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64, + R_X86_64_GOTPLT64 need a got entry. R_X86_64_GOTPLT64 also a PLT + entry. R_X86_64_GOTPC64 needs a .got section. R_X86_64_PLTOFF64 + needs a PLT entry. + (elf64_x86_64_gc_sweep_hook): Reflect changes from + elf64_x86_64_check_relocs for the new relocs. + (elf64_x86_64_relocate_section): Handle new relocs. + +2006-03-22 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that + rel->r_addend is zero. + +2006-03-22 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type + of "loc". + +2006-03-22 Richard Sandiford + Daniel Jacobowitz + Phil Edwards + Zack Weinberg + Mark Mitchell + Nathan Sidwell + + * bfd-in2.h: Regenerate. + * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas. + * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza. + (bfd_elf32_littlemips_vxworks_vec): Likewise. + (bfd_elf32_bigmips_vec): Add elf-vxworks.lo. + (bfd_elf32_littlemips_vec): Likewise. + (bfd_elf32_nbigmips_vec): Likewise. + (bfd_elf32_nlittlemips_vec): Likewise. + (bfd_elf32_ntradbigmips_vec): Likewise. + (bfd_elf32_ntradlittlemips_vec): Likewise. + (bfd_elf32_tradbigmips_vec): Likewise. + (bfd_elf32_tradlittlemips_vec): Likewise. + (bfd_elf64_bigmips_vec): Likewise. + (bfd_elf64_littlemips_vec): Likewise. + (bfd_elf64_tradbigmips_vec): Likewise. + (bfd_elf64_tradlittlemips_vec): Likewise. + * elf32-mips.c: Include elf-vxworks.h. + (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto + instead of calling mips_elf32_rtype_to_howto directly. + (mips_vxworks_copy_howto_rela): New reloc howto. + (mips_vxworks_jump_slot_howto_rela): Likewise. + (mips_vxworks_bfd_reloc_type_lookup): New function. + (mips_vxworks_rtype_to_howto): Likewise. + (mips_vxworks_final_write_processing): Likewise. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks. + (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise. + (elf_backend_want_got_plt): Likewise. + (elf_backend_want_plt_sym): Likewise. + (elf_backend_got_symbol_offset): Likewise. + (elf_backend_want_dynbss): Likewise. + (elf_backend_may_use_rel_p): Likewise. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_backend_got_header_size: Likewise. + (elf_backend_plt_readonly): Likewise. + (bfd_elf32_bfd_reloc_type_lookup): Likewise. + (elf_backend_mips_rtype_to_howto): Likewise. + (elf_backend_adjust_dynamic_symbol): Likewise. + (elf_backend_finish_dynamic_symbol): Likewise. + (bfd_elf32_bfd_link_hash_table_create): Likewise. + (elf_backend_add_symbol_hook): Likewise. + (elf_backend_link_output_symbol_hook): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_final_write_processing: Likewise. + (elf_backend_additional_program_headers): Likewise. + (elf_backend_modify_segment_map): Likewise. + (elf_backend_symbol_processing): Likewise. + * elfxx-mips.c: Include elf-vxworks.h. + (mips_elf_link_hash_entry): Add is_relocation_target and + is_branch_target fields. + (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt, + srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields. + (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros. + (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument. + Return 3 for VxWorks. + (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a + mips_elf_link_hash_table. Return 0 for VxWorks. + (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a + mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET. + (mips_vxworks_exec_plt0_entry): New variable. + (mips_vxworks_exec_plt_entry): Likewise. + (mips_vxworks_shared_plt0_entry): Likewise. + (mips_vxworks_shared_plt_entry): Likewise. + (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields. + (mips_elf_rel_dyn_section): Change the bfd argument to a + mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get + the name of the section. + (mips_elf_initialize_tls_slots): Update the call to + mips_elf_rel_dyn_section. + (mips_elf_gotplt_index): New function. + (mips_elf_local_got_index): Add an input_section argument. + Update the call to mips_elf_create_local_got_entry. + (mips_elf_got_page): Likewise. + (mips_elf_got16_entry): Likewise. + (mips_elf_create_local_got_entry): Add bfd_link_info and input_section + arguments. Create dynamic relocations for each entry on VxWorks. + (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE. + (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE + and MIPS_RESERVED_GOTNO. + (mips_elf_create_got_section): Update the uses of + MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks. + (is_gott_symbol): New function. + (mips_elf_calculate_relocation): Use a dynobj local variable. + Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and + mips_elf_got_page_entry. Set G to the .got.plt entry when calculating + VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT + relocations on VxWorks. Add dynamic relocations for references + to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't + create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 + in VxWorks executables. + (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument. + Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry. + Don't allocate a null entry on VxWorks. + (mips_elf_create_dynamic_relocation): Update the call to + mips_elf_rel_dyn_section. Use absolute rather than relative + relocations for VxWorks, and make them RELA rather than REL. + (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic + read-only on VxWorks. Update the call to mips_elf_rel_dyn_section. + Create the .plt, .rela.plt, .dynbss and .rela.bss sections on + VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol. + Call elf_vxworks_create_dynamic_sections for VxWorks and + initialize the plt_header_size and plt_entry_size fields. + (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be + used in VxWorks executables. Don't allocate dynamic relocations + for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables. + Set is_relocation_target for each symbol referenced by a relocation. + Allocate .rela.dyn entries for relocations against the special + VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT + entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate + a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*, + R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls + to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations. + Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26 + relocations. Don't set no_fn_stub on VxWorks. + (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to + mips_elf_allocate_dynamic_relocations. + (_bfd_mips_vxworks_adjust_dynamic_symbol): New function. + (_bfd_mips_elf_always_size_sections): Do not allocate GOT page + entries for VxWorks, and do not create multiple GOTs. + (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME. + Handle .got specially for VxWorks. Update the uses of + MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations. + Check for sgotplt and splt. Allocate the .rel(a).dyn contents last, + once its final size is known. Set DF_TEXTREL for VxWorks. Add + DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL + tags on VxWorks. Do not add the MIPS-specific tags for VxWorks. + (_bfd_mips_vxworks_finish_dynamic_symbol): New function. + (mips_vxworks_finish_exec_plt): Likewise. + (mips_vxworks_finish_shared_plt): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call + to mips_elf_rel_dyn_section. Use a VxWorks-specific value of + DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, + DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO + and mips_elf_rel_dyn_section. Use a different GOT header for + VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks. + (_bfd_mips_elf_link_hash_table_create): Initialize the new + mips_elf_link_hash_table fields. + (_bfd_mips_vxworks_link_hash_table_create): New function. + (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_ + on VxWorks. Update the call to ELF_MIPS_GP_OFFSET. + * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare. + (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise. + (_bfd_mips_vxworks_link_hash_table_create): Likewise. + * libbfd.h: Regenerate. + * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h. + (elf32-mips.lo): Likewise. + * Makefile.in: Regenerate. + * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare. + * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare. + (bfd_elf32_littlemips_vxworks_vec): Likewise. + (_bfd_target_vector): Add entries for them. + +2006-03-19 John David Anglin + + * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss + section from SHF_PARISC_WEAKORDER to SHF_HP_TLS. + (elf_backend_special_sections): Remove #undef. + +2006-03-18 John David Anglin + + * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry + for undefined weak symbols. + +2006-03-17 Daniel Jacobowitz + + PR ld/2462 + * elflink.c (bfd_elf_final_link): Remove + bed->elf_backend_emit_relocs from emit_relocs. + +2006-03-17 Alexandre Oliva + + * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from + first relocation to the second when relaxing TLS GD to LE; + zero it out when relaxing to IE. + +2006-03-17 Alan Modra + + PR 2434 + * elflink.c (elf_link_add_object_symbols): Save and restore + warning sym's linked sym. + +2006-03-16 Alan Modra + + PR 2434 + * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. + (elf_link_add_object_symbols): Delete unnecessary locals. Rename + hash_table -> htab. Formatting. Save entire symbol table + before loading as-needed syms, and restore afterwards if lib not + needed. Use bfd_hash_allocate rather than bfd_alloc for sym + name. Free some buffers earlier. + * bfd-in.h (struct bfd_hash_table): Add entsize. + (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. + * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise + * hash.c (bfd_hash_table_init_n): Add entsize param, save to + hash table. + (bfd_hash_table_init): Add param, adjust calls. + * aoutx.h: Adjust all hash_table_init functions and calls. + * bfd.c: Likewise. + * coff-arm.c: Likewise. + * coff-h8300.c: Likewise. + * coff-ppc.c: Likewise. + * cofflink.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf-m10300.c: Likewise. + * elf-strtab.c: Likewise. + * elf.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * i386linux.c: Likewise. + * libaout.h: Likewise. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * merge.c: Likewise. + * opncls.c: Likewise. + * pdp11.c: Likewise. + * sparclinux.c: Likewise. + * stabs.c: Likewise. + * sunos.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * section.c (struct section_hash_entry): Move to.. + * libbfd-in.h: ..here. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2006-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs + against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak + last change to REL32 relocs so that they are counted as + possibly dynamic as per REL24 and REL14. + +2006-03-16 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24 + checks from REL32. + +2006-03-15 Ben Elliston + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all + in_list elements, not just the first. + +2006-03-14 Richard Sandiford + + * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split + out from... + (_bfd_mips_elf_relocate_section): ...here. Use it to adjust r_addend + for final links too. + +2006-03-13 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot. + +2006-03-11 H.J. Lu + + PR ld/2443 + * dwarf2.c (concat_filename): Don't issue an error if file is 0. + +2006-03-10 Paul Brook + + * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5. + (elf32_arm_print_private_bfd_data): Ditto. + +2006-03-09 Paul Brook + + * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional + mapping symbols. + +2006-03-09 Khem Raj + + * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned + char type. + +2006-03-08 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. + +2006-03-07 Richard Sandiford + Daniel Jacobowitz + Zack Weinberg + Nathan Sidwell + Paul Brook + Ricardo Anguiano + Phil Edwards + + * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo. + (bfd_elf32_bigarm_symbian_vec): Likewise. + (bfd_elf32_bigarm_vxworks_vec): Likewise. + (bfd_elf32_littlearm_vec): Likewise. + (bfd_elf32_littlearm_symbian_vec): Likewise. + (bfd_elf32_littlearm_vxworks_vec): Likewise. + * configure: Regenerate. + * elf32-arm.c: Include libiberty.h and elf-vxworks.h. + (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros. + (elf32_arm_vxworks_bed): Add forward declaration. + (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12. + (elf32_arm_vxworks_exec_plt0_entry): New table. + (elf32_arm_vxworks_exec_plt_entry): Likewise. + (elf32_arm_vxworks_shared_plt_entry): Likewise. + (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields. + (reloc_section_p): New function. + (create_got_section): Use RELOC_SECTION. + (elf32_arm_create_dynamic_sections): Likewise. Call + elf_vxworks_create_dynamic_sections for VxWorks targets. + Choose between the two possible values of plt_header_size + and plt_entry_size. + (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2. + (elf32_arm_abs12_reloc): New function. + (elf32_arm_final_link_relocate): Call it. Allow the creation of + dynamic R_ARM_ABS12 relocs on VxWorks. Use reloc_section_p, + RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION. Initialize the + r_addend fields of relocs. On rela targets, skip any code that + adjusts in-place addends. When using _bfd_link_final_relocate + to perform a final relocation, pass rel->r_addend as the addend + argument. + (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks + object, ignore flags that are not standard on VxWorks. + (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12 + relocs on VxWorks. Use reloc_section_p. + (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE. + (allocate_dynrelocs): Use RELOC_SIZE. Account for the size of + .rela.plt.unloaded relocs on VxWorks targets. + (elf32_arm_size_dynamic_sections): Use RELOC_SIZE. Check for + .rela.plt.unloaded as well as .rel(a).plt. Add DT_RELA* tags + instead of DT_REL* tags on RELA targets. + (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE + and SWAP_RELOC_OUT. Initialize r_addend fields. Handle VxWorks + PLT entries. Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks. + (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE + and SWAP_RELOC_OUT. Initialize r_addend fields. Handle DT_RELASZ + like DT_RELSZ. Handle the VxWorks form of initial PLT entry. + Correct the .rela.plt.unreloaded symbol indexes. + (elf32_arm_output_symbol_hook): Call the VxWorks version of this + hook on VxWorks targets. + (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true. + Minor formatting tweak. + (elf32_arm_vxworks_final_write_processing): New function. + (elf_backend_add_symbol_hook): Override for VxWorks and reset + for Symbian. + (elf_backend_final_write_processing): Likewise. + (elf_backend_emit_relocs): Likewise. + (elf_backend_want_plt_sym): Likewise. + (ELF_MAXPAGESIZE): Likewise. + (elf_backend_may_use_rel_p): Minor formatting tweak. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elf_backend_rela_normal): Likewise. + * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h. + +2006-03-06 Nathan Sidwell + + * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp): + New. Adjust other variants. + (bfd_default_scan): Update. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c: Adjust. + (bfd_m68k_compatible): New. Use it for architectures. + * elf32-m68k.c (elf32_m68k_object_p): Adjust. + (elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b + mismatch. + (elf32_m68k_print_private_bfd_data): Adjust. + * ieee.c (ieee_write_processor): Adjust. + +2006-03-06 Alan Modra + + * dwarf2.c: Formatting. + (add_line_info): Remove outer loop. + +2006-03-05 H.J. Lu + Alan Modra + + PR binutils/2338 + * dwarf2.c (loadable_section): New struct. + (dwarf2_debug): Add loadable_section_count and + loadable_sections. + (new_line_sorts_after): New. + (add_line_info): Use new_line_sorts_after to compare line + addresses. + (check_function_name): Removed. + (unset_sections): New. + (place_sections): New. + (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections + and unset_sections on relocatable files. + (_bfd_dwarf2_find_line): Likewise. + +2006-03-03 Nick Clifton + + * cpu-avr.c: Update to ISO-C90 formatting. + * elf32-avr.c: Likewise. + +2006-03-03 Bjoern Haase + + * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI + and R_AVR_MS8_LDI + (bfd_elf_avr_final_write_processing): Set + EF_AVR_LINKRELAX_PREPARED in e_flags field. + (elf32_avr_relax_section): New function. + (elf32_avr_relax_delete_bytes): New function. + (elf32_avr_get_relocated_section_contents): New function. + (avr_pc_wrap_around): New function. + (avr_relative_distance_considering_wrap_around): New function. + (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI. + * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2006-03-02 DJ Delorie + + * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol + calculations. + +2006-03-02 Richard Sandiford + + * elf32-ppc.c (is_ppc_elf_target): Return true if the target is + bfd_elf32_powerpc_vxworks_vec. + +2006-03-02 Nick Clifton + + * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'. + +2006-03-02 Richard Sandiford + + * elf32-i386.c (elf_i386_create_dynamic_sections): Use + elf_vxworks_create_dynamic_sections. + (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT + symbol handling. + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use + elf_vxworks_create_dynamic_sections. + (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT + symbol handling. + * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function. + * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare. + +2006-03-02 Richard Sandiford + + * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete. + (elf_backend_link_output_symbol_hook): Use + elf_vxworks_link_output_symbol_hook instead. + * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete. + (elf_backend_link_output_symbol_hook): Use + elf_vxworks_link_output_symbol_hook instead. + * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the + same interface as elf_backend_link_output_symbol_hook. + * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update + prototype accordingly. + +2006-03-02 Richard Sandiford + + * elf32-ppc.c (ppc_elf_plt_type): New enumeration. + (ppc_elf_link_hash_table): Replace old_got and new_got with + plt_type and can_use_new_plt. + (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS, + SEC_LOAD and SEC_READONLY to the VxWorks .plt flags. + (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt. + Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt. + (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to + either plt_type == PLT_OLD or plt_type == PLT_NEW. Assert that + this function should not be called for VxWorks targets. + (ppc_elf_tls_setup): Use plt_type instead of old_got. + (allocate_got): Likewise. Rearrange so that max_before_header + is only used for PLT_OLD and PLT_NEW. + (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks. + (ppc_elf_size_dynamic_sections): Likewise. + (ppc_elf_relax_section): Likewise. + (ppc_elf_relocate_section): Likewise. + (ppc_elf_finish_dynamic_symbol): Likewise. + (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type. + +2006-02-28 Richard Sandiford + + * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index. + (elf_i386_link_hash_table_create): Initialize it. + (elf_i386_compute_jump_table_size): Use it instead of + srelplt->reloc_count. + (allocate_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + +2006-02-27 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag. + (_bfd_elf_write_section_eh_frame): Likewise. + +2006-02-27 Carlos O'Donell + + * po/Make-in: Add html target. + +2006-02-27 Richard Sandiford + + * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the + cached hgot entry to check for _GLOBAL_OFFSET_TABLE_. + * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise. + * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise. + * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. Also use + the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_. + * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise. + +2006-02-25 Richard Sandiford + + * elf-bfd.h (elf_link_hash_table): Add hplt field. + * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it. + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. + * elf32-frv.c (_frv_create_got_section): Likewise. + * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt. + (elf_i386_link_hash_table_create): Don't initialize them. + (elf_i386_size_dynamic_sections): Use the generic ELF hplt and + hgot fields. + (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt. + (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields. + (ppc_elf_finish_dynamic_symbol): Likewise. + +2006-02-24 DJ Delorie + + * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs. + (m32c_elf_relocate_section): Don't relocate them. + (compare_reloc): New. + (relax_reloc): Remove. + (m32c_offset_for_reloc): New. + (m16c_addr_encodings): New. + (m16c_jmpaddr_encodings): New. + (m32c_addr_encodings): New. + (m32c_elf_relax_section): Relax jumps and address displacements. + (m32c_elf_relax_delete_bytes): Adjust for internal syms. Fix up + short jumps. + + * reloc.c: Add m32c relax relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2006-02-24 H.J. Lu + + PR ld/2218 + * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol. + (_bfd_elf_link_hash_fixup_symbol): New. + + * elflink.c (_bfd_elf_link_hash_fixup_symbol): New. + (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if + it isn't NULL. + + * elfxx-ia64.c (elf_backend_fixup_symbol): Defined. + + * elfxx-target.h (elf_backend_fixup_symbol): New. + (elfNN_bed): Initialize elf_backend_fixup_symbol. + +2006-02-23 H.J. Lu + + * cpu-ia64-opc.c (ins_immu5b): New. + (ext_immu5b): Likewise. + (elf64_ia64_operands): Add IMMU5b. + +2006-02-21 Alan Modra + + PR ld/2218 + * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie + is dynamic. + * elf32-hppa.c (allocate_dynrelocs): Likewise. + * elf32-i386.c (allocate_dynrelocs): Likewise. + * elf32-s390.c (allocate_dynrelocs): Likewise. + * elf32-sh.c (allocate_dynrelocs): Likewise. + * elf64-s390.c (allocate_dynrelocs): Likewise. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + * elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs + on undef weak with non-default visibility too. + * elfxx-sparc.c (allocate_dynrelocs): Ditto. + +2006-02-21 Alan Modra + + * bfd.c: (_bfd_default_error_handler): Don't call abort on + error, instead call _exit. + (_bfd_abort): Call _exit not xexit. + +2006-02-17 Kevin Buettner + + * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo): + New functions. + * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. + +2006-02-17 Shrirang Khisti + Anil Paranjape + Shilin Shakti + + * Makefile.am: Add xc16x related entry + * Makefile.in: Regenerate + * archures.c: Add bfd_xc16x_arch + * bfd-in2.h: Regenerate + * config.bfd: Add xc16x-*-elf + * configure.in: Add bfd_elf32_xc16x_vec + * configure: Regenerate. + * targets.c: Added xc16x related information + * cpu-xc16x.c: New file + * reloc.c: Add new relocations specific to xc16x: + BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG, + BFD_RELOC_XC16X_SOF + * elf32-xc16x.c: New file. + +2006-02-17 Alan Modra + + * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + +2006-02-17 Alan Modra + + PR ld/2218 + * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is + dynamic. + (ppc64_elf_relocate_section): Check output reloc section size. + * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test. + +2006-02-16 H.J. Lu + + PR ld/2322 + * elf.c (get_segment_type): New function. + (_bfd_elf_print_private_bfd_data): Use it. + (print_segment_map): New function. + (assign_file_positions_for_segments): Call print_segment_map + when there are not enough room for program headers. + +2006-02-16 Nick Hudson + + * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use + traditional MIPS ELF targets. + +2006-02-15 H.J. Lu + + PR binutils/2338 + * dwarf2.c (check_function_name): New function. + (_bfd_dwarf2_find_nearest_line): Use check_function_name to + check if function is correct. + +2006-02-16 Alan Modra + + * elflink.c (_bfd_elf_default_action_discarded): Return 0 for + debug sections. + (elf_link_input_bfd): Adjust comments. + +2006-02-10 H.J. Lu + + * elf.c (copy_private_bfd_data): Minor update. + +2006-02-10 H.J. Lu + + PR binutils/2258 + * elf.c (copy_private_bfd_data): Renamed to ... + (rewrite_elf_program_header): This. + (copy_elf_program_header): New function. + (copy_private_bfd_data): Likewise. + +2006-02-07 Nathan Sidwell + + * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e, + bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x, + bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249, + bfd_mach_mcf547x, bfd_mach_mcf548x): Remove. + (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div, + bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac, + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp, + bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac, + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac, + bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac, + bfd_mach_mcf_isa_b_usp_float_emac): New. + (bfd_default_scan): Update coldfire mapping. + * bfd-in.h (bfd_m68k_mach_to_features, + bfd_m68k_features_to_mach): Declare. + * bfd-in2.h: Rebuilt. + * cpu-m68k.c (arch_info_struct): Add new coldfire machines, + adjust legacy names. + (m68k_arch_features): New. + (bfd_m68k_mach_to_features, + bfd_m68k_features_to_mach): Define. + * elf32-m68k.c (elf32_m68k_object_p): New. + (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags. + (elf32_m68k_print_private_bfd_data): Print the CF EF flags. + (elf_backend_object_p): Define. + * ieee.c (ieee_write_processor): Update coldfire machines. + * libbfd.h: Rebuilt. + +2006-02-06 Steve Ellcey + + * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS + if SHF_TLS is set. + +2006-02-05 Arnold Metselaar + + * coff-z80.c (r_imm24): New howto. + (rtype2howto): New case R_IMM24. + (coff_z80_reloc_type_lookup): New case BFD_RELOC_24. + (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24. + +2006-02-04 Richard Sandiford + + * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol + has already been assigned a GOT index, copy that index to the + current hash table entry. + +2006-02-01 Eric Botcazou + + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass + for call-to-undefweak reloc overflow. + +2006-01-31 Eric Botcazou + + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass + for 32-bit relocs overflow. + +2006-01-27 Paul Brook + + * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb + objects. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC, + BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC, + BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf32-i386.c (elf_howto_table): New relocations. + (R_386_tls): Adjust. + (elf_i386_reloc_type_lookup): Map new relocations. + (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. + (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. + (struct elf_i386_link_hash_entry): Add tlsdesc_got field. + (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field. + (elf_i386_local_tlsdesc_gotent): New macro. + (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size. + (elf_i386_compute_jump_table_size): New macro. + (link_hash_newfunc): Initialize tlsdesc_got. + (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size. + (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf_i386_check_relocs): Likewise. Allocate space for + local_tlsdesc_gotent. + (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (allocate_dynrelocs): Count function PLT relocations. Reserve + space for TLS descriptors and relocations. + (elf_i386_size_dynamic_sections): Reserve space for TLS + descriptors and relocations. Set up sgotplt_jump_table_size. + Don't zero reloc_count in srelplt. + (elf_i386_always_size_sections): New. Set up _TLS_MODULE_BASE_. + (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. + (elf_backend_always_size_sections): Define. + * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC, + R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL. + (R_X86_64_standard): Adjust. + (x86_64_reloc_map): Map new relocs. + (elf64_x86_64_rtype_to_howto): New, split out of... + (elf64_x86_64_info_to_howto): ... this function, and... + (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val. + (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros. + (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros. + (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field. + (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field. + (elf64_x86_64_local_tlsdesc_gotent): New macro. + (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt, + tlsdesc_got and sgotplt_jump_table_size fields. + (elf64_x86_64_compute_jump_table_size): New macro. + (link_hash_newfunc): Initialize tlsdesc_got. + (elf64_x86_64_link_hash_table_create): Initialize new fields. + (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and + R_X86_64_TLSDESC_CALL. + (elf64_x86_64_check_relocs): Likewise. Allocate space for + local_tlsdesc_gotent. + (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and + R_X86_64_TLSDESC_CALL. + (allocate_dynrelocs): Count function PLT relocations. Reserve + space for TLS descriptors and relocations. + (elf64_x86_64_size_dynamic_sections): Reserve space for TLS + descriptors and relocations. Set up sgotplt_jump_table_size, + tlsdesc_plt and tlsdesc_got. Make room for them. Don't zero + reloc_count in srelplt. Add dynamic entries for DT_TLSDESC_PLT + and DT_TLSDESC_GOT. + (elf64_x86_64_always_size_sections): New. Set up + _TLS_MODULE_BASE_. + (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and + R_386_TLS_DESC_CALL. + (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P. + (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and + DT_TLSDESC_GOT. Set up TLS descriptor lazy resolver PLT entry. + (elf_backend_always_size_sections): Define. + +2006-01-17 H.J. Lu + + PR binutils/2096 + * dwarf2.c (comp_unit_contains_address): Update comment. + (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of + lma. Return TRUE only if both comp_unit_contains_address and + comp_unit_find_nearest_line return TRUE. + (_bfd_dwarf2_find_line): Use section's vma, instead of lma. + +2006-01-18 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref. + (bfd_elf_gc_mark_dynamic_ref_symbol): Declare. + * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from + elf_gc_mark_dynamic_ref_symbol. Make global. + (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref. + * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define. + (elfNN_bed): Init new field. + * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define. + (ppc64_elf_gc_mark_dynamic_ref): New function. + +2006-01-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop. + +2006-01-17 Nick Clifton + + PR binutils/2159 + * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused + parameters. + +2006-01-11 Nick Clifton + + * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry + into the newly (re)allocated map array. + +2006-01-09 Alexis Wilke + + * peXXigen.c (tbl): Add comma after "HIGH3ADJ". + +2006-01-01 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_action_discarded): Return 0 + for .toc1 section. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am index 77278a832a1..48919af759b 100644 --- a/contrib/binutils/bfd/Makefile.am +++ b/contrib/binutils/bfd/Makefile.am @@ -1,6 +1,7 @@ ## Process this file with automake to generate Makefile.in AUTOMAKE_OPTIONS = 1.9 cygnus +ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Uncomment the following line when doing a release. # RELEASE=y @@ -63,6 +64,7 @@ ALL_MACHINES = \ cpu-arm.lo \ cpu-avr.lo \ cpu-bfin.lo \ + cpu-cr16.lo \ cpu-cr16c.lo \ cpu-cris.lo \ cpu-crx.lo \ @@ -91,6 +93,7 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-maxq.lo \ cpu-mcore.lo \ + cpu-mep.lo \ cpu-mips.lo \ cpu-mmix.lo \ cpu-mt.lo \ @@ -103,8 +106,10 @@ ALL_MACHINES = \ cpu-powerpc.lo \ cpu-rs6000.lo \ cpu-s390.lo \ + cpu-score.lo \ cpu-sh.lo \ cpu-sparc.lo \ + cpu-spu.lo \ cpu-tic30.lo \ cpu-tic4x.lo \ cpu-tic54x.lo \ @@ -125,6 +130,7 @@ ALL_MACHINES_CFILES = \ cpu-arm.c \ cpu-avr.c \ cpu-bfin.c \ + cpu-cr16.c \ cpu-cris.c \ cpu-cr16c.c \ cpu-crx.c \ @@ -153,6 +159,7 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-maxq.c \ cpu-mcore.c \ + cpu-mep.c \ cpu-mips.c \ cpu-mmix.c \ cpu-mt.c \ @@ -165,8 +172,10 @@ ALL_MACHINES_CFILES = \ cpu-powerpc.c \ cpu-rs6000.c \ cpu-s390.c \ + cpu-score.c \ cpu-sh.c \ cpu-sparc.c \ + cpu-spu.c \ cpu-tic30.c \ cpu-tic4x.c \ cpu-tic54x.c \ @@ -235,6 +244,7 @@ BFD32_BACKENDS = \ elf32-arm.lo \ elf32-avr.lo \ elf32-bfin.lo \ + elf32-cr16.lo \ elf32-cr16c.lo \ elf32-cris.lo \ elf32-crx.lo \ @@ -262,6 +272,7 @@ BFD32_BACKENDS = \ elf-m10200.lo \ elf-m10300.lo \ elf32-mcore.lo \ + elf32-mep.lo \ elfxx-mips.lo \ elf32-mips.lo \ elf32-mt.lo \ @@ -271,12 +282,14 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-s390.lo \ + elf32-score.lo \ elf32-sh.lo \ elf32-sh-symbian.lo \ elf32-sh64.lo \ elf32-sh64-com.lo \ elfxx-sparc.lo \ elf32-sparc.lo \ + elf32-spu.lo \ elf32-v850.lo \ elf32-vax.lo \ elf32-xstormy16.lo \ @@ -284,6 +297,7 @@ BFD32_BACKENDS = \ elf32-xc16x.lo \ elf32.lo \ elflink.lo \ + elf-attrs.lo \ elf-strtab.lo \ elf-eh-frame.lo \ elf-vxworks.lo \ @@ -323,6 +337,8 @@ BFD32_BACKENDS = \ pef.lo \ pe-arm.lo \ pei-arm.lo \ + pe-arm-wince.lo \ + pei-arm-wince.lo \ pe-i386.lo \ pei-i386.lo \ pe-mcore.lo \ @@ -407,6 +423,7 @@ BFD32_BACKENDS_CFILES = \ elf32-arm.c \ elf32-avr.c \ elf32-bfin.c \ + elf32-cr16.c \ elf32-cr16c.c \ elf32-cris.c \ elf32-crx.c \ @@ -434,6 +451,7 @@ BFD32_BACKENDS_CFILES = \ elf-m10200.c \ elf-m10300.c \ elf32-mcore.c \ + elf32-mep.c \ elfxx-mips.c \ elf32-mips.c \ elf32-mt.c \ @@ -445,10 +463,12 @@ BFD32_BACKENDS_CFILES = \ elf32-sh64.c \ elf32-sh64-com.c \ elf32-s390.c \ + elf32-score.c \ elf32-sh.c \ elf32-sh-symbian.c \ elfxx-sparc.c \ elf32-sparc.c \ + elf32-spu.c \ elf32-v850.c \ elf32-vax.c \ elf32-xstormy16.c \ @@ -456,6 +476,7 @@ BFD32_BACKENDS_CFILES = \ elf32-xc16x.c \ elf32.c \ elflink.c \ + elf-attrs.c \ elf-strtab.c \ elf-eh-frame.c \ elf-vxworks.c \ @@ -495,6 +516,8 @@ BFD32_BACKENDS_CFILES = \ pef.c \ pe-arm.c \ pei-arm.c \ + pe-arm-wince.c \ + pei-arm-wince.c \ pe-i386.c \ pei-i386.c \ pe-mcore.c \ @@ -538,6 +561,7 @@ BFD64_BACKENDS = \ coff64-rs6000.lo \ demo64.lo \ efi-app-ia64.lo \ + efi-app-x86_64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ elf64-hppa.lo \ @@ -555,7 +579,11 @@ BFD64_BACKENDS = \ mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ - pepigen.lo + coff-x86_64.lo \ + pe-x86_64.lo \ + pei-x86_64.lo \ + pepigen.lo \ + pex64igen.lo BFD64_BACKENDS_CFILES = \ aix5ppc-core.c \ @@ -564,6 +592,7 @@ BFD64_BACKENDS_CFILES = \ coff64-rs6000.c \ demo64.c \ efi-app-ia64.c \ + efi-app-x86_64.c \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ @@ -578,7 +607,10 @@ BFD64_BACKENDS_CFILES = \ elf64.c \ mmo.c \ nlm32-alpha.c \ - nlm64.c + nlm64.c \ + coff-x86_64.c \ + pe-x86_64.c \ + pei-x86_64.c OPTIONAL_BACKENDS = \ aix386-core.lo \ @@ -612,11 +644,10 @@ CONFIG_STATUS_DEPENDENCIES = \ WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ -BFD_LIBS = @bfd_libs@ BFD_MACHINES = @bfd_machines@ TDEFAULTS = @tdefaults@ -INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl +INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@ # C source files that correspond to .o's. SOURCE_CFILES = \ @@ -628,7 +659,7 @@ SOURCE_CFILES = \ $(OPTIONAL_BACKENDS_CFILES) BUILD_CFILES = \ - elf32-ia64.c elf64-ia64.c peigen.c pepigen.c + elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) @@ -698,7 +729,8 @@ install-html-recursive: # BFD_BACKENDS Routines the configured targets need. # BFD_MACHINES Architecture-specific routines the configured targets need. # COREFILE Core file routines for a native configuration -OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ +# bfd64_libs Routines for 64bit support +OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@ stamp-ofiles: Makefile rm -f tofiles @@ -715,10 +747,12 @@ stamp-ofiles: Makefile ofiles: stamp-ofiles ; @true -libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) +# Since BFD64_LIBS is optional and we can't have substitution in +# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead. +libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) libbfd_la_DEPENDENCIES = $(OFILES) ofiles libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@ -libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ +libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@ # libtool will build .libs/libbfd.a. We create libbfd.a in the build # directory so that we don't have to convert all the programs that use @@ -756,6 +790,9 @@ targets.lo: targets.c Makefile archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c +dwarf2.lo: dwarf2.c Makefile + $(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c + elf32-target.h : elfxx-target.h rm -f elf32-target.h sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new @@ -786,6 +823,11 @@ pepigen.c : peXXigen.c sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new mv -f pepigen.new pepigen.c +pex64igen.c: peXXigen.c + rm -f pex64igen.c + sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new + mv -f pex64igen.new pex64igen.c + BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h LOCAL_H_DEPS= libbfd.h sysdep.h config.h $(BFD32_LIBS) \ @@ -929,17 +971,26 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h -DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) +DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in @echo "creating $@" @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ bfd_version_string="\"$(VERSION)\"" ;\ + bfd_soversion="$(VERSION)" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ if test "x$(RELEASE)" = x ; then \ bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ - bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\ + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ fi ;\ - sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@ + sed -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ + -e "s,@bfd_version_package@,$$bfd_version_package," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion # What appears below is generated by a hacked mkdep using gcc -MM. @@ -950,11 +1001,12 @@ archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/safe-ctype.h -bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +bfd.lo: bfd.c $(INCDIR)/filenames.h bfdver.h $(INCDIR)/libiberty.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h bfdio.lo: bfdio.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ @@ -1008,6 +1060,7 @@ cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-bfin.lo: cpu-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-cr16.lo: cpu-cr16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1040,6 +1093,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-mep.lo: cpu-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1055,9 +1109,11 @@ cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-score.lo: cpu-score.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(srcdir)/../opcodes/sh-opc.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-spu.lo: cpu-spu.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1127,7 +1183,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ - coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \ + coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \ @@ -1197,7 +1254,7 @@ coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \ $(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ @@ -1260,11 +1317,16 @@ elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h elf32-avr.h elf32-target.h elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \ + elf32-target.h +elf32-cr16.lo: elf32-cr16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \ $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ @@ -1378,19 +1440,24 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mep.lo: elf32-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + elf32-target.h elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h + elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ - ecoffswap.h elf32-target.h elf-vxworks.h + ecoffswap.h elf32-target.h elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \ @@ -1422,9 +1489,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ - elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -1434,27 +1501,36 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-score.lo: elf32-score.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \ $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \ - elf32-target.h + $(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf-vxworks.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf32-target.h elf-vxworks.h + elfxx-sparc.h elf-vxworks.h elf32-target.h +elf32-spu.lo: elf32-spu.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/spu.h \ + $(INCDIR)/elf/reloc-macros.h elf32-spu.h elf32-target.h elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \ @@ -1486,6 +1562,9 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/libiberty.h $(INCDIR)/objalloc.h +elf-attrs.lo: elf-attrs.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h @@ -1570,7 +1649,7 @@ m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h libaout.h $(INCDIR)/bfdlink.h aout-target.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ $(INCDIR)/aout/ar.h -mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ +mach-o.lo: mach-o.c $(INCDIR)/filenames.h mach-o.h \ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ @@ -1610,8 +1689,8 @@ pdp11.lo: pdp11.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ $(INCDIR)/safe-ctype.h -pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ - $(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h +pef.lo: pef.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + pef.h pef-traceback.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -1620,6 +1699,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -1662,7 +1751,7 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h \ +ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/hashtab.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/internal.h \ @@ -1703,7 +1792,7 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h -vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \ +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h bfdver.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/hashtab.h \ vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ @@ -1713,12 +1802,12 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ libcoff.h libxcoff.h -xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +xsym.lo: xsym.c $(INCDIR)/filenames.h xsym.h $(INCDIR)/hashtab.h xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-isa-internal.h xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \ $(INCDIR)/xtensa-isa-internal.h -aix5ppc-core.lo: aix5ppc-core.c +aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/filenames.h aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/hashtab.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -1740,6 +1829,11 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h +efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \ + coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \ + coffcode.h peicode.h libpei.h elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/x86-64.h \ @@ -1808,6 +1902,21 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h +coff-x86_64.lo: coff-x86_64.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + coffswap.h +pe-x86_64.lo: pe-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h +pei-x86_64.lo: pei-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h @@ -1824,16 +1933,19 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf32-target.h + $(INCDIR)/hashtab.h elf32-target.h elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf64-target.h + $(INCDIR)/hashtab.h elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h +pex64igen.lo: pex64igen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/contrib/binutils/bfd/Makefile.in b/contrib/binutils/bfd/Makefile.in index 8ed90563561..8f4580e1821 100644 --- a/contrib/binutils/bfd/Makefile.in +++ b/contrib/binutils/bfd/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,8 +15,6 @@ @SET_MAKE@ -SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -49,10 +47,17 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \ $(srcdir)/../config.sub subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/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)/../config/acx.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/bfd.m4 \ + $(top_srcdir)/warning.m4 $(top_srcdir)/acinclude.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 \ @@ -80,19 +85,18 @@ am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \ linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo \ stab-syms.lo merge.lo dwarf2.lo simple.lo -am__objects_2 = archive64.lo -am_libbfd_la_OBJECTS = $(am__objects_1) $(am__objects_2) +am_libbfd_la_OBJECTS = $(am__objects_1) libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS) 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 $@ SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -105,7 +109,6 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ @@ -131,20 +134,24 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEBUGDIR = @DEBUGDIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ 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_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@ INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@ @@ -152,10 +159,10 @@ 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@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -167,6 +174,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -176,14 +185,16 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ +PKGVERSION = @PKGVERSION@ POSUB = @POSUB@ RANLIB = @RANLIB@ +REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@ +REPORT_BUGS_TO = @REPORT_BUGS_TO@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TDEFINES = @TDEFINES@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ @@ -192,6 +203,7 @@ WIN32LIBADD = @WIN32LIBADD@ XGETTEXT = @XGETTEXT@ 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@ all_backends = @all_backends@ @@ -202,10 +214,10 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +bfd64_libs = @bfd64_libs@ bfd_backends = @bfd_backends@ bfd_default_target_size = @bfd_default_target_size@ bfd_file_ptr = @bfd_file_ptr@ -bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ bfd_ufile_ptr = @bfd_ufile_ptr@ bfdincludedir = @bfdincludedir@ @@ -230,10 +242,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@ @@ -251,6 +263,7 @@ target_vendor = @target_vendor@ tdefaults = @tdefaults@ wordsize = @wordsize@ AUTOMAKE_OPTIONS = 1.9 cygnus +ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Uncomment the following line when doing a release. # RELEASE=y @@ -299,6 +312,7 @@ ALL_MACHINES = \ cpu-arm.lo \ cpu-avr.lo \ cpu-bfin.lo \ + cpu-cr16.lo \ cpu-cr16c.lo \ cpu-cris.lo \ cpu-crx.lo \ @@ -327,6 +341,7 @@ ALL_MACHINES = \ cpu-m10300.lo \ cpu-maxq.lo \ cpu-mcore.lo \ + cpu-mep.lo \ cpu-mips.lo \ cpu-mmix.lo \ cpu-mt.lo \ @@ -339,8 +354,10 @@ ALL_MACHINES = \ cpu-powerpc.lo \ cpu-rs6000.lo \ cpu-s390.lo \ + cpu-score.lo \ cpu-sh.lo \ cpu-sparc.lo \ + cpu-spu.lo \ cpu-tic30.lo \ cpu-tic4x.lo \ cpu-tic54x.lo \ @@ -361,6 +378,7 @@ ALL_MACHINES_CFILES = \ cpu-arm.c \ cpu-avr.c \ cpu-bfin.c \ + cpu-cr16.c \ cpu-cris.c \ cpu-cr16c.c \ cpu-crx.c \ @@ -389,6 +407,7 @@ ALL_MACHINES_CFILES = \ cpu-m10300.c \ cpu-maxq.c \ cpu-mcore.c \ + cpu-mep.c \ cpu-mips.c \ cpu-mmix.c \ cpu-mt.c \ @@ -401,8 +420,10 @@ ALL_MACHINES_CFILES = \ cpu-powerpc.c \ cpu-rs6000.c \ cpu-s390.c \ + cpu-score.c \ cpu-sh.c \ cpu-sparc.c \ + cpu-spu.c \ cpu-tic30.c \ cpu-tic4x.c \ cpu-tic54x.c \ @@ -472,6 +493,7 @@ BFD32_BACKENDS = \ elf32-arm.lo \ elf32-avr.lo \ elf32-bfin.lo \ + elf32-cr16.lo \ elf32-cr16c.lo \ elf32-cris.lo \ elf32-crx.lo \ @@ -499,6 +521,7 @@ BFD32_BACKENDS = \ elf-m10200.lo \ elf-m10300.lo \ elf32-mcore.lo \ + elf32-mep.lo \ elfxx-mips.lo \ elf32-mips.lo \ elf32-mt.lo \ @@ -508,12 +531,14 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-s390.lo \ + elf32-score.lo \ elf32-sh.lo \ elf32-sh-symbian.lo \ elf32-sh64.lo \ elf32-sh64-com.lo \ elfxx-sparc.lo \ elf32-sparc.lo \ + elf32-spu.lo \ elf32-v850.lo \ elf32-vax.lo \ elf32-xstormy16.lo \ @@ -521,6 +546,7 @@ BFD32_BACKENDS = \ elf32-xc16x.lo \ elf32.lo \ elflink.lo \ + elf-attrs.lo \ elf-strtab.lo \ elf-eh-frame.lo \ elf-vxworks.lo \ @@ -560,6 +586,8 @@ BFD32_BACKENDS = \ pef.lo \ pe-arm.lo \ pei-arm.lo \ + pe-arm-wince.lo \ + pei-arm-wince.lo \ pe-i386.lo \ pei-i386.lo \ pe-mcore.lo \ @@ -644,6 +672,7 @@ BFD32_BACKENDS_CFILES = \ elf32-arm.c \ elf32-avr.c \ elf32-bfin.c \ + elf32-cr16.c \ elf32-cr16c.c \ elf32-cris.c \ elf32-crx.c \ @@ -671,6 +700,7 @@ BFD32_BACKENDS_CFILES = \ elf-m10200.c \ elf-m10300.c \ elf32-mcore.c \ + elf32-mep.c \ elfxx-mips.c \ elf32-mips.c \ elf32-mt.c \ @@ -682,10 +712,12 @@ BFD32_BACKENDS_CFILES = \ elf32-sh64.c \ elf32-sh64-com.c \ elf32-s390.c \ + elf32-score.c \ elf32-sh.c \ elf32-sh-symbian.c \ elfxx-sparc.c \ elf32-sparc.c \ + elf32-spu.c \ elf32-v850.c \ elf32-vax.c \ elf32-xstormy16.c \ @@ -693,6 +725,7 @@ BFD32_BACKENDS_CFILES = \ elf32-xc16x.c \ elf32.c \ elflink.c \ + elf-attrs.c \ elf-strtab.c \ elf-eh-frame.c \ elf-vxworks.c \ @@ -732,6 +765,8 @@ BFD32_BACKENDS_CFILES = \ pef.c \ pe-arm.c \ pei-arm.c \ + pe-arm-wince.c \ + pei-arm-wince.c \ pe-i386.c \ pei-i386.c \ pe-mcore.c \ @@ -776,6 +811,7 @@ BFD64_BACKENDS = \ coff64-rs6000.lo \ demo64.lo \ efi-app-ia64.lo \ + efi-app-x86_64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ elf64-hppa.lo \ @@ -793,7 +829,11 @@ BFD64_BACKENDS = \ mmo.lo \ nlm32-alpha.lo \ nlm64.lo \ - pepigen.lo + coff-x86_64.lo \ + pe-x86_64.lo \ + pei-x86_64.lo \ + pepigen.lo \ + pex64igen.lo BFD64_BACKENDS_CFILES = \ aix5ppc-core.c \ @@ -802,6 +842,7 @@ BFD64_BACKENDS_CFILES = \ coff64-rs6000.c \ demo64.c \ efi-app-ia64.c \ + efi-app-x86_64.c \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ @@ -816,7 +857,10 @@ BFD64_BACKENDS_CFILES = \ elf64.c \ mmo.c \ nlm32-alpha.c \ - nlm64.c + nlm64.c \ + coff-x86_64.c \ + pe-x86_64.c \ + pei-x86_64.c OPTIONAL_BACKENDS = \ aix386-core.lo \ @@ -852,10 +896,9 @@ CONFIG_STATUS_DEPENDENCIES = \ WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ -BFD_LIBS = @bfd_libs@ BFD_MACHINES = @bfd_machines@ TDEFAULTS = @tdefaults@ -INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl +INCLUDES = @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) @INCINTL@ # C source files that correspond to .o's. SOURCE_CFILES = \ @@ -867,7 +910,7 @@ SOURCE_CFILES = \ $(OPTIONAL_BACKENDS_CFILES) BUILD_CFILES = \ - elf32-ia64.c elf64-ia64.c peigen.c pepigen.c + elf32-ia64.c elf64-ia64.c peigen.c pepigen.c pex64igen.c CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) SOURCE_HFILES = \ @@ -892,11 +935,15 @@ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) # BFD_BACKENDS Routines the configured targets need. # BFD_MACHINES Architecture-specific routines the configured targets need. # COREFILE Core file routines for a native configuration -OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ -libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) $(BFD64_LIBS_CFILES) +# bfd64_libs Routines for 64bit support +OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@ + +# Since BFD64_LIBS is optional and we can't have substitution in +# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead. +libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) libbfd_la_DEPENDENCIES = $(OFILES) ofiles libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@ -libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@ +libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@ # libtool will build .libs/libbfd.a. We create libbfd.a in the build # directory so that we don't have to convert all the programs that use @@ -919,7 +966,7 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h -DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) +DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -931,15 +978,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 \ @@ -1340,6 +1387,9 @@ targets.lo: targets.c Makefile archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c +dwarf2.lo: dwarf2.c Makefile + $(LIBTOOL) --mode=compile $(COMPILE) -c -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c + elf32-target.h : elfxx-target.h rm -f elf32-target.h sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new @@ -1369,6 +1419,11 @@ pepigen.c : peXXigen.c rm -f pepigen.c sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new mv -f pepigen.new pepigen.c + +pex64igen.c: peXXigen.c + rm -f pex64igen.c + sed -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new + mv -f pex64igen.new pex64igen.c $(BFD32_LIBS) \ $(BFD64_LIBS) \ $(ALL_MACHINES) \ @@ -1501,11 +1556,20 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in @echo "creating $@" @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ bfd_version_string="\"$(VERSION)\"" ;\ + bfd_soversion="$(VERSION)" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ if test "x$(RELEASE)" = x ; then \ bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ - bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\ + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ fi ;\ - sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@ + sed -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ + -e "s,@bfd_version_package@,$$bfd_version_package," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion # What appears below is generated by a hacked mkdep using gcc -MM. @@ -1516,11 +1580,12 @@ archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/safe-ctype.h -bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +bfd.lo: bfd.c $(INCDIR)/filenames.h bfdver.h $(INCDIR)/libiberty.h \ + $(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h bfdio.lo: bfdio.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cache.lo: cache.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ @@ -1574,6 +1639,7 @@ cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-bfin.lo: cpu-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-cr16.lo: cpu-cr16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1606,6 +1672,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-maxq.lo: cpu-maxq.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-mep.lo: cpu-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-mt.lo: cpu-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1621,9 +1688,11 @@ cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-score.lo: cpu-score.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(srcdir)/../opcodes/sh-opc.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +cpu-spu.lo: cpu-spu.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h @@ -1693,7 +1762,8 @@ coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ - coff-m68k.c $(INCDIR)/hashtab.h libcoff.h $(INCDIR)/bfdlink.h \ + coff-m68k.c $(INCDIR)/hashtab.h $(INCDIR)/coff/m68k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/h8300.h \ @@ -1763,7 +1833,7 @@ coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \ $(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ @@ -1826,11 +1896,16 @@ elf32-arm.lo: elf32-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h elf32-avr.h elf32-target.h elf32-bfin.lo: elf32-bfin.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/bfin.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/dwarf2.h \ + elf32-target.h +elf32-cr16.lo: elf32-cr16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h \ $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ @@ -1944,19 +2019,24 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mep.lo: elf32-mep.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + elf32-target.h elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h + elf-vxworks.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h elf-vxworks.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ - ecoffswap.h elf32-target.h elf-vxworks.h + ecoffswap.h elf32-target.h elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \ @@ -1988,9 +2068,9 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ - elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + elf32-sh64.h elf32-sh.c $(INCDIR)/hashtab.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -2000,27 +2080,36 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-score.lo: elf32-score.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ - $(srcdir)/../opcodes/sh-opc.h elf32-target.h + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf-vxworks.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c \ $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \ - elf32-target.h + $(INCDIR)/elf/external.h elf-vxworks.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ + $(srcdir)/../opcodes/sh-opc.h elf32-sh-relocs.h elf32-target.h elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf-vxworks.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h elfxx-sparc.h elf-vxworks.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ - elfxx-sparc.h elf32-target.h elf-vxworks.h + elfxx-sparc.h elf-vxworks.h elf32-target.h +elf32-spu.lo: elf32-spu.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/spu.h \ + $(INCDIR)/elf/reloc-macros.h elf32-spu.h elf32-target.h elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \ @@ -2052,6 +2141,9 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/libiberty.h $(INCDIR)/objalloc.h +elf-attrs.lo: elf-attrs.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h @@ -2136,7 +2228,7 @@ m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h libaout.h $(INCDIR)/bfdlink.h aout-target.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ $(INCDIR)/aout/ar.h -mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ +mach-o.lo: mach-o.c $(INCDIR)/filenames.h mach-o.h \ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ @@ -2176,8 +2268,8 @@ pdp11.lo: pdp11.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ $(INCDIR)/safe-ctype.h -pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ - $(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h +pef.lo: pef.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ + pef.h pef-traceback.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -2186,6 +2278,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ @@ -2228,7 +2330,7 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -ppcboot.lo: ppcboot.c $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h \ +ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/hashtab.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/coff/internal.h \ @@ -2269,7 +2371,7 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h vms.h -vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \ +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h bfdver.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/hashtab.h \ vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ @@ -2279,12 +2381,12 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h \ libcoff.h libxcoff.h -xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +xsym.lo: xsym.c $(INCDIR)/filenames.h xsym.h $(INCDIR)/hashtab.h xtensa-isa.lo: xtensa-isa.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-isa-internal.h xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \ $(INCDIR)/xtensa-isa-internal.h -aix5ppc-core.lo: aix5ppc-core.c +aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/filenames.h aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/hashtab.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -2306,6 +2408,11 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h +efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \ + coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \ + coffcode.h peicode.h libpei.h elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/x86-64.h \ @@ -2374,6 +2481,21 @@ nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h +coff-x86_64.lo: coff-x86_64.c $(INCDIR)/filenames.h \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + coffswap.h +pe-x86_64.lo: pe-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h +pei-x86_64.lo: pei-x86_64.c $(INCDIR)/filenames.h coff-x86_64.c \ + $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h coffcode.h \ + peicode.h libpei.h aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h @@ -2390,18 +2512,21 @@ elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf32-target.h + $(INCDIR)/hashtab.h elf32-target.h elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h \ - elf64-target.h + $(INCDIR)/hashtab.h elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ia64.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h +pex64igen.lo: pex64igen.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.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/contrib/binutils/bfd/acinclude.m4 b/contrib/binutils/bfd/acinclude.m4 index 95e3d4a702d..cd4fd55be6c 100644 --- a/contrib/binutils/bfd/acinclude.m4 +++ b/contrib/binutils/bfd/acinclude.m4 @@ -1,7 +1,3 @@ -sinclude(../config/acx.m4) -sinclude(../bfd/bfd.m4) -sinclude(../bfd/warning.m4) - dnl See whether we need to use fopen-bin.h rather than fopen-same.h. AC_DEFUN([BFD_BINARY_FOPEN], [AC_REQUIRE([AC_CANONICAL_TARGET]) @@ -45,22 +41,6 @@ else fi AC_SUBST(EXEEXT_FOR_BUILD)])dnl -sinclude(../libtool.m4) -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_DEFUN([AM_DISABLE_SHARED],) -AC_SUBST(LIBTOOL) -]) - -sinclude(../gettext.m4) -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) - AC_DEFUN([AM_INSTALL_LIBBFD], [AC_MSG_CHECKING([whether to install libbfd]) AC_ARG_ENABLE(install-libbfd, diff --git a/contrib/binutils/bfd/aclocal.m4 b/contrib/binutils/bfd/aclocal.m4 index d5f315805a9..9dfea067fbf 100644 --- a/contrib/binutils/bfd/aclocal.m4 +++ b/contrib/binutils/bfd/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.9.5 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. @@ -28,7 +28,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.5])]) + [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -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])]) - # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering @@ -889,4 +868,18 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([../config/acx.m4]) +m4_include([../config/depstand.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/lead-dot.m4]) +m4_include([../config/nls.m4]) +m4_include([../config/po.m4]) +m4_include([../config/progtest.m4]) +m4_include([../config/stdint.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) +m4_include([bfd.m4]) +m4_include([warning.m4]) m4_include([acinclude.m4]) diff --git a/contrib/binutils/bfd/aout-arm.c b/contrib/binutils/bfd/aout-arm.c index d8834a4f331..4b0d42c1aca 100644 --- a/contrib/binutils/bfd/aout-arm.c +++ b/contrib/binutils/bfd/aout-arm.c @@ -1,6 +1,6 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" /* Avoid multiple definitions from aoutx if supporting standard a.out as well as our own. */ @@ -50,6 +50,7 @@ #define N_MAGIC(x) ((x).a_info & ~07200) #define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup +#define MY_bfd_reloc_name_lookup aoutarm_bfd_reloc_name_lookup #include "libaout.h" #include "aout/aout64.h" @@ -317,6 +318,22 @@ MY (bfd_reloc_type_lookup) (bfd *abfd, } } +static reloc_howto_type * +MY (bfd_reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (MY (howto_table)) / sizeof (MY (howto_table)[0]); + i++) + if (MY (howto_table)[i].name != NULL + && strcasecmp (MY (howto_table)[i].name, r_name) == 0) + return &MY (howto_table)[i]; + + return NULL; +} + #define MY_swap_std_reloc_in MY (swap_std_reloc_in) #define MY_swap_std_reloc_out MY (swap_std_reloc_out) #define MY_get_section_contents _bfd_generic_get_section_contents diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h index 5a30eda7414..3e5fa910170 100644 --- a/contrib/binutils/bfd/aout-target.h +++ b/contrib/binutils/bfd/aout-target.h @@ -1,6 +1,6 @@ /* Define a target vector and some small routines for a variant of a.out. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -29,6 +29,7 @@ #endif extern reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type * NAME (aout, reloc_name_lookup) (bfd *, const char *); /* Set parameters about this a.out file that are machine-dependent. This routine is called from some_aout_object_p just before it returns. */ @@ -494,6 +495,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup NAME (aout, reloc_type_lookup) #endif +#ifndef MY_bfd_reloc_name_lookup +#define MY_bfd_reloc_name_lookup NAME (aout, reloc_name_lookup) +#endif #ifndef MY_bfd_make_debug_symbol #define MY_bfd_make_debug_symbol 0 #endif diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h index cba4fbbeff9..0353bfdc3f2 100644 --- a/contrib/binutils/bfd/aoutf1.h +++ b/contrib/binutils/bfd/aoutf1.h @@ -1,6 +1,6 @@ /* A.out "format 1" file handling code for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/sun4.h" @@ -566,6 +566,7 @@ sunos4_core_file_p (bfd *abfd) struct internal_sunos_core internal_sunos_core; char external_core[1]; } *mergem; + flagword flags; if (bfd_bread ((void *) longbuf, (bfd_size_type) sizeof (longbuf), abfd) != sizeof (longbuf)) @@ -627,28 +628,31 @@ sunos4_core_file_p (bfd *abfd) abfd->tdata.sun_core_data->hdr = core; /* Create the sections. */ - core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack", + flags); if (core_stacksec (abfd) == NULL) /* bfd_release frees everything allocated after it's arg. */ goto loser; - core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data", + flags); if (core_datasec (abfd) == NULL) goto loser; - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + flags = SEC_HAS_CONTENTS; + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + flags); if (core_regsec (abfd) == NULL) goto loser; - core_reg2sec (abfd) = bfd_make_section_anyway (abfd, ".reg2"); + flags = SEC_HAS_CONTENTS; + core_reg2sec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg2", + flags); if (core_reg2sec (abfd) == NULL) goto loser; - core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; - core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS; - core_stacksec (abfd)->size = core->c_ssize; core_datasec (abfd)->size = core->c_dsize; core_regsec (abfd)->size = core->c_regs_size; diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h index 7dce07240ff..09331aa0ca2 100644 --- a/contrib/binutils/bfd/aoutx.h +++ b/contrib/binutils/bfd/aoutx.h @@ -1,6 +1,6 @@ /* BFD semi-generic back-end for a.out binaries. 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. Written by Cygnus Support. @@ -118,8 +118,8 @@ DESCRIPTION #define KEEPIT udata.i -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "safe-ctype.h" #include "bfdlink.h" @@ -129,8 +129,6 @@ DESCRIPTION #include "aout/stab_gnu.h" #include "aout/ar.h" -reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - /* SUBSECTION Relocations @@ -319,6 +317,31 @@ NAME (aout, reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) } } +reloc_howto_type * +NAME (aout, reloc_name_lookup) (bfd *abfd, const char *r_name) +{ + unsigned int i, size; + reloc_howto_type *howto_table; + + if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE) + { + howto_table = howto_table_ext; + size = sizeof (howto_table_ext) / sizeof (howto_table_ext[0]); + } + else + { + howto_table = howto_table_std; + size = sizeof (howto_table_std) / sizeof (howto_table_std[0]); + } + + for (i = 0; i < size; i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + /* SUBSECTION Internal entry points @@ -1193,26 +1216,21 @@ NAME (aout, new_section_hook) (bfd *abfd, asection *newsect) { obj_textsec (abfd)= newsect; newsect->target_index = N_TEXT; - return TRUE; } - - if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) + else if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) { obj_datasec (abfd) = newsect; newsect->target_index = N_DATA; - return TRUE; } - - if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) + else if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) { obj_bsssec (abfd) = newsect; newsect->target_index = N_BSS; - return TRUE; } } /* We allow more than three sections internally. */ - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } bfd_boolean @@ -1934,7 +1952,10 @@ NAME (aout, swap_std_reloc_out) (bfd *abfd, if (bfd_is_com_section (output_section) || bfd_is_abs_section (output_section) - || bfd_is_und_section (output_section)) + || bfd_is_und_section (output_section) + /* PR gas/3041 a.out relocs against weak symbols + must be treated as if they were against externs. */ + || (sym->flags & BSF_WEAK)) { if (bfd_abs_section_ptr->symbol == sym) { @@ -2785,7 +2806,8 @@ NAME (aout, find_nearest_line) (bfd *abfd, } int -NAME (aout, sizeof_headers) (bfd *abfd, bfd_boolean execable ATTRIBUTE_UNUSED) +NAME (aout, sizeof_headers) (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return adata (abfd).exec_bytes_size; } diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index 5a12f01f7cc..053ad47dfdd 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -1,6 +1,6 @@ /* BFD back-end for archive files (libraries). Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. @@ -129,8 +129,8 @@ SUBSECTION " 18 " - Long name 18 characters long, extended pseudo-BSD. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "aout/ar.h" @@ -666,10 +666,7 @@ bfd_generic_archive_p (bfd *abfd) first = bfd_openr_next_archived_file (abfd, NULL); if (first != NULL) { - bfd_boolean fail; - first->target_defaulted = FALSE; - fail = FALSE; if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { @@ -915,12 +912,12 @@ bfd_slurp_armap (bfd *abfd) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return FALSE; - if (!strncmp (nextname, "__.SYMDEF ", 16) - || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ + if (CONST_STRNEQ (nextname, "__.SYMDEF ") + || CONST_STRNEQ (nextname, "__.SYMDEF/ ")) /* Old Linux archives. */ return do_slurp_bsd_armap (abfd); - else if (!strncmp (nextname, "/ ", 16)) + else if (CONST_STRNEQ (nextname, "/ ")) return do_slurp_coff_armap (abfd); - else if (!strncmp (nextname, "/SYM64/ ", 16)) + else if (CONST_STRNEQ (nextname, "/SYM64/ ")) { /* 64bit ELF (Irix 6) archive. */ #ifdef BFD64 @@ -966,11 +963,11 @@ bfd_slurp_bsd_armap_f2 (bfd *abfd) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return FALSE; - if (!strncmp (nextname, "__.SYMDEF ", 16) - || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* Old Linux archives. */ + if (CONST_STRNEQ (nextname, "__.SYMDEF ") + || CONST_STRNEQ (nextname, "__.SYMDEF/ ")) /* Old Linux archives. */ return do_slurp_bsd_armap (abfd); - if (strncmp (nextname, "/ ", 16)) + if (! CONST_STRNEQ (nextname, "/ ")) { bfd_has_map (abfd) = FALSE; return TRUE; @@ -1066,8 +1063,8 @@ _bfd_slurp_extended_name_table (bfd *abfd) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) return FALSE; - if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 && - strncmp (nextname, "// ", 16) != 0) + if (! CONST_STRNEQ (nextname, "ARFILENAMES/ ") + && ! CONST_STRNEQ (nextname, "// ")) { bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->extended_names_size = 0; @@ -1237,7 +1234,9 @@ _bfd_construct_extended_name_table (bfd *abfd, *tablen = 0; /* Figure out how long the table should be. */ - for (current = abfd->archive_head; current != NULL; current = current->next) + for (current = abfd->archive_head; + current != NULL; + current = current->archive_next) { const char *normal; unsigned int thislen; @@ -1289,8 +1288,9 @@ _bfd_construct_extended_name_table (bfd *abfd, *tablen = total_namelen; strptr = *tabloc; - for (current = abfd->archive_head; current != NULL; current = - current->next) + for (current = abfd->archive_head; + current != NULL; + current = current->archive_next) { const char *normal; unsigned int thislen; @@ -1339,7 +1339,7 @@ hpux_uid_gid_encode (char str[6], long int id) str[5] = '@' + (id & 3); id >>= 2; - for (cnt = 4; cnt >= 0; ++cnt, id >>= 6) + for (cnt = 4; cnt >= 0; --cnt, id >>= 6) str[cnt] = ' ' + (id & 0x3f); } #endif /* HPUX_LARGE_AR_IDS */ @@ -1640,7 +1640,9 @@ _bfd_write_archive_contents (bfd *arch) /* Verify the viability of all entries; if any of them live in the filesystem (as opposed to living in an archive open for input) then construct a fresh ar_hdr for them. */ - for (current = arch->archive_head; current; current = current->next) + for (current = arch->archive_head; + current != NULL; + current = current->archive_next) { /* This check is checking the bfds for the objects we're reading from (which are usually either an object file or archive on @@ -1650,14 +1652,14 @@ _bfd_write_archive_contents (bfd *arch) if (bfd_write_p (current)) { bfd_set_error (bfd_error_invalid_operation); - return FALSE; + goto input_err; } if (!current->arelt_data) { current->arelt_data = bfd_ar_hdr_from_filesystem (arch, current->filename, current); if (!current->arelt_data) - return FALSE; + goto input_err; /* Put in the file name. */ BFD_SEND (arch, _bfd_truncate_arname, @@ -1708,7 +1710,9 @@ _bfd_write_archive_contents (bfd *arch) } } - for (current = arch->archive_head; current; current = current->next) + for (current = arch->archive_head; + current != NULL; + current = current->archive_next) { char buffer[DEFAULT_BUFFERSIZE]; unsigned int remaining = arelt_size (current); @@ -1719,7 +1723,7 @@ _bfd_write_archive_contents (bfd *arch) != sizeof (*hdr)) return FALSE; if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) - return FALSE; + goto input_err; while (remaining) { unsigned int amt = DEFAULT_BUFFERSIZE; @@ -1729,8 +1733,8 @@ _bfd_write_archive_contents (bfd *arch) if (bfd_bread (buffer, amt, current) != amt) { if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_malformed_archive); - return FALSE; + bfd_set_error (bfd_error_file_truncated); + goto input_err; } if (bfd_bwrite (buffer, amt, arch) != amt) return FALSE; @@ -1763,6 +1767,10 @@ _bfd_write_archive_contents (bfd *arch) } return TRUE; + + input_err: + bfd_set_error (bfd_error_on_input, current, bfd_get_error ()); + return FALSE; } /* Note that the namidx for the first symbol is 0. */ @@ -1801,12 +1809,12 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) /* Drop all the files called __.SYMDEF, we're going to make our own. */ while (arch->archive_head && strcmp (arch->archive_head->filename, "__.SYMDEF") == 0) - arch->archive_head = arch->archive_head->next; + arch->archive_head = arch->archive_head->archive_next; /* Map over each element. */ for (current = arch->archive_head; current != NULL; - current = current->next, elt_no++) + current = current->archive_next, elt_no++) { if (bfd_check_format (current, bfd_object) && (bfd_get_file_flags (current) & HAS_SYMS) != 0) @@ -1963,7 +1971,7 @@ bsd_write_armap (bfd *arch, { firstreal += arelt_size (current) + sizeof (struct ar_hdr); firstreal += firstreal % 2; - current = current->next; + current = current->archive_next; } while (current != map[count].u.abfd); } @@ -2133,7 +2141,7 @@ coff_write_armap (bfd *arch, archive_member_file_ptr += arelt_size (current) + sizeof (struct ar_hdr); /* Remember aboout the even alignment. */ archive_member_file_ptr += archive_member_file_ptr % 2; - current = current->next; + current = current->archive_next; } /* Now write the strings themselves. */ diff --git a/contrib/binutils/bfd/archive64.c b/contrib/binutils/bfd/archive64.c index 3b28f853c21..5e2bf1198c2 100644 --- a/contrib/binutils/bfd/archive64.c +++ b/contrib/binutils/bfd/archive64.c @@ -1,30 +1,30 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 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. + 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. */ + 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 file supports the 64-bit (MIPS) ELF archives. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/ar.h" @@ -65,10 +65,10 @@ bfd_elf64_archive_slurp_armap (bfd *abfd) return FALSE; /* Archives with traditional armaps are still permitted. */ - if (strncmp (nextname, "/ ", 16) == 0) + if (CONST_STRNEQ (nextname, "/ ")) return bfd_slurp_armap (abfd); - if (strncmp (nextname, "/SYM64/ ", 16) != 0) + if (! CONST_STRNEQ (nextname, "/SYM64/ ")) { bfd_has_map (abfd) = FALSE; return TRUE; @@ -215,7 +215,7 @@ bfd_elf64_archive_write_armap (bfd *arch, + sizeof (struct ar_hdr)); /* remember about the even alignment */ archive_member_file_ptr += archive_member_file_ptr % 2; - current = current->next; + current = current->archive_next; } /* now write the strings themselves */ diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c index 137c8285806..d14ac3898bb 100644 --- a/contrib/binutils/bfd/archures.c +++ b/contrib/binutils/bfd/archures.c @@ -1,6 +1,6 @@ /* BFD library support routines for architectures. 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. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "safe-ctype.h" @@ -80,22 +80,26 @@ DESCRIPTION .#define bfd_mach_m68040 6 .#define bfd_mach_m68060 7 .#define bfd_mach_cpu32 8 -.#define bfd_mach_mcf_isa_a_nodiv 9 -.#define bfd_mach_mcf_isa_a 10 -.#define bfd_mach_mcf_isa_a_mac 11 -.#define bfd_mach_mcf_isa_a_emac 12 -.#define bfd_mach_mcf_isa_aplus 13 -.#define bfd_mach_mcf_isa_aplus_mac 14 -.#define bfd_mach_mcf_isa_aplus_emac 15 -.#define bfd_mach_mcf_isa_b_nousp 16 -.#define bfd_mach_mcf_isa_b_nousp_mac 17 -.#define bfd_mach_mcf_isa_b_nousp_emac 18 -.#define bfd_mach_mcf_isa_b 19 -.#define bfd_mach_mcf_isa_b_mac 20 -.#define bfd_mach_mcf_isa_b_emac 21 -.#define bfd_mach_mcf_isa_b_float 22 -.#define bfd_mach_mcf_isa_b_float_mac 23 -.#define bfd_mach_mcf_isa_b_float_emac 24 +.#define bfd_mach_fido 9 +.#define bfd_mach_mcf_isa_a_nodiv 10 +.#define bfd_mach_mcf_isa_a 11 +.#define bfd_mach_mcf_isa_a_mac 12 +.#define bfd_mach_mcf_isa_a_emac 13 +.#define bfd_mach_mcf_isa_aplus 14 +.#define bfd_mach_mcf_isa_aplus_mac 15 +.#define bfd_mach_mcf_isa_aplus_emac 16 +.#define bfd_mach_mcf_isa_b_nousp 17 +.#define bfd_mach_mcf_isa_b_nousp_mac 18 +.#define bfd_mach_mcf_isa_b_nousp_emac 19 +.#define bfd_mach_mcf_isa_b 20 +.#define bfd_mach_mcf_isa_b_mac 21 +.#define bfd_mach_mcf_isa_b_emac 22 +.#define bfd_mach_mcf_isa_b_float 23 +.#define bfd_mach_mcf_isa_b_float_mac 24 +.#define bfd_mach_mcf_isa_b_float_emac 25 +.#define bfd_mach_mcf_isa_c 26 +.#define bfd_mach_mcf_isa_c_mac 27 +.#define bfd_mach_mcf_isa_c_emac 28 . bfd_arch_vax, {* DEC Vax *} . bfd_arch_i960, {* Intel 960 *} . {* The order of the following is important. @@ -136,6 +140,8 @@ DESCRIPTION .{* Nonzero if MACH is a 64 bit sparc architecture. *} .#define bfd_mach_sparc_64bit_p(mach) \ . ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) +. bfd_arch_spu, {* PowerPC SPU *} +.#define bfd_mach_spu 256 . bfd_arch_mips, {* MIPS Rxxxx *} .#define bfd_mach_mips3000 3000 .#define bfd_mach_mips3900 3900 @@ -274,6 +280,7 @@ DESCRIPTION .#define bfd_mach_arm_XScale 10 .#define bfd_mach_arm_ep9312 11 .#define bfd_mach_arm_iWMMXt 12 +.#define bfd_mach_arm_iWMMXt2 13 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} @@ -315,6 +322,9 @@ DESCRIPTION .#define bfd_mach_fr500 500 .#define bfd_mach_fr550 550 . bfd_arch_mcore, +. bfd_arch_mep, +.#define bfd_mach_mep 1 +.#define bfd_mach_mep_h1 0x6831 . bfd_arch_ia64, {* HP/Intel ia64 *} .#define bfd_mach_ia64_elf64 64 .#define bfd_mach_ia64_elf32 32 @@ -335,8 +345,11 @@ DESCRIPTION .#define bfd_mach_avr3 3 .#define bfd_mach_avr4 4 .#define bfd_mach_avr5 5 +.#define bfd_mach_avr6 6 . bfd_arch_bfin, {* ADI Blackfin *} .#define bfd_mach_bfin 1 +. bfd_arch_cr16, {* National Semiconductor CompactRISC (ie CR16). *} +.#define bfd_mach_cr16 1 . bfd_arch_cr16c, {* National Semiconductor CompactRISC. *} .#define bfd_mach_cr16c 1 . bfd_arch_crx, {* National Semiconductor CRX. *} @@ -348,6 +361,7 @@ DESCRIPTION . bfd_arch_s390, {* IBM s390 *} .#define bfd_mach_s390_31 31 .#define bfd_mach_s390_64 64 +. bfd_arch_score, {* Sunplus score *} . bfd_arch_openrisc, {* OpenRISC *} . bfd_arch_mmix, {* Donald Knuth's educational processor. *} . bfd_arch_xstormy16, @@ -425,6 +439,7 @@ extern const bfd_arch_info_type bfd_arc_arch; extern const bfd_arch_info_type bfd_arm_arch; extern const bfd_arch_info_type bfd_avr_arch; extern const bfd_arch_info_type bfd_bfin_arch; +extern const bfd_arch_info_type bfd_cr16_arch; extern const bfd_arch_info_type bfd_cr16c_arch; extern const bfd_arch_info_type bfd_cris_arch; extern const bfd_arch_info_type bfd_crx_arch; @@ -451,6 +466,7 @@ extern const bfd_arch_info_type bfd_m68k_arch; extern const bfd_arch_info_type bfd_m88k_arch; extern const bfd_arch_info_type bfd_maxq_arch; extern const bfd_arch_info_type bfd_mcore_arch; +extern const bfd_arch_info_type bfd_mep_arch; extern const bfd_arch_info_type bfd_mips_arch; extern const bfd_arch_info_type bfd_mmix_arch; extern const bfd_arch_info_type bfd_mn10200_arch; @@ -466,8 +482,10 @@ extern const bfd_arch_info_type bfd_powerpc_archs[]; #define bfd_powerpc_arch bfd_powerpc_archs[0] extern const bfd_arch_info_type bfd_rs6000_arch; extern const bfd_arch_info_type bfd_s390_arch; +extern const bfd_arch_info_type bfd_score_arch; extern const bfd_arch_info_type bfd_sh_arch; extern const bfd_arch_info_type bfd_sparc_arch; +extern const bfd_arch_info_type bfd_spu_arch; extern const bfd_arch_info_type bfd_tic30_arch; extern const bfd_arch_info_type bfd_tic4x_arch; extern const bfd_arch_info_type bfd_tic54x_arch; @@ -492,6 +510,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_arm_arch, &bfd_avr_arch, &bfd_bfin_arch, + &bfd_cr16_arch, &bfd_cr16c_arch, &bfd_cris_arch, &bfd_crx_arch, @@ -518,6 +537,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_m88k_arch, &bfd_maxq_arch, &bfd_mcore_arch, + &bfd_mep_arch, &bfd_mips_arch, &bfd_mmix_arch, &bfd_mn10200_arch, @@ -531,8 +551,10 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_powerpc_arch, &bfd_rs6000_arch, &bfd_s390_arch, + &bfd_score_arch, &bfd_sh_arch, &bfd_sparc_arch, + &bfd_spu_arch, &bfd_tic30_arch, &bfd_tic4x_arch, &bfd_tic54x_arch, diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h index 33b649d0585..617aa07ec55 100644 --- a/contrib/binutils/bfd/bfd-in.h +++ b/contrib/binutils/bfd/bfd-in.h @@ -1,7 +1,7 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -43,6 +43,30 @@ extern "C" { #endif #endif +/* This is a utility macro to handle the situation where the code + wants to place a constant string into the code, followed by a + comma and then the length of the string. Doing this by hand + is error prone, so using this macro is safer. The macro will + also safely handle the case where a NULL is passed as the arg. */ +#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0) +/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro + to create the arguments to another macro, since the preprocessor + will mis-count the number of arguments to the outer macro (by not + evaluating STRING_COMMA_LEN and so missing the comma). This is a + problem for example when trying to use STRING_COMMA_LEN to build + the arguments to the strncmp() macro. Hence this alternative + definition of strncmp is provided here. + + Note - these macros do NOT work if STR2 is not a constant string. */ +#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) + /* strcpy() can have a similar problem, but since we know we are + copying a constant string, we can use memcpy which will be faster + since there is no need to check for a NUL byte inside STR. We + can also save time if we do not need to copy the terminating NUL. */ +#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) +#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) + + /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ @@ -326,7 +350,15 @@ typedef struct bfd_section *sec_ptr; (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ / bfd_octets_per_byte (bfd)) -typedef struct stat stat_type; +/* Return TRUE if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section (sec) \ + && bfd_is_abs_section ((sec)->output_section) \ + && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ + && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) + +/* Forward define. */ +struct stat; typedef enum bfd_print_symbol { @@ -374,10 +406,6 @@ struct bfd_hash_table { /* The hash array. */ struct bfd_hash_entry **table; - /* The number of slots in the hash table. */ - unsigned int size; - /* The size of elements. */ - unsigned int entsize; /* A function used to create new elements in the hash table. The first entry is itself a pointer to an element. When this function is first invoked, this pointer will be NULL. However, @@ -390,6 +418,14 @@ struct bfd_hash_table /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; + /* The number of slots in the hash table. */ + unsigned int size; + /* The number of entries in the hash table. */ + unsigned int count; + /* The size of elements. */ + unsigned int entsize; + /* If non-zero, don't grow the hash table. */ + unsigned int frozen:1; }; /* Initialize a hash table. */ @@ -660,7 +696,7 @@ extern void bfd_elf_set_dt_needed_name extern const char *bfd_elf_get_dt_soname (bfd *); extern void bfd_elf_set_dyn_lib_class - (bfd *, int); + (bfd *, enum dynamic_lib_link_class); extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list @@ -817,6 +853,27 @@ extern bfd_boolean bfd_coff_set_symbol_class extern bfd_boolean bfd_m68k_coff_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +/* ARM VFP11 erratum workaround support. */ +typedef enum +{ + BFD_ARM_VFP11_FIX_DEFAULT, + BFD_ARM_VFP11_FIX_NONE, + BFD_ARM_VFP11_FIX_SCALAR, + BFD_ARM_VFP11_FIX_VECTOR +} bfd_arm_vfp11_fix; + +extern void bfd_elf32_arm_init_maps + (bfd *); + +extern void bfd_elf32_arm_set_vfp11_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_vfp11_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -842,10 +899,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *); extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); + (bfd *, struct bfd_link_info *); void bfd_elf32_arm_set_target_relocs - (struct bfd_link_info *, int, char *, int, int); + (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, + int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -854,8 +912,14 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *); /* ELF ARM mapping symbol support */ -extern bfd_boolean bfd_is_arm_mapping_symbol_name - (const char * name); +#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) +#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) +#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) +#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) +extern bfd_boolean bfd_is_arm_special_symbol_name + (const char * name, int type); + +extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h index ddcda2377df..8ea1cdd3b18 100644 --- a/contrib/binutils/bfd/bfd-in2.h +++ b/contrib/binutils/bfd/bfd-in2.h @@ -8,7 +8,7 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -50,6 +50,30 @@ extern "C" { #endif #endif +/* This is a utility macro to handle the situation where the code + wants to place a constant string into the code, followed by a + comma and then the length of the string. Doing this by hand + is error prone, so using this macro is safer. The macro will + also safely handle the case where a NULL is passed as the arg. */ +#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0) +/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro + to create the arguments to another macro, since the preprocessor + will mis-count the number of arguments to the outer macro (by not + evaluating STRING_COMMA_LEN and so missing the comma). This is a + problem for example when trying to use STRING_COMMA_LEN to build + the arguments to the strncmp() macro. Hence this alternative + definition of strncmp is provided here. + + Note - these macros do NOT work if STR2 is not a constant string. */ +#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) + /* strcpy() can have a similar problem, but since we know we are + copying a constant string, we can use memcpy which will be faster + since there is no need to check for a NUL byte inside STR. We + can also save time if we do not need to copy the terminating NUL. */ +#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) +#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) + + /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ @@ -333,7 +357,15 @@ typedef struct bfd_section *sec_ptr; (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ / bfd_octets_per_byte (bfd)) -typedef struct stat stat_type; +/* Return TRUE if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section (sec) \ + && bfd_is_abs_section ((sec)->output_section) \ + && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ + && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) + +/* Forward define. */ +struct stat; typedef enum bfd_print_symbol { @@ -381,10 +413,6 @@ struct bfd_hash_table { /* The hash array. */ struct bfd_hash_entry **table; - /* The number of slots in the hash table. */ - unsigned int size; - /* The size of elements. */ - unsigned int entsize; /* A function used to create new elements in the hash table. The first entry is itself a pointer to an element. When this function is first invoked, this pointer will be NULL. However, @@ -397,6 +425,14 @@ struct bfd_hash_table /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; + /* The number of slots in the hash table. */ + unsigned int size; + /* The number of entries in the hash table. */ + unsigned int count; + /* The size of elements. */ + unsigned int entsize; + /* If non-zero, don't grow the hash table. */ + unsigned int frozen:1; }; /* Initialize a hash table. */ @@ -667,7 +703,7 @@ extern void bfd_elf_set_dt_needed_name extern const char *bfd_elf_get_dt_soname (bfd *); extern void bfd_elf_set_dyn_lib_class - (bfd *, int); + (bfd *, enum dynamic_lib_link_class); extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list @@ -824,6 +860,27 @@ extern bfd_boolean bfd_coff_set_symbol_class extern bfd_boolean bfd_m68k_coff_create_embedded_relocs (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +/* ARM VFP11 erratum workaround support. */ +typedef enum +{ + BFD_ARM_VFP11_FIX_DEFAULT, + BFD_ARM_VFP11_FIX_NONE, + BFD_ARM_VFP11_FIX_SCALAR, + BFD_ARM_VFP11_FIX_VECTOR +} bfd_arm_vfp11_fix; + +extern void bfd_elf32_arm_init_maps + (bfd *); + +extern void bfd_elf32_arm_set_vfp11_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_vfp11_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -849,10 +906,11 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info *); extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); + (bfd *, struct bfd_link_info *); void bfd_elf32_arm_set_target_relocs - (struct bfd_link_info *, int, char *, int, int); + (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, + int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -861,8 +919,14 @@ extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *); /* ELF ARM mapping symbol support */ -extern bfd_boolean bfd_is_arm_mapping_symbol_name - (const char * name); +#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) +#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) +#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) +#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) +extern bfd_boolean bfd_is_arm_special_symbol_name + (const char * name, int type); + +extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines @@ -935,7 +999,10 @@ bfd *bfd_openr_iovec (const char *filename, const char *target, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)); + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)); bfd *bfd_openw (const char *filename, const char *target); @@ -1076,7 +1143,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -long bfd_get_size (bfd *abfd); +file_ptr bfd_get_size (bfd *abfd); /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ @@ -1225,7 +1292,9 @@ typedef struct bfd_section else up the line will take care of it later. */ #define SEC_LINKER_CREATED 0x200000 - /* This section should not be subject to garbage collection. */ + /* This section should not be subject to garbage collection. + Also set to inform the linker that this section should not be + listed in the link map as discarded. */ #define SEC_KEEP 0x400000 /* This section contains "short" data, and should be placed @@ -1471,11 +1540,6 @@ extern asection bfd_ind_section; || ((SEC) == bfd_com_section_ptr) \ || ((SEC) == bfd_ind_section_ptr)) -extern const struct bfd_symbol * const bfd_abs_symbol; -extern const struct bfd_symbol * const bfd_com_symbol; -extern const struct bfd_symbol * const bfd_und_symbol; -extern const struct bfd_symbol * const bfd_ind_symbol; - /* Macros to handle insertion and deletion of a bfd's sections. These only handle the list pointers, ie. do not adjust section_count, target_index etc. */ @@ -1566,7 +1630,7 @@ extern const struct bfd_symbol * const bfd_ind_symbol; #define bfd_section_removed_from_list(ABFD, S) \ ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ +#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ @@ -1597,11 +1661,8 @@ extern const struct bfd_symbol * const bfd_ind_symbol; /* target_index, used_by_bfd, constructor_chain, owner, */ \ 0, NULL, NULL, NULL, \ \ - /* symbol, */ \ - (struct bfd_symbol *) SYM, \ - \ - /* symbol_ptr_ptr, */ \ - (struct bfd_symbol **) SYM_PTR, \ + /* symbol, symbol_ptr_ptr, */ \ + (struct bfd_symbol *) SYM, &SEC.symbol, \ \ /* map_head, map_tail */ \ { NULL }, { NULL } \ @@ -1683,22 +1744,26 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 -#define bfd_mach_mcf_isa_a_nodiv 9 -#define bfd_mach_mcf_isa_a 10 -#define bfd_mach_mcf_isa_a_mac 11 -#define bfd_mach_mcf_isa_a_emac 12 -#define bfd_mach_mcf_isa_aplus 13 -#define bfd_mach_mcf_isa_aplus_mac 14 -#define bfd_mach_mcf_isa_aplus_emac 15 -#define bfd_mach_mcf_isa_b_nousp 16 -#define bfd_mach_mcf_isa_b_nousp_mac 17 -#define bfd_mach_mcf_isa_b_nousp_emac 18 -#define bfd_mach_mcf_isa_b 19 -#define bfd_mach_mcf_isa_b_mac 20 -#define bfd_mach_mcf_isa_b_emac 21 -#define bfd_mach_mcf_isa_b_float 22 -#define bfd_mach_mcf_isa_b_float_mac 23 -#define bfd_mach_mcf_isa_b_float_emac 24 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -1739,6 +1804,8 @@ enum bfd_architecture /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) + bfd_arch_spu, /* PowerPC SPU */ +#define bfd_mach_spu 256 bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 @@ -1876,6 +1943,7 @@ enum bfd_architecture #define bfd_mach_arm_XScale 10 #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 +#define bfd_mach_arm_iWMMXt2 13 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -1917,6 +1985,9 @@ enum bfd_architecture #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 bfd_arch_mcore, + bfd_arch_mep, +#define bfd_mach_mep 1 +#define bfd_mach_mep_h1 0x6831 bfd_arch_ia64, /* HP/Intel ia64 */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 @@ -1937,8 +2008,11 @@ enum bfd_architecture #define bfd_mach_avr3 3 #define bfd_mach_avr4 4 #define bfd_mach_avr5 5 +#define bfd_mach_avr6 6 bfd_arch_bfin, /* ADI Blackfin */ #define bfd_mach_bfin 1 + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ +#define bfd_mach_cr16 1 bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ #define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ @@ -1950,6 +2024,7 @@ enum bfd_architecture bfd_arch_s390, /* IBM s390 */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 + bfd_arch_score, /* Sunplus score */ bfd_arch_openrisc, /* OpenRISC */ bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, @@ -2427,6 +2502,22 @@ relocation types already defined. */ BFD_RELOC_SPARC_TLS_TPOFF32, BFD_RELOC_SPARC_TLS_TPOFF64, +/* SPU Relocations. */ + BFD_RELOC_SPU_IMM7, + BFD_RELOC_SPU_IMM8, + BFD_RELOC_SPU_IMM10, + BFD_RELOC_SPU_IMM10W, + BFD_RELOC_SPU_IMM16, + BFD_RELOC_SPU_IMM16W, + BFD_RELOC_SPU_IMM18, + BFD_RELOC_SPU_PCREL9a, + BFD_RELOC_SPU_PCREL9b, + BFD_RELOC_SPU_PCREL16, + BFD_RELOC_SPU_LO16, + BFD_RELOC_SPU_HI16, + BFD_RELOC_SPU_PPU32, + BFD_RELOC_SPU_PPU64, + /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or "addend" in some special way. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when @@ -2909,6 +3000,16 @@ pc-relative or some form of GOT-indirect relocation. */ /* 31-bit PC relative address. */ BFD_RELOC_ARM_PREL31, +/* Low and High halfword relocations for MOVW and MOVT instructions. */ + BFD_RELOC_ARM_MOVW, + BFD_RELOC_ARM_MOVT, + BFD_RELOC_ARM_MOVW_PCREL, + BFD_RELOC_ARM_MOVT_PCREL, + BFD_RELOC_ARM_THUMB_MOVW, + BFD_RELOC_ARM_THUMB_MOVT, + BFD_RELOC_ARM_THUMB_MOVW_PCREL, + BFD_RELOC_ARM_THUMB_MOVT_PCREL, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -2928,11 +3029,42 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_TLS_IE32, BFD_RELOC_ARM_TLS_LE32, +/* ARM group relocations. */ + BFD_RELOC_ARM_ALU_PC_G0_NC, + BFD_RELOC_ARM_ALU_PC_G0, + BFD_RELOC_ARM_ALU_PC_G1_NC, + BFD_RELOC_ARM_ALU_PC_G1, + BFD_RELOC_ARM_ALU_PC_G2, + BFD_RELOC_ARM_LDR_PC_G0, + BFD_RELOC_ARM_LDR_PC_G1, + BFD_RELOC_ARM_LDR_PC_G2, + BFD_RELOC_ARM_LDRS_PC_G0, + BFD_RELOC_ARM_LDRS_PC_G1, + BFD_RELOC_ARM_LDRS_PC_G2, + BFD_RELOC_ARM_LDC_PC_G0, + BFD_RELOC_ARM_LDC_PC_G1, + BFD_RELOC_ARM_LDC_PC_G2, + BFD_RELOC_ARM_ALU_SB_G0_NC, + BFD_RELOC_ARM_ALU_SB_G0, + BFD_RELOC_ARM_ALU_SB_G1_NC, + BFD_RELOC_ARM_ALU_SB_G1, + BFD_RELOC_ARM_ALU_SB_G2, + BFD_RELOC_ARM_LDR_SB_G0, + BFD_RELOC_ARM_LDR_SB_G1, + BFD_RELOC_ARM_LDR_SB_G2, + BFD_RELOC_ARM_LDRS_SB_G0, + BFD_RELOC_ARM_LDRS_SB_G1, + BFD_RELOC_ARM_LDRS_SB_G2, + BFD_RELOC_ARM_LDC_SB_G0, + BFD_RELOC_ARM_LDC_SB_G1, + BFD_RELOC_ARM_LDC_SB_G2, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, BFD_RELOC_ARM_ADRL_IMMEDIATE, BFD_RELOC_ARM_T32_IMMEDIATE, + BFD_RELOC_ARM_T32_ADD_IMM, BFD_RELOC_ARM_T32_IMM12, BFD_RELOC_ARM_T32_ADD_PC12, BFD_RELOC_ARM_SHIFT_IMM, @@ -3446,6 +3578,29 @@ short offset into 11 bits. */ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, BFD_RELOC_MCORE_RVA, +/* Toshiba Media Processor Relocations. */ + BFD_RELOC_MEP_8, + BFD_RELOC_MEP_16, + BFD_RELOC_MEP_32, + BFD_RELOC_MEP_PCREL8A2, + BFD_RELOC_MEP_PCREL12A2, + BFD_RELOC_MEP_PCREL17A2, + BFD_RELOC_MEP_PCREL24A2, + BFD_RELOC_MEP_PCABS24A2, + BFD_RELOC_MEP_LOW16, + BFD_RELOC_MEP_HI16U, + BFD_RELOC_MEP_HI16S, + BFD_RELOC_MEP_GPREL, + BFD_RELOC_MEP_TPREL, + BFD_RELOC_MEP_TPREL7, + BFD_RELOC_MEP_TPREL7A2, + BFD_RELOC_MEP_TPREL7A4, + BFD_RELOC_MEP_UIMM24, + BFD_RELOC_MEP_ADDR24A4, + BFD_RELOC_MEP_GNU_VTINHERIT, + BFD_RELOC_MEP_GNU_VTENTRY, + + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -3545,10 +3700,22 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, +/* This is a 16 bit reloc for the AVR that stores 8 bit value +(command address) into 8 bit immediate value of LDI insn. If the address +is beyond the 128k boundary, the linker inserts a jump stub for this reloc +in the lower 128k. */ + BFD_RELOC_AVR_LO8_LDI_GS, + /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit of command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_HI8_LDI_PM, +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit +of command address) into 8 bit immediate value of LDI insn. If the address +is beyond the 128k boundary, the linker inserts a jump stub for this reloc +below 128k. */ + BFD_RELOC_AVR_HI8_LDI_GS, + /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit of command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_HH8_LDI_PM, @@ -3689,6 +3856,31 @@ instructions */ BFD_RELOC_390_GOTPLT20, BFD_RELOC_390_TLS_GOTIE20, +/* Score relocations */ + BFD_RELOC_SCORE_DUMMY1, + +/* Low 16 bit for load/store */ + BFD_RELOC_SCORE_GPREL15, + +/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_DUMMY2, + BFD_RELOC_SCORE_JMP, + +/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_BRANCH, + +/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE16_JMP, + +/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE16_BRANCH, + +/* Undocumented Score relocs */ + BFD_RELOC_SCORE_GOT15, + BFD_RELOC_SCORE_GOT_LO16, + BFD_RELOC_SCORE_CALL15, + BFD_RELOC_SCORE_DUMMY_HI16, + /* Scenix IP2K - 9-bit register number / data address */ BFD_RELOC_IP2K_FR9, @@ -3913,6 +4105,35 @@ This is the 5 bits of a value. */ BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C, +/* NS CR16 Relocations. */ + BFD_RELOC_CR16_NUM8, + BFD_RELOC_CR16_NUM16, + BFD_RELOC_CR16_NUM32, + BFD_RELOC_CR16_NUM32a, + BFD_RELOC_CR16_REGREL0, + BFD_RELOC_CR16_REGREL4, + BFD_RELOC_CR16_REGREL4a, + BFD_RELOC_CR16_REGREL14, + BFD_RELOC_CR16_REGREL14a, + BFD_RELOC_CR16_REGREL16, + BFD_RELOC_CR16_REGREL20, + BFD_RELOC_CR16_REGREL20a, + BFD_RELOC_CR16_ABS20, + BFD_RELOC_CR16_ABS24, + BFD_RELOC_CR16_IMM4, + BFD_RELOC_CR16_IMM8, + BFD_RELOC_CR16_IMM16, + BFD_RELOC_CR16_IMM20, + BFD_RELOC_CR16_IMM24, + BFD_RELOC_CR16_IMM32, + BFD_RELOC_CR16_IMM32a, + BFD_RELOC_CR16_DISP4, + BFD_RELOC_CR16_DISP8, + BFD_RELOC_CR16_DISP16, + BFD_RELOC_CR16_DISP20, + BFD_RELOC_CR16_DISP24, + BFD_RELOC_CR16_DISP24a, + /* NS CRX Relocations. */ BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8, @@ -4026,6 +4247,10 @@ This is the 5 bits of a value. */ BFD_RELOC_XSTORMY16_24, BFD_RELOC_XSTORMY16_FPTR16, +/* Self-describing complex relocations. */ + BFD_RELOC_RELC, + + /* Infineon Relocations. */ BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, @@ -4163,6 +4388,8 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); +reloc_howto_type *bfd_reloc_name_lookup + (bfd *abfd, const char *reloc_name); const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); @@ -4275,6 +4502,14 @@ typedef struct bfd_symbol /* This symbol is thread local. Used in ELF. */ #define BSF_THREAD_LOCAL 0x40000 + /* This symbol represents a complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_RELC 0x80000 + + /* This symbol represents a signed complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_SRELC 0x100000 + flagword flags; /* A pointer to the section to which this symbol is @@ -4442,7 +4677,7 @@ struct bfd /* Stuff only useful for archives. */ void *arelt_data; struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *next; /* The next BFD in the archive. */ + struct bfd *archive_next; /* The next BFD in the archive. */ struct bfd *archive_head; /* The first BFD in the archive. */ bfd_boolean has_armap; @@ -4524,13 +4759,14 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_on_input, bfd_error_invalid_error_code } bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag); +void bfd_set_error (bfd_error_type error_tag, ...); const char *bfd_errmsg (bfd_error_type error_tag); @@ -4585,8 +4821,8 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) -#define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) +#define bfd_sizeof_headers(abfd, info) \ + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ @@ -4694,6 +4930,16 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *); void bfd_preserve_finish (bfd *, struct bfd_preserve *); +bfd_vma bfd_emul_get_maxpagesize (const char *); + +void bfd_emul_set_maxpagesize (const char *, bfd_vma); + +bfd_vma bfd_emul_get_commonpagesize (const char *); + +void bfd_emul_set_commonpagesize (const char *, bfd_vma); + +char *bfd_demangle (bfd *, const char *, int); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -4992,7 +5238,8 @@ typedef struct bfd_target #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup + NAME##_bfd_reloc_type_lookup, \ + NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); long (*_bfd_canonicalize_reloc) @@ -5000,6 +5247,9 @@ typedef struct bfd_target /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); + reloc_howto_type * + (*reloc_name_lookup) (bfd *, const char *); + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ @@ -5028,7 +5278,7 @@ typedef struct bfd_target NAME##_bfd_discard_group, \ NAME##_section_already_linked \ - int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); + int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, bfd_boolean, struct bfd_symbol **); @@ -5071,7 +5321,8 @@ typedef struct bfd_target /* Check if SEC has been already linked during a reloceatable or final link. */ - void (*_section_already_linked) (bfd *, struct bfd_section *); + void (*_section_already_linked) (bfd *, struct bfd_section *, + struct bfd_link_info *); /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ @@ -5131,10 +5382,11 @@ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) -void bfd_section_already_linked (bfd *abfd, asection *sec); +void bfd_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info); -#define bfd_section_already_linked(abfd, sec) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec)) +#define bfd_section_already_linked(abfd, sec, info) \ + BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c index 733f6ee0272..510df0ab27f 100644 --- a/contrib/binutils/bfd/bfd.c +++ b/contrib/binutils/bfd/bfd.c @@ -1,6 +1,6 @@ /* Generic BFD library interface and support routines. 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. Written by Cygnus Support. @@ -139,7 +139,7 @@ CODE_FRAGMENT . {* Stuff only useful for archives. *} . void *arelt_data; . struct bfd *my_archive; {* The containing archive BFD. *} -. struct bfd *next; {* The next BFD in the archive. *} +. struct bfd *archive_next; {* The next BFD in the archive. *} . struct bfd *archive_head; {* The first BFD in the archive. *} . bfd_boolean has_armap; . @@ -202,11 +202,12 @@ CODE_FRAGMENT . */ -#include "bfd.h" -#include "bfdver.h" #include "sysdep.h" #include +#include "bfd.h" +#include "bfdver.h" #include "libiberty.h" +#include "demangle.h" #include "safe-ctype.h" #include "bfdlink.h" #include "libbfd.h" @@ -271,6 +272,7 @@ CODE_FRAGMENT . bfd_error_bad_value, . bfd_error_file_truncated, . bfd_error_file_too_big, +. bfd_error_on_input, . bfd_error_invalid_error_code .} .bfd_error_type; @@ -278,6 +280,8 @@ CODE_FRAGMENT */ static bfd_error_type bfd_error = bfd_error_no_error; +static bfd *input_bfd = NULL; +static bfd_error_type input_error = bfd_error_no_error; const char *const bfd_errmsgs[] = { @@ -300,6 +304,7 @@ const char *const bfd_errmsgs[] = N_("Bad value"), N_("File truncated"), N_("File too big"), + N_("Error reading %s: %s"), N_("#") }; @@ -325,16 +330,32 @@ FUNCTION bfd_set_error SYNOPSIS - void bfd_set_error (bfd_error_type error_tag); + void bfd_set_error (bfd_error_type error_tag, ...); DESCRIPTION Set the BFD error condition to be @var{error_tag}. + If @var{error_tag} is bfd_error_on_input, then this function + takes two more parameters, the input bfd where the error + occurred, and the bfd_error_type error. */ void -bfd_set_error (bfd_error_type error_tag) +bfd_set_error (bfd_error_type error_tag, ...) { bfd_error = error_tag; + if (error_tag == bfd_error_on_input) + { + /* This is an error that occurred during bfd_close when + writing an archive, but on one of the input files. */ + va_list ap; + + va_start (ap, error_tag); + input_bfd = va_arg (ap, bfd *); + input_error = va_arg (ap, int); + if (input_error >= bfd_error_on_input) + abort (); + va_end (ap); + } } /* @@ -355,6 +376,19 @@ bfd_errmsg (bfd_error_type error_tag) #ifndef errno extern int errno; #endif + if (error_tag == bfd_error_on_input) + { + char *buf; + const char *msg = bfd_errmsg (input_error); + + if (asprintf (&buf, _(bfd_errmsgs [error_tag]), input_bfd->filename, msg) + != -1) + return buf; + + /* Ick, what to do on out of memory? */ + return msg; + } + if (error_tag == bfd_error_system_call) return xstrerror (errno); @@ -382,16 +416,10 @@ DESCRIPTION void bfd_perror (const char *message) { - if (bfd_get_error () == bfd_error_system_call) - /* Must be a system error then. */ - perror ((char *) message); + if (message == NULL || *message == '\0') + fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); else - { - if (message == NULL || *message == '\0') - fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); - else - fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); - } + fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ())); } /* @@ -419,6 +447,23 @@ static const char *_bfd_error_program_name; %A section name from section. For group components, print group name too. %B file name from bfd. For archive components, prints archive too. + + Note - because these two extra format specifiers require special handling + they are scanned for and processed in this function, before calling + vfprintf. This means that the *arguments* for these format specifiers + must be the first ones in the variable argument list, regardless of where + the specifiers appear in the format string. Thus for example calling + this function with a format string of: + + "blah %s blah %A blah %d blah %B" + + would involve passing the arguments as: + + "blah %s blah %A blah %d blah %B", + asection_for_the_%A, + bfd_for_the_%B, + string_for_the_%s, + integer_for_the_%d); */ void @@ -483,7 +528,11 @@ _bfd_default_error_handler (const char *fmt, ...) if (p[1] == 'B') { bfd *abfd = va_arg (ap, bfd *); - if (abfd->my_archive) + + if (abfd == NULL) + /* Invoking %B with a null bfd pointer is an internal error. */ + abort (); + else if (abfd->my_archive) snprintf (bufp, avail, "%s(%s)", abfd->my_archive->filename, abfd->filename); else @@ -492,10 +541,14 @@ _bfd_default_error_handler (const char *fmt, ...) else { asection *sec = va_arg (ap, asection *); - bfd *abfd = sec->owner; + bfd *abfd; const char *group = NULL; struct coff_comdat_info *ci; + if (sec == NULL) + /* Invoking %A with a null section pointer is an internal error. */ + abort (); + abfd = sec->owner; if (abfd != NULL && bfd_get_flavour (abfd) == bfd_target_elf_flavour && elf_next_in_group (sec) != NULL @@ -851,14 +904,16 @@ bfd_get_sign_extend_vma (bfd *abfd) name = bfd_get_target (abfd); - /* Return a proper value for DJGPP & PE COFF (x86 COFF variants). + /* Return a proper value for DJGPP & PE COFF. This function is required for DWARF2 support, but there is no place to store this information in the COFF back end. Should enough other COFF targets add support for DWARF2, a place will have to be found. Until then, this hack will do. */ - if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0 + if (CONST_STRNEQ (name, "coff-go32") || strcmp (name, "pe-i386") == 0 - || strcmp (name, "pei-i386") == 0) + || strcmp (name, "pei-i386") == 0 + || strcmp (name, "pe-arm-wince-little") == 0 + || strcmp (name, "pei-arm-wince-little") == 0) return 1; bfd_set_error (bfd_error_wrong_format); @@ -1158,8 +1213,8 @@ FUNCTION DESCRIPTION The following functions exist but have not yet been documented. -.#define bfd_sizeof_headers(abfd, reloc) \ -. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) +.#define bfd_sizeof_headers(abfd, info) \ +. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) . .#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ . BFD_SEND (abfd, _bfd_find_nearest_line, \ @@ -1298,11 +1353,10 @@ bfd_record_phdr (bfd *abfd, amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) count - 1) * sizeof (asection *); - m = bfd_alloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) return FALSE; - m->next = NULL; m->p_type = type; m->p_flags = flags; m->p_paddr = at; @@ -1335,6 +1389,15 @@ bfd_fprintf_vma (bfd *abfd, void *stream, bfd_vma value) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value); +#ifdef BFD64 + /* fprintf_vma() on a 64-bit enabled host will always print a 64-bit + value, but really we want to display the address in the target's + address size. Since we do not have a field in the bfd structure + to tell us this, we take a guess, based on the target's name. */ + else if (strstr (bfd_get_target (abfd), "64") == NULL + && strcmp (bfd_get_target (abfd), "mmo") != 0) + fprintf ((FILE *) stream, "%08lx", (unsigned long) (value & 0xffffffff)); +#endif else fprintf_vma ((FILE *) stream, value); } @@ -1513,3 +1576,212 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve) objalloc. */ bfd_hash_table_free (&preserve->section_htab); } + +/* +FUNCTION + bfd_emul_get_maxpagesize + +SYNOPSIS + bfd_vma bfd_emul_get_maxpagesize (const char *); + +DESCRIPTION + Returns the maximum page size, in bytes, as determined by + emulation. + +RETURNS + Returns the maximum page size in bytes for ELF, abort + otherwise. +*/ + +bfd_vma +bfd_emul_get_maxpagesize (const char *emul) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target != NULL + && target->flavour == bfd_target_elf_flavour) + return xvec_get_elf_backend_data (target)->maxpagesize; + + abort (); + return 0; +} + +static void +bfd_elf_set_pagesize (const bfd_target *target, bfd_vma size, + int offset, const bfd_target *orig_target) +{ + if (target->flavour == bfd_target_elf_flavour) + { + const struct elf_backend_data *bed; + + bed = xvec_get_elf_backend_data (target); + *((bfd_vma *) ((char *) bed + offset)) = size; + } + + if (target->alternative_target + && target->alternative_target != orig_target) + bfd_elf_set_pagesize (target->alternative_target, size, offset, + orig_target); +} + +/* +FUNCTION + bfd_emul_set_maxpagesize + +SYNOPSIS + void bfd_emul_set_maxpagesize (const char *, bfd_vma); + +DESCRIPTION + For ELF, set the maximum page size for the emulation. It is + a no-op for other formats. + +*/ + +void +bfd_emul_set_maxpagesize (const char *emul, bfd_vma size) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target) + bfd_elf_set_pagesize (target, size, + offsetof (struct elf_backend_data, + maxpagesize), target); +} + +/* +FUNCTION + bfd_emul_get_commonpagesize + +SYNOPSIS + bfd_vma bfd_emul_get_commonpagesize (const char *); + +DESCRIPTION + Returns the common page size, in bytes, as determined by + emulation. + +RETURNS + Returns the common page size in bytes for ELF, abort otherwise. +*/ + +bfd_vma +bfd_emul_get_commonpagesize (const char *emul) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target != NULL + && target->flavour == bfd_target_elf_flavour) + return xvec_get_elf_backend_data (target)->commonpagesize; + + abort (); + return 0; +} + +/* +FUNCTION + bfd_emul_set_commonpagesize + +SYNOPSIS + void bfd_emul_set_commonpagesize (const char *, bfd_vma); + +DESCRIPTION + For ELF, set the common page size for the emulation. It is + a no-op for other formats. + +*/ + +void +bfd_emul_set_commonpagesize (const char *emul, bfd_vma size) +{ + const bfd_target *target; + + target = bfd_find_target (emul, NULL); + if (target) + bfd_elf_set_pagesize (target, size, + offsetof (struct elf_backend_data, + commonpagesize), target); +} + +/* +FUNCTION + bfd_demangle + +SYNOPSIS + char *bfd_demangle (bfd *, const char *, int); + +DESCRIPTION + Wrapper around cplus_demangle. Strips leading underscores and + other such chars that would otherwise confuse the demangler. + If passed a g++ v3 ABI mangled name, returns a buffer allocated + with malloc holding the demangled name. Returns NULL otherwise + and on memory alloc failure. +*/ + +char * +bfd_demangle (bfd *abfd, const char *name, int options) +{ + char *res, *alloc; + const char *pre, *suf; + size_t pre_len; + + if (abfd != NULL + && *name != '\0' + && bfd_get_symbol_leading_char (abfd) == *name) + ++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 == '$') + ++name; + pre_len = name - pre; + + /* Strip off @plt and suchlike too. */ + alloc = NULL; + suf = strchr (name, '@'); + if (suf != NULL) + { + alloc = bfd_malloc (suf - name + 1); + if (alloc == NULL) + return NULL; + memcpy (alloc, name, suf - name); + alloc[suf - name] = '\0'; + name = alloc; + } + + res = cplus_demangle (name, options); + + if (alloc != NULL) + free (alloc); + + if (res == NULL) + return NULL; + + /* Put back any prefix or suffix. */ + if (pre_len != 0 || suf != NULL) + { + size_t len; + size_t suf_len; + char *final; + + len = strlen (res); + if (suf == NULL) + suf = res + len; + suf_len = strlen (suf) + 1; + final = bfd_malloc (pre_len + len + suf_len); + if (final != NULL) + { + 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; +} diff --git a/contrib/binutils/bfd/bfdio.c b/contrib/binutils/bfd/bfdio.c index 22ea886b5cb..0df25c3baf8 100644 --- a/contrib/binutils/bfd/bfdio.c +++ b/contrib/binutils/bfd/bfdio.c @@ -1,7 +1,7 @@ /* Low-level I/O routines for BFDs. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -23,12 +23,10 @@ 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 #include "bfd.h" #include "libbfd.h" -#include - #ifndef S_IXUSR #define S_IXUSR 0100 /* Execute by owner. */ #endif @@ -116,6 +114,15 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd) { size_t nread; + /* If this is an archive element, don't read past the end of + this element. */ + if (abfd->arelt_data != NULL) + { + size_t maxbytes = ((struct areltdata *) abfd->arelt_data)->parsed_size; + if (size > maxbytes) + size = maxbytes; + } + if ((abfd->flags & BFD_IN_MEMORY) != 0) { struct bfd_in_memory *bim; @@ -401,7 +408,7 @@ FUNCTION bfd_get_size SYNOPSIS - long bfd_get_size (bfd *abfd); + file_ptr bfd_get_size (bfd *abfd); DESCRIPTION Return the file size (as read from file system) for the file @@ -429,7 +436,7 @@ DESCRIPTION size reasonable?". */ -long +file_ptr bfd_get_size (bfd *abfd) { struct stat buf; diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c index 458626f02a3..b5347dd4ba4 100644 --- a/contrib/binutils/bfd/binary.c +++ b/contrib/binutils/bfd/binary.c @@ -1,6 +1,6 @@ /* BFD back-end for binary objects. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -32,8 +32,8 @@ the file. objcopy cooperates by specially setting the start address to zero by default. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "safe-ctype.h" #include "libbfd.h" @@ -63,6 +63,7 @@ binary_object_p (bfd *abfd) { struct stat statbuf; asection *sec; + flagword flags; if (abfd->target_defaulted) { @@ -80,10 +81,10 @@ binary_object_p (bfd *abfd) } /* One data section. */ - sec = bfd_make_section (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".data", flags); if (sec == NULL) return NULL; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS; sec->vma = 0; sec->size = statbuf.st_size; sec->filepos = 0; @@ -220,9 +221,6 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define binary_read_minisymbols _bfd_generic_read_minisymbols #define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define binary_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup -#define binary_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l) -#define binary_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l) #define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) /* Set the architecture of a binary file. */ @@ -305,7 +303,7 @@ binary_set_section_contents (bfd *abfd, static int binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -367,7 +365,7 @@ const bfd_target binary_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (binary), - BFD_JUMP_TABLE_RELOCS (binary), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (binary), BFD_JUMP_TABLE_LINK (binary), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/contrib/binutils/bfd/bout.c b/contrib/binutils/bfd/bout.c index 5102ba77622..fe132129d67 100644 --- a/contrib/binutils/bfd/bout.c +++ b/contrib/binutils/bfd/bout.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 b.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -635,7 +635,8 @@ callj_callback (bfd *abfd, } static reloc_howto_type * -b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { switch (code) { @@ -651,6 +652,20 @@ b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_typ } } +static reloc_howto_type * +b_out_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + if (strcasecmp (howto_reloc_callj.name, r_name) == 0) + return &howto_reloc_callj; + if (strcasecmp (howto_reloc_abs32.name, r_name) == 0) + return &howto_reloc_abs32; + if (strcasecmp (howto_reloc_pcrel24.name, r_name) == 0) + return &howto_reloc_pcrel24; + + return NULL; +} + /* Allocate enough room for all the reloc entries, plus pointers to them all. */ static bfd_boolean @@ -990,7 +1005,8 @@ b_out_set_arch_mach (bfd *abfd, } static int -b_out_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, bfd_boolean ignore ATTRIBUTE_UNUSED) +b_out_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (struct external_exec); } diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c index 6db6a6b4d56..5252cc9d132 100644 --- a/contrib/binutils/bfd/cache.c +++ b/contrib/binutils/bfd/cache.c @@ -1,7 +1,7 @@ /* BFD library -- caching of file descriptors. Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). @@ -40,8 +40,8 @@ SUBSECTION Caching functions */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" diff --git a/contrib/binutils/bfd/coff-alpha.c b/contrib/binutils/bfd/coff-alpha.c index d9b890502d3..dcb182bff9b 100644 --- a/contrib/binutils/bfd/coff-alpha.c +++ b/contrib/binutils/bfd/coff-alpha.c @@ -1,6 +1,6 @@ /* BFD back-end for ALPHA Extended-Coff files. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -1244,6 +1244,22 @@ alpha_bfd_reloc_type_lookup (abfd, code) return &alpha_howto_table[alpha_type]; } + +static reloc_howto_type * +alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]); + i++) + if (alpha_howto_table[i].name != NULL + && strcasecmp (alpha_howto_table[i].name, r_name) == 0) + return &alpha_howto_table[i]; + + return NULL; +} /* A helper routine for alpha_relocate_section which converts an external reloc when generating relocatable output. Returns the @@ -2361,6 +2377,8 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = /* Looking up a reloc type is Alpha specific. */ #define _bfd_ecoff_bfd_reloc_type_lookup alpha_bfd_reloc_type_lookup +#define _bfd_ecoff_bfd_reloc_name_lookup \ + alpha_bfd_reloc_name_lookup /* So is getting relocated section contents. */ #define _bfd_ecoff_bfd_get_relocated_section_contents \ diff --git a/contrib/binutils/bfd/coff-arm.c b/contrib/binutils/bfd/coff-arm.c index 6b83dc7af7f..28cd4e736ea 100644 --- a/contrib/binutils/bfd/coff-arm.c +++ b/contrib/binutils/bfd/coff-arm.c @@ -1,6 +1,6 @@ /* BFD back-end for ARM COFF files. 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. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/arm.h" #include "coff/internal.h" @@ -163,6 +163,19 @@ coff_arm_reloc (bfd *abfd, /* These most certainly belong somewhere else. Just had to get rid of the manifest constants in the code. */ + +#ifdef ARM_WINCE + +#define ARM_26D 0 +#define ARM_32 1 +#define ARM_RVA32 2 +#define ARM_26 3 +#define ARM_THUMB12 4 +#define ARM_SECTION 14 +#define ARM_SECREL 15 + +#else + #define ARM_8 0 #define ARM_16 1 #define ARM_32 2 @@ -179,20 +192,6 @@ coff_arm_reloc (bfd *abfd, #define ARM_THUMB12 13 #define ARM_THUMB23 14 -#ifdef ARM_WINCE -#undef ARM_32 -#undef ARM_RVA32 -#undef ARM_26 -#undef ARM_THUMB12 -#undef ARM_26D - -#define ARM_26D 0 -#define ARM_32 1 -#define ARM_RVA32 2 -#define ARM_26 3 -#define ARM_THUMB12 4 -#define ARM_SECTION 14 -#define ARM_SECREL 15 #endif static bfd_reloc_status_type aoutarm_fix_pcrel_26_done @@ -220,7 +219,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_dont, aoutarm_fix_pcrel_26_done, "ARM_26D", - FALSE, + TRUE, /* partial_inplace. */ 0x00ffffff, 0x0, PCRELOFFSET), @@ -233,7 +232,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_32", - FALSE, + TRUE, /* partial_inplace. */ 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -246,7 +245,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_RVA32", - FALSE, + TRUE, /* partial_inplace. */ 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -294,7 +293,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_SECTION", - FALSE, + TRUE, /* partial_inplace. */ 0x0000ffff, 0x0000ffff, PCRELOFFSET), @@ -307,7 +306,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = complain_overflow_bitfield, coff_arm_reloc, "ARM_SECREL", - FALSE, + TRUE, /* partial_inplace. */ 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -539,6 +538,32 @@ coff_arm_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (rel->r_type == ARM_RVA32) *addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase; +#if defined COFF_WITH_PE && defined ARM_WINCE + if (rel->r_type == ARM_SECREL) + { + bfd_vma osect_vma; + + if (h && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak)) + osect_vma = h->root.u.def.section->output_section->vma; + else + { + asection *sec; + int i; + + /* Sigh, the only way to get the section to offset against + is to find it the hard way. */ + + for (sec = abfd->sections, i = 1; i < sym->n_scnum; i++) + sec = sec->next; + + osect_vma = sec->output_section->vma; + } + + *addendp -= osect_vma; + } +#endif + return howto; } @@ -808,6 +833,7 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code) ASTD (BFD_RELOC_RVA, ARM_RVA32); ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26); ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12); + ASTD (BFD_RELOC_32_SECREL, ARM_SECREL); #else ASTD (BFD_RELOC_8, ARM_8); ASTD (BFD_RELOC_16, ARM_16); @@ -827,6 +853,23 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +coff_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (aoutarm_std_reloc_howto) + / sizeof (aoutarm_std_reloc_howto[0])); + i++) + if (aoutarm_std_reloc_howto[i].name != NULL + && strcasecmp (aoutarm_std_reloc_howto[i].name, r_name) == 0) + return &aoutarm_std_reloc_howto[i]; + + return NULL; +} + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2 #define COFF_PAGE_SIZE 0x1000 @@ -1209,12 +1252,14 @@ coff_arm_relocate_section (bfd *output_bfd, generation of bl's instruction offset. */ addend -= 8; #endif - howto = &fake_arm26_reloc; + howto = & fake_arm26_reloc; } #ifdef ARM_WINCE /* MS ARM-CE makes the reloc relative to the opcode's pc, not the next opcode's pc, so is off by one. */ + if (howto->pc_relative && !info->relocatable) + addend -= 8; #endif /* If we are doing a relocatable link, then we can just ignore @@ -1938,12 +1983,11 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd, if (sec == NULL) { - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - - sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME); - + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); + sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME, + flags); if (sec == NULL - || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) return FALSE; } @@ -1952,12 +1996,12 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd, if (sec == NULL) { - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - - sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME); + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); + sec = bfd_make_section_with_flags (abfd, THUMB2ARM_GLUE_SECTION_NAME, + flags); if (sec == NULL - || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) return FALSE; } @@ -2085,6 +2129,7 @@ bfd_arm_process_before_allocation (bfd * abfd, #endif /* ! defined (COFF_IMAGE_WITH_PE) */ #define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_arm_reloc_name_lookup #define coff_relocate_section coff_arm_relocate_section #define coff_bfd_is_local_label_name coff_arm_is_local_label_name #define coff_adjust_symndx coff_arm_adjust_symndx @@ -2397,7 +2442,9 @@ Warning: Clearing the interworking flag of %B because non-interworking code in % /* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX *must* match the definitions in gcc/config/arm/{coff|semi|aout}.h. */ +#ifndef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "" +#endif #ifndef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" #endif diff --git a/contrib/binutils/bfd/coff-aux.c b/contrib/binutils/bfd/coff-aux.c index e22d85566a6..f28a9483fd5 100644 --- a/contrib/binutils/bfd/coff-aux.c +++ b/contrib/binutils/bfd/coff-aux.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple M68K COFF A/UX 3.x files. - Copyright 1996, 1997, 2000, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 2000, 2002, 2007 Free Software Foundation, Inc. Written by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -37,8 +37,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define COFF_COMMON_ADDEND -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" static bfd_boolean coff_m68k_aux_link_add_one_symbol PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c index 0d71cd00065..81d38001233 100644 --- a/contrib/binutils/bfd/coff-i386.c +++ b/contrib/binutils/bfd/coff-i386.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 386 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/i386.h" @@ -546,6 +546,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp) } #define coff_bfd_reloc_type_lookup coff_i386_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_i386_reloc_name_lookup static reloc_howto_type * coff_i386_reloc_type_lookup (abfd, code) @@ -578,6 +579,20 @@ coff_i386_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + #define coff_rtype_to_howto coff_i386_rtype_to_howto #ifdef TARGET_UNDERSCORE diff --git a/contrib/binutils/bfd/coff-ia64.c b/contrib/binutils/bfd/coff-ia64.c index 1e3b3440f2e..32702a8f6ff 100644 --- a/contrib/binutils/bfd/coff-ia64.c +++ b/contrib/binutils/bfd/coff-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 COFF files. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/ia64.h" #include "coff/internal.h" diff --git a/contrib/binutils/bfd/coff-mips.c b/contrib/binutils/bfd/coff-mips.c index 34b072c4138..d5dafc7bf35 100644 --- a/contrib/binutils/bfd/coff-mips.c +++ b/contrib/binutils/bfd/coff-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS Extended-Coff files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -21,8 +21,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -769,6 +769,22 @@ mips_bfd_reloc_type_lookup (abfd, code) return &mips_howto_table[mips_type]; } + +static reloc_howto_type * +mips_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mips_howto_table) / sizeof (mips_howto_table[0]); + i++) + if (mips_howto_table[i].name != NULL + && strcasecmp (mips_howto_table[i].name, r_name) == 0) + return &mips_howto_table[i]; + + return NULL; +} /* A helper routine for mips_relocate_section which handles the REFHI relocations. The REFHI relocation must be followed by a REFLO @@ -1375,6 +1391,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = /* Looking up a reloc type is MIPS specific. */ #define _bfd_ecoff_bfd_reloc_type_lookup mips_bfd_reloc_type_lookup +#define _bfd_ecoff_bfd_reloc_name_lookup mips_bfd_reloc_name_lookup /* Getting relocated section contents is generic. */ #define _bfd_ecoff_bfd_get_relocated_section_contents \ diff --git a/contrib/binutils/bfd/coff-ppc.c b/contrib/binutils/bfd/coff-ppc.c index b4427936933..72ade4e8ad2 100644 --- a/contrib/binutils/bfd/coff-ppc.c +++ b/contrib/binutils/bfd/coff-ppc.c @@ -1,6 +1,6 @@ /* BFD back-end for PowerPC Microsoft Portable Executable files. 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. Original version pieced together by Kim Knuttila (krk@cygnus.com) @@ -33,9 +33,8 @@ - dlltool will not produce correct output in some .reloc cases, and will not produce the right glue code for dll function calls. */ -#include "bfd.h" #include "sysdep.h" - +#include "bfd.h" #include "libbfd.h" #include "coff/powerpc.h" @@ -1332,7 +1331,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, DUMP_RELOC2 (howto->name, rel); - if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0) + if (CONST_STRNEQ (input_section->name, ".idata$2") && first_thunk_address == 0) { /* Set magic values. */ int idata5offset; @@ -1961,8 +1960,23 @@ ppc_coff_reloc_type_lookup (abfd, code) return NULL; } } - #undef HOW2MAP + +static reloc_howto_type * +ppc_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]); + i++) + if (ppc_coff_howto_table[i].name != NULL + && strcasecmp (ppc_coff_howto_table[i].name, r_name) == 0) + return &ppc_coff_howto_table[i]; + + return NULL; +} /* Tailor coffcode.h -- macro heaven. */ @@ -1971,6 +1985,7 @@ ppc_coff_reloc_type_lookup (abfd, code) /* We use the special COFF backend linker, with our own special touch. */ #define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup ppc_coff_reloc_name_lookup #define coff_rtype_to_howto coff_ppc_rtype_to_howto #define coff_relocate_section coff_ppc_relocate_section #define coff_bfd_final_link ppc_bfd_coff_final_link diff --git a/contrib/binutils/bfd/coff-rs6000.c b/contrib/binutils/bfd/coff-rs6000.c index 951587f99b1..f446f497306 100644 --- a/contrib/binutils/bfd/coff-rs6000.c +++ b/contrib/binutils/bfd/coff-rs6000.c @@ -1,12 +1,7 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. - Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - FIXME: Can someone provide a transliteration of this name into ASCII? - Using the following chars caused a compiler warning on HIUX (so I replaced - them with octal escapes), and isn't useful without an understanding of what - character set it is. - Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, - and John Gilmore. + Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -26,8 +21,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -59,7 +54,7 @@ extern bfd_boolean _bfd_xcoff_write_armap extern bfd_boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); extern int _bfd_xcoff_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + PARAMS ((bfd *, struct bfd_link_info *)); extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); extern unsigned int _bfd_xcoff_swap_sym_out @@ -98,6 +93,7 @@ void xcoff_rtype2howto #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup +#define coff_bfd_reloc_name_lookup _bfd_xcoff_reloc_name_lookup #ifdef AIX_CORE extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); @@ -1051,6 +1047,21 @@ _bfd_xcoff_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +_bfd_xcoff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (xcoff_howto_table) / sizeof (xcoff_howto_table[0]); + i++) + if (xcoff_howto_table[i].name != NULL + && strcasecmp (xcoff_howto_table[i].name, r_name) == 0) + return &xcoff_howto_table[i]; + + return NULL; +} /* XCOFF archive support. The original version of this code was by Damon A. Permezel. It was enhanced to permit cross support, and @@ -1638,7 +1649,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) + SXCOFFARFMAG + arelt_size (sub)); fileoff = (fileoff + 1) &~ 1; - sub = sub->next; + sub = sub->archive_next; } for (i = 0; i < orl_count; i++) @@ -1809,7 +1820,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } i++; } - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -1913,7 +1924,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) + SXCOFFARFMAG + arelt_size (current_bfd)); fileoff += fileoff & 1; - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -1934,7 +1945,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } i++; } - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -2009,7 +2020,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) + SXCOFFARFMAG + arelt_size (current_bfd)); fileoff += fileoff & 1; - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -2030,7 +2041,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } i++; } - current_bfd = current_bfd->next; + current_bfd = current_bfd->archive_next; if (current_bfd != NULL) arch_info = bfd_get_arch_info (current_bfd); } @@ -2089,7 +2100,7 @@ xcoff_write_archive_contents_old (abfd) count = 0; total_namlen = 0; - for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next) { ++count; total_namlen += strlen (normalize_filename (sub)) + 1; @@ -2105,7 +2116,9 @@ xcoff_write_archive_contents_old (abfd) hasobjects = FALSE; prevoff = 0; nextoff = SIZEOF_AR_FILE_HDR; - for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) + for (sub = abfd->archive_head, i = 0; + sub != NULL; + sub = sub->archive_next, i++) { const char *name; bfd_size_type namlen; @@ -2253,7 +2266,7 @@ xcoff_write_archive_contents_old (abfd) abfd) != XCOFFARMAG_ELEMENT_SIZE) return FALSE; } - for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + for (sub = abfd->archive_head; sub != NULL; sub = sub->archive_next) { const char *name; bfd_size_type namlen; @@ -2323,7 +2336,7 @@ xcoff_write_archive_contents_big (abfd) hasobjects = FALSE; for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; current_bfd != NULL; - current_bfd = current_bfd->next, count++) + current_bfd = current_bfd->archive_next, count++) { total_namlen += strlen (normalize_filename (current_bfd)) + 1; @@ -2345,7 +2358,7 @@ xcoff_write_archive_contents_big (abfd) nextoff = SIZEOF_AR_FILE_HDR_BIG; for (current_bfd = abfd->archive_head, i = 0; current_bfd != NULL; - current_bfd = current_bfd->next, i++) + current_bfd = current_bfd->archive_next, i++) { const char *name; bfd_size_type namlen; @@ -2512,8 +2525,9 @@ xcoff_write_archive_contents_big (abfd) offsets = NULL; } - for (current_bfd = abfd->archive_head; current_bfd != NULL; - current_bfd = current_bfd->next) + for (current_bfd = abfd->archive_head; + current_bfd != NULL; + current_bfd = current_bfd->archive_next) { const char *name; size_t namlen; @@ -2573,9 +2587,8 @@ _bfd_xcoff_write_archive_contents (abfd) always uses an a.out header. */ int -_bfd_xcoff_sizeof_headers (abfd, reloc) - bfd *abfd; - bfd_boolean reloc ATTRIBUTE_UNUSED; +_bfd_xcoff_sizeof_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { int size; @@ -4179,6 +4192,7 @@ const bfd_target rs6000coff_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, _bfd_xcoff_reloc_type_lookup, + _bfd_xcoff_reloc_name_lookup, /* Write */ coff_set_arch_mach, @@ -4429,6 +4443,7 @@ const bfd_target pmac_xcoff_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, _bfd_xcoff_reloc_type_lookup, + _bfd_xcoff_reloc_name_lookup, /* Write */ coff_set_arch_mach, diff --git a/contrib/binutils/bfd/coff-sparc.c b/contrib/binutils/bfd/coff-sparc.c index 0236f525e66..236c7bfd4e3 100644 --- a/contrib/binutils/bfd/coff-sparc.c +++ b/contrib/binutils/bfd/coff-sparc.c @@ -1,6 +1,6 @@ /* BFD back-end for Sparc COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, - 2002, 2003, 2005 Free Software Foundation, Inc. + 2002, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/sparc.h" #include "coff/internal.h" @@ -158,6 +158,24 @@ coff_sparc_reloc_type_lookup (abfd, code) } #define coff_bfd_reloc_type_lookup coff_sparc_reloc_type_lookup +static reloc_howto_type * +coff_sparc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (coff_sparc_howto_table) + / sizeof (coff_sparc_howto_table[0])); + i++) + if (coff_sparc_howto_table[i].name != NULL + && strcasecmp (coff_sparc_howto_table[i].name, r_name) == 0) + return &coff_sparc_howto_table[i]; + + return NULL; +} +#define coff_bfd_reloc_name_lookup coff_sparc_reloc_name_lookup + static void rtype2howto (cache_ptr, dst) arelent *cache_ptr; diff --git a/contrib/binutils/bfd/coff64-rs6000.c b/contrib/binutils/bfd/coff64-rs6000.c index e0aa87ef677..5e0804f00fc 100644 --- a/contrib/binutils/bfd/coff64-rs6000.c +++ b/contrib/binutils/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -127,7 +127,7 @@ extern bfd_boolean _bfd_xcoff_write_armap extern bfd_boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); extern int _bfd_xcoff_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + PARAMS ((bfd *, struct bfd_link_info *)); extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); extern unsigned int _bfd_xcoff_swap_sym_out @@ -161,7 +161,7 @@ static const bfd_target *xcoff64_archive_p static bfd *xcoff64_openr_next_archived_file PARAMS ((bfd *, bfd *)); static int xcoff64_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + PARAMS ((bfd *, struct bfd_link_info *)); static asection *xcoff64_create_csect_from_smclas PARAMS ((bfd *, union internal_auxent *, const char *)); static bfd_boolean xcoff64_is_lineno_count_overflow @@ -237,6 +237,7 @@ bfd_boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define coff_bfd_reloc_type_lookup xcoff64_reloc_type_lookup +#define coff_bfd_reloc_name_lookup xcoff64_reloc_name_lookup #ifdef AIX_CORE extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); @@ -1843,6 +1844,22 @@ xcoff64_reloc_type_lookup (abfd, code) } } +static reloc_howto_type * +xcoff64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (xcoff64_howto_table) / sizeof (xcoff64_howto_table[0]); + i++) + if (xcoff64_howto_table[i].name != NULL + && strcasecmp (xcoff64_howto_table[i].name, r_name) == 0) + return &xcoff64_howto_table[i]; + + return NULL; +} + /* Read in the armap of an XCOFF archive. */ static bfd_boolean @@ -2056,9 +2073,8 @@ xcoff64_openr_next_archived_file (archive, last_file) always uses an a.out header. */ static int -xcoff64_sizeof_headers (abfd, reloc) - bfd *abfd; - bfd_boolean reloc ATTRIBUTE_UNUSED; +xcoff64_sizeof_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { int size; @@ -2726,6 +2742,7 @@ const bfd_target rs6000coff64_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, xcoff64_reloc_type_lookup, + xcoff64_reloc_name_lookup, /* Write */ coff_set_arch_mach, @@ -2977,6 +2994,7 @@ const bfd_target aix5coff64_vec = coff_get_reloc_upper_bound, coff_canonicalize_reloc, xcoff64_reloc_type_lookup, + xcoff64_reloc_name_lookup, /* Write */ coff_set_arch_mach, diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h index 256732c314d..a2aac5f63b4 100644 --- a/contrib/binutils/bfd/coffcode.h +++ b/contrib/binutils/bfd/coffcode.h @@ -1,6 +1,6 @@ /* Support for the generic parts of most COFF variants, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -427,7 +427,7 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) styp_flags = STYP_LIT; #endif /* _LIT */ } - else if (!strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1)) + else if (CONST_STRNEQ (sec_name, DOT_DEBUG)) { /* Handle the XCOFF debug section and DWARF2 debug sections. */ if (!sec_name[6]) @@ -435,12 +435,12 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) else styp_flags = STYP_DEBUG_INFO; } - else if (!strncmp (sec_name, ".stab", 5)) + else if (CONST_STRNEQ (sec_name, ".stab")) { styp_flags = STYP_DEBUG_INFO; } #ifdef COFF_LONG_SECTION_NAMES - else if (!strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1)) + else if (CONST_STRNEQ (sec_name, GNU_LINKONCE_WI)) { styp_flags = STYP_DEBUG_INFO; } @@ -529,8 +529,8 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) but there are more IMAGE_SCN_* flags. */ /* FIXME: There is no gas syntax to specify the debug section flag. */ - if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0 - || strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0) + if (CONST_STRNEQ (sec_name, DOT_DEBUG) + || CONST_STRNEQ (sec_name, GNU_LINKONCE_WI)) sec_flags = SEC_DEBUGGING; /* skip LOAD */ @@ -674,14 +674,14 @@ styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED, #endif sec_flags |= SEC_ALLOC; } - else if (strncmp (name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0 + else if (CONST_STRNEQ (name, DOT_DEBUG) #ifdef _COMMENT || strcmp (name, _COMMENT) == 0 #endif #ifdef COFF_LONG_SECTION_NAMES - || strncmp (name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0 + || CONST_STRNEQ (name, GNU_LINKONCE_WI) #endif - || strncmp (name, ".stab", 5) == 0) + || CONST_STRNEQ (name, ".stab")) { #ifdef COFF_PAGE_SIZE sec_flags |= SEC_DEBUGGING; @@ -715,7 +715,7 @@ styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED, The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + if (CONST_STRNEQ (name, ".gnu.linkonce")) sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; #endif @@ -1071,7 +1071,7 @@ styp_to_sec_flags (bfd *abfd, /* The MS PE spec sets the DISCARDABLE flag on .reloc sections but we do not want them to be labelled as debug section, since then strip would remove them. */ - if (strncmp (name, ".reloc", sizeof ".reloc" - 1) != 0) + if (! CONST_STRNEQ (name, ".reloc")) sec_flags |= SEC_DEBUGGING; break; case IMAGE_SCN_MEM_SHARED: @@ -1126,7 +1126,7 @@ styp_to_sec_flags (bfd *abfd, The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + if (CONST_STRNEQ (name, ".gnu.linkonce")) sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; #endif @@ -1546,6 +1546,9 @@ static const unsigned int coff_section_alignment_table_size = static bfd_boolean coff_new_section_hook (bfd * abfd, asection * section) { + combined_entry_type *native; + bfd_size_type amt; + section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER; #ifdef RS6000COFF_C @@ -1557,34 +1560,31 @@ coff_new_section_hook (bfd * abfd, asection * section) section->alignment_power = bfd_xcoff_data_align_power (abfd); #endif - /* PR binutils/2724: Only real sections have a symbol that - has the coff_symbol_type structure allocated for it. */ - if (! bfd_is_const_section (section)) - { - combined_entry_type *native; - bfd_size_type amt; + /* Set up the section symbol. */ + if (!_bfd_generic_new_section_hook (abfd, section)) + return FALSE; - /* Allocate aux records for section symbols, to store size and - related info. + /* Allocate aux records for section symbols, to store size and + related info. - @@ The 10 is a guess at a plausible maximum number of aux entries - (but shouldn't be a constant). */ - amt = sizeof (combined_entry_type) * 10; - native = bfd_zalloc (abfd, amt); - if (native == NULL) - return FALSE; + @@ The 10 is a guess at a plausible maximum number of aux entries + (but shouldn't be a constant). */ + amt = sizeof (combined_entry_type) * 10; + native = bfd_zalloc (abfd, amt); + if (native == NULL) + return FALSE; - /* We don't need to set up n_name, n_value, or n_scnum in the native - symbol information, since they'll be overridden by the BFD symbol - anyhow. However, we do need to set the type and storage class, - in case this symbol winds up getting written out. The value 0 - for n_numaux is already correct. */ - native->u.syment.n_type = T_NULL; - native->u.syment.n_sclass = C_STAT; + /* We don't need to set up n_name, n_value, or n_scnum in the native + symbol information, since they'll be overridden by the BFD symbol + anyhow. However, we do need to set the type and storage class, + in case this symbol winds up getting written out. The value 0 + for n_numaux is already correct. */ + + native->u.syment.n_type = T_NULL; + native->u.syment.n_sclass = C_STAT; + + coffsymbol (section->symbol)->native = native; - coffsymbol (section->symbol)->native = native; - } - coff_set_custom_section_alignment (abfd, section, coff_section_alignment_table, coff_section_alignment_table_size); @@ -1882,11 +1882,17 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr) #ifdef I386MAGIC case I386MAGIC: case I386PTXMAGIC: - case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler */ - case LYNXCOFFMAGIC: /* shadows the m68k Lynx number below, sigh */ + case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler. */ + case LYNXCOFFMAGIC: /* Shadows the m68k Lynx number below, sigh. */ arch = bfd_arch_i386; break; #endif +#ifdef AMD64MAGIC + case AMD64MAGIC: + arch = bfd_arch_i386; + machine = bfd_mach_x86_64; + break; +#endif #ifdef IA64MAGIC case IA64MAGIC: arch = bfd_arch_ia64; @@ -2532,11 +2538,15 @@ coff_write_relocs (bfd * abfd, int first_undef) else { n.r_symndx = get_index ((*(q->sym_ptr_ptr))); - /* Take notice if the symbol reloc points to a symbol - we don't have in our symbol table. What should we - do for this?? */ + /* Check to see if the symbol reloc points to a symbol + we don't have in our symbol table. */ if (n.r_symndx > obj_conv_table_size (abfd)) - abort (); + { + bfd_set_error (bfd_error_bad_value); + _bfd_error_handler (_("%B: reloc against a non-existant symbol index: %ld"), + abfd, n.r_symndx); + return FALSE; + } } } @@ -2717,12 +2727,17 @@ coff_set_flags (bfd * abfd, return TRUE; #endif -#ifdef I386MAGIC +#if defined(I386MAGIC) || defined(AMD64MAGIC) case bfd_arch_i386: +#if defined(I386MAGIC) *magicp = I386MAGIC; -#ifdef LYNXOS +#endif +#if defined LYNXOS /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; +#endif +#if defined AMD64MAGIC + *magicp = AMD64MAGIC; #endif return TRUE; #endif @@ -3755,6 +3770,7 @@ coff_write_object_contents (bfd * abfd) internal_f.f_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE; #endif +#ifndef COFF_WITH_pex64 #ifdef COFF_WITH_PE internal_f.f_flags |= IMAGE_FILE_32BIT_MACHINE; #else @@ -3763,6 +3779,7 @@ coff_write_object_contents (bfd * abfd) else internal_f.f_flags |= F_AR32W; #endif +#endif #ifdef TI_TARGET_ID /* Target id is used in TI COFF v1 and later; COFF0 won't use this field, @@ -3856,16 +3873,18 @@ coff_write_object_contents (bfd * abfd) #if defined(I386) #define __A_MAGIC_SET__ -#if defined(LYNXOS) +#if defined LYNXOS internal_a.magic = LYNXCOFFMAGIC; -#else /* LYNXOS */ +#elif defined AMD64 + internal_a.magic = IMAGE_NT_OPTIONAL_HDR64_MAGIC; +#else internal_a.magic = ZMAGIC; -#endif /* LYNXOS */ +#endif #endif /* I386 */ #if defined(IA64) #define __A_MAGIC_SET__ - internal_a.magic = ZMAGIC; + internal_a.magic = PE32PMAGIC; #endif /* IA64 */ #if defined(SPARC) @@ -4851,6 +4870,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols) cache_ptr = reloc_cache + idx; src = native_relocs + idx; + dst.r_offset = 0; coff_swap_reloc_in (abfd, src, &dst); #ifdef RELOC_PROCESSING @@ -4931,6 +4951,7 @@ coff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, { arelent genrel; + genrel.howto = NULL; RTYPE2HOWTO (&genrel, rel); return genrel.howto; } @@ -5314,6 +5335,9 @@ static const bfd_coff_backend_data ticoff1_swap_table = #ifndef coff_bfd_reloc_type_lookup #define coff_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #endif +#ifndef coff_bfd_reloc_name_lookup +#define coff_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup +#endif #ifndef coff_bfd_get_relocated_section_contents #define coff_bfd_get_relocated_section_contents \ diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c index c541e6a590e..8884a7f14db 100644 --- a/contrib/binutils/bfd/coffgen.c +++ b/contrib/binutils/bfd/coffgen.c @@ -1,6 +1,6 @@ /* Support for the generic parts of COFF, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -37,8 +37,8 @@ Those functions may not use any COFF specific information, such as coff_data (abfd). */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/internal.h" #include "libcoff.h" @@ -1901,7 +1901,16 @@ coff_print_symbol (bfd *abfd, combined->u.syment.n_type, combined->u.syment.n_sclass, combined->u.syment.n_numaux); - fprintf_vma (file, val); +#ifdef BFD64 + /* fprintf_vma() on a 64-bit enabled host will always print a 64-bit + value, but really we want to display the address in the target's + address size. Since we do not have a field in the bfd structure + to tell us this, we take a guess, based on the target's name. */ + if (strstr (bfd_get_target (abfd), "64") == NULL) + fprintf (file, "%08lx", (unsigned long) (val & 0xffffffff)); + else +#endif + fprintf_vma (file, val); fprintf (file, " %s", symbol->name); for (aux = 0; aux < combined->u.syment.n_numaux; aux++) @@ -2238,11 +2247,11 @@ coff_find_inliner_info (bfd *abfd, } int -coff_sizeof_headers (bfd *abfd, bfd_boolean reloc) +coff_sizeof_headers (bfd *abfd, struct bfd_link_info *info) { size_t size; - if (! reloc) + if (!info->relocatable) size = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd); else size = bfd_coff_filhsz (abfd); diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c index a1f6684bb61..1ed7107fc1d 100644 --- a/contrib/binutils/bfd/cofflink.c +++ b/contrib/binutils/bfd/cofflink.c @@ -1,6 +1,6 @@ /* COFF specific linker code. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -21,8 +21,8 @@ /* This file contains the COFF backend linker code. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -232,7 +232,7 @@ coff_link_check_ar_symbols (bfd *abfd, /* Auto import. */ if (!h && info->pei386_auto_import - && !strncmp (name,"__imp_", 6)) + && CONST_STRNEQ (name, "__imp_")) h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); /* We are only interested in symbols that are currently @@ -439,7 +439,7 @@ coff_link_add_symbols (bfd *abfd, || classification == COFF_SYMBOL_PE_SECTION) && coff_section_data (abfd, section) != NULL && coff_section_data (abfd, section)->comdat != NULL - && strncmp (name, "??_", 3) == 0 + && CONST_STRNEQ (name, "??_") && strcmp (name, coff_section_data (abfd, section)->comdat->name) == 0) { if (*sym_hash == NULL) @@ -583,7 +583,7 @@ coff_link_add_symbols (bfd *abfd, asection *stab; for (stab = abfd->sections; stab; stab = stab->next) - if (strncmp (".stab", stab->name, 5) == 0 + if (CONST_STRNEQ (stab->name, ".stab") && (!stab->name[5] || (stab->name[5] == '.' && ISDIGIT (stab->name[6])))) { @@ -1232,16 +1232,14 @@ process_embedded_commands (bfd *output_bfd, s++; continue; } - if (strncmp (s, "-attr", 5) == 0) + if (CONST_STRNEQ (s, "-attr")) { char *name; char *attribs; asection *asec; int loop = 1; int had_write = 0; - int had_read = 0; int had_exec= 0; - int had_shared= 0; s += 5; s = get_name (s, &name); @@ -1255,10 +1253,8 @@ process_embedded_commands (bfd *output_bfd, had_write = 1; break; case 'R': - had_read = 1; break; case 'S': - had_shared = 1; break; case 'X': had_exec = 1; @@ -1276,11 +1272,11 @@ process_embedded_commands (bfd *output_bfd, asec->flags |= SEC_READONLY; } } - else if (strncmp (s,"-heap", 5) == 0) - s = dores_com (s+5, output_bfd, 1); + else if (CONST_STRNEQ (s, "-heap")) + s = dores_com (s + 5, output_bfd, 1); - else if (strncmp (s,"-stack", 6) == 0) - s = dores_com (s+6, output_bfd, 0); + else if (CONST_STRNEQ (s, "-stack")) + s = dores_com (s + 6, output_bfd, 0); else s++; @@ -1925,6 +1921,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) generate two symbols with the same name, but only one will have aux entries. */ BFD_ASSERT (isymp->n_numaux == 0 + || h->numaux == 0 || h->numaux == isymp->n_numaux); } @@ -1940,7 +1937,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) union internal_auxent aux; union internal_auxent *auxp; - if (h != NULL) + if (h != NULL && h->aux != NULL && (h->numaux > i)) auxp = h->aux + i; else { diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd index b112f4b656f..92539963a6e 100755 --- a/contrib/binutils/bfd/config.bfd +++ b/contrib/binutils/bfd/config.bfd @@ -31,12 +31,7 @@ targ_underscore=no # Catch obsolete configurations. case $targ in - m68*-apple-aux* | \ - m68*-apollo-* | \ - m68*-bull-sysv* | \ - m68*-*-rtemscoff* | \ - i960-*-rtems* | \ - or32-*-rtems* | \ + maxq-*-coff | \ null) if test "x$enable_obsolete" != xyes; then echo "*** Configuration $targ is obsolete." >&2 @@ -48,6 +43,12 @@ case $targ in esac case $targ in + m68*-apple-aux* | \ + m68*-apollo-* | \ + m68*-bull-sysv* | \ + m68*-*-rtemscoff* | \ + i960-*-rtems* | \ + or32-*-rtems* | \ m68*-*-lynxos* | \ sparc-*-lynxos* | \ vax-*-vms* | \ @@ -75,9 +76,11 @@ bfin*) targ_archs=bfd_bfin_arch ;; c30*) targ_archs=bfd_tic30_arch ;; c4x*) targ_archs=bfd_tic4x_arch ;; c54x*) targ_archs=bfd_tic54x_arch ;; +cr16*) targ_archs=bfd_cr16_arch ;; crisv32) targ_archs=bfd_cris_arch ;; crx*) targ_archs=bfd_crx_arch ;; dlx*) targ_archs=bfd_dlx_arch ;; +fido*) targ_archs=bfd_m68k_arch ;; hppa*) targ_archs=bfd_hppa_arch ;; i[3-7]86) targ_archs=bfd_i386_arch ;; i370) targ_archs=bfd_i370_arch ;; @@ -95,10 +98,11 @@ rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; s390*) targ_archs=bfd_s390_arch ;; sh*) targ_archs=bfd_sh_arch ;; sparc*) targ_archs=bfd_sparc_arch ;; +spu*) targ_archs=bfd_spu_arch ;; strongarm*) targ_archs=bfd_arm_arch ;; thumb*) targ_archs=bfd_arm_arch ;; v850*) targ_archs=bfd_v850_arch ;; -x86_64) targ_archs=bfd_i386_arch ;; +x86_64*) targ_archs=bfd_i386_arch ;; xscale*) targ_archs=bfd_arm_arch ;; xtensa*) targ_archs=bfd_xtensa_arch ;; z80|r800) targ_archs=bfd_z80_arch ;; @@ -137,6 +141,7 @@ case "${targ}" in alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_alpha_freebsd_vec targ_selvecs=ecoffalpha_little_vec + want64=true # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case "${targ}" in alpha*-*-freebsd3* | alpha*-*-freebsd4 | alpha*-*-freebsd4.0*) @@ -146,36 +151,49 @@ case "${targ}" in alpha*-*-netbsd* | alpha*-*-openbsd*) targ_defvec=bfd_elf64_alpha_vec targ_selvecs=ecoffalpha_little_vec + want64=true ;; alpha*-*-netware*) targ_defvec=ecoffalpha_little_vec targ_selvecs=nlm32_alpha_vec + want64=true ;; alpha*-*-linuxecoff*) targ_defvec=ecoffalpha_little_vec targ_selvecs=bfd_elf64_alpha_vec + want64=true ;; alpha*-*-linux-* | alpha*-*-elf*) targ_defvec=bfd_elf64_alpha_vec targ_selvecs=ecoffalpha_little_vec + want64=true ;; alpha*-*-*vms*) targ_defvec=vms_alpha_vec + want64=true ;; alpha*-*-*) targ_defvec=ecoffalpha_little_vec + want64=true ;; ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_ia64_little_vec targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + want64=true ;; ia64*-*-hpux*) targ_defvec=bfd_elf32_ia64_hpux_big_vec targ_selvecs="bfd_elf64_ia64_hpux_big_vec" + want64=true ;; - sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu) + sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu) + targ_defvec=bfd_elf64_sparc_freebsd_vec + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + ;; + sparc64-*-netbsd* | sparc64-*-openbsd*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + want64=true ;; #endif /* BFD64 */ @@ -215,8 +233,8 @@ case "${targ}" in targ_cflags=-DARM_COFF_BUGFIX ;; arm-wince-pe | arm-*-wince) - targ_defvec=armpe_little_vec - targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec" + targ_defvec=arm_wince_pe_little_vec + targ_selvecs="arm_wince_pe_little_vec arm_wince_pe_big_vec arm_wince_pei_little_vec arm_wince_pei_big_vec" targ_underscore=no targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX" ;; @@ -340,6 +358,11 @@ case "${targ}" in targ_underscore=yes ;; + cr16-*-elf*) + targ_defvec=bfd_elf32_cr16_vec + targ_underscore=yes + ;; + cr16c-*-elf*) targ_defvec=bfd_elf32_cr16c_vec targ_underscore=yes @@ -369,6 +392,11 @@ case "${targ}" in targ_defvec=bfd_elf32_d30v_vec ;; + fido-*-elf* ) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs="m68kcoff_vec ieee_vec" + ;; + fr30-*-elf) targ_defvec=bfd_elf32_fr30_vec ;; @@ -407,11 +435,13 @@ case "${targ}" in hppa*64*-*-linux-*) targ_defvec=bfd_elf64_hppa_linux_vec targ_selvecs=bfd_elf64_hppa_vec + want64=true ;; hppa*64*-*-hpux11*) targ_defvec=bfd_elf64_hppa_vec targ_selvecs=bfd_elf64_hppa_linux_vec targ_cflags=-DHPUX_LARGE_AR_IDS + want64=true ;; #endif @@ -553,18 +583,28 @@ case "${targ}" in x86_64-*-elf*) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386coff_vec" + want64=true ;; x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) - targ_defvec=bfd_elf64_x86_64_vec - targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" + targ_defvec=bfd_elf64_x86_64_freebsd_vec + targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec" + want64=true ;; x86_64-*-netbsd* | x86_64-*-openbsd*) targ_defvec=bfd_elf64_x86_64_vec - targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec" + want64=true ;; x86_64-*-linux-*) targ_defvec=bfd_elf64_x86_64_vec - targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec" + want64=true + ;; + x86_64-*-mingw*) + targ_defvec=x86_64pe_vec + targ_selvecs="x86_64pe_vec x86_64pei_vec x86_64coff_vec bfd_elf64_x86_64_vec" + want64=true + targ_underscore=yes ;; #endif i[3-7]86-*-lynxos*) @@ -644,7 +684,7 @@ case "${targ}" in targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec" targ_underscore=yes ;; - i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*) + i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv*) targ_defvec=icoff_little_vec targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec" targ_underscore=yes @@ -675,17 +715,14 @@ case "${targ}" in targ_defvec=bfd_elf32_m32rlelin_vec targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec" ;; - m32r*-*-linux*) targ_defvec=bfd_elf32_m32rlin_vec targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec" ;; - m32r*le-*-*) targ_defvec=bfd_elf32_m32rle_vec targ_selvecs="bfd_elf32_m32r_vec bfd_elf32_m32rle_vec" ;; - m32r-*-*) targ_defvec=bfd_elf32_m32r_vec ;; @@ -699,13 +736,6 @@ case "${targ}" in targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec" ;; - m68*-apollo-*) - targ_defvec=apollocoff_vec - ;; - m68*-bull-sysv*) - targ_defvec=m68kcoffun_vec - targ_underscore=yes - ;; m68*-motorola-sysv*) targ_defvec=m68ksysvcoff_vec ;; @@ -721,10 +751,6 @@ case "${targ}" in targ_selvecs="cisco_core_big_vec ieee_vec" targ_underscore=yes ;; - m68*-*-rtemscoff*) - targ_defvec=m68kcoff_vec - targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" - ;; m68*-*-elf* | m68*-*-sysv4* | m68*-*-uclinux*) targ_defvec=bfd_elf32_m68k_vec targ_selvecs="m68kcoff_vec ieee_vec" @@ -788,9 +814,6 @@ case "${targ}" in targ_defvec=bfd_elf32_m68k_vec targ_selvecs=m68kcoff_vec ;; - m68*-apple-aux*) - targ_defvec=m68kaux_coff_vec - ;; m68*-*-psos*) targ_defvec=bfd_elf32_m68k_vec targ_selvecs=ieee_vec @@ -827,6 +850,11 @@ case "${targ}" in targ_selvecs="mcore_pe_big_vec mcore_pe_little_vec mcore_pei_big_vec mcore_pei_little_vec" ;; + mep-*-elf) + targ_defvec=bfd_elf32_mep_vec + targ_selvecs=bfd_elf32_mep_little_vec + ;; + mips*-big-*) targ_defvec=ecoff_big_vec targ_selvecs=ecoff_little_vec @@ -855,6 +883,7 @@ case "${targ}" in mips*-*-irix6*) targ_defvec=bfd_elf32_nbigmips_vec targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + want64=true ;; #endif mips*-*-irix5*) @@ -881,12 +910,24 @@ case "${targ}" in mips*el-*-vxworks*) targ_defvec=bfd_elf32_littlemips_vxworks_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + want64=true ;; mips*-*-vxworks*) targ_defvec=bfd_elf32_bigmips_vxworks_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + want64=true ;; #endif + mips*el-sde-elf*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true + ;; + mips*-sde-elf*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true + ;; mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*) targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" @@ -903,6 +944,7 @@ case "${targ}" in mips64*-*-openbsd*) targ_defvec=bfd_elf64_tradbigmips_vec targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #endif mips*el-*-openbsd*) @@ -917,10 +959,12 @@ case "${targ}" in mips64*el-*-linux*) targ_defvec=bfd_elf32_ntradlittlemips_vec targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" + want64=true ;; mips64*-*-linux*) targ_defvec=bfd_elf32_ntradbigmips_vec targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #endif mips*el-*-linux*) @@ -937,6 +981,7 @@ case "${targ}" in mmix-*-*) targ_defvec=bfd_elf64_mmix_vec targ_selvecs=bfd_mmo_vec + want64=true ;; #endif mn10200-*-*) @@ -969,7 +1014,7 @@ case "${targ}" in targ_defvec=bfd_elf32_openrisc_vec ;; - or32-*-coff | or32-*-rtems* ) + or32-*-coff) targ_defvec=or32coff_big_vec targ_underscore=yes ;; @@ -1034,15 +1079,18 @@ case "${targ}" in powerpc64-*-aix*) targ_defvec=rs6000coff64_vec targ_selvecs=rs6000coff_vec + want64=true ;; powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ powerpc64-*-*bsd*) targ_defvec=bfd_elf64_powerpc_vec targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" + want64=true ;; powerpc64le-*-elf* | powerpcle-*-elf64*) targ_defvec=bfd_elf64_powerpcle_vec targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec" + want64=true ;; #endif powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ @@ -1107,40 +1155,49 @@ case "${targ}" in s390x-*-linux*) targ_defvec=bfd_elf64_s390_vec targ_selvecs=bfd_elf32_s390_vec + want64=true ;; s390x-*-tpf*) targ_defvec=bfd_elf64_s390_vec + want64=true ;; #endif + score*-*-elf*) + targ_defvec=bfd_elf32_bigscore_vec + targ_selvecs=bfd_elf32_littlescore_vec + ;; + #ifdef BFD64 sh64l*-*-elf*) targ_defvec=bfd_elf32_sh64l_vec targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec" targ_underscore=yes + want64=true ;; sh64-*-elf*) targ_defvec=bfd_elf32_sh64_vec targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec" targ_underscore=yes + want64=true ;; sh64eb-*-linux*) targ_defvec=bfd_elf32_sh64blin_vec targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec" + want64=true ;; sh64-*-linux*) targ_defvec=bfd_elf32_sh64lin_vec targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec" + want64=true + ;; + sh-*-linux*) + targ_defvec=bfd_elf32_shblin_vec + targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" + want64=true ;; #endif /* BFD64 */ - sh-*-linux*) - targ_defvec=bfd_elf32_shblin_vec - targ_selvecs=bfd_elf32_shlin_vec -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" -#endif - ;; sh*eb-*-linux*) targ_defvec=bfd_elf32_shblin_vec targ_selvecs=bfd_elf32_shlin_vec @@ -1150,40 +1207,49 @@ case "${targ}" in targ_selvecs=bfd_elf32_shblin_vec ;; + sh-*-uclinux* | sh[12]-*-uclinux*) + targ_defvec=bfd_elf32_sh_vec + targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_shlin_vec" +#ifdef BFD64 + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" +#endif + ;; + #ifdef BFD64 sh5le-*-netbsd*) targ_defvec=bfd_elf32_sh64lnbsd_vec targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; sh5-*-netbsd*) targ_defvec=bfd_elf32_sh64nbsd_vec targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; sh64le-*-netbsd*) targ_defvec=bfd_elf64_sh64lnbsd_vec targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; sh64-*-netbsd*) targ_defvec=bfd_elf64_sh64nbsd_vec targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf32_shnbsd_vec bfd_elf32_shlnbsd_vec" + want64=true ;; -#endif sh*l*-*-netbsdelf*) targ_defvec=bfd_elf32_shlnbsd_vec - targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" -#endif + targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" + want64=true ;; sh-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec - targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" -#endif + targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" + want64=true ;; +#endif + sh*-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" @@ -1193,40 +1259,48 @@ case "${targ}" in targ_selvecs="shlcoff_vec shlcoff_small_vec" targ_underscore=yes ;; + +#ifdef BFD64 shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*) targ_defvec=bfd_elf32_shl_vec - targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" -#endif + targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" targ_underscore=yes + want64=true ;; +#endif + sh-*-rtemscoff*) targ_defvec=shcoff_vec targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes ;; + +#ifdef BFD64 sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*) targ_defvec=bfd_elf32_sh_vec - targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" -#ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" -#endif + targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" targ_underscore=yes + want64=true ;; +#endif + sh-*-nto*) targ_defvec=bfd_elf32_sh_vec targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes ;; + sh*-*-openbsd*) + targ_defvec=bfd_elf32_shlnbsd_vec + targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" + ;; sh-*-pe) targ_defvec=shlpe_vec targ_selvecs="shlpe_vec shlpei_vec" targ_underscore=yes ;; sh-*-vxworks) - targ_defvec=bfd_elf32_sh_vec - targ_selvecs="bfd_elf32_shl_vec" + targ_defvec=bfd_elf32_shvxworks_vec + targ_selvecs="bfd_elf32_shlvxworks_vec" # FIXME None of the following are actually used on this target, but # they're necessary for coff-sh.c (which is unconditionally used) to be # compiled correctly. @@ -1287,6 +1361,7 @@ case "${targ}" in sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*) targ_defvec=bfd_elf32_sparc_vec targ_selvecs="bfd_elf64_sparc_vec sunos_big_vec" + want64=true ;; #endif sparc-*-sysv4*) @@ -1304,14 +1379,17 @@ case "${targ}" in sparc64-*-aout*) targ_defvec=sunos_big_vec targ_underscore=yes + want64=true ;; sparc64-*-linux-*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" + want64=true ;; sparc64-*-elf*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs=bfd_elf32_sparc_vec + want64=true ;; #endif /* BFD64 */ sparc*-*-coff*) @@ -1326,6 +1404,10 @@ case "${targ}" in targ_underscore=yes ;; + spu-*-elf) + targ_defvec=bfd_elf32_spu_vec + ;; + #if HAVE_host_aout_vec tahoe-*-*) targ_defvec=host_aout_vec diff --git a/contrib/binutils/bfd/config.in b/contrib/binutils/bfd/config.in index 6c738257d98..aa91dd69888 100644 --- a/contrib/binutils/bfd/config.in +++ b/contrib/binutils/bfd/config.in @@ -1,29 +1,9 @@ /* config.in. Generated from configure.in by autoheader. */ -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* 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 -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the 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 `basename', and to 0 if you don't. */ #undef HAVE_DECL_BASENAME @@ -83,6 +63,9 @@ */ #undef HAVE_DIRENT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL @@ -107,33 +90,18 @@ /* Define to 1 if you have the `ftello64' function. */ #undef HAVE_FTELLO64 -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* 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 - /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define to 1 if you have the 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 header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - /* Define if has lwpstatus_t. */ #undef HAVE_LWPSTATUS_T @@ -149,9 +117,6 @@ /* Define to 1 if you have the `madvise' function. */ #undef HAVE_MADVISE -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -161,15 +126,9 @@ /* Define to 1 if you have the `mprotect' function. */ #undef HAVE_MPROTECT -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NL_TYPES_H - /* Define if has prpsinfo32_t. */ #undef HAVE_PRPSINFO32_T @@ -200,21 +159,12 @@ /* Define if has pstatus_t. */ #undef HAVE_PSTATUS_T -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - /* Define if has pxstatus_t. */ #undef HAVE_PXSTATUS_T -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - /* Define to 1 if you have the `setitimer' function. */ #undef HAVE_SETITIMER -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -224,15 +174,6 @@ /* Define to 1 if you have the 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 header file. */ #undef HAVE_STRINGS_H @@ -259,9 +200,6 @@ */ #undef HAVE_SYS_NDIR_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCFS_H @@ -280,20 +218,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the header file. */ -#undef HAVE_VALUES_H - /* Define if has win32_pstatus_t. */ #undef HAVE_WIN32_PSTATUS_T -/* 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 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 @@ -313,6 +243,12 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* The size of a `char', as computed by sizeof. */ +#undef SIZEOF_CHAR + +/* The size of a `int', as computed by sizeof. */ +#undef SIZEOF_INT + /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG @@ -322,13 +258,11 @@ /* The size of a `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION +/* The size of a `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of a `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -358,18 +292,3 @@ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif - -/* 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 does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure index af6c22b5a66..3cff895158f 100755 --- a/contrib/binutils/bfd/configure +++ b/contrib/binutils/bfd/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 #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 AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir 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 HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults 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 AR ac_ct_AR RANLIB ac_ct_RANLIB LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP DEBUGDIR PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -852,16 +1001,19 @@ 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=no - --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=no] + --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-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-targets alternative target configurations --enable-commonbfdlib build shared BFD/opcodes/libiberty library --enable-secureplt Default to creating read-only plt entries - --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 --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-install-libbfd controls installation of libbfd and related headers @@ -870,10 +1022,16 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=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-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-mmap try using mmap for BFD input files if available - --with-included-gettext use the GNU gettext library included here + --with-separate-debug-dir=DIR + Look for global separate debug info in DIR + [default=LIBDIR/debug] + --with-pkgversion=PKG Use PKG in the version string in place of "GNU + Binutils" + --with-bugurl=URL Direct users to URL to report a bug Some influential environment variables: CC C compiler command @@ -2836,7 +2994,7 @@ fi # Define the identity of the package. PACKAGE=bfd - VERSION=2.17 + VERSION=2.17.50 cat >>confdefs.h <<_ACEOF @@ -3240,1302 +3398,33 @@ fi 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=no -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 &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 <&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 <&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 4035 "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" - ;; + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; *) - # `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" + 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; -} | - 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-64-bit-bfd or --disable-64-bit-bfd was given. -if test "${enable_64_bit_bfd+set}" = set; then - enableval="$enable_64_bit_bfd" - case "${enableval}" in - yes) want64=true ;; - no) want64=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 -echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - want64=false -fi; # 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; -# Check whether --with-mmap or --without-mmap was given. -if test "${with_mmap+set}" = set; then - withval="$with_mmap" - case "${withval}" in - yes) want_mmap=true ;; - no) want_mmap=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${withval} for BFD with-mmap option" >&5 -echo "$as_me: error: bad value ${withval} for BFD with-mmap option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - want_mmap=false -fi; -# Check whether --enable-secureplt or --disable-secureplt was given. -if test "${enable_secureplt+set}" = set; then - enableval="$enable_secureplt" - case "${enableval}" in - yes) use_secureplt=true ;; - no) use_secureplt=false ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for secureplt option" >&5 -echo "$as_me: error: bad value ${enableval} for secureplt option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - use_secureplt=false -fi; if test $use_secureplt = true; then - -cat >>confdefs.h <<\_ACEOF -#define USE_SECUREPLT 1 -_ACEOF - -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 + enable_shared=no 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 - -echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi; - echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - case ${build_alias} in - "") build_noncanonical=${build} ;; - *) build_noncanonical=${build_alias} ;; -esac - - case ${host_alias} in - "") host_noncanonical=${build_noncanonical} ;; - *) host_noncanonical=${host_alias} ;; -esac - - case ${target_alias} in - "") target_noncanonical=${host_noncanonical} ;; - *) target_noncanonical=${target_alias} ;; -esac - -echo "$as_me:$LINENO: checking whether to install libbfd" >&5 -echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6 - # Check whether --enable-install-libbfd or --disable-install-libbfd was given. -if test "${enable_install_libbfd+set}" = set; then - enableval="$enable_install_libbfd" - install_libbfd_p=$enableval -else - if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then - install_libbfd_p=yes - else - install_libbfd_p=no - fi -fi; - echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 -echo "${ECHO_T}$install_libbfd_p" >&6 - - -if test $install_libbfd_p = yes; then - INSTALL_LIBBFD_TRUE= - INSTALL_LIBBFD_FALSE='#' -else - INSTALL_LIBBFD_TRUE='#' - INSTALL_LIBBFD_FALSE= -fi - - # Need _noncanonical variables for this. - - - - - # libbfd.a is a host library containing target dependent code - bfdlibdir='$(libdir)' - bfdincludedir='$(includedir)' - if test "${host}" != "${target}"; then - bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' - bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' - fi -host64=false -target64=false -bfd_default_target_size=32 -# host stuff: ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5273,7 +4162,1149 @@ _ACEOF -ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi" + + +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-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 + 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 &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 &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_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_DUMPBIN="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +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 "$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_ac_ct_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_DUMPBIN="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +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 "$ac_ct_DUMPBIN" && break +done +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + 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 + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:4668: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:4671: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:4674: 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:$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 + +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 +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 + 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 + 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 + + + + + + + + + + +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 + 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 + +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 +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 +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 + + 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 + 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 + +test -z "$STRIP" && STRIP=: + + + + + + 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 @@ -5354,6 +5385,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 5729 "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' @@ -5589,21 +6147,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 @@ -5770,184 +6313,6 @@ _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. */ - -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 - 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 - -_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_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -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 -_ACEOF - ;; -esac - # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -6020,9 +6385,13 @@ 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 + +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 +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 cat >conftest.$ac_ext <<_ACEOF @@ -6032,16 +6401,8 @@ 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; -} + +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -6065,1106 +6426,1378 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_off_t=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no +eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 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 - : +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 + +fi + +done + + + +# 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 + 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 off_t long +#define LT_OBJDIR "$lt_cv_objdir/" _ACEOF -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 + + + + + + + + + + + + + + + +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 - 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 - 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_size_t=yes -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_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -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 - -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - 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_working_alloca_h=yes -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 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -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 - 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 -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - 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_alloca_works=yes -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 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -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. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -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 - -_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* - -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 - 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi +*** 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 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 +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 - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 + 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 + +*** 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 + +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 - 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 (); - } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else - return (&dummy > addr) ? 1 : -1; -} - -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 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -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_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 - 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 - 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 $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= + MAGIC_CMD=: fi -else - ac_cpp_err=yes fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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:6829: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6833: \$? = $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* - 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 +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&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 +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= ;; - 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 + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; 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 "$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 - 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 + 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:7151: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7155: \$? = $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 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +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 -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 + + + +# +# 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 - 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 declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func + 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" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=yes" +if test x"$lt_prog_compiler_static_works" = xyes; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" + lt_prog_compiler_static= 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 "$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 - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -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 -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc + 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 -/* 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 -#include - -#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 -# 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 */ - -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); -} -_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_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 + 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:7256: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7260: \$? = $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 -rm -f conftest.mmap +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 - - - - - -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 "$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 -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 - 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 + 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:7311: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7315: \$? = $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* -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 +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&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= + + + +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 - ac_cpp_err=yes + need_locks=no 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: $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 + + + + + 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 ;; - 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 + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes ;; -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 + openbsd*) + with_gnu_ld=no + ;; + esac -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -fi + # 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 -done + # 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 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 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 + ;; -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 $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + 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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; } @@ -7191,84 +7824,49 @@ 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" + +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 -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 - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -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 $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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; } @@ -7295,55 +7893,277 @@ 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" + +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 -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 - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -fi -done + 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 + ;; - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then + 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 + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_STPCPY 1 -_ACEOF + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; - fi + 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 + ;; - 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 + 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. */ -#include -int -main () -{ -return LC_MESSAGES - ; - return 0; -} + 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 + + 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 @@ -7367,386 +8187,2677 @@ 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 + 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 -am_cv_val_LC_MESSAGES=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -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 + 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 + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_LC_MESSAGES 1 -_ACEOF + 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 + ;; + 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 + ;; + + *nto* | *qnx*) + ;; + + 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 + ;; + + 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=: + ;; + + 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' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + 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: checking whether NLS is requested" >&5 + +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.so + # instead of lib.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. */ + +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 + 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 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + 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 + + # 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' + ;; + +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 + ;; + +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 + ;; + +*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 + shlibpath_overrides_runpath=yes + fi + ;; + +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 + ;; + +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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + 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 +else + 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. */ + +/* 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 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_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + 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_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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 + 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. */ + +/* 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 () +{ +shl_load (); + ; + 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_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=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_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:$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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + 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_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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. */ + +/* 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 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_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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. */ + +/* 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 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_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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 +else + 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. */ + +/* 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 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_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + 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 + 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 10108 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#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 +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 + 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 10208 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#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 -fr conftest* + + +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" + ;; + 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-64-bit-bfd or --disable-64-bit-bfd was given. +if test "${enable_64_bit_bfd+set}" = set; then + enableval="$enable_64_bit_bfd" + case "${enableval}" in + yes) want64=true ;; + no) want64=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 +echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + want64=false +fi; # 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; +# Check whether --with-mmap or --without-mmap was given. +if test "${with_mmap+set}" = set; then + withval="$with_mmap" + case "${withval}" in + yes) want_mmap=true ;; + no) want_mmap=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${withval} for BFD with-mmap option" >&5 +echo "$as_me: error: bad value ${withval} for BFD with-mmap option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + want_mmap=false +fi; +# Check whether --enable-secureplt or --disable-secureplt was given. +if test "${enable_secureplt+set}" = set; then + enableval="$enable_secureplt" + case "${enableval}" in + yes) use_secureplt=true ;; + no) use_secureplt=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for secureplt option" >&5 +echo "$as_me: error: bad value ${enableval} for secureplt option" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + use_secureplt=false +fi; if test $use_secureplt = true; then + +cat >>confdefs.h <<\_ACEOF +#define USE_SECUREPLT 1 +_ACEOF + +fi + +DEBUGDIR=${libdir}/debug + + +# Check whether --with-separate-debug-dir or --without-separate-debug-dir was given. +if test "${with_separate_debug_dir+set}" = set; then + withval="$with_separate_debug_dir" + DEBUGDIR="${withval}" +fi; + + + + +# Check whether --with-pkgversion or --without-pkgversion was given. +if test "${with_pkgversion+set}" = set; then + withval="$with_pkgversion" + case "$withval" in + yes) { { echo "$as_me:$LINENO: error: package version not specified" >&5 +echo "$as_me: error: package version not specified" >&2;} + { (exit 1); exit 1; }; } ;; + no) PKGVERSION= ;; + *) PKGVERSION="($withval) " ;; + esac +else + PKGVERSION="(GNU Binutils) " + +fi; + + + + +# Check whether --with-bugurl or --without-bugurl was given. +if test "${with_bugurl+set}" = set; then + withval="$with_bugurl" + case "$withval" in + yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5 +echo "$as_me: error: bug URL not specified" >&2;} + { (exit 1); exit 1; }; } ;; + no) BUGURL= + ;; + *) BUGURL="$withval" + ;; + esac +else + BUGURL="http://www.sourceware.org/bugzilla/" + +fi; + case ${BUGURL} in + "") + REPORT_BUGS_TO= + REPORT_BUGS_TEXI= + ;; + *) + REPORT_BUGS_TO="<$BUGURL>" + REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} + ;; + esac; + + + + + +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 + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + +if false; then + GENINSRC_NEVER_TRUE= + GENINSRC_NEVER_FALSE='#' +else + GENINSRC_NEVER_TRUE='#' + GENINSRC_NEVER_FALSE= +fi + + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + +echo "$as_me:$LINENO: checking whether to install libbfd" >&5 +echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6 + # Check whether --enable-install-libbfd or --disable-install-libbfd was given. +if test "${enable_install_libbfd+set}" = set; then + enableval="$enable_install_libbfd" + install_libbfd_p=$enableval +else + if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then + install_libbfd_p=yes + else + install_libbfd_p=no + fi +fi; + echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 +echo "${ECHO_T}$install_libbfd_p" >&6 + + +if test $install_libbfd_p = yes; then + INSTALL_LIBBFD_TRUE= + INSTALL_LIBBFD_FALSE='#' +else + INSTALL_LIBBFD_TRUE='#' + INSTALL_LIBBFD_FALSE= +fi + + # Need _noncanonical variables for this. + + + + + # libbfd.a is a host library containing target dependent code + bfdlibdir='$(libdir)' + bfdincludedir='$(includedir)' + if test "${host}" != "${target}"; then + bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' + bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' + fi + + + + + + +host64=false +target64=false +bfd_default_target_size=32 + +# host stuff: + +ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw 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 - # Check whether --enable-nls or --disable-nls was given. +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + 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 + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +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 "$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 -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 $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 -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 -_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 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 -_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 + 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_cpp_err=yes + ac_executable_p="test -f" 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 +rm -f conf$$.file - 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: 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 - ;; - 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 -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 $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 - -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 - 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 -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -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 - - 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 - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $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 bindtextdomain (); -int -main () -{ -bindtextdomain (); - ; - 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_intl_bindtextdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_bindtextdomain=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 $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. */ - -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_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libintl=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_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - # Extract the first word of "msgfmt", so it can be a program name with args. +# 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 @@ -7754,308 +10865,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. - ;; - *) - 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 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test "$MSGFMT" != "no"; then - -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 - - # 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. - ;; + ac_cv_path_MSGFMT="$MSGFMT" # 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 -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - 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 - 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 - - 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 - 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 - - - - - 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 + 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 - 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. -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 - 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="msgfmt" - ;; + 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 @@ -8063,7 +10897,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 @@ -8103,7 +10937,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 @@ -8111,27 +10975,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 @@ -8139,284 +11007,105 @@ else echo "${ECHO_T}no" >&6 fi - - 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 + rm -f messages.po - - - - - - - - - - - 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 " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . 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 -_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 -_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 + +# 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + 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 +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&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 -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 "$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 - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi + ac_config_commands="$ac_config_commands default-1" - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - 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 - - # Permit host specific settings. . ${srcdir}/configure.host @@ -9760,6 +12449,2853 @@ fi done + + +inttype_headers=`echo inttypes.h sys/inttypes.h | sed -e 's/,/ /g'` + +acx_cv_header_stdint=stddef.h +acx_cv_header_stdint_kind="(already complete)" +for i in stdint.h $inttype_headers; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uintmax_t + unset ac_cv_type_int_least32_t + unset ac_cv_type_int_fast32_t + unset ac_cv_type_uint64_t + echo $ECHO_N "looking for a compliant stdint.h in $i, $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintmax_t+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 +#include <$i> + +int +main () +{ +if ((uintmax_t *) 0) + return 0; +if (sizeof (uintmax_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 + 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_uintmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintmax_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 +if test $ac_cv_type_uintmax_t = yes; then + acx_cv_header_stdint=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+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 +#include <$i> + +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_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 + 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_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then + : +else + acx_cv_header_stdint_kind="(mostly complete)" +fi + + echo "$as_me:$LINENO: checking for int_least32_t" >&5 +echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int_least32_t+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 +#include <$i> + +int +main () +{ +if ((int_least32_t *) 0) + return 0; +if (sizeof (int_least32_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 + 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_int_least32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int_least32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6 +if test $ac_cv_type_int_least32_t = yes; then + : +else + acx_cv_header_stdint_kind="(mostly complete)" +fi + + echo "$as_me:$LINENO: checking for int_fast32_t" >&5 +echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int_fast32_t+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 +#include <$i> + +int +main () +{ +if ((int_fast32_t *) 0) + return 0; +if (sizeof (int_fast32_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 + 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_int_fast32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int_fast32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6 +if test $ac_cv_type_int_fast32_t = yes; then + : +else + acx_cv_header_stdint_kind="(mostly complete)" +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+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 +#include <$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_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 + 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_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + : +else + acx_cv_header_stdint_kind="(lacks uint64_t)" +fi + + break +done +if test "$acx_cv_header_stdint" = stddef.h; then + acx_cv_header_stdint_kind="(lacks uintmax_t)" + for i in stdint.h $inttype_headers; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + echo $ECHO_N "looking for an incomplete stdint.h in $i, $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+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 +#include <$i> + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_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 + 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_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + acx_cv_header_stdint=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+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 +#include <$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_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 + 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_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 + + echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+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 +#include <$i> + +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_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 + 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_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 + + break + done +fi +if test "$acx_cv_header_stdint" = stddef.h; then + acx_cv_header_stdint_kind="(u_intXX_t style)" + for i in sys/types.h $inttype_headers; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + echo $ECHO_N "looking for u_intXX_t types in $i, $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+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 +#include <$i> + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_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 + 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_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + acx_cv_header_stdint=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+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 +#include <$i> + +int +main () +{ +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_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 + 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_u_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_u_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 + + break + done +fi +if test "$acx_cv_header_stdint" = stddef.h; then + acx_cv_header_stdint_kind="(using manual detection)" +fi + +test -z "$ac_cv_type_uintptr_t" && ac_cv_type_uintptr_t=no +test -z "$ac_cv_type_uint64_t" && ac_cv_type_uint64_t=no +test -z "$ac_cv_type_u_int64_t" && ac_cv_type_u_int64_t=no +test -z "$ac_cv_type_int_least32_t" && ac_cv_type_int_least32_t=no +test -z "$ac_cv_type_int_fast32_t" && ac_cv_type_int_fast32_t=no + +# ----------------- Summarize what we found so far + +echo "$as_me:$LINENO: checking what to include in bfd_stdint.h" >&5 +echo $ECHO_N "checking what to include in bfd_stdint.h... $ECHO_C" >&6 + +case `$as_basename bfd_stdint.h || +$as_expr X/bfd_stdint.h : '.*/\([^/][^/]*\)/*$' \| \ + Xbfd_stdint.h : 'X\(//\)$' \| \ + Xbfd_stdint.h : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/bfd_stdint.h | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` in + stdint.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 +echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; + inttypes.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 +echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; + *) ;; +esac + +echo "$as_me:$LINENO: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5 +echo "${ECHO_T}$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6 + +# ----------------- done included file, check C basic types -------- + +# Lacking an uintptr_t? Test size of void * +case "$acx_cv_header_stdint:$ac_cv_type_uintptr_t" in + stddef.h:* | *:no) echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6 +if test "${ac_cv_type_void_p+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 ((void * *) 0) + return 0; +if (sizeof (void *)) + 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 + 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_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_void_p=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6 + +echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +if test "${ac_cv_sizeof_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_void_p" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +test_array [0] = 0 + + ; + 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_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +test_array [0] = 0 + + ; + 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_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +test_array [0] = 0 + + ; + 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_void_p=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (void *)); } +unsigned long ulongval () { return (long) (sizeof (void *)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (void *))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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_sizeof_void_p=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_void_p=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + ;; +esac + +# Lacking an uint64_t? Test size of long +case "$acx_cv_header_stdint:$ac_cv_type_uint64_t:$ac_cv_type_u_int64_t" in + stddef.h:*:* | *:no:no) echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+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 ((long *) 0) + return 0; +if (sizeof (long)) + 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 + 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_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + 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_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + 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_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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_sizeof_long=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + ;; +esac + +if test $acx_cv_header_stdint = stddef.h; then + # Lacking a good header? Test size of everything and deduce all types. + echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+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 ((int *) 0) + return 0; +if (sizeof (int)) + 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 + 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_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + 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_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + 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_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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_sizeof_int=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + + echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6 +if test "${ac_cv_type_short+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 ((short *) 0) + return 0; +if (sizeof (short)) + 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 + 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_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_short=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6 + +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +test_array [0] = 0 + + ; + 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_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +test_array [0] = 0 + + ; + 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_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +test_array [0] = 0 + + ; + 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (short)); } +unsigned long ulongval () { return (long) (sizeof (short)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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_sizeof_short=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_short=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + + echo "$as_me:$LINENO: checking for char" >&5 +echo $ECHO_N "checking for char... $ECHO_C" >&6 +if test "${ac_cv_type_char+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 ((char *) 0) + return 0; +if (sizeof (char)) + 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 + 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_char=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_char=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 +echo "${ECHO_T}$ac_cv_type_char" >&6 + +echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6 +if test "${ac_cv_sizeof_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_char" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; +test_array [0] = 0 + + ; + 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_lo=0 ac_mid=0 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; +test_array [0] = 0 + + ; + 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_hi=-1 ac_mid=-1 + while :; do + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; +test_array [0] = 0 + + ; + 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + + ; + 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_char=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (char)); } +unsigned long ulongval () { return (long) (sizeof (char)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (char))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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_sizeof_char=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_char=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + + + echo "$as_me:$LINENO: checking for type equivalent to int8_t" >&5 +echo $ECHO_N "checking for type equivalent to int8_t... $ECHO_C" >&6 + case "$ac_cv_sizeof_char" in + 1) acx_cv_type_int8_t=char ;; + *) { { echo "$as_me:$LINENO: error: no 8-bit type" >&5 +echo "$as_me: error: no 8-bit type" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_int8_t" >&5 +echo "${ECHO_T}$acx_cv_type_int8_t" >&6 + + echo "$as_me:$LINENO: checking for type equivalent to int16_t" >&5 +echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6 + case "$ac_cv_sizeof_int:$ac_cv_sizeof_short" in + 2:*) acx_cv_type_int16_t=int ;; + *:2) acx_cv_type_int16_t=short ;; + *) { { echo "$as_me:$LINENO: error: no 16-bit type" >&5 +echo "$as_me: error: no 16-bit type" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_int16_t" >&5 +echo "${ECHO_T}$acx_cv_type_int16_t" >&6 + + echo "$as_me:$LINENO: checking for type equivalent to int32_t" >&5 +echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6 + case "$ac_cv_sizeof_int:$ac_cv_sizeof_long" in + 4:*) acx_cv_type_int32_t=int ;; + *:4) acx_cv_type_int32_t=long ;; + *) { { echo "$as_me:$LINENO: error: no 32-bit type" >&5 +echo "$as_me: error: no 32-bit type" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_int32_t" >&5 +echo "${ECHO_T}$acx_cv_type_int32_t" >&6 +fi + +# These tests are here to make the output prettier + +if test "$ac_cv_type_uint64_t" != yes && test "$ac_cv_type_u_int64_t" != yes; then + case "$ac_cv_sizeof_long" in + 8) acx_cv_type_int64_t=long ;; + esac + echo "$as_me:$LINENO: checking for type equivalent to int64_t" >&5 +echo $ECHO_N "checking for type equivalent to int64_t... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5 +echo "${ECHO_T}${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6 +fi + +# Now we can use the above types + +if test "$ac_cv_type_uintptr_t" != yes; then + echo "$as_me:$LINENO: checking for type equivalent to intptr_t" >&5 +echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6 + case $ac_cv_sizeof_void_p in + 2) acx_cv_type_intptr_t=int16_t ;; + 4) acx_cv_type_intptr_t=int32_t ;; + 8) acx_cv_type_intptr_t=int64_t ;; + *) { { echo "$as_me:$LINENO: error: no equivalent for intptr_t" >&5 +echo "$as_me: error: no equivalent for intptr_t" >&2;} + { (exit please report a bug); exit please report a bug; }; } + esac + echo "$as_me:$LINENO: result: $acx_cv_type_intptr_t" >&5 +echo "${ECHO_T}$acx_cv_type_intptr_t" >&6 +fi + +# ----------------- done all checks, emit header ------------- + ac_config_commands="$ac_config_commands bfd_stdint.h" + + + echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then @@ -11467,7 +17003,9 @@ if test "${target}" = "${host}"; then alpha*-*-*) COREFILE=osf-core.lo ;; arm-*-freebsd* | arm-*-kfreebsd*-gnu) COREFILE='' ;; - arm-*-netbsd*) COREFILE=netbsd-core.lo ;; + arm-*-netbsd* | arm-*-openbsd*) + COREFILE=netbsd-core.lo + ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; @@ -11674,7 +17212,9 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; s390*-*-*) COREFILE=trad-core.lo ;; - sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; + sh*-*-netbsd* | sh*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; sparc-*-netbsd* | sparc*-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -13038,7 +18578,7 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" +elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" for vec in $selvecs do @@ -13057,6 +18597,10 @@ do arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; @@ -13067,6 +18611,7 @@ do b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; + bfd_efi_app_x86_64_vec) tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; @@ -13082,6 +18627,7 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_bigmips_vxworks_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;; bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;; @@ -13127,6 +18673,8 @@ do bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; + bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; + bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;; @@ -13143,24 +18691,29 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; + bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; # FIXME: We include cofflink.lo not because it's needed for # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec # which needs it but does not list it. Should be fixed in right place. - bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; @@ -13192,8 +18745,10 @@ do bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; @@ -13216,6 +18771,7 @@ do i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;; i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; + x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;; i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;; @@ -13227,6 +18783,8 @@ do i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; + x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; + x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;; icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;; @@ -13379,7 +18937,7 @@ fi # all_targets is true case ${host64}-${target64}-${want64} in *true*) wordsize=64 - bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' + bfd64_libs='$(BFD64_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' if test $BFD_HOST_64_BIT_DEFINED = 0; then { echo "$as_me:$LINENO: WARNING: You have requested a 64 bit BFD configuration, but" >&5 @@ -13420,7 +18978,6 @@ echo "$as_me: error: A newer version of gcc is needed for the requested 64-bit B ;; false-false-false) wordsize=32 - bfd_libs='$(BFD32_LIBS)' all_backends='$(BFD32_BACKENDS)' ;; esac @@ -14524,6 +20081,7 @@ esac rm -f doc/config.status ac_config_files="$ac_config_files Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in" + ac_config_commands="$ac_config_commands default" @@ -14643,6 +20201,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 if test -z "${INSTALL_LIBBFD_TRUE}" && test -z "${INSTALL_LIBBFD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBBFD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -15086,6 +20651,272 @@ 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' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_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_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%}" + + +GCC="$GCC" +CC="$CC" +acx_cv_header_stdint="$acx_cv_header_stdint" +acx_cv_type_int8_t="$acx_cv_type_int8_t" +acx_cv_type_int16_t="$acx_cv_type_int16_t" +acx_cv_type_int32_t="$acx_cv_type_int32_t" +acx_cv_type_int64_t="$acx_cv_type_int64_t" +acx_cv_type_intptr_t="$acx_cv_type_intptr_t" +ac_cv_type_uintmax_t="$ac_cv_type_uintmax_t" +ac_cv_type_uintptr_t="$ac_cv_type_uintptr_t" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_type_u_int32_t="$ac_cv_type_u_int32_t" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_sizeof_void_p="$ac_cv_sizeof_void_p" + + + _ACEOF @@ -15100,6 +20931,9 @@ do "bfd-in3.h" ) CONFIG_FILES="$CONFIG_FILES bfd-in3.h:bfd-in2.h" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "bfd_stdint.h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS bfd_stdint.h" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -15241,42 +21075,50 @@ 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,@LN_S@,$LN_S,;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,@lt_ECHO@,$lt_ECHO,;t t +s,@CPP@,$CPP,;t t +s,@DEBUGDIR@,$DEBUGDIR,;t t +s,@PKGVERSION@,$PKGVERSION,;t t +s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t +s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t s,@NO_WERROR@,$NO_WERROR,;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,@INSTALL_LIBBFD_TRUE@,$INSTALL_LIBBFD_TRUE,;t t s,@INSTALL_LIBBFD_FALSE@,$INSTALL_LIBBFD_FALSE,;t t s,@host_noncanonical@,$host_noncanonical,;t t s,@target_noncanonical@,$target_noncanonical,;t t s,@bfdlibdir@,$bfdlibdir,;t t s,@bfdincludedir@,$bfdincludedir,;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,@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,@GMSGFMT@,$GMSGFMT,;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,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;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,@HDEFINES@,$HDEFINES,;t t s,@BFD_HOST_64BIT_LONG@,$BFD_HOST_64BIT_LONG,;t t s,@BFD_HOST_LONG_LONG@,$BFD_HOST_LONG_LONG,;t t @@ -15291,7 +21133,7 @@ s,@WIN32LDFLAGS@,$WIN32LDFLAGS,;t t s,@WIN32LIBADD@,$WIN32LIBADD,;t t s,@TDEFINES@,$TDEFINES,;t t s,@wordsize@,$wordsize,;t t -s,@bfd_libs@,$bfd_libs,;t t +s,@bfd64_libs@,$bfd64_libs,;t t s,@all_backends@,$all_backends,;t t s,@bfd_backends@,$bfd_backends,;t t s,@bfd_machines@,$bfd_machines,;t t @@ -15986,7 +21828,1002 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} done done ;; - default ) sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-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 , 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 + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# 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 ;; + bfd_stdint.h ) +if test "$GCC" = yes; then + echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h +else + echo "/* generated for $CC */" > tmp-stdint.h +fi + +sed 's/^ *//' >> tmp-stdint.h < +EOF + +if test "$acx_cv_header_stdint" != stdint.h; then + echo "#include " >> tmp-stdint.h +fi +if test "$acx_cv_header_stdint" != stddef.h; then + echo "#include <$acx_cv_header_stdint>" >> tmp-stdint.h +fi + +sed 's/^ *//' >> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <= 199901L + #ifndef _INT64_T + #define _INT64_T + #ifndef __int64_t_defined + typedef long long int64_t; + #endif + #endif + #ifndef _UINT64_T + #define _UINT64_T + typedef unsigned long long uint64_t; + #endif + + #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0 + /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and + does not implement __extension__. But that compiler doesn't define + __GNUC_MINOR__. */ + # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) + # define __extension__ + # endif + + # ifndef _INT64_T + # define _INT64_T + __extension__ typedef long long int64_t; + # endif + # ifndef _UINT64_T + # define _UINT64_T + __extension__ typedef unsigned long long uint64_t; + # endif + + #elif !defined __STRICT_ANSI__ + # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ + + # ifndef _INT64_T + # define _INT64_T + typedef __int64 int64_t; + # endif + # ifndef _UINT64_T + # define _UINT64_T + typedef unsigned __int64 uint64_t; + # endif + # endif /* compiler */ + + #endif /* ANSI version */ +EOF +fi + +# ------------- done int64_t types, emit intptr types ------------ +if test "$ac_cv_type_uintptr_t" != yes; then + sed 's/^ *//' >> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h <> tmp-stdint.h < po/Makefile ;; esac done _ACEOF diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in index 212f96142fd..1ea98ae0259 100644 --- a/contrib/binutils/bfd/configure.in +++ b/contrib/binutils/bfd/configure.in @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c]) AC_CANONICAL_TARGET AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.17) +AM_INIT_AUTOMAKE(bfd, 2.17.50) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -19,7 +19,10 @@ dnl Default to a non shared library. This may be overridden by the dnl configure option --enable-shared. AM_DISABLE_SHARED -AM_PROG_LIBTOOL +AC_PROG_CC +AC_GNU_SOURCE + +AC_PROG_LIBTOOL AC_ARG_ENABLE(64-bit-bfd, [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], @@ -63,6 +66,17 @@ if test $use_secureplt = true; then [Define if we should default to creating read-only plt entries]) fi +DEBUGDIR=${libdir}/debug + +AC_ARG_WITH(separate-debug-dir, + AS_HELP_STRING([--with-separate-debug-dir=DIR], + [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]), +[DEBUGDIR="${withval}"]) +AC_SUBST(DEBUGDIR) + +ACX_PKGVERSION([GNU Binutils]) +ACX_BUGURL([http://www.sourceware.org/bugzilla/]) + AM_BINUTILS_WARNINGS AM_CONFIG_HEADER(config.h:config.in) @@ -72,6 +86,7 @@ if test -z "$target" ; then fi AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) AM_INSTALL_LIBBFD AC_EXEEXT @@ -81,11 +96,9 @@ bfd_default_target_size=32 # host stuff: -AC_PROG_CC -AC_GNU_SOURCE - ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi" -CY_GNU_GETTEXT +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS # Permit host specific settings. . ${srcdir}/configure.host @@ -135,6 +148,7 @@ BFD_CC_FOR_BUILD AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h) +GCC_HEADER_STDINT(bfd_stdint.h) AC_HEADER_TIME AC_HEADER_DIRENT ACX_HEADER_STRING @@ -178,7 +192,9 @@ if test "${target}" = "${host}"; then alpha*-*-*) COREFILE=osf-core.lo ;; arm-*-freebsd* | arm-*-kfreebsd*-gnu) COREFILE='' ;; - arm-*-netbsd*) COREFILE=netbsd-core.lo ;; + arm-*-netbsd* | arm-*-openbsd*) + COREFILE=netbsd-core.lo + ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; @@ -361,7 +377,9 @@ changequote([,])dnl powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; s390*-*-*) COREFILE=trad-core.lo ;; - sh*-*-netbsd*) COREFILE=netbsd-core.lo ;; + sh*-*-netbsd* | sh*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; sparc-*-netbsd* | sparc*-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -551,7 +569,7 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" +elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo" for vec in $selvecs do @@ -570,6 +588,10 @@ do arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; @@ -580,6 +602,7 @@ do b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; + bfd_efi_app_x86_64_vec) tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; @@ -595,6 +618,7 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_bigmips_vxworks_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_cr16_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;; bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;; @@ -640,6 +664,8 @@ do bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; + bfd_elf32_mep_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; + bfd_elf32_mep_little_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;; @@ -656,24 +682,29 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + bfd_elf32_bigscore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; + bfd_elf32_littlescore_vec) tb="$tb elf32-score.lo elf32.lo $elf" ;; # FIXME: We include cofflink.lo not because it's needed for # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec # which needs it but does not list it. Should be fixed in right place. - bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shl_symbian_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shvxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + bfd_elf32_spu_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; @@ -705,8 +736,10 @@ do bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;; bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; @@ -729,6 +762,7 @@ do i386aout_vec) tb="$tb i386aout.lo aout32.lo" ;; i386bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; i386coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; + x86_64coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;; i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;; @@ -740,6 +774,8 @@ do i386os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; + x86_64pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; + x86_64pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; i860coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; icoff_big_vec) tb="$tb coff-i960.lo cofflink.lo" ;; icoff_little_vec) tb="$tb coff-i960.lo cofflink.lo" ;; @@ -890,7 +926,7 @@ fi # all_targets is true case ${host64}-${target64}-${want64} in *true*) wordsize=64 - bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' + bfd64_libs='$(BFD64_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' if test $BFD_HOST_64_BIT_DEFINED = 0; then AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) @@ -911,13 +947,12 @@ case ${host64}-${target64}-${want64} in ;; false-false-false) wordsize=32 - bfd_libs='$(BFD32_LIBS)' all_backends='$(BFD32_BACKENDS)' ;; esac AC_SUBST(wordsize) -AC_SUBST(bfd_libs) +AC_SUBST(bfd64_libs) AC_SUBST(all_backends) AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) @@ -962,7 +997,28 @@ esac rm -f doc/config.status AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in]) -AC_CONFIG_COMMANDS([default],[[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]],[[]]) + +dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of +dnl our two separate POTFILES. Yuck. +AC_CONFIG_COMMANDS([default], +[[ +case "$srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; +esac +POFILES= +GMOFILES= +for lang in dummy $OBSOLETE_ALL_LINGUAS; do + if test $lang != dummy; then + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + fi +done +sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \ + -e '/BLD-POTFILES =/r po/BLD-POTFILES' \ + -e "s,@POFILES@,$POFILES," \ + -e "s,@GMOFILES@,$GMOFILES," \ + po/Makefile.in > po/Makefile]],[[]]) dnl Required by html and install-html AC_SUBST(datarootdir) diff --git a/contrib/binutils/bfd/corefile.c b/contrib/binutils/bfd/corefile.c index 602de911a2c..58cd7f613f6 100644 --- a/contrib/binutils/bfd/corefile.c +++ b/contrib/binutils/bfd/corefile.c @@ -1,6 +1,6 @@ /* Core file generic interface routines for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -30,8 +30,8 @@ DESCRIPTION These are functions pertaining to core files. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* diff --git a/contrib/binutils/bfd/cpu-alpha.c b/contrib/binutils/bfd/cpu-alpha.c index 48b748d9f36..db7abfbdb29 100644 --- a/contrib/binutils/bfd/cpu-alpha.c +++ b/contrib/binutils/bfd/cpu-alpha.c @@ -1,5 +1,5 @@ /* BFD support for the Alpha architecture. - Copyright 1992, 1993, 1998, 2000, 2002, 2003 + Copyright 1992, 1993, 1998, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \ diff --git a/contrib/binutils/bfd/cpu-arc.c b/contrib/binutils/bfd/cpu-arc.c index ef97da0eda2..bf9a739149f 100644 --- a/contrib/binutils/bfd/cpu-arc.c +++ b/contrib/binutils/bfd/cpu-arc.c @@ -1,5 +1,6 @@ /* BFD support for the ARC processor - Copyright 1994, 1995, 1997, 2001, 2002 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 2001, 2002, 2007 + Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARC(mach, print_name, default_p, next) \ diff --git a/contrib/binutils/bfd/cpu-arm.c b/contrib/binutils/bfd/cpu-arm.c index a28a1f9e8fc..a44b98395ee 100644 --- a/contrib/binutils/bfd/cpu-arm.c +++ b/contrib/binutils/bfd/cpu-arm.c @@ -1,5 +1,5 @@ /* BFD support for the ARM processor - Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005 + Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" @@ -92,7 +92,8 @@ processors[] = { bfd_mach_arm_4, "strongarm1100" }, { bfd_mach_arm_XScale, "xscale" }, { bfd_mach_arm_ep9312, "ep9312" }, - { bfd_mach_arm_iWMMXt, "iwmmxt" } + { bfd_mach_arm_iWMMXt, "iwmmxt" }, + { bfd_mach_arm_iWMMXt2, "iwmmxt2" } }; static bfd_boolean @@ -137,7 +138,8 @@ static const bfd_arch_info_type arch_info_struct[] = N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]), N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]), N (bfd_mach_arm_ep9312, "ep9312", FALSE, & arch_info_struct[11]), - N (bfd_mach_arm_iWMMXt,"iwmmxt", FALSE, NULL) + N (bfd_mach_arm_iWMMXt, "iwmmxt", FALSE, & arch_info_struct[12]), + N (bfd_mach_arm_iWMMXt2, "iwmmxt2", FALSE, NULL) }; const bfd_arch_info_type bfd_arm_arch = @@ -179,7 +181,9 @@ bfd_arm_merge_machines (bfd *ibfd, bfd *obfd) Intel XScale binary, since these architecture have co-processors which will not both be present on the same physical hardware. */ else if (in == bfd_mach_arm_ep9312 - && (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt)) + && (out == bfd_mach_arm_XScale + || out == bfd_mach_arm_iWMMXt + || out == bfd_mach_arm_iWMMXt2)) { _bfd_error_handler (_("\ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"), @@ -188,7 +192,9 @@ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"), return FALSE; } else if (out == bfd_mach_arm_ep9312 - && (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt)) + && (in == bfd_mach_arm_XScale + || in == bfd_mach_arm_iWMMXt + || in == bfd_mach_arm_iWMMXt2)) { _bfd_error_handler (_("\ ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"), @@ -309,6 +315,7 @@ bfd_arm_update_notes (bfd *abfd, const char *note_section) case bfd_mach_arm_XScale: expected = "XScale"; break; case bfd_mach_arm_ep9312: expected = "ep9312"; break; case bfd_mach_arm_iWMMXt: expected = "iWMMXt"; break; + case bfd_mach_arm_iWMMXt2: expected = "iWMMXt2"; break; } if (strcmp (arch_string, expected) != 0) @@ -355,7 +362,8 @@ architectures[] = { "armv5te", bfd_mach_arm_5TE }, { "XScale", bfd_mach_arm_XScale }, { "ep9312", bfd_mach_arm_ep9312 }, - { "iWMMXt", bfd_mach_arm_iWMMXt } + { "iWMMXt", bfd_mach_arm_iWMMXt }, + { "iWMMXt2", bfd_mach_arm_iWMMXt2 } }; /* Extract the machine number stored in a note section. */ @@ -402,14 +410,22 @@ bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section) } bfd_boolean -bfd_is_arm_mapping_symbol_name (const char * name) +bfd_is_arm_special_symbol_name (const char * name, int type) { /* The ARM compiler outputs several obsolete forms. Recognize them - in addition to the standard $a, $t and $d. */ - return (name != NULL) - && (name[0] == '$') - && ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd') - || (name[1] == 'm') || (name[1] == 'f') || (name[1] == 'p')) - && (name[2] == 0 || name[2] == '.'); + in addition to the standard $a, $t and $d. We are somewhat loose + in what we accept here, since the full set is not documented. */ + if (!name || name[0] != '$') + return FALSE; + if (name[1] == 'a' || name[1] == 't' || name[1] == 'd') + type &= BFD_ARM_SPECIAL_SYM_TYPE_MAP; + else if (name[1] == 'm' || name[1] == 'f' || name[1] == 'p') + type &= BFD_ARM_SPECIAL_SYM_TYPE_TAG; + else if (name[1] >= 'a' && name[1] <= 'z') + type &= BFD_ARM_SPECIAL_SYM_TYPE_OTHER; + else + return FALSE; + + return (type != 0 && (name[2] == 0 || name[2] == '.')); } diff --git a/contrib/binutils/bfd/cpu-cr16.c b/contrib/binutils/bfd/cpu-cr16.c new file mode 100644 index 00000000000..5695f0eda87 --- /dev/null +++ b/contrib/binutils/bfd/cpu-cr16.c @@ -0,0 +1,40 @@ +/* BFD support for the CR16 processor. + Copyright 2007 Free Software Foundation, Inc. + Written by M R Swami Reddy + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libbfd.h" + + +const bfd_arch_info_type bfd_cr16_arch = + { + 16, /* 16 bits in a word. */ + 32, /* 32 bits in an address. */ + 8, /* 8 bits in a byte. */ + bfd_arch_cr16, /* enum bfd_architecture arch. */ + bfd_mach_cr16, + "cr16", /* Arch name. */ + "cr16", /* Printable name. */ + 1, /* Unsigned int section alignment power. */ + TRUE, /* The one and only. */ + bfd_default_compatible, + bfd_default_scan , + 0, + }; diff --git a/contrib/binutils/bfd/cpu-i386.c b/contrib/binutils/bfd/cpu-i386.c index 8886c47d0a0..339c7d99400 100644 --- a/contrib/binutils/bfd/cpu-i386.c +++ b/contrib/binutils/bfd/cpu-i386.c @@ -1,5 +1,5 @@ /* BFD support for the Intel 386 architecture. - Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004 + Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2004, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_x86_64_arch_intel_syntax = diff --git a/contrib/binutils/bfd/cpu-ia64.c b/contrib/binutils/bfd/cpu-ia64.c index e172f5a85f2..a38d24de41b 100644 --- a/contrib/binutils/bfd/cpu-ia64.c +++ b/contrib/binutils/bfd/cpu-ia64.c @@ -1,5 +1,5 @@ /* BFD support for the ia64 architecture. - Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_ia64_elf32_arch = diff --git a/contrib/binutils/bfd/cpu-mep.c b/contrib/binutils/bfd/cpu-mep.c new file mode 100644 index 00000000000..d5ee1d67b42 --- /dev/null +++ b/contrib/binutils/bfd/cpu-mep.c @@ -0,0 +1,28 @@ +/* BFD support for the Toshiba Media Engine Processor. + Copyright (C) 2001, 2002, 2004, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libbfd.h" + +#define MA(x, n, def, y) { 32, 32, 8, bfd_arch_mep, x, "mep", n, \ + 2, def, bfd_default_compatible, bfd_default_scan, y } + +static const bfd_arch_info_type bfd_h1_arch = MA (bfd_mach_mep_h1, "h1", FALSE, NULL); +const bfd_arch_info_type bfd_mep_arch = MA (bfd_mach_mep, "mep", TRUE, & bfd_h1_arch); diff --git a/contrib/binutils/bfd/cpu-mips.c b/contrib/binutils/bfd/cpu-mips.c index c232f85d0fc..54bc0cf2262 100644 --- a/contrib/binutils/bfd/cpu-mips.c +++ b/contrib/binutils/bfd/cpu-mips.c @@ -1,6 +1,6 @@ /* bfd back-end for mips support Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type *mips_compatible diff --git a/contrib/binutils/bfd/cpu-powerpc.c b/contrib/binutils/bfd/cpu-powerpc.c index 2584d651162..e3583306129 100644 --- a/contrib/binutils/bfd/cpu-powerpc.c +++ b/contrib/binutils/bfd/cpu-powerpc.c @@ -1,5 +1,5 @@ /* BFD PowerPC CPU definition - Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003 + Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* The common PowerPC architecture is compatible with the RS/6000. */ diff --git a/contrib/binutils/bfd/cpu-rs6000.c b/contrib/binutils/bfd/cpu-rs6000.c index 43c7be7539f..4ed1d71e1a9 100644 --- a/contrib/binutils/bfd/cpu-rs6000.c +++ b/contrib/binutils/bfd/cpu-rs6000.c @@ -1,11 +1,7 @@ /* BFD back-end for rs6000 support - Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003 + Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2007 Free Software Foundation, Inc. - FIXME: Can someone provide a transliteration of this name into ASCII? - Using the following chars caused a compiler warning on HIUX (so I replaced - them with octal escapes), and isn't useful without an understanding of what - character set it is. - Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM + Written by Mimi Phuong-Thao Vo of IBM and John Gilmore of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -24,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* The RS/6000 architecture is compatible with the PowerPC common diff --git a/contrib/binutils/bfd/cpu-s390.c b/contrib/binutils/bfd/cpu-s390.c index e7c714f26dc..b385a9c6bdb 100644 --- a/contrib/binutils/bfd/cpu-s390.c +++ b/contrib/binutils/bfd/cpu-s390.c @@ -1,5 +1,5 @@ /* BFD support for the s390 processor. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" const bfd_arch_info_type bfd_s390_64_arch = diff --git a/contrib/binutils/bfd/cpu-score.c b/contrib/binutils/bfd/cpu-score.c new file mode 100644 index 00000000000..90d3113bd66 --- /dev/null +++ b/contrib/binutils/bfd/cpu-score.c @@ -0,0 +1,51 @@ +/* BFD support for the score processor + Copyright 2006, 2007 Free Software Foundation, Inc. + Contributed by + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libbfd.h" + +const bfd_arch_info_type +bfd_score_arch = +{ + 32, /* There's 32 bits_per_word. */ + 32, /* There's 32 bits_per_address. */ + 8, /* There's 8 bits_per_byte. */ + bfd_arch_score, /* One of enum bfd_architecture, defined + in archures.c and provided in + generated header files. */ + 0, /* Only 1 machine, but #255 for + historical reasons. */ + "score", /* The arch_name. */ + "score", /* The printable name is the same. */ + 4, /* Section alignment power; each section + is aligned to (only) 2^4 bytes. */ + TRUE, /* This is the default "machine", since + there's only one. */ + bfd_default_compatible, /* A default function for testing + "machine" compatibility of two + bfd_arch_info_type. */ + bfd_default_scan, /* Check if an bfd_arch_info_type is a + match. */ + NULL /* Pointer to next bfd_arch_info_type in + the same family. */ +}; diff --git a/contrib/binutils/bfd/cpu-sparc.c b/contrib/binutils/bfd/cpu-sparc.c index 42153269a24..35a109e2c49 100644 --- a/contrib/binutils/bfd/cpu-sparc.c +++ b/contrib/binutils/bfd/cpu-sparc.c @@ -1,5 +1,5 @@ /* BFD support for the SPARC architecture. - Copyright 1992, 1995, 1996, 1998, 2000, 2002 + Copyright 1992, 1995, 1996, 1998, 2000, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" static const bfd_arch_info_type arch_info_struct[] = diff --git a/contrib/binutils/bfd/cpu-spu.c b/contrib/binutils/bfd/cpu-spu.c new file mode 100644 index 00000000000..540a19fa71b --- /dev/null +++ b/contrib/binutils/bfd/cpu-spu.c @@ -0,0 +1,54 @@ +/* Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libbfd.h" + + +static const bfd_arch_info_type * +spu_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b) +{ + BFD_ASSERT (a->arch == bfd_arch_spu); + switch (b->arch) + { + default: + return NULL; + case bfd_arch_spu: + return bfd_default_compatible (a, b); + } + /*NOTREACHED*/ +} + +const bfd_arch_info_type bfd_spu_arch[] = +{ + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_spu, /* architecture */ + bfd_mach_spu, /* machine */ + "spu", /* architecture name */ + "spu:256K", /* printable name */ + 3, /* aligned power */ + TRUE, /* the default machine for the architecture */ + spu_compatible, /* the spu is only compatible with itself, see above */ + bfd_default_scan, + 0, /* next -- there are none! */ + } +}; diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog index 7909268f98b..6b96b613d13 100644 --- a/contrib/binutils/bfd/doc/ChangeLog +++ b/contrib/binutils/bfd/doc/ChangeLog @@ -1,7 +1,56 @@ +2007-07-02 Alan Modra + + * Makefile.in: Regenerate. + +2007-06-30 H.J. Lu + + * Makefile.in: Likewise. + +2007-06-14 H.J. Lu + + * Makefile.in: Regenerated. + +2007-05-22 Nick Clifton + + * bfd.texinfo: Use @copying around the copyright notice. + * bfdint.texi: Likewise. + +2007-05-21 Nick Clifton + + * bfdint.texi: Add GNU Free Documentation License notice. + +2007-04-24 Alan Modra + + * Makefile.in: Regenerate. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * Makefile.in: Regenerate. + +2006-07-24 Ralk Wildenhues + + * bfd..texinfo: Fix spelling mistakes. + * bfdint.texinfo: Likewise. + +2006-07-18 Nigel Stephens + + * bfd.texinfo: Add @section for "What to Put Where". + 2006-06-07 Joseph S. Myers * bfd.texinfo: Remove local @tex code. +2006-06-05 Alan Modra + + * Makefile.in: Regenerate. + +2006-05-11 Carlos O'Donell + + * bfd.texinfo: Rename "Index" to "BFD Index" + 2006-04-06 Carlos O'Donell * Makefile.am: Add install-html and install-html-am targets. diff --git a/contrib/binutils/bfd/doc/Makefile.am b/contrib/binutils/bfd/doc/Makefile.am index 6d221faad4a..6ff434a6e7e 100644 --- a/contrib/binutils/bfd/doc/Makefile.am +++ b/contrib/binutils/bfd/doc/Makefile.am @@ -8,7 +8,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ libbfd.texi bfdwin.texi bfdio.texi \ opncls.texi reloc.texi section.texi \ syms.texi targets.texi init.texi hash.texi linker.texi \ - mmo.texi + mmo.texi \ + bfdver.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ @@ -51,6 +52,7 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ TEXIDIR = $(srcdir)/../../texinfo/fsf info_TEXINFOS = bfd.texinfo +bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi MKDOC = chew$(EXEEXT_FOR_BUILD) @@ -68,8 +70,6 @@ chew.o: chew.c protos: libbfd.h libcoff.h bfd.h -$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo - # We can't replace these rules with an implicit rule, because # makes without VPATH support couldn't find the .h files in `..'. @@ -274,6 +274,17 @@ bfd.h: $(BFD_H_DEP) echo "#endif" >> $@ echo "#endif" >> $@ +bfdver.texi: $(srcdir)/Makefile.in + @echo "creating $@"; \ + echo "@set VERSION $(VERSION)" > bfdver.texi; \ + if [ -n "$(PKGVERSION)" ]; then \ + echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \ + fi; \ + echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \ + if [ -n "$(REPORT_BUGS_TEXI)" ]; then \ + echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \ + fi + noinst_TEXINFOS = bfdint.texi MOSTLYCLEANFILES = $(MKDOC) *.o @@ -309,6 +320,11 @@ install-html-am: $(HTMLS) fi; \ done +MAINTAINERCLEANFILES += bfd.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 += bfd.info +endif diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in index ad81061ec7b..02b15d0dbe3 100644 --- a/contrib/binutils/bfd/doc/Makefile.in +++ b/contrib/binutils/bfd/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -36,13 +36,26 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ + +# 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@am__append_1 = bfd.info subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(bfd_TEXINFOS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/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)/../config/acx.m4 \ + $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/nls.m4 $(top_srcdir)/../config/po.m4 \ + $(top_srcdir)/../config/progtest.m4 \ + $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/bfd.m4 \ + $(top_srcdir)/warning.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -51,7 +64,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/bfd.info +INFO_DEPS = bfd.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = bfd.dvi @@ -69,7 +82,6 @@ MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ @@ -95,20 +107,24 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEBUGDIR = @DEBUGDIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ 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_LIBBFD_FALSE = @INSTALL_LIBBFD_FALSE@ INSTALL_LIBBFD_TRUE = @INSTALL_LIBBFD_TRUE@ @@ -116,10 +132,10 @@ 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@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -131,6 +147,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -140,14 +158,16 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POFILES = @POFILES@ +PKGVERSION = @PKGVERSION@ POSUB = @POSUB@ RANLIB = @RANLIB@ +REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@ +REPORT_BUGS_TO = @REPORT_BUGS_TO@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TDEFINES = @TDEFINES@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ @@ -156,6 +176,7 @@ WIN32LIBADD = @WIN32LIBADD@ XGETTEXT = @XGETTEXT@ 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@ all_backends = @all_backends@ @@ -166,10 +187,10 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +bfd64_libs = @bfd64_libs@ bfd_backends = @bfd_backends@ bfd_default_target_size = @bfd_default_target_size@ bfd_file_ptr = @bfd_file_ptr@ -bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ bfd_ufile_ptr = @bfd_ufile_ptr@ bfdincludedir = @bfdincludedir@ @@ -194,10 +215,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@ @@ -221,7 +242,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ libbfd.texi bfdwin.texi bfdio.texi \ opncls.texi reloc.texi section.texi \ syms.texi targets.texi init.texi hash.texi linker.texi \ - mmo.texi + mmo.texi \ + bfdver.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ @@ -263,6 +285,7 @@ SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ TEXIDIR = $(srcdir)/../../texinfo/fsf info_TEXINFOS = bfd.texinfo +bfd_TEXINFOS = $(DOCFILES) bfdsumm.texi MKDOC = chew$(EXEEXT_FOR_BUILD) INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../../include \ -I$(srcdir)/../../intl -I../../intl @@ -314,13 +337,14 @@ BFD_H_DEP = \ noinst_TEXINFOS = bfdint.texi MOSTLYCLEANFILES = $(MKDOC) *.o CLEANFILES = *.p *.ip -DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log -MAINTAINERCLEANFILES = $(DOCFILES) +DISTCLEANFILES = bfd.?? bfd.??? bfd.h libbfd.h libcoff.h texput.log \ + $(am__append_1) +MAINTAINERCLEANFILES = $(DOCFILES) bfd.info html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; all: all-am .SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texinfo +.SUFFIXES: .dvi .ps $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -330,9 +354,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 \ @@ -360,40 +384,38 @@ clean-libtool: distclean-libtool: -rm -f libtool -.texinfo.info: +bfd.info: bfd.texinfo $(bfd_TEXINFOS) restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ - 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; \ - cd "$$am__cwd"; \ + 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 && \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ $<; \ + -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc -.texinfo.dvi: +bfd.dvi: bfd.texinfo $(bfd_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo -.texinfo.pdf: +bfd.pdf: bfd.texinfo $(bfd_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< + $(TEXI2PDF) -o $@ `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo -.texinfo.html: +bfd.html: bfd.texinfo $(bfd_TEXINFOS) rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ + -o $(@:.html=.htp) `test -f 'bfd.texinfo' || echo '$(srcdir)/'`bfd.texinfo; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ @@ -403,11 +425,8 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/bfd.info: bfd.texinfo -bfd.dvi: bfd.texinfo -bfd.pdf: bfd.texinfo -bfd.html: bfd.texinfo .dvi.ps: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-info-am: @@ -600,8 +619,6 @@ chew.o: chew.c protos: libbfd.h libcoff.h bfd.h -$(srcdir)/bfd.info bfd.dvi bfd.html: $(DOCFILES) bfdsumm.texi bfd.texinfo - # We can't replace these rules with an implicit rule, because # makes without VPATH support couldn't find the .h files in `..'. @@ -762,6 +779,17 @@ bfd.h: $(BFD_H_DEP) echo "#endif" >> $@ echo "#endif" >> $@ +bfdver.texi: $(srcdir)/Makefile.in + @echo "creating $@"; \ + echo "@set VERSION $(VERSION)" > bfdver.texi; \ + if [ -n "$(PKGVERSION)" ]; then \ + echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \ + fi; \ + echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \ + if [ -n "$(REPORT_BUGS_TEXI)" ]; then \ + echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \ + fi + # We want install to imply install-info as per GNU standards, despite the # cygnus option. install: install-info diff --git a/contrib/binutils/bfd/doc/aoutx.texi b/contrib/binutils/bfd/doc/aoutx.texi deleted file mode 100644 index 7cf9787f106..00000000000 --- a/contrib/binutils/bfd/doc/aoutx.texi +++ /dev/null @@ -1,213 +0,0 @@ -@section a.out backends - - -@strong{Description}@* -BFD supports a number of different flavours of a.out format, -though the major differences are only the sizes of the -structures on disk, and the shape of the relocation -information. - -The support is split into a basic support file @file{aoutx.h} -and other files which derive functions from the base. One -derivation file is @file{aoutf1.h} (for a.out flavour 1), and -adds to the basic a.out functions support for sun3, sun4, 386 -and 29k a.out files, to create a target jump vector for a -specific target. - -This information is further split out into more specific files -for each machine, including @file{sunos.c} for sun3 and sun4, -@file{newsos3.c} for the Sony NEWS, and @file{demo64.c} for a -demonstration of a 64 bit a.out format. - -The base file @file{aoutx.h} defines general mechanisms for -reading and writing records to and from disk and various -other methods which BFD requires. It is included by -@file{aout32.c} and @file{aout64.c} to form the names -@code{aout_32_swap_exec_header_in}, @code{aout_64_swap_exec_header_in}, etc. - -As an example, this is what goes on to make the back end for a -sun4, from @file{aout32.c}: - -@example - #define ARCH_SIZE 32 - #include "aoutx.h" -@end example - -Which exports names: - -@example - ... - aout_32_canonicalize_reloc - aout_32_find_nearest_line - aout_32_get_lineno - aout_32_get_reloc_upper_bound - ... -@end example - -from @file{sunos.c}: - -@example - #define TARGET_NAME "a.out-sunos-big" - #define VECNAME sunos_big_vec - #include "aoutf1.h" -@end example - -requires all the names from @file{aout32.c}, and produces the jump vector - -@example - sunos_big_vec -@end example - -The file @file{host-aout.c} is a special case. It is for a large set -of hosts that use ``more or less standard'' a.out files, and -for which cross-debugging is not interesting. It uses the -standard 32-bit a.out support routines, but determines the -file offsets and addresses of the text, data, and BSS -sections, the machine architecture and machine type, and the -entry point address, in a host-dependent manner. Once these -values have been determined, generic code is used to handle -the object file. - -When porting it to run on a new system, you must supply: - -@example - HOST_PAGE_SIZE - HOST_SEGMENT_SIZE - HOST_MACHINE_ARCH (optional) - HOST_MACHINE_MACHINE (optional) - HOST_TEXT_START_ADDR - HOST_STACK_END_ADDR -@end example - -in the file @file{../include/sys/h-@var{XXX}.h} (for your host). These -values, plus the structures and macros defined in @file{a.out.h} on -your host system, will produce a BFD target that will access -ordinary a.out files on your host. To configure a new machine -to use @file{host-aout.c}, specify: - -@example - TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec - TDEPFILES= host-aout.o trad-core.o -@end example - -in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in} -to use the -@file{@var{XXX}.mt} file (by setting "@code{bfd_target=XXX}") when your -configuration is selected. - -@subsection Relocations - - -@strong{Description}@* -The file @file{aoutx.h} provides for both the @emph{standard} -and @emph{extended} forms of a.out relocation records. - -The standard records contain only an -address, a symbol index, and a type field. The extended records -(used on 29ks and sparcs) also have a full integer for an -addend. - -@subsection Internal entry points - - -@strong{Description}@* -@file{aoutx.h} exports several routines for accessing the -contents of an a.out file, which are gathered and exported in -turn by various format specific files (eg sunos.c). - -@findex aout_@var{size}_swap_exec_header_in -@subsubsection @code{aout_@var{size}_swap_exec_header_in} -@strong{Synopsis} -@example -void aout_@var{size}_swap_exec_header_in, - (bfd *abfd, - struct external_exec *bytes, - struct internal_exec *execp); -@end example -@strong{Description}@* -Swap the information in an executable header @var{raw_bytes} taken -from a raw byte stream memory image into the internal exec header -structure @var{execp}. - -@findex aout_@var{size}_swap_exec_header_out -@subsubsection @code{aout_@var{size}_swap_exec_header_out} -@strong{Synopsis} -@example -void aout_@var{size}_swap_exec_header_out - (bfd *abfd, - struct internal_exec *execp, - struct external_exec *raw_bytes); -@end example -@strong{Description}@* -Swap the information in an internal exec header structure -@var{execp} into the buffer @var{raw_bytes} ready for writing to disk. - -@findex aout_@var{size}_some_aout_object_p -@subsubsection @code{aout_@var{size}_some_aout_object_p} -@strong{Synopsis} -@example -const bfd_target *aout_@var{size}_some_aout_object_p - (bfd *abfd, - struct internal_exec *execp, - const bfd_target *(*callback_to_real_object_p) (bfd *)); -@end example -@strong{Description}@* -Some a.out variant thinks that the file open in @var{abfd} -checking is an a.out file. Do some more checking, and set up -for access if it really is. Call back to the calling -environment's "finish up" function just before returning, to -handle any last-minute setup. - -@findex aout_@var{size}_mkobject -@subsubsection @code{aout_@var{size}_mkobject} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); -@end example -@strong{Description}@* -Initialize BFD @var{abfd} for use with a.out files. - -@findex aout_@var{size}_machine_type -@subsubsection @code{aout_@var{size}_machine_type} -@strong{Synopsis} -@example -enum machine_type aout_@var{size}_machine_type - (enum bfd_architecture arch, - unsigned long machine, - bfd_boolean *unknown); -@end example -@strong{Description}@* -Keep track of machine architecture and machine type for -a.out's. Return the @code{machine_type} for a particular -architecture and machine, or @code{M_UNKNOWN} if that exact architecture -and machine can't be represented in a.out format. - -If the architecture is understood, machine type 0 (default) -is always understood. - -@findex aout_@var{size}_set_arch_mach -@subsubsection @code{aout_@var{size}_set_arch_mach} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_set_arch_mach, - (bfd *, - enum bfd_architecture arch, - unsigned long machine); -@end example -@strong{Description}@* -Set the architecture and the machine of the BFD @var{abfd} to the -values @var{arch} and @var{machine}. Verify that @var{abfd}'s format -can support the architecture required. - -@findex aout_@var{size}_new_section_hook -@subsubsection @code{aout_@var{size}_new_section_hook} -@strong{Synopsis} -@example -bfd_boolean aout_@var{size}_new_section_hook, - (bfd *abfd, - asection *newsect); -@end example -@strong{Description}@* -Called by the BFD in response to a @code{bfd_make_section} -request. - diff --git a/contrib/binutils/bfd/doc/archive.texi b/contrib/binutils/bfd/doc/archive.texi deleted file mode 100644 index 3d0a97d4b82..00000000000 --- a/contrib/binutils/bfd/doc/archive.texi +++ /dev/null @@ -1,99 +0,0 @@ -@section Archives - - -@strong{Description}@* -An archive (or library) is just another BFD. It has a symbol -table, although there's not much a user program will do with it. - -The big difference between an archive BFD and an ordinary BFD -is that the archive doesn't have sections. Instead it has a -chain of BFDs that are considered its contents. These BFDs can -be manipulated like any other. The BFDs contained in an -archive opened for reading will all be opened for reading. You -may put either input or output BFDs into an archive opened for -output; they will be handled correctly when the archive is closed. - -Use @code{bfd_openr_next_archived_file} to step through -the contents of an archive opened for input. You don't -have to read the entire archive if you don't want -to! Read it until you find what you want. - -Archive contents of output BFDs are chained through the -@code{next} pointer in a BFD. The first one is findable through -the @code{archive_head} slot of the archive. Set it with -@code{bfd_set_archive_head} (q.v.). A given BFD may be in only one -open output archive at a time. - -As expected, the BFD archive code is more general than the -archive code of any given environment. BFD archives may -contain files of different formats (e.g., a.out and coff) and -even different architectures. You may even place archives -recursively into archives! - -This can cause unexpected confusion, since some archive -formats are more expressive than others. For instance, Intel -COFF archives can preserve long filenames; SunOS a.out archives -cannot. If you move a file from the first to the second -format and back again, the filename may be truncated. -Likewise, different a.out environments have different -conventions as to how they truncate filenames, whether they -preserve directory names in filenames, etc. When -interoperating with native tools, be sure your files are -homogeneous. - -Beware: most of these formats do not react well to the -presence of spaces in filenames. We do the best we can, but -can't always handle this case due to restrictions in the format of -archives. Many Unix utilities are braindead in regards to -spaces and such in filenames anyway, so this shouldn't be much -of a restriction. - -Archives are supported in BFD in @code{archive.c}. - -@subsection Archive functions - - -@findex bfd_get_next_mapent -@subsubsection @code{bfd_get_next_mapent} -@strong{Synopsis} -@example -symindex bfd_get_next_mapent - (bfd *abfd, symindex previous, carsym **sym); -@end example -@strong{Description}@* -Step through archive @var{abfd}'s symbol table (if it -has one). Successively update @var{sym} with the next symbol's -information, returning that symbol's (internal) index into the -symbol table. - -Supply @code{BFD_NO_MORE_SYMBOLS} as the @var{previous} entry to get -the first one; returns @code{BFD_NO_MORE_SYMBOLS} when you've already -got the last one. - -A @code{carsym} is a canonical archive symbol. The only -user-visible element is its name, a null-terminated string. - -@findex bfd_set_archive_head -@subsubsection @code{bfd_set_archive_head} -@strong{Synopsis} -@example -bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); -@end example -@strong{Description}@* -Set the head of the chain of -BFDs contained in the archive @var{output} to @var{new_head}. - -@findex bfd_openr_next_archived_file -@subsubsection @code{bfd_openr_next_archived_file} -@strong{Synopsis} -@example -bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); -@end example -@strong{Description}@* -Provided a BFD, @var{archive}, containing an archive and NULL, open -an input BFD on the first contained element and returns that. -Subsequent calls should pass -the archive and the previous return value to return a created -BFD to the next contained element. NULL is returned when there -are no more. - diff --git a/contrib/binutils/bfd/doc/archures.texi b/contrib/binutils/bfd/doc/archures.texi deleted file mode 100644 index bf72179dad3..00000000000 --- a/contrib/binutils/bfd/doc/archures.texi +++ /dev/null @@ -1,585 +0,0 @@ -@section Architectures -BFD keeps one atom in a BFD describing the -architecture of the data attached to the BFD: a pointer to a -@code{bfd_arch_info_type}. - -Pointers to structures can be requested independently of a BFD -so that an architecture's information can be interrogated -without access to an open BFD. - -The architecture information is provided by each architecture package. -The set of default architectures is selected by the macro -@code{SELECT_ARCHITECTURES}. This is normally set up in the -@file{config/@var{target}.mt} file of your choice. If the name is not -defined, then all the architectures supported are included. - -When BFD starts up, all the architectures are called with an -initialize method. It is up to the architecture back end to -insert as many items into the list of architectures as it wants to; -generally this would be one for each machine and one for the -default case (an item with a machine field of 0). - -BFD's idea of an architecture is implemented in @file{archures.c}. - -@subsection bfd_architecture - - -@strong{Description}@* -This enum gives the object file's CPU architecture, in a -global sense---i.e., what processor family does it belong to? -Another field indicates which processor within -the family is in use. The machine gives a number which -distinguishes different versions of the architecture, -containing, for example, 2 and 3 for Intel i960 KA and i960 KB, -and 68020 and 68030 for Motorola 68020 and 68030. -@example -enum bfd_architecture -@{ - bfd_arch_unknown, /* File arch not known. */ - bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_mcf_isa_a_nodiv 9 -#define bfd_mach_mcf_isa_a 10 -#define bfd_mach_mcf_isa_a_mac 11 -#define bfd_mach_mcf_isa_a_emac 12 -#define bfd_mach_mcf_isa_aplus 13 -#define bfd_mach_mcf_isa_aplus_mac 14 -#define bfd_mach_mcf_isa_aplus_emac 15 -#define bfd_mach_mcf_isa_b_nousp 16 -#define bfd_mach_mcf_isa_b_nousp_mac 17 -#define bfd_mach_mcf_isa_b_nousp_emac 18 -#define bfd_mach_mcf_isa_b 19 -#define bfd_mach_mcf_isa_b_mac 20 -#define bfd_mach_mcf_isa_b_emac 21 -#define bfd_mach_mcf_isa_b_float 22 -#define bfd_mach_mcf_isa_b_float_mac 23 -#define bfd_mach_mcf_isa_b_float_emac 24 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ - -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 - - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ -#define bfd_mach_sparc 1 -/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ -#define bfd_mach_sparc_sparclet 2 -#define bfd_mach_sparc_sparclite 3 -#define bfd_mach_sparc_v8plus 4 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ -#define bfd_mach_sparc_sparclite_le 6 -#define bfd_mach_sparc_v9 7 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ -#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ -#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ -/* Nonzero if MACH has the v9 instruction set. */ -#define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ - && (mach) != bfd_mach_sparc_sparclite_le) -/* Nonzero if MACH is a 64 bit sparc architecture. */ -#define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_mips, /* MIPS Rxxxx */ -#define bfd_mach_mips3000 3000 -#define bfd_mach_mips3900 3900 -#define bfd_mach_mips4000 4000 -#define bfd_mach_mips4010 4010 -#define bfd_mach_mips4100 4100 -#define bfd_mach_mips4111 4111 -#define bfd_mach_mips4120 4120 -#define bfd_mach_mips4300 4300 -#define bfd_mach_mips4400 4400 -#define bfd_mach_mips4600 4600 -#define bfd_mach_mips4650 4650 -#define bfd_mach_mips5000 5000 -#define bfd_mach_mips5400 5400 -#define bfd_mach_mips5500 5500 -#define bfd_mach_mips6000 6000 -#define bfd_mach_mips7000 7000 -#define bfd_mach_mips8000 8000 -#define bfd_mach_mips9000 9000 -#define bfd_mach_mips10000 10000 -#define bfd_mach_mips12000 12000 -#define bfd_mach_mips16 16 -#define bfd_mach_mips5 5 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ -#define bfd_mach_mipsisa32 32 -#define bfd_mach_mipsisa32r2 33 -#define bfd_mach_mipsisa64 64 -#define bfd_mach_mipsisa64r2 65 - bfd_arch_i386, /* Intel 386 */ -#define bfd_mach_i386_i386 1 -#define bfd_mach_i386_i8086 2 -#define bfd_mach_i386_i386_intel_syntax 3 -#define bfd_mach_x86_64 64 -#define bfd_mach_x86_64_intel_syntax 65 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ - bfd_arch_powerpc, /* PowerPC */ -#define bfd_mach_ppc 32 -#define bfd_mach_ppc64 64 -#define bfd_mach_ppc_403 403 -#define bfd_mach_ppc_403gc 4030 -#define bfd_mach_ppc_505 505 -#define bfd_mach_ppc_601 601 -#define bfd_mach_ppc_602 602 -#define bfd_mach_ppc_603 603 -#define bfd_mach_ppc_ec603e 6031 -#define bfd_mach_ppc_604 604 -#define bfd_mach_ppc_620 620 -#define bfd_mach_ppc_630 630 -#define bfd_mach_ppc_750 750 -#define bfd_mach_ppc_860 860 -#define bfd_mach_ppc_a35 35 -#define bfd_mach_ppc_rs64ii 642 -#define bfd_mach_ppc_rs64iii 643 -#define bfd_mach_ppc_7400 7400 -#define bfd_mach_ppc_e500 500 - bfd_arch_rs6000, /* IBM RS/6000 */ -#define bfd_mach_rs6k 6000 -#define bfd_mach_rs6k_rs1 6001 -#define bfd_mach_rs6k_rsc 6003 -#define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ -#define bfd_mach_hppa10 10 -#define bfd_mach_hppa11 11 -#define bfd_mach_hppa20 20 -#define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ -#define bfd_mach_d10v 1 -#define bfd_mach_d10v_ts2 2 -#define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ -#define bfd_mach_m6812_default 0 -#define bfd_mach_m6812 1 -#define bfd_mach_m6812s 2 - bfd_arch_z8k, /* Zilog Z8000 */ -#define bfd_mach_z8001 1 -#define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b -#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM. */ -#define bfd_mach_arm_unknown 0 -#define bfd_mach_arm_2 1 -#define bfd_mach_arm_2a 2 -#define bfd_mach_arm_3 3 -#define bfd_mach_arm_3M 4 -#define bfd_mach_arm_4 5 -#define bfd_mach_arm_4T 6 -#define bfd_mach_arm_5 7 -#define bfd_mach_arm_5T 8 -#define bfd_mach_arm_5TE 9 -#define bfd_mach_arm_XScale 10 -#define bfd_mach_arm_ep9312 11 -#define bfd_mach_arm_iWMMXt 12 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ -#define bfd_mach_tic3x 30 -#define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ -#define bfd_mach_v850 1 -#define bfd_mach_v850e 'E' -#define bfd_mach_v850e1 '1' - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ -#define bfd_mach_m32r 1 /* For backwards compatibility. */ -#define bfd_mach_m32rx 'x' -#define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 -#define bfd_mach_am33 330 -#define bfd_mach_am33_2 332 - bfd_arch_fr30, -#define bfd_mach_fr30 0x46523330 - bfd_arch_frv, -#define bfd_mach_frv 1 -#define bfd_mach_frvsimple 2 -#define bfd_mach_fr300 300 -#define bfd_mach_fr400 400 -#define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ -#define bfd_mach_fr500 500 -#define bfd_mach_fr550 550 - bfd_arch_mcore, - bfd_arch_ia64, /* HP/Intel ia64 */ -#define bfd_mach_ia64_elf64 64 -#define bfd_mach_ia64_elf32 32 - bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ -#define bfd_mach_ip2022 1 -#define bfd_mach_ip2022ext 2 - bfd_arch_iq2000, /* Vitesse IQ2000. */ -#define bfd_mach_iq2000 1 -#define bfd_mach_iq10 2 - bfd_arch_mt, -#define bfd_mach_ms1 1 -#define bfd_mach_mrisc2 2 -#define bfd_mach_ms2 3 - bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers. */ -#define bfd_mach_avr1 1 -#define bfd_mach_avr2 2 -#define bfd_mach_avr3 3 -#define bfd_mach_avr4 4 -#define bfd_mach_avr5 5 - bfd_arch_bfin, /* ADI Blackfin */ -#define bfd_mach_bfin 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 - bfd_arch_crx, /* National Semiconductor CRX. */ -#define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ -#define bfd_mach_cris_v0_v10 255 -#define bfd_mach_cris_v32 32 -#define bfd_mach_cris_v10_v32 1032 - bfd_arch_s390, /* IBM s390 */ -#define bfd_mach_s390_31 31 -#define bfd_mach_s390_64 64 - bfd_arch_openrisc, /* OpenRISC */ - bfd_arch_mmix, /* Donald Knuth's educational processor. */ - bfd_arch_xstormy16, -#define bfd_mach_xstormy16 1 - bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ -#define bfd_mach_xc16x 1 -#define bfd_mach_xc16xl 2 -#define bfd_mach_xc16xs 3 - bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ -#define bfd_mach_xtensa 1 - bfd_arch_maxq, /* Dallas MAXQ 10/20 */ -#define bfd_mach_maxq10 10 -#define bfd_mach_maxq20 20 - bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_last - @}; -@end example - -@subsection bfd_arch_info - - -@strong{Description}@* -This structure contains information on architectures for use -within BFD. -@example - -typedef struct bfd_arch_info -@{ - int bits_per_word; - int bits_per_address; - int bits_per_byte; - enum bfd_architecture arch; - unsigned long mach; - const char *arch_name; - const char *printable_name; - unsigned int section_align_power; - /* TRUE if this is the default machine for the architecture. - The default arch should be the first entry for an arch so that - all the entries for that arch can be accessed via @code{next}. */ - bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - - bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); - - const struct bfd_arch_info *next; -@} -bfd_arch_info_type; - -@end example - -@findex bfd_printable_name -@subsubsection @code{bfd_printable_name} -@strong{Synopsis} -@example -const char *bfd_printable_name (bfd *abfd); -@end example -@strong{Description}@* -Return a printable string representing the architecture and machine -from the pointer to the architecture info structure. - -@findex bfd_scan_arch -@subsubsection @code{bfd_scan_arch} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_scan_arch (const char *string); -@end example -@strong{Description}@* -Figure out if BFD supports any cpu which could be described with -the name @var{string}. Return a pointer to an @code{arch_info} -structure if a machine is found, otherwise NULL. - -@findex bfd_arch_list -@subsubsection @code{bfd_arch_list} -@strong{Synopsis} -@example -const char **bfd_arch_list (void); -@end example -@strong{Description}@* -Return a freshly malloced NULL-terminated vector of the names -of all the valid BFD architectures. Do not modify the names. - -@findex bfd_arch_get_compatible -@subsubsection @code{bfd_arch_get_compatible} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_arch_get_compatible - (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); -@end example -@strong{Description}@* -Determine whether two BFDs' architectures and machine types -are compatible. Calculates the lowest common denominator -between the two architectures and machine types implied by -the BFDs and returns a pointer to an @code{arch_info} structure -describing the compatible machine. - -@findex bfd_default_arch_struct -@subsubsection @code{bfd_default_arch_struct} -@strong{Description}@* -The @code{bfd_default_arch_struct} is an item of -@code{bfd_arch_info_type} which has been initialized to a fairly -generic state. A BFD starts life by pointing to this -structure, until the correct back end has determined the real -architecture of the file. -@example -extern const bfd_arch_info_type bfd_default_arch_struct; -@end example - -@findex bfd_set_arch_info -@subsubsection @code{bfd_set_arch_info} -@strong{Synopsis} -@example -void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -@end example -@strong{Description}@* -Set the architecture info of @var{abfd} to @var{arg}. - -@findex bfd_default_set_arch_mach -@subsubsection @code{bfd_default_set_arch_mach} -@strong{Synopsis} -@example -bfd_boolean bfd_default_set_arch_mach - (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -@end example -@strong{Description}@* -Set the architecture and machine type in BFD @var{abfd} -to @var{arch} and @var{mach}. Find the correct -pointer to a structure and insert it into the @code{arch_info} -pointer. - -@findex bfd_get_arch -@subsubsection @code{bfd_get_arch} -@strong{Synopsis} -@example -enum bfd_architecture bfd_get_arch (bfd *abfd); -@end example -@strong{Description}@* -Return the enumerated type which describes the BFD @var{abfd}'s -architecture. - -@findex bfd_get_mach -@subsubsection @code{bfd_get_mach} -@strong{Synopsis} -@example -unsigned long bfd_get_mach (bfd *abfd); -@end example -@strong{Description}@* -Return the long type which describes the BFD @var{abfd}'s -machine. - -@findex bfd_arch_bits_per_byte -@subsubsection @code{bfd_arch_bits_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_arch_bits_per_byte (bfd *abfd); -@end example -@strong{Description}@* -Return the number of bits in one of the BFD @var{abfd}'s -architecture's bytes. - -@findex bfd_arch_bits_per_address -@subsubsection @code{bfd_arch_bits_per_address} -@strong{Synopsis} -@example -unsigned int bfd_arch_bits_per_address (bfd *abfd); -@end example -@strong{Description}@* -Return the number of bits in one of the BFD @var{abfd}'s -architecture's addresses. - -@findex bfd_default_compatible -@subsubsection @code{bfd_default_compatible} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, const bfd_arch_info_type *b); -@end example -@strong{Description}@* -The default function for testing for compatibility. - -@findex bfd_default_scan -@subsubsection @code{bfd_default_scan} -@strong{Synopsis} -@example -bfd_boolean bfd_default_scan - (const struct bfd_arch_info *info, const char *string); -@end example -@strong{Description}@* -The default function for working out whether this is an -architecture hit and a machine hit. - -@findex bfd_get_arch_info -@subsubsection @code{bfd_get_arch_info} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); -@end example -@strong{Description}@* -Return the architecture info struct in @var{abfd}. - -@findex bfd_lookup_arch -@subsubsection @code{bfd_lookup_arch} -@strong{Synopsis} -@example -const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -Look for the architecture info structure which matches the -arguments @var{arch} and @var{machine}. A machine of 0 matches the -machine/architecture structure which marks itself as the -default. - -@findex bfd_printable_arch_mach -@subsubsection @code{bfd_printable_arch_mach} -@strong{Synopsis} -@example -const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -Return a printable string representing the architecture and -machine type. - -This routine is depreciated. - -@findex bfd_octets_per_byte -@subsubsection @code{bfd_octets_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_octets_per_byte (bfd *abfd); -@end example -@strong{Description}@* -Return the number of octets (8-bit quantities) per target byte -(minimum addressable unit). In most cases, this will be one, but some -DSP targets have 16, 32, or even 48 bits per byte. - -@findex bfd_arch_mach_octets_per_byte -@subsubsection @code{bfd_arch_mach_octets_per_byte} -@strong{Synopsis} -@example -unsigned int bfd_arch_mach_octets_per_byte - (enum bfd_architecture arch, unsigned long machine); -@end example -@strong{Description}@* -See bfd_octets_per_byte. - -This routine is provided for those cases where a bfd * is not -available - diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo index 432e0526449..04b4266e651 100644 --- a/contrib/binutils/bfd/doc/bfd.texinfo +++ b/contrib/binutils/bfd/doc/bfd.texinfo @@ -1,7 +1,7 @@ \input texinfo.tex @setfilename bfd.info @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, -@c 2001, 2002, 2003 +@c 2001, 2002, 2003, 2006, 2007 @c Free Software Foundation, Inc. @c @synindex fn cp @@ -14,26 +14,29 @@ END-INFO-DIR-ENTRY @end format @end ifinfo -@ifinfo +@copying This file documents the BFD library. -Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2000, 2001, 2003, 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 - 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''. +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 ``GNU General Public License'' and ``Funding +Free Software'', the Front-Cover texts being (a) (see below), and with +the Back-Cover Texts being (b) (see below). A copy of the license is +included in the section entitled ``GNU Free Documentation License''. -@ignore -Permission is granted to process this file through Tex and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). +(a) The FSF's Front-Cover Text is: -@end ignore -@end ifinfo + A GNU Manual + +(b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. +@end copying @iftex @c@finalout @setchapternewpage on @@ -43,7 +46,7 @@ notice identical to this one except for the removal of this paragraph @title{libbfd} @subtitle{The Binary File Descriptor Library} @sp 1 -@subtitle First Edition---BFD version < 3.0 % Since no product is stable berfore version 3.0 :-) +@subtitle First Edition---BFD version < 3.0 % Since no product is stable before version 3.0 :-) @subtitle Original Document Created: April 1991 @author {Steve Chamberlain} @author {Cygnus Support} @@ -62,7 +65,7 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2001, 2003, 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 @@ -73,6 +76,7 @@ Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc. @end titlepage @end iftex +@contents @node Top, Overview, (dir), (dir) @ifinfo @@ -84,7 +88,7 @@ This file documents the binary file descriptor library libbfd. * BFD front end:: BFD front end * BFD back ends:: BFD back ends * GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index +* BFD Index:: BFD Index @end menu @node Overview, BFD front end, Top, Top @@ -144,7 +148,7 @@ To use the library, include @file{bfd.h} and link with @file{libbfd.a}. BFD provides a common interface to the parts of an object file for a calling application. -When an application sucessfully opens a target file (object, archive, or +When an application successfully opens a target file (object, archive, or whatever), a pointer to an internal structure is returned. This pointer points to a structure called @code{bfd}, described in @file{bfd.h}. Our convention is to call this pointer a BFD, and @@ -294,6 +298,7 @@ structures. @end ignore @end menu @node What to Put Where, aout, BFD back ends, BFD back ends +@section What to Put Where All of BFD lives in one directory. @node aout, coff, What to Put Where, BFD back ends @@ -310,11 +315,11 @@ All of BFD lives in one directory. @node mmo, , elf, BFD back ends @include mmo.texi -@node GNU Free Documentation License, Index, BFD back ends, Top +@node GNU Free Documentation License, BFD Index, BFD back ends, Top @include fdl.texi -@node Index, , GNU Free Documentation License, Top -@unnumbered Index +@node BFD Index, , GNU Free Documentation License, Top +@unnumbered BFD Index @printindex cp @tex @@ -332,5 +337,4 @@ All of BFD lives in one directory. % Blame: doc@cygnus.com, 28mar91. @end tex -@contents @bye diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi index 98826fd5206..b7e7c548e6a 100644 --- a/contrib/binutils/bfd/doc/bfdint.texi +++ b/contrib/binutils/bfd/doc/bfdint.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 2000, 2001, 2002, 2003, 2004 +@c 2000, 2001, 2002, 2003, 2004, 2006, 2007 @c Free Software Foundation, Inc. @setfilename bfdint.info @@ -13,6 +13,33 @@ @page @end iftex +@copying +This file documents the internals of the BFD library. + +Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, +1996, 1998, 2000, 2001, 2002, 2003, 2004, 2006, 2007 +Free Software Foundation, Inc. +Contributed by Cygnus Support. + +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 ``GNU General Public License'' and ``Funding +Free Software'', the Front-Cover texts being (a) (see below), and with +the Back-Cover Texts being (b) (see below). A copy of the license is +included in the section entitled ``GNU Free Documentation License''. + +(a) The FSF's Front-Cover Text is: + + A GNU Manual + +(b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. +@end copying + @node Top @top BFD Internals @raisesections @@ -189,7 +216,7 @@ and handle it using the special hooks. In some cases there is also implicit information which BFD can not represent. For example, the MIPS processor distinguishes small and -large symbols, and requires that all small symbls be within 32K of the +large symbols, and requires that all small symbols be within 32K of the GP register. This means that the MIPS assembler must be able to mark variables as either small or large, and the MIPS linker must know to put small symbols within range of the GP register. Since BFD can not @@ -230,7 +257,7 @@ Follow the GNU coding standards. Avoid global variables. We ideally want BFD to be fully reentrant, so that it can be used in multiple threads. All uses of global or static variables interfere with that. Initialized constant variables are OK, -and they should be explicitly marked with const. Instead of global +and they should be explicitly marked with @samp{const}. Instead of global variables, use data attached to a BFD or to a linker hash table. @item @@ -1391,7 +1418,7 @@ constants used by the generic support. @subsection ELF sections and segments The ELF ABI permits a file to have either sections or segments or both. -Relocateable object files conventionally have only sections. +Relocatable object files conventionally have only sections. Executables conventionally have both. Core files conventionally have only program segments. @@ -1744,23 +1771,6 @@ support. The processor function hooks and constants are ad hoc and need better documentation. -When a linker script uses @samp{SIZEOF_HEADERS}, the ELF backend must -guess at the number of program segments which will be required, in -@samp{get_program_header_size}. This is because the linker calls -@samp{bfd_sizeof_headers} before it knows all the section addresses and -sizes. The ELF backend may later discover, when creating program -segments, that more program segments are required. This is currently -reported as an error in @samp{assign_file_positions_for_segments}. - -In practice this makes it difficult to use @samp{SIZEOF_HEADERS} except -with a carefully defined linker script. Unfortunately, -@samp{SIZEOF_HEADERS} is required for fast program loading on a native -system, since it permits the initial code section to appear on the same -page as the program segments, saving a page read when the program starts -running. Fortunately, native systems permit careful definition of the -linker script. Still, ideally it would be possible to use relaxation to -compute the number of program segments. - @node BFD glossary @section BFD glossary @cindex glossary for bfd diff --git a/contrib/binutils/bfd/doc/bfdio.texi b/contrib/binutils/bfd/doc/bfdio.texi deleted file mode 100644 index eb7e31df9d0..00000000000 --- a/contrib/binutils/bfd/doc/bfdio.texi +++ /dev/null @@ -1,72 +0,0 @@ -@findex struct bfd_iovec -@subsubsection @code{struct bfd_iovec} -@strong{Description}@* -The @code{struct bfd_iovec} contains the internal file I/O class. -Each @code{BFD} has an instance of this class and all file I/O is -routed through it (it is assumed that the instance implements -all methods listed below). -@example -struct bfd_iovec -@{ - /* To avoid problems with macros, a "b" rather than "f" - prefix is prepended to each method name. */ - /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching - bytes starting at PTR. Return the number of bytes actually - transfered (a read past end-of-file returns less than NBYTES), - or -1 (setting @code{bfd_error}) if an error occurs. */ - file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes); - file_ptr (*bwrite) (struct bfd *abfd, const void *ptr, - file_ptr nbytes); - /* Return the current IOSTREAM file offset, or -1 (setting @code{bfd_error} - if an error occurs. */ - file_ptr (*btell) (struct bfd *abfd); - /* For the following, on successful completion a value of 0 is returned. - Otherwise, a value of -1 is returned (and @code{bfd_error} is set). */ - int (*bseek) (struct bfd *abfd, file_ptr offset, int whence); - int (*bclose) (struct bfd *abfd); - int (*bflush) (struct bfd *abfd); - int (*bstat) (struct bfd *abfd, struct stat *sb); -@}; -@end example - -@findex bfd_get_mtime -@subsubsection @code{bfd_get_mtime} -@strong{Synopsis} -@example -long bfd_get_mtime (bfd *abfd); -@end example -@strong{Description}@* -Return the file modification time (as read from the file system, or -from the archive header for archive members). - -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Synopsis} -@example -long bfd_get_size (bfd *abfd); -@end example -@strong{Description}@* -Return the file size (as read from file system) for the file -associated with BFD @var{abfd}. - -The initial motivation for, and use of, this routine is not -so we can get the exact size of the object the BFD applies to, since -that might not be generally possible (archive members for example). -It would be ideal if someone could eventually modify -it so that such results were guaranteed. - -Instead, we want to ask questions like "is this NNN byte sized -object I'm about to try read from file offset YYY reasonable?" -As as example of where we might do this, some object formats -use string tables for which the first @code{sizeof (long)} bytes of the -table contain the size of the table itself, including the size bytes. -If an application tries to read what it thinks is one of these -string tables, without some way to validate the size, and for -some reason the size is wrong (byte swapping error, wrong location -for the string table, etc.), the only clue is likely to be a read -error when it tries to read the table, or a "virtual memory -exhausted" error when it tries to allocate 15 bazillon bytes -of space for the 15 bazillon byte table it is about to read. -This function at least allows us to answer the question, "is the -size reasonable?". - diff --git a/contrib/binutils/bfd/doc/bfdt.texi b/contrib/binutils/bfd/doc/bfdt.texi deleted file mode 100644 index a22fe3861d9..00000000000 --- a/contrib/binutils/bfd/doc/bfdt.texi +++ /dev/null @@ -1,721 +0,0 @@ -@section @code{typedef bfd} -A BFD has type @code{bfd}; objects of this type are the -cornerstone of any application using BFD. Using BFD -consists of making references though the BFD and to data in the BFD. - -Here is the structure that defines the type @code{bfd}. It -contains the major data about the file and pointers -to the rest of the data. - - -@example - -struct bfd -@{ - /* A unique identifier of the BFD */ - unsigned int id; - - /* The filename the application opened the BFD with. */ - const char *filename; - - /* A pointer to the target jump table. */ - const struct bfd_target *xvec; - - /* The IOSTREAM, and corresponding IO vector that provide access - to the file backing the BFD. */ - void *iostream; - const struct bfd_iovec *iovec; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - bfd_boolean cacheable; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - bfd_boolean target_defaulted; - - /* The caching routines use these to maintain a - least-recently-used list of BFDs. */ - struct bfd *lru_prev, *lru_next; - - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ - ufile_ptr where; - - /* ... and here: (``once'' means at least once). */ - bfd_boolean opened_once; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - bfd_boolean mtime_set; - - /* File modified time, if mtime_set is TRUE. */ - long mtime; - - /* Reserved for an unimplemented file locking extension. */ - int ifd; - - /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; - - /* The direction with which the BFD was opened. */ - enum bfd_direction - @{ - no_direction = 0, - read_direction = 1, - write_direction = 2, - both_direction = 3 - @} - direction; - - /* Format_specific flags. */ - flagword flags; - - /* Currently my_archive is tested before adding origin to - anything. I believe that this can become always an add of - origin, with origin set to 0 for non archive files. */ - ufile_ptr origin; - - /* Remember when output has begun, to stop strange things - from happening. */ - bfd_boolean output_has_begun; - - /* A hash table for section names. */ - struct bfd_hash_table section_htab; - - /* Pointer to linked list of sections. */ - struct bfd_section *sections; - - /* The last section on the section list. */ - struct bfd_section *section_last; - - /* The number of sections. */ - unsigned int section_count; - - /* Stuff only useful for object files: - The start address. */ - bfd_vma start_address; - - /* Used for input and output. */ - unsigned int symcount; - - /* Symbol table for output BFD (with symcount entries). */ - struct bfd_symbol **outsymbols; - - /* Used for slurped dynamic symbol tables. */ - unsigned int dynsymcount; - - /* Pointer to structure which contains architecture information. */ - const struct bfd_arch_info *arch_info; - - /* Flag set if symbols from this BFD should not be exported. */ - bfd_boolean no_export; - - /* Stuff only useful for archives. */ - void *arelt_data; - struct bfd *my_archive; /* The containing archive BFD. */ - struct bfd *next; /* The next BFD in the archive. */ - struct bfd *archive_head; /* The first BFD in the archive. */ - bfd_boolean has_armap; - - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; - - /* Used by the back end to hold private data. */ - union - @{ - struct aout_data_struct *aout_data; - struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; - struct coff_tdata *coff_obj_data; - struct pe_tdata *pe_obj_data; - struct xcoff_tdata *xcoff_obj_data; - struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; - struct srec_data_struct *srec_data; - struct ihex_data_struct *ihex_data; - struct tekhex_data_struct *tekhex_data; - struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; - struct mmo_data_struct *mmo_data; - struct sun_core_struct *sun_core_data; - struct sco5_core_struct *sco5_core_data; - struct trad_core_struct *trad_core_data; - struct som_data_struct *som_data; - struct hpux_core_struct *hpux_core_data; - struct hppabsd_core_struct *hppabsd_core_data; - struct sgi_core_struct *sgi_core_data; - struct lynx_core_struct *lynx_core_data; - struct osf_core_struct *osf_core_data; - struct cisco_core_struct *cisco_core_data; - struct versados_data_struct *versados_data; - struct netbsd_core_struct *netbsd_core_data; - struct mach_o_data_struct *mach_o_data; - struct mach_o_fat_data_struct *mach_o_fat_data; - struct bfd_pef_data_struct *pef_data; - struct bfd_pef_xlib_data_struct *pef_xlib_data; - struct bfd_sym_data_struct *sym_data; - void *any; - @} - tdata; - - /* Used by the application to hold private data. */ - void *usrdata; - - /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use void * to avoid requiring the inclusion - of objalloc.h. */ - void *memory; -@}; - -@end example -@section Error reporting -Most BFD functions return nonzero on success (check their -individual documentation for precise semantics). On an error, -they call @code{bfd_set_error} to set an error condition that callers -can check by calling @code{bfd_get_error}. -If that returns @code{bfd_error_system_call}, then check -@code{errno}. - -The easiest way to report a BFD error to the user is to -use @code{bfd_perror}. - -@subsection Type @code{bfd_error_type} -The values returned by @code{bfd_get_error} are defined by the -enumerated type @code{bfd_error_type}. - - -@example - -typedef enum bfd_error -@{ - bfd_error_no_error = 0, - bfd_error_system_call, - bfd_error_invalid_target, - bfd_error_wrong_format, - bfd_error_wrong_object_format, - bfd_error_invalid_operation, - bfd_error_no_memory, - bfd_error_no_symbols, - bfd_error_no_armap, - bfd_error_no_more_archived_files, - bfd_error_malformed_archive, - bfd_error_file_not_recognized, - bfd_error_file_ambiguously_recognized, - bfd_error_no_contents, - bfd_error_nonrepresentable_section, - bfd_error_no_debug_section, - bfd_error_bad_value, - bfd_error_file_truncated, - bfd_error_file_too_big, - bfd_error_invalid_error_code -@} -bfd_error_type; - -@end example -@findex bfd_get_error -@subsubsection @code{bfd_get_error} -@strong{Synopsis} -@example -bfd_error_type bfd_get_error (void); -@end example -@strong{Description}@* -Return the current BFD error condition. - -@findex bfd_set_error -@subsubsection @code{bfd_set_error} -@strong{Synopsis} -@example -void bfd_set_error (bfd_error_type error_tag); -@end example -@strong{Description}@* -Set the BFD error condition to be @var{error_tag}. - -@findex bfd_errmsg -@subsubsection @code{bfd_errmsg} -@strong{Synopsis} -@example -const char *bfd_errmsg (bfd_error_type error_tag); -@end example -@strong{Description}@* -Return a string describing the error @var{error_tag}, or -the system error if @var{error_tag} is @code{bfd_error_system_call}. - -@findex bfd_perror -@subsubsection @code{bfd_perror} -@strong{Synopsis} -@example -void bfd_perror (const char *message); -@end example -@strong{Description}@* -Print to the standard error stream a string describing the -last BFD error that occurred, or the last system error if -the last BFD error was a system call failure. If @var{message} -is non-NULL and non-empty, the error string printed is preceded -by @var{message}, a colon, and a space. It is followed by a newline. - -@subsection BFD error handler -Some BFD functions want to print messages describing the -problem. They call a BFD error handler function. This -function may be overridden by the program. - -The BFD error handler acts like printf. - - -@example - -typedef void (*bfd_error_handler_type) (const char *, ...); - -@end example -@findex bfd_set_error_handler -@subsubsection @code{bfd_set_error_handler} -@strong{Synopsis} -@example -bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); -@end example -@strong{Description}@* -Set the BFD error handler function. Returns the previous -function. - -@findex bfd_set_error_program_name -@subsubsection @code{bfd_set_error_program_name} -@strong{Synopsis} -@example -void bfd_set_error_program_name (const char *); -@end example -@strong{Description}@* -Set the program name to use when printing a BFD error. This -is printed before the error message followed by a colon and -space. The string must not be changed after it is passed to -this function. - -@findex bfd_get_error_handler -@subsubsection @code{bfd_get_error_handler} -@strong{Synopsis} -@example -bfd_error_handler_type bfd_get_error_handler (void); -@end example -@strong{Description}@* -Return the BFD error handler function. - -@section Miscellaneous - - -@subsection Miscellaneous functions - - -@findex bfd_get_reloc_upper_bound -@subsubsection @code{bfd_get_reloc_upper_bound} -@strong{Synopsis} -@example -long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); -@end example -@strong{Description}@* -Return the number of bytes required to store the -relocation information associated with section @var{sect} -attached to bfd @var{abfd}. If an error occurs, return -1. - -@findex bfd_canonicalize_reloc -@subsubsection @code{bfd_canonicalize_reloc} -@strong{Synopsis} -@example -long bfd_canonicalize_reloc - (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); -@end example -@strong{Description}@* -Call the back end associated with the open BFD -@var{abfd} and translate the external form of the relocation -information attached to @var{sec} into the internal canonical -form. Place the table into memory at @var{loc}, which has -been preallocated, usually by a call to -@code{bfd_get_reloc_upper_bound}. Returns the number of relocs, or --1 on error. - -The @var{syms} table is also needed for horrible internal magic -reasons. - -@findex bfd_set_reloc -@subsubsection @code{bfd_set_reloc} -@strong{Synopsis} -@example -void bfd_set_reloc - (bfd *abfd, asection *sec, arelent **rel, unsigned int count); -@end example -@strong{Description}@* -Set the relocation pointer and count within -section @var{sec} to the values @var{rel} and @var{count}. -The argument @var{abfd} is ignored. - -@findex bfd_set_file_flags -@subsubsection @code{bfd_set_file_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); -@end example -@strong{Description}@* -Set the flag word in the BFD @var{abfd} to the value @var{flags}. - -Possible errors are: -@itemize @bullet - -@item -@code{bfd_error_wrong_format} - The target bfd was not of object format. -@item -@code{bfd_error_invalid_operation} - The target bfd was open for reading. -@item -@code{bfd_error_invalid_operation} - -The flag word contained a bit which was not applicable to the -type of file. E.g., an attempt was made to set the @code{D_PAGED} bit -on a BFD format which does not support demand paging. -@end itemize - -@findex bfd_get_arch_size -@subsubsection @code{bfd_get_arch_size} -@strong{Synopsis} -@example -int bfd_get_arch_size (bfd *abfd); -@end example -@strong{Description}@* -Returns the architecture address size, in bits, as determined -by the object file's format. For ELF, this information is -included in the header. - -@strong{Returns}@* -Returns the arch size in bits if known, @code{-1} otherwise. - -@findex bfd_get_sign_extend_vma -@subsubsection @code{bfd_get_sign_extend_vma} -@strong{Synopsis} -@example -int bfd_get_sign_extend_vma (bfd *abfd); -@end example -@strong{Description}@* -Indicates if the target architecture "naturally" sign extends -an address. Some architectures implicitly sign extend address -values when they are converted to types larger than the size -of an address. For instance, bfd_get_start_address() will -return an address sign extended to fill a bfd_vma when this is -the case. - -@strong{Returns}@* -Returns @code{1} if the target architecture is known to sign -extend addresses, @code{0} if the target architecture is known to -not sign extend addresses, and @code{-1} otherwise. - -@findex bfd_set_start_address -@subsubsection @code{bfd_set_start_address} -@strong{Synopsis} -@example -bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); -@end example -@strong{Description}@* -Make @var{vma} the entry point of output BFD @var{abfd}. - -@strong{Returns}@* -Returns @code{TRUE} on success, @code{FALSE} otherwise. - -@findex bfd_get_gp_size -@subsubsection @code{bfd_get_gp_size} -@strong{Synopsis} -@example -unsigned int bfd_get_gp_size (bfd *abfd); -@end example -@strong{Description}@* -Return the maximum size of objects to be optimized using the GP -register under MIPS ECOFF. This is typically set by the @code{-G} -argument to the compiler, assembler or linker. - -@findex bfd_set_gp_size -@subsubsection @code{bfd_set_gp_size} -@strong{Synopsis} -@example -void bfd_set_gp_size (bfd *abfd, unsigned int i); -@end example -@strong{Description}@* -Set the maximum size of objects to be optimized using the GP -register under ECOFF or MIPS ELF. This is typically set by -the @code{-G} argument to the compiler, assembler or linker. - -@findex bfd_scan_vma -@subsubsection @code{bfd_scan_vma} -@strong{Synopsis} -@example -bfd_vma bfd_scan_vma (const char *string, const char **end, int base); -@end example -@strong{Description}@* -Convert, like @code{strtoul}, a numerical expression -@var{string} into a @code{bfd_vma} integer, and return that integer. -(Though without as many bells and whistles as @code{strtoul}.) -The expression is assumed to be unsigned (i.e., positive). -If given a @var{base}, it is used as the base for conversion. -A base of 0 causes the function to interpret the string -in hex if a leading "0x" or "0X" is found, otherwise -in octal if a leading zero is found, otherwise in decimal. - -If the value would overflow, the maximum @code{bfd_vma} value is -returned. - -@findex bfd_copy_private_header_data -@subsubsection @code{bfd_copy_private_header_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Copy private BFD header information from the BFD @var{ibfd} to the -the BFD @var{obfd}. This copies information that may require -sections to exist, but does not require symbol tables. Return -@code{true} on success, @code{false} on error. -Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_copy_private_bfd_data -@subsubsection @code{bfd_copy_private_bfd_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Copy private BFD information from the BFD @var{ibfd} to the -the BFD @var{obfd}. Return @code{TRUE} on success, @code{FALSE} on error. -Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_merge_private_bfd_data -@subsubsection @code{bfd_merge_private_bfd_data} -@strong{Synopsis} -@example -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); -@end example -@strong{Description}@* -Merge private BFD information from the BFD @var{ibfd} to the -the output file BFD @var{obfd} when linking. Return @code{TRUE} -on success, @code{FALSE} on error. Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) -@end example - -@findex bfd_set_private_flags -@subsubsection @code{bfd_set_private_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); -@end example -@strong{Description}@* -Set private BFD flag information in the BFD @var{abfd}. -Return @code{TRUE} on success, @code{FALSE} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{obfd}. -@end itemize -@example -#define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) -@end example - -@findex Other functions -@subsubsection @code{Other functions} -@strong{Description}@* -The following functions exist but have not yet been documented. -@example -#define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) - -#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) - -#define bfd_find_line(abfd, syms, sym, file, line) \ - BFD_SEND (abfd, _bfd_find_line, \ - (abfd, syms, sym, file, line)) - -#define bfd_find_inliner_info(abfd, file, func, line) \ - BFD_SEND (abfd, _bfd_find_inliner_info, \ - (abfd, file, func, line)) - -#define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) - -#define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) - -#define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - -#define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) - -#define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) - -#define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) - -#define bfd_relax_section(abfd, section, link_info, again) \ - BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) - -#define bfd_gc_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) - -#define bfd_merge_sections(abfd, link_info) \ - BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) - -#define bfd_is_group_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) - -#define bfd_discard_group(abfd, sec) \ - BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) - -#define bfd_link_hash_table_create(abfd) \ - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - -#define bfd_link_add_symbols(abfd, info) \ - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) - -#define bfd_link_just_syms(abfd, sec, info) \ - BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) - -#define bfd_final_link(abfd, info) \ - BFD_SEND (abfd, _bfd_final_link, (abfd, info)) - -#define bfd_free_cached_info(abfd) \ - BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) - -#define bfd_get_dynamic_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) - -#define bfd_print_private_bfd_data(abfd, file)\ - BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) - -#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) - -#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ - BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ - dyncount, dynsyms, ret)) - -#define bfd_get_dynamic_reloc_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) - -#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ - BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) - -extern bfd_byte *bfd_get_relocated_section_contents - (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, - bfd_boolean, asymbol **); - -@end example - -@findex bfd_alt_mach_code -@subsubsection @code{bfd_alt_mach_code} -@strong{Synopsis} -@example -bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -@end example -@strong{Description}@* -When more than one machine code number is available for the -same machine type, this function can be used to switch between -the preferred one (alternative == 0) and any others. Currently, -only ELF supports this feature, with up to two alternate -machine codes. - - -@example -struct bfd_preserve -@{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -@}; - -@end example -@findex bfd_preserve_save -@subsubsection @code{bfd_preserve_save} -@strong{Synopsis} -@example -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); -@end example -@strong{Description}@* -When testing an object for compatibility with a particular -target back-end, the back-end object_p function needs to set -up certain fields in the bfd on successfully recognizing the -object. This typically happens in a piecemeal fashion, with -failures possible at many points. On failure, the bfd is -supposed to be restored to its initial state, which is -virtually impossible. However, restoring a subset of the bfd -state works in practice. This function stores the subset and -reinitializes the bfd. - -@findex bfd_preserve_restore -@subsubsection @code{bfd_preserve_restore} -@strong{Synopsis} -@example -void bfd_preserve_restore (bfd *, struct bfd_preserve *); -@end example -@strong{Description}@* -This function restores bfd state saved by bfd_preserve_save. -If MARKER is non-NULL in struct bfd_preserve then that block -and all subsequently bfd_alloc'd memory is freed. - -@findex bfd_preserve_finish -@subsubsection @code{bfd_preserve_finish} -@strong{Synopsis} -@example -void bfd_preserve_finish (bfd *, struct bfd_preserve *); -@end example -@strong{Description}@* -This function should be called when the bfd state saved by -bfd_preserve_save is no longer needed. ie. when the back-end -object_p function returns with success. - diff --git a/contrib/binutils/bfd/doc/bfdwin.texi b/contrib/binutils/bfd/doc/bfdwin.texi deleted file mode 100644 index b1fd7d5bed6..00000000000 --- a/contrib/binutils/bfd/doc/bfdwin.texi +++ /dev/null @@ -1,2 +0,0 @@ -@findex -@subsubsection @code{} diff --git a/contrib/binutils/bfd/doc/cache.texi b/contrib/binutils/bfd/doc/cache.texi deleted file mode 100644 index 5820a2a6a1d..00000000000 --- a/contrib/binutils/bfd/doc/cache.texi +++ /dev/null @@ -1,65 +0,0 @@ -@section File caching -The file caching mechanism is embedded within BFD and allows -the application to open as many BFDs as it wants without -regard to the underlying operating system's file descriptor -limit (often as low as 20 open files). The module in -@code{cache.c} maintains a least recently used list of -@code{BFD_CACHE_MAX_OPEN} files, and exports the name -@code{bfd_cache_lookup}, which runs around and makes sure that -the required BFD is open. If not, then it chooses a file to -close, closes it and opens the one wanted, returning its file -handle. - -@subsection Caching functions - - -@findex bfd_cache_init -@subsubsection @code{bfd_cache_init} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_init (bfd *abfd); -@end example -@strong{Description}@* -Add a newly opened BFD to the cache. - -@findex bfd_cache_close -@subsubsection @code{bfd_cache_close} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_close (bfd *abfd); -@end example -@strong{Description}@* -Remove the BFD @var{abfd} from the cache. If the attached file is open, -then close it too. - -@strong{Returns}@* -@code{FALSE} is returned if closing the file fails, @code{TRUE} is -returned if all is well. - -@findex bfd_cache_close_all -@subsubsection @code{bfd_cache_close_all} -@strong{Synopsis} -@example -bfd_boolean bfd_cache_close_all (void); -@end example -@strong{Description}@* -Remove all BFDs from the cache. If the attached file is open, -then close it too. - -@strong{Returns}@* -@code{FALSE} is returned if closing one of the file fails, @code{TRUE} is -returned if all is well. - -@findex bfd_open_file -@subsubsection @code{bfd_open_file} -@strong{Synopsis} -@example -FILE* bfd_open_file (bfd *abfd); -@end example -@strong{Description}@* -Call the OS to open a file for @var{abfd}. Return the @code{FILE *} -(possibly @code{NULL}) that results from this operation. Set up the -BFD so that future accesses know the file is open. If the @code{FILE *} -returned is @code{NULL}, then it won't have been put in the -cache, so it won't have to be removed from it. - diff --git a/contrib/binutils/bfd/doc/coffcode.texi b/contrib/binutils/bfd/doc/coffcode.texi deleted file mode 100644 index 6689009c081..00000000000 --- a/contrib/binutils/bfd/doc/coffcode.texi +++ /dev/null @@ -1,608 +0,0 @@ -@section coff backends -BFD supports a number of different flavours of coff format. -The major differences between formats are the sizes and -alignments of fields in structures on disk, and the occasional -extra field. - -Coff in all its varieties is implemented with a few common -files and a number of implementation specific files. For -example, The 88k bcs coff format is implemented in the file -@file{coff-m88k.c}. This file @code{#include}s -@file{coff/m88k.h} which defines the external structure of the -coff format for the 88k, and @file{coff/internal.h} which -defines the internal structure. @file{coff-m88k.c} also -defines the relocations used by the 88k format -@xref{Relocations}. - -The Intel i960 processor version of coff is implemented in -@file{coff-i960.c}. This file has the same structure as -@file{coff-m88k.c}, except that it includes @file{coff/i960.h} -rather than @file{coff-m88k.h}. - -@subsection Porting to a new version of coff -The recommended method is to select from the existing -implementations the version of coff which is most like the one -you want to use. For example, we'll say that i386 coff is -the one you select, and that your coff flavour is called foo. -Copy @file{i386coff.c} to @file{foocoff.c}, copy -@file{../include/coff/i386.h} to @file{../include/coff/foo.h}, -and add the lines to @file{targets.c} and @file{Makefile.in} -so that your new back end is used. Alter the shapes of the -structures in @file{../include/coff/foo.h} so that they match -what you need. You will probably also have to add -@code{#ifdef}s to the code in @file{coff/internal.h} and -@file{coffcode.h} if your version of coff is too wild. - -You can verify that your new BFD backend works quite simply by -building @file{objdump} from the @file{binutils} directory, -and making sure that its version of what's going on and your -host system's idea (assuming it has the pretty standard coff -dump utility, usually called @code{att-dump} or just -@code{dump}) are the same. Then clean up your code, and send -what you've done to Cygnus. Then your stuff will be in the -next release, and you won't have to keep integrating it. - -@subsection How the coff backend works - - -@subsubsection File layout -The Coff backend is split into generic routines that are -applicable to any Coff target and routines that are specific -to a particular target. The target-specific routines are -further split into ones which are basically the same for all -Coff targets except that they use the external symbol format -or use different values for certain constants. - -The generic routines are in @file{coffgen.c}. These routines -work for any Coff target. They use some hooks into the target -specific code; the hooks are in a @code{bfd_coff_backend_data} -structure, one of which exists for each target. - -The essentially similar target-specific routines are in -@file{coffcode.h}. This header file includes executable C code. -The various Coff targets first include the appropriate Coff -header file, make any special defines that are needed, and -then include @file{coffcode.h}. - -Some of the Coff targets then also have additional routines in -the target source file itself. - -For example, @file{coff-i960.c} includes -@file{coff/internal.h} and @file{coff/i960.h}. It then -defines a few constants, such as @code{I960}, and includes -@file{coffcode.h}. Since the i960 has complex relocation -types, @file{coff-i960.c} also includes some code to -manipulate the i960 relocs. This code is not in -@file{coffcode.h} because it would not be used by any other -target. - -@subsubsection Bit twiddling -Each flavour of coff supported in BFD has its own header file -describing the external layout of the structures. There is also -an internal description of the coff layout, in -@file{coff/internal.h}. A major function of the -coff backend is swapping the bytes and twiddling the bits to -translate the external form of the structures into the normal -internal form. This is all performed in the -@code{bfd_swap}_@i{thing}_@i{direction} routines. Some -elements are different sizes between different versions of -coff; it is the duty of the coff version specific include file -to override the definitions of various packing routines in -@file{coffcode.h}. E.g., the size of line number entry in coff is -sometimes 16 bits, and sometimes 32 bits. @code{#define}ing -@code{PUT_LNSZ_LNNO} and @code{GET_LNSZ_LNNO} will select the -correct one. No doubt, some day someone will find a version of -coff which has a varying field size not catered to at the -moment. To port BFD, that person will have to add more @code{#defines}. -Three of the bit twiddling routines are exported to -@code{gdb}; @code{coff_swap_aux_in}, @code{coff_swap_sym_in} -and @code{coff_swap_lineno_in}. @code{GDB} reads the symbol -table on its own, but uses BFD to fix things up. More of the -bit twiddlers are exported for @code{gas}; -@code{coff_swap_aux_out}, @code{coff_swap_sym_out}, -@code{coff_swap_lineno_out}, @code{coff_swap_reloc_out}, -@code{coff_swap_filehdr_out}, @code{coff_swap_aouthdr_out}, -@code{coff_swap_scnhdr_out}. @code{Gas} currently keeps track -of all the symbol table and reloc drudgery itself, thereby -saving the internal BFD overhead, but uses BFD to swap things -on the way out, making cross ports much safer. Doing so also -allows BFD (and thus the linker) to use the same header files -as @code{gas}, which makes one avenue to disaster disappear. - -@subsubsection Symbol reading -The simple canonical form for symbols used by BFD is not rich -enough to keep all the information available in a coff symbol -table. The back end gets around this problem by keeping the original -symbol table around, "behind the scenes". - -When a symbol table is requested (through a call to -@code{bfd_canonicalize_symtab}), a request gets through to -@code{coff_get_normalized_symtab}. This reads the symbol table from -the coff file and swaps all the structures inside into the -internal form. It also fixes up all the pointers in the table -(represented in the file by offsets from the first symbol in -the table) into physical pointers to elements in the new -internal table. This involves some work since the meanings of -fields change depending upon context: a field that is a -pointer to another structure in the symbol table at one moment -may be the size in bytes of a structure at the next. Another -pass is made over the table. All symbols which mark file names -(@code{C_FILE} symbols) are modified so that the internal -string points to the value in the auxent (the real filename) -rather than the normal text associated with the symbol -(@code{".file"}). - -At this time the symbol names are moved around. Coff stores -all symbols less than nine characters long physically -within the symbol table; longer strings are kept at the end of -the file in the string table. This pass moves all strings -into memory and replaces them with pointers to the strings. - -The symbol table is massaged once again, this time to create -the canonical table used by the BFD application. Each symbol -is inspected in turn, and a decision made (using the -@code{sclass} field) about the various flags to set in the -@code{asymbol}. @xref{Symbols}. The generated canonical table -shares strings with the hidden internal symbol table. - -Any linenumbers are read from the coff file too, and attached -to the symbols which own the functions the linenumbers belong to. - -@subsubsection Symbol writing -Writing a symbol to a coff file which didn't come from a coff -file will lose any debugging information. The @code{asymbol} -structure remembers the BFD from which the symbol was taken, and on -output the back end makes sure that the same destination target as -source target is present. - -When the symbols have come from a coff file then all the -debugging information is preserved. - -Symbol tables are provided for writing to the back end in a -vector of pointers to pointers. This allows applications like -the linker to accumulate and output large symbol tables -without having to do too much byte copying. - -This function runs through the provided symbol table and -patches each symbol marked as a file place holder -(@code{C_FILE}) to point to the next file place holder in the -list. It also marks each @code{offset} field in the list with -the offset from the first symbol of the current symbol. - -Another function of this procedure is to turn the canonical -value form of BFD into the form used by coff. Internally, BFD -expects symbol values to be offsets from a section base; so a -symbol physically at 0x120, but in a section starting at -0x100, would have the value 0x20. Coff expects symbols to -contain their final value, so symbols have their values -changed at this point to reflect their sum with their owning -section. This transformation uses the -@code{output_section} field of the @code{asymbol}'s -@code{asection} @xref{Sections}. - -@itemize @bullet - -@item -@code{coff_mangle_symbols} -@end itemize -This routine runs though the provided symbol table and uses -the offsets generated by the previous pass and the pointers -generated when the symbol table was read in to create the -structured hierarchy required by coff. It changes each pointer -to a symbol into the index into the symbol table of the asymbol. - -@itemize @bullet - -@item -@code{coff_write_symbols} -@end itemize -This routine runs through the symbol table and patches up the -symbols from their internal form into the coff way, calls the -bit twiddlers, and writes out the table to the file. - -@findex coff_symbol_type -@subsubsection @code{coff_symbol_type} -@strong{Description}@* -The hidden information for an @code{asymbol} is described in a -@code{combined_entry_type}: - - -@example - -typedef struct coff_ptr_struct -@{ - /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ - unsigned int offset; - - /* Should the value of this symbol be renumbered. Used for - XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ - unsigned int fix_value : 1; - - /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_tag : 1; - - /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_end : 1; - - /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ - unsigned int fix_scnlen : 1; - - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the - index into the line number entries. Set by coff_slurp_symbol_table. */ - unsigned int fix_line : 1; - - /* The container for the symbol structure as read and translated - from the file. */ - union - @{ - union internal_auxent auxent; - struct internal_syment syment; - @} u; -@} combined_entry_type; - - -/* Each canonical asymbol really looks like this: */ - -typedef struct coff_symbol_struct -@{ - /* The actual symbol which the rest of BFD works with */ - asymbol symbol; - - /* A pointer to the hidden information for this symbol */ - combined_entry_type *native; - - /* A pointer to the linenumber information for this symbol */ - struct lineno_cache_entry *lineno; - - /* Have the line numbers been relocated yet ? */ - bfd_boolean done_lineno; -@} coff_symbol_type; -@end example -@findex bfd_coff_backend_data -@subsubsection @code{bfd_coff_backend_data} - -@example -/* COFF symbol classifications. */ - -enum coff_symbol_classification -@{ - /* Global symbol. */ - COFF_SYMBOL_GLOBAL, - /* Common symbol. */ - COFF_SYMBOL_COMMON, - /* Undefined symbol. */ - COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ - COFF_SYMBOL_LOCAL, - /* PE section symbol. */ - COFF_SYMBOL_PE_SECTION -@}; - -@end example -Special entry points for gdb to swap in coff symbol table parts: -@example -typedef struct -@{ - void (*_bfd_coff_swap_aux_in) - (bfd *, void *, int, int, int, int, void *); - - void (*_bfd_coff_swap_sym_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_lineno_in) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aux_out) - (bfd *, void *, int, int, int, int, void *); - - unsigned int (*_bfd_coff_swap_sym_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_lineno_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_reloc_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_filehdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_aouthdr_out) - (bfd *, void *, void *); - - unsigned int (*_bfd_coff_swap_scnhdr_out) - (bfd *, void *, void *); - - unsigned int _bfd_filhsz; - unsigned int _bfd_aoutsz; - unsigned int _bfd_scnhsz; - unsigned int _bfd_symesz; - unsigned int _bfd_auxesz; - unsigned int _bfd_relsz; - unsigned int _bfd_linesz; - unsigned int _bfd_filnmlen; - bfd_boolean _bfd_coff_long_filenames; - bfd_boolean _bfd_coff_long_section_names; - unsigned int _bfd_coff_default_section_alignment_power; - bfd_boolean _bfd_coff_force_symnames_in_strings; - unsigned int _bfd_coff_debug_string_prefix_length; - - void (*_bfd_coff_swap_filehdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_aouthdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_scnhdr_in) - (bfd *, void *, void *); - - void (*_bfd_coff_swap_reloc_in) - (bfd *abfd, void *, void *); - - bfd_boolean (*_bfd_coff_bad_format_hook) - (bfd *, void *); - - bfd_boolean (*_bfd_coff_set_arch_mach_hook) - (bfd *, void *); - - void * (*_bfd_coff_mkobject_hook) - (bfd *, void *, void *); - - bfd_boolean (*_bfd_styp_to_sec_flags_hook) - (bfd *, void *, const char *, asection *, flagword *); - - void (*_bfd_set_alignment_hook) - (bfd *, asection *, void *); - - bfd_boolean (*_bfd_coff_slurp_symbol_table) - (bfd *); - - bfd_boolean (*_bfd_coff_symname_in_debug) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_pointerize_aux_hook) - (bfd *, combined_entry_type *, combined_entry_type *, - unsigned int, combined_entry_type *); - - bfd_boolean (*_bfd_coff_print_aux) - (bfd *, FILE *, combined_entry_type *, combined_entry_type *, - combined_entry_type *, unsigned int); - - void (*_bfd_coff_reloc16_extra_cases) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, - bfd_byte *, unsigned int *, unsigned int *); - - int (*_bfd_coff_reloc16_estimate) - (bfd *, asection *, arelent *, unsigned int, - struct bfd_link_info *); - - enum coff_symbol_classification (*_bfd_coff_classify_symbol) - (bfd *, struct internal_syment *); - - bfd_boolean (*_bfd_coff_compute_section_file_positions) - (bfd *); - - bfd_boolean (*_bfd_coff_start_final_link) - (bfd *, struct bfd_link_info *); - - bfd_boolean (*_bfd_coff_relocate_section) - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - struct internal_reloc *, struct internal_syment *, asection **); - - reloc_howto_type *(*_bfd_coff_rtype_to_howto) - (bfd *, asection *, struct internal_reloc *, - struct coff_link_hash_entry *, struct internal_syment *, - bfd_vma *); - - bfd_boolean (*_bfd_coff_adjust_symndx) - (bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, bfd_boolean *); - - bfd_boolean (*_bfd_coff_link_add_one_symbol) - (struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, - struct bfd_link_hash_entry **); - - bfd_boolean (*_bfd_coff_link_output_has_begun) - (bfd *, struct coff_final_link_info *); - - bfd_boolean (*_bfd_coff_final_link_postscript) - (bfd *, struct coff_final_link_info *); - -@} bfd_coff_backend_data; - -#define coff_backend_info(abfd) \ - ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) - -#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) - -#define bfd_coff_swap_sym_in(a,e,i) \ - ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) - -#define bfd_coff_swap_lineno_in(a,e,i) \ - ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) - -#define bfd_coff_swap_reloc_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) - -#define bfd_coff_swap_lineno_out(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) - -#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ - ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) - -#define bfd_coff_swap_sym_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) - -#define bfd_coff_swap_scnhdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) - -#define bfd_coff_swap_filehdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) - -#define bfd_coff_swap_aouthdr_out(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) - -#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) -#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) -#define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) -#define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) -#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) -#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) -#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) -#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) -#define bfd_coff_long_filenames(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_filenames) -#define bfd_coff_long_section_names(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_long_section_names) -#define bfd_coff_default_section_alignment_power(abfd) \ - (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) -#define bfd_coff_swap_filehdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) - -#define bfd_coff_swap_aouthdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) - -#define bfd_coff_swap_scnhdr_in(abfd, i,o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) - -#define bfd_coff_swap_reloc_in(abfd, i, o) \ - ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) - -#define bfd_coff_bad_format_hook(abfd, filehdr) \ - ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) - -#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ - ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) -#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ - (abfd, filehdr, aouthdr)) - -#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ - ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ - (abfd, scnhdr, name, section, flags_ptr)) - -#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ - ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) - -#define bfd_coff_slurp_symbol_table(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) - -#define bfd_coff_symname_in_debug(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) - -#define bfd_coff_force_symnames_in_strings(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) - -#define bfd_coff_debug_string_prefix_length(abfd)\ - (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) - -#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ - ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ - (abfd, file, base, symbol, aux, indaux)) - -#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ - reloc, data, src_ptr, dst_ptr)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ - (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) - -#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ - ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ - (abfd, section, reloc, shrink, link_info)) - -#define bfd_coff_classify_symbol(abfd, sym)\ - ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ - (abfd, sym)) - -#define bfd_coff_compute_section_file_positions(abfd)\ - ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ - (abfd)) - -#define bfd_coff_start_final_link(obfd, info)\ - ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ - (obfd, info)) -#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ - ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ - (obfd, info, ibfd, o, con, rel, isyms, secs)) -#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ - ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ - (abfd, sec, rel, h, sym, addendp)) -#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ - ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ - (obfd, info, ibfd, sec, rel, adjustedp)) -#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ - value, string, cp, coll, hashp)\ - ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ - (info, abfd, name, flags, section, value, string, cp, coll, hashp)) - -#define bfd_coff_link_output_has_begun(a,p) \ - ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p)) -#define bfd_coff_final_link_postscript(a,p) \ - ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p)) - -@end example -@subsubsection Writing relocations -To write relocations, the back end steps though the -canonical relocation table and create an -@code{internal_reloc}. The symbol index to use is removed from -the @code{offset} field in the symbol table supplied. The -address comes directly from the sum of the section base -address and the relocation offset; the type is dug directly -from the howto field. Then the @code{internal_reloc} is -swapped into the shape of an @code{external_reloc} and written -out to disk. - -@subsubsection Reading linenumbers -Creating the linenumber table is done by reading in the entire -coff linenumber table, and creating another table for internal use. - -A coff linenumber table is structured so that each function -is marked as having a line number of 0. Each line within the -function is an offset from the first line in the function. The -base of the line number information for the table is stored in -the symbol associated with the function. - -Note: The PE format uses line number 0 for a flag indicating a -new source file. - -The information is copied from the external to the internal -table, and each symbol which marks a function is marked by -pointing its... - -How does this work ? - -@subsubsection Reading relocations -Coff relocations are easily transformed into the internal BFD form -(@code{arelent}). - -Reading a coff relocation table is done in the following stages: - -@itemize @bullet - -@item -Read the entire coff relocation table into memory. - -@item -Process each relocation in turn; first swap it from the -external to the internal form. - -@item -Turn the symbol referenced in the relocation's symbol index -into a pointer into the canonical symbol table. -This table is the same as the one returned by a call to -@code{bfd_canonicalize_symtab}. The back end will call that -routine and save the result if a canonicalization hasn't been done. - -@item -The reloc index is turned into a pointer to a howto -structure, in a back end specific way. For instance, the 386 -and 960 use the @code{r_type} to directly produce an index -into a howto table vector; the 88k subtracts a number from the -@code{r_type} field and creates an addend field. -@end itemize - diff --git a/contrib/binutils/bfd/doc/core.texi b/contrib/binutils/bfd/doc/core.texi deleted file mode 100644 index 1f09445ef76..00000000000 --- a/contrib/binutils/bfd/doc/core.texi +++ /dev/null @@ -1,60 +0,0 @@ -@section Core files - - -@subsection Core file functions - - -@strong{Description}@* -These are functions pertaining to core files. - -@findex bfd_core_file_failing_command -@subsubsection @code{bfd_core_file_failing_command} -@strong{Synopsis} -@example -const char *bfd_core_file_failing_command (bfd *abfd); -@end example -@strong{Description}@* -Return a read-only string explaining which program was running -when it failed and produced the core file @var{abfd}. - -@findex bfd_core_file_failing_signal -@subsubsection @code{bfd_core_file_failing_signal} -@strong{Synopsis} -@example -int bfd_core_file_failing_signal (bfd *abfd); -@end example -@strong{Description}@* -Returns the signal number which caused the core dump which -generated the file the BFD @var{abfd} is attached to. - -@findex core_file_matches_executable_p -@subsubsection @code{core_file_matches_executable_p} -@strong{Synopsis} -@example -bfd_boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); -@end example -@strong{Description}@* -Return @code{TRUE} if the core file attached to @var{core_bfd} -was generated by a run of the executable file attached to -@var{exec_bfd}, @code{FALSE} otherwise. - -@findex generic_core_file_matches_executable_p -@subsubsection @code{generic_core_file_matches_executable_p} -@strong{Synopsis} -@example -bfd_boolean generic_core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); -@end example -@strong{Description}@* -Return TRUE if the core file attached to @var{core_bfd} -was generated by a run of the executable file attached -to @var{exec_bfd}. The match is based on executable -basenames only. - -Note: When not able to determine the core file failing -command or the executable name, we still return TRUE even -though we're not sure that core file and executable match. -This is to avoid generating a false warning in situations -where we really don't know whether they match or not. - diff --git a/contrib/binutils/bfd/doc/elf.texi b/contrib/binutils/bfd/doc/elf.texi deleted file mode 100644 index 4f9434cf69d..00000000000 --- a/contrib/binutils/bfd/doc/elf.texi +++ /dev/null @@ -1,22 +0,0 @@ -@section ELF backends -BFD support for ELF formats is being worked on. -Currently, the best supported back ends are for sparc and i386 -(running svr4 or Solaris 2). - -Documentation of the internals of the support code still needs -to be written. The code is changing quickly enough that we -haven't bothered yet. - -@findex bfd_elf_find_section -@subsubsection @code{bfd_elf_find_section} -@strong{Synopsis} -@example -struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); -@end example -@strong{Description}@* -Helper functions for GDB to locate the string tables. -Since BFD hides string tables from callers, GDB needs to use an -internal hook to find them. Sun's .stabstr, in particular, -isn't even pointed to by the .stab section, so ordinary -mechanisms wouldn't work to find it, even if we had some. - diff --git a/contrib/binutils/bfd/doc/elfcode.texi b/contrib/binutils/bfd/doc/elfcode.texi deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/contrib/binutils/bfd/doc/format.texi b/contrib/binutils/bfd/doc/format.texi deleted file mode 100644 index 9674acff440..00000000000 --- a/contrib/binutils/bfd/doc/format.texi +++ /dev/null @@ -1,112 +0,0 @@ -@section File formats -A format is a BFD concept of high level file contents type. The -formats supported by BFD are: - -@itemize @bullet - -@item -@code{bfd_object} -@end itemize -The BFD may contain data, symbols, relocations and debug info. - -@itemize @bullet - -@item -@code{bfd_archive} -@end itemize -The BFD contains other BFDs and an optional index. - -@itemize @bullet - -@item -@code{bfd_core} -@end itemize -The BFD contains the result of an executable core dump. - -@subsection File format functions - - -@findex bfd_check_format -@subsubsection @code{bfd_check_format} -@strong{Synopsis} -@example -bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); -@end example -@strong{Description}@* -Verify if the file attached to the BFD @var{abfd} is compatible -with the format @var{format} (i.e., one of @code{bfd_object}, -@code{bfd_archive} or @code{bfd_core}). - -If the BFD has been set to a specific target before the -call, only the named target and format combination is -checked. If the target has not been set, or has been set to -@code{default}, then all the known target backends is -interrogated to determine a match. If the default target -matches, it is used. If not, exactly one target must recognize -the file, or an error results. - -The function returns @code{TRUE} on success, otherwise @code{FALSE} -with one of the following error codes: - -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -if @code{format} is not one of @code{bfd_object}, @code{bfd_archive} or -@code{bfd_core}. - -@item -@code{bfd_error_system_call} - -if an error occured during a read - even some file mismatches -can cause bfd_error_system_calls. - -@item -@code{file_not_recognised} - -none of the backends recognised the file format. - -@item -@code{bfd_error_file_ambiguously_recognized} - -more than one backend recognised the file format. -@end itemize - -@findex bfd_check_format_matches -@subsubsection @code{bfd_check_format_matches} -@strong{Synopsis} -@example -bfd_boolean bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); -@end example -@strong{Description}@* -Like @code{bfd_check_format}, except when it returns FALSE with -@code{bfd_errno} set to @code{bfd_error_file_ambiguously_recognized}. In that -case, if @var{matching} is not NULL, it will be filled in with -a NULL-terminated list of the names of the formats that matched, -allocated with @code{malloc}. -Then the user may choose a format and try again. - -When done with the list that @var{matching} points to, the caller -should free it. - -@findex bfd_set_format -@subsubsection @code{bfd_set_format} -@strong{Synopsis} -@example -bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); -@end example -@strong{Description}@* -This function sets the file format of the BFD @var{abfd} to the -format @var{format}. If the target set in the BFD does not -support the format requested, the format is invalid, or the BFD -is not open for writing, then an error occurs. - -@findex bfd_format_string -@subsubsection @code{bfd_format_string} -@strong{Synopsis} -@example -const char *bfd_format_string (bfd_format format); -@end example -@strong{Description}@* -Return a pointer to a const string -@code{invalid}, @code{object}, @code{archive}, @code{core}, or @code{unknown}, -depending upon the value of @var{format}. - diff --git a/contrib/binutils/bfd/doc/hash.texi b/contrib/binutils/bfd/doc/hash.texi deleted file mode 100644 index 88d9585cc40..00000000000 --- a/contrib/binutils/bfd/doc/hash.texi +++ /dev/null @@ -1,247 +0,0 @@ -@section Hash Tables -@cindex Hash tables -BFD provides a simple set of hash table functions. Routines -are provided to initialize a hash table, to free a hash table, -to look up a string in a hash table and optionally create an -entry for it, and to traverse a hash table. There is -currently no routine to delete an string from a hash table. - -The basic hash table does not permit any data to be stored -with a string. However, a hash table is designed to present a -base class from which other types of hash tables may be -derived. These derived types may store additional information -with the string. Hash tables were implemented in this way, -rather than simply providing a data pointer in a hash table -entry, because they were designed for use by the linker back -ends. The linker may create thousands of hash table entries, -and the overhead of allocating private data and storing and -following pointers becomes noticeable. - -The basic hash table code is in @code{hash.c}. - -@menu -* Creating and Freeing a Hash Table:: -* Looking Up or Entering a String:: -* Traversing a Hash Table:: -* Deriving a New Hash Table Type:: -@end menu - -@node Creating and Freeing a Hash Table, Looking Up or Entering a String, Hash Tables, Hash Tables -@subsection Creating and freeing a hash table -@findex bfd_hash_table_init -@findex bfd_hash_table_init_n -To create a hash table, create an instance of a @code{struct -bfd_hash_table} (defined in @code{bfd.h}) and call -@code{bfd_hash_table_init} (if you know approximately how many -entries you will need, the function @code{bfd_hash_table_init_n}, -which takes a @var{size} argument, may be used). -@code{bfd_hash_table_init} returns @code{FALSE} if some sort of -error occurs. - -@findex bfd_hash_newfunc -The function @code{bfd_hash_table_init} take as an argument a -function to use to create new entries. For a basic hash -table, use the function @code{bfd_hash_newfunc}. @xref{Deriving -a New Hash Table Type}, for why you would want to use a -different value for this argument. - -@findex bfd_hash_allocate -@code{bfd_hash_table_init} will create an objalloc which will be -used to allocate new entries. You may allocate memory on this -objalloc using @code{bfd_hash_allocate}. - -@findex bfd_hash_table_free -Use @code{bfd_hash_table_free} to free up all the memory that has -been allocated for a hash table. This will not free up the -@code{struct bfd_hash_table} itself, which you must provide. - -@findex bfd_hash_set_default_size -Use @code{bfd_hash_set_default_size} to set the default size of -hash table to use. - -@node Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables -@subsection Looking up or entering a string -@findex bfd_hash_lookup -The function @code{bfd_hash_lookup} is used both to look up a -string in the hash table and to create a new entry. - -If the @var{create} argument is @code{FALSE}, @code{bfd_hash_lookup} -will look up a string. If the string is found, it will -returns a pointer to a @code{struct bfd_hash_entry}. If the -string is not found in the table @code{bfd_hash_lookup} will -return @code{NULL}. You should not modify any of the fields in -the returns @code{struct bfd_hash_entry}. - -If the @var{create} argument is @code{TRUE}, the string will be -entered into the hash table if it is not already there. -Either way a pointer to a @code{struct bfd_hash_entry} will be -returned, either to the existing structure or to a newly -created one. In this case, a @code{NULL} return means that an -error occurred. - -If the @var{create} argument is @code{TRUE}, and a new entry is -created, the @var{copy} argument is used to decide whether to -copy the string onto the hash table objalloc or not. If -@var{copy} is passed as @code{FALSE}, you must be careful not to -deallocate or modify the string as long as the hash table -exists. - -@node Traversing a Hash Table, Deriving a New Hash Table Type, Looking Up or Entering a String, Hash Tables -@subsection Traversing a hash table -@findex bfd_hash_traverse -The function @code{bfd_hash_traverse} may be used to traverse a -hash table, calling a function on each element. The traversal -is done in a random order. - -@code{bfd_hash_traverse} takes as arguments a function and a -generic @code{void *} pointer. The function is called with a -hash table entry (a @code{struct bfd_hash_entry *}) and the -generic pointer passed to @code{bfd_hash_traverse}. The function -must return a @code{boolean} value, which indicates whether to -continue traversing the hash table. If the function returns -@code{FALSE}, @code{bfd_hash_traverse} will stop the traversal and -return immediately. - -@node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables -@subsection Deriving a new hash table type -Many uses of hash tables want to store additional information -which each entry in the hash table. Some also find it -convenient to store additional information with the hash table -itself. This may be done using a derived hash table. - -Since C is not an object oriented language, creating a derived -hash table requires sticking together some boilerplate -routines with a few differences specific to the type of hash -table you want to create. - -An example of a derived hash table is the linker hash table. -The structures for this are defined in @code{bfdlink.h}. The -functions are in @code{linker.c}. - -You may also derive a hash table from an already derived hash -table. For example, the a.out linker backend code uses a hash -table derived from the linker hash table. - -@menu -* Define the Derived Structures:: -* Write the Derived Creation Routine:: -* Write Other Derived Routines:: -@end menu - -@node Define the Derived Structures, Write the Derived Creation Routine, Deriving a New Hash Table Type, Deriving a New Hash Table Type -@subsubsection Define the derived structures -You must define a structure for an entry in the hash table, -and a structure for the hash table itself. - -The first field in the structure for an entry in the hash -table must be of the type used for an entry in the hash table -you are deriving from. If you are deriving from a basic hash -table this is @code{struct bfd_hash_entry}, which is defined in -@code{bfd.h}. The first field in the structure for the hash -table itself must be of the type of the hash table you are -deriving from itself. If you are deriving from a basic hash -table, this is @code{struct bfd_hash_table}. - -For example, the linker hash table defines @code{struct -bfd_link_hash_entry} (in @code{bfdlink.h}). The first field, -@code{root}, is of type @code{struct bfd_hash_entry}. Similarly, -the first field in @code{struct bfd_link_hash_table}, @code{table}, -is of type @code{struct bfd_hash_table}. - -@node Write the Derived Creation Routine, Write Other Derived Routines, Define the Derived Structures, Deriving a New Hash Table Type -@subsubsection Write the derived creation routine -You must write a routine which will create and initialize an -entry in the hash table. This routine is passed as the -function argument to @code{bfd_hash_table_init}. - -In order to permit other hash tables to be derived from the -hash table you are creating, this routine must be written in a -standard way. - -The first argument to the creation routine is a pointer to a -hash table entry. This may be @code{NULL}, in which case the -routine should allocate the right amount of space. Otherwise -the space has already been allocated by a hash table type -derived from this one. - -After allocating space, the creation routine must call the -creation routine of the hash table type it is derived from, -passing in a pointer to the space it just allocated. This -will initialize any fields used by the base hash table. - -Finally the creation routine must initialize any local fields -for the new hash table type. - -Here is a boilerplate example of a creation routine. -@var{function_name} is the name of the routine. -@var{entry_type} is the type of an entry in the hash table you -are creating. @var{base_newfunc} is the name of the creation -routine of the hash table type your hash table is derived -from. - - -@example -struct bfd_hash_entry * -@var{function_name} (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) -@{ - struct @var{entry_type} *ret = (@var{entry_type} *) entry; - - /* Allocate the structure if it has not already been allocated by a - derived class. */ - if (ret == NULL) - @{ - ret = bfd_hash_allocate (table, sizeof (* ret)); - if (ret == NULL) - return NULL; - @} - - /* Call the allocation method of the base class. */ - ret = ((@var{entry_type} *) - @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string)); - - /* Initialize the local fields here. */ - - return (struct bfd_hash_entry *) ret; -@} -@end example -@strong{Description}@* -The creation routine for the linker hash table, which is in -@code{linker.c}, looks just like this example. -@var{function_name} is @code{_bfd_link_hash_newfunc}. -@var{entry_type} is @code{struct bfd_link_hash_entry}. -@var{base_newfunc} is @code{bfd_hash_newfunc}, the creation -routine for a basic hash table. - -@code{_bfd_link_hash_newfunc} also initializes the local fields -in a linker hash table entry: @code{type}, @code{written} and -@code{next}. - -@node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type -@subsubsection Write other derived routines -You will want to write other routines for your new hash table, -as well. - -You will want an initialization routine which calls the -initialization routine of the hash table you are deriving from -and initializes any other local fields. For the linker hash -table, this is @code{_bfd_link_hash_table_init} in @code{linker.c}. - -You will want a lookup routine which calls the lookup routine -of the hash table you are deriving from and casts the result. -The linker hash table uses @code{bfd_link_hash_lookup} in -@code{linker.c} (this actually takes an additional argument which -it uses to decide how to return the looked up value). - -You may want a traversal routine. This should just call the -traversal routine of the hash table you are deriving from with -appropriate casts. The linker hash table uses -@code{bfd_link_hash_traverse} in @code{linker.c}. - -These routines may simply be defined as macros. For example, -the a.out backend linker hash table, which is derived from the -linker hash table, uses macros for the lookup and traversal -routines. These are @code{aout_link_hash_lookup} and -@code{aout_link_hash_traverse} in aoutx.h. - diff --git a/contrib/binutils/bfd/doc/init.texi b/contrib/binutils/bfd/doc/init.texi deleted file mode 100644 index ab735f8e986..00000000000 --- a/contrib/binutils/bfd/doc/init.texi +++ /dev/null @@ -1,16 +0,0 @@ -@section Initialization - - -@subsection Initialization functions -These are the functions that handle initializing a BFD. - -@findex bfd_init -@subsubsection @code{bfd_init} -@strong{Synopsis} -@example -void bfd_init (void); -@end example -@strong{Description}@* -This routine must be called before any other BFD function to -initialize magical internal data structures. - diff --git a/contrib/binutils/bfd/doc/libbfd.texi b/contrib/binutils/bfd/doc/libbfd.texi deleted file mode 100644 index fef6e0e842e..00000000000 --- a/contrib/binutils/bfd/doc/libbfd.texi +++ /dev/null @@ -1,179 +0,0 @@ -@section Implementation details - - -@subsection Internal functions - - -@strong{Description}@* -These routines are used within BFD. -They are not intended for export, but are documented here for -completeness. - -@findex bfd_write_bigendian_4byte_int -@subsubsection @code{bfd_write_bigendian_4byte_int} -@strong{Synopsis} -@example -bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); -@end example -@strong{Description}@* -Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big -endian order regardless of what else is going on. This is useful in -archives. - -@findex bfd_put_size -@subsubsection @code{bfd_put_size} -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Description}@* -These macros as used for reading and writing raw data in -sections; each access (except for bytes) is vectored through -the target format of the BFD and mangled accordingly. The -mangling performs any necessary endian translations and -removes alignment restrictions. Note that types accepted and -returned by these macros are identical so they can be swapped -around in macros---for example, @file{libaout.h} defines @code{GET_WORD} -to either @code{bfd_get_32} or @code{bfd_get_64}. - -In the put routines, @var{val} must be a @code{bfd_vma}. If we are on a -system without prototypes, the caller is responsible for making -sure that is true, with a cast if necessary. We don't cast -them in the macro definitions because that would prevent @code{lint} -or @code{gcc -Wall} from detecting sins such as passing a pointer. -To detect calling these with less than a @code{bfd_vma}, use -@code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s. -@example - -/* Byte swapping macros for user section data. */ - -#define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) -#define bfd_put_signed_8 \ - bfd_put_8 -#define bfd_get_8(abfd, ptr) \ - (*(unsigned char *) (ptr) & 0xff) -#define bfd_get_signed_8(abfd, ptr) \ - (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) - -#define bfd_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) -#define bfd_put_signed_16 \ - bfd_put_16 -#define bfd_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx16, (ptr)) -#define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) - -#define bfd_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) -#define bfd_put_signed_32 \ - bfd_put_32 -#define bfd_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx32, (ptr)) -#define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) - -#define bfd_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) -#define bfd_put_signed_64 \ - bfd_put_64 -#define bfd_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx64, (ptr)) -#define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) - -#define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) - -#define bfd_put(bits, abfd, val, ptr) \ - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) - -@end example - -@findex bfd_h_put_size -@subsubsection @code{bfd_h_put_size} -@strong{Description}@* -These macros have the same function as their @code{bfd_get_x} -brethren, except that they are used for removing information -for the header records of object files. Believe it or not, -some object files keep their header records in big endian -order and their data in little endian order. -@example - -/* Byte swapping macros for file header data. */ - -#define bfd_h_put_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) -#define bfd_h_put_signed_8(abfd, val, ptr) \ - bfd_put_8 (abfd, val, ptr) -#define bfd_h_get_8(abfd, ptr) \ - bfd_get_8 (abfd, ptr) -#define bfd_h_get_signed_8(abfd, ptr) \ - bfd_get_signed_8 (abfd, ptr) - -#define bfd_h_put_16(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) -#define bfd_h_put_signed_16 \ - bfd_h_put_16 -#define bfd_h_get_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx16, (ptr)) -#define bfd_h_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) - -#define bfd_h_put_32(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) -#define bfd_h_put_signed_32 \ - bfd_h_put_32 -#define bfd_h_get_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx32, (ptr)) -#define bfd_h_get_signed_32(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) - -#define bfd_h_put_64(abfd, val, ptr) \ - BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) -#define bfd_h_put_signed_64 \ - bfd_h_put_64 -#define bfd_h_get_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx64, (ptr)) -#define bfd_h_get_signed_64(abfd, ptr) \ - BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) - -/* Aliases for the above, which should eventually go away. */ - -#define H_PUT_64 bfd_h_put_64 -#define H_PUT_32 bfd_h_put_32 -#define H_PUT_16 bfd_h_put_16 -#define H_PUT_8 bfd_h_put_8 -#define H_PUT_S64 bfd_h_put_signed_64 -#define H_PUT_S32 bfd_h_put_signed_32 -#define H_PUT_S16 bfd_h_put_signed_16 -#define H_PUT_S8 bfd_h_put_signed_8 -#define H_GET_64 bfd_h_get_64 -#define H_GET_32 bfd_h_get_32 -#define H_GET_16 bfd_h_get_16 -#define H_GET_8 bfd_h_get_8 -#define H_GET_S64 bfd_h_get_signed_64 -#define H_GET_S32 bfd_h_get_signed_32 -#define H_GET_S16 bfd_h_get_signed_16 -#define H_GET_S8 bfd_h_get_signed_8 - - -@end example - -@findex bfd_log2 -@subsubsection @code{bfd_log2} -@strong{Synopsis} -@example -unsigned int bfd_log2 (bfd_vma x); -@end example -@strong{Description}@* -Return the log base 2 of the value supplied, rounded up. E.g., an -@var{x} of 1025 returns 11. A @var{x} of 0 returns 0. - diff --git a/contrib/binutils/bfd/doc/linker.texi b/contrib/binutils/bfd/doc/linker.texi deleted file mode 100644 index 8a55006a187..00000000000 --- a/contrib/binutils/bfd/doc/linker.texi +++ /dev/null @@ -1,380 +0,0 @@ -@section Linker Functions -@cindex Linker -The linker uses three special entry points in the BFD target -vector. It is not necessary to write special routines for -these entry points when creating a new BFD back end, since -generic versions are provided. However, writing them can -speed up linking and make it use significantly less runtime -memory. - -The first routine creates a hash table used by the other -routines. The second routine adds the symbols from an object -file to the hash table. The third routine takes all the -object files and links them together to create the output -file. These routines are designed so that the linker proper -does not need to know anything about the symbols in the object -files that it is linking. The linker merely arranges the -sections as directed by the linker script and lets BFD handle -the details of symbols and relocs. - -The second routine and third routines are passed a pointer to -a @code{struct bfd_link_info} structure (defined in -@code{bfdlink.h}) which holds information relevant to the link, -including the linker hash table (which was created by the -first routine) and a set of callback functions to the linker -proper. - -The generic linker routines are in @code{linker.c}, and use the -header file @code{genlink.h}. As of this writing, the only back -ends which have implemented versions of these routines are -a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out -routines are used as examples throughout this section. - -@menu -* Creating a Linker Hash Table:: -* Adding Symbols to the Hash Table:: -* Performing the Final Link:: -@end menu - -@node Creating a Linker Hash Table, Adding Symbols to the Hash Table, Linker Functions, Linker Functions -@subsection Creating a linker hash table -@cindex _bfd_link_hash_table_create in target vector -@cindex target vector (_bfd_link_hash_table_create) -The linker routines must create a hash table, which must be -derived from @code{struct bfd_link_hash_table} described in -@code{bfdlink.c}. @xref{Hash Tables}, for information on how to -create a derived hash table. This entry point is called using -the target vector of the linker output file. - -The @code{_bfd_link_hash_table_create} entry point must allocate -and initialize an instance of the desired hash table. If the -back end does not require any additional information to be -stored with the entries in the hash table, the entry point may -simply create a @code{struct bfd_link_hash_table}. Most likely, -however, some additional information will be needed. - -For example, with each entry in the hash table the a.out -linker keeps the index the symbol has in the final output file -(this index number is used so that when doing a relocatable -link the symbol index used in the output file can be quickly -filled in when copying over a reloc). The a.out linker code -defines the required structures and functions for a hash table -derived from @code{struct bfd_link_hash_table}. The a.out linker -hash table is created by the function -@code{NAME(aout,link_hash_table_create)}; it simply allocates -space for the hash table, initializes it, and returns a -pointer to it. - -When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until -you have finished. You should simply create a new hash table -which defines no additional fields, and then simply add fields -as they become necessary. - -@node Adding Symbols to the Hash Table, Performing the Final Link, Creating a Linker Hash Table, Linker Functions -@subsection Adding symbols to the hash table -@cindex _bfd_link_add_symbols in target vector -@cindex target vector (_bfd_link_add_symbols) -The linker proper will call the @code{_bfd_link_add_symbols} -entry point for each object file or archive which is to be -linked (typically these are the files named on the command -line, but some may also come from the linker script). The -entry point is responsible for examining the file. For an -object file, BFD must add any relevant symbol information to -the hash table. For an archive, BFD must determine which -elements of the archive should be used and adding them to the -link. - -The a.out version of this entry point is -@code{NAME(aout,link_add_symbols)}. - -@menu -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: -@end menu - -@node Differing file formats, Adding symbols from an object file, Adding Symbols to the Hash Table, Adding Symbols to the Hash Table -@subsubsection Differing file formats -Normally all the files involved in a link will be of the same -format, but it is also possible to link together different -format object files, and the back end must support that. The -@code{_bfd_link_add_symbols} entry point is called via the target -vector of the file to be added. This has an important -consequence: the function may not assume that the hash table -is the type created by the corresponding -@code{_bfd_link_hash_table_create} vector. All the -@code{_bfd_link_add_symbols} function can assume about the hash -table is that it is derived from @code{struct -bfd_link_hash_table}. - -Sometimes the @code{_bfd_link_add_symbols} function must store -some information in the hash table entry to be used by the -@code{_bfd_final_link} function. In such a case the @code{creator} -field of the hash table must be checked to make sure that the -hash table was created by an object file of the same format. - -The @code{_bfd_final_link} routine must be prepared to handle a -hash entry without any extra information added by the -@code{_bfd_link_add_symbols} function. A hash entry without -extra information will also occur when the linker script -directs the linker to create a symbol. Note that, regardless -of how a hash table entry is added, all the fields will be -initialized to some sort of null value by the hash table entry -initialization function. - -See @code{ecoff_link_add_externals} for an example of how to -check the @code{creator} field before saving information (in this -case, the ECOFF external symbol debugging information) in a -hash table entry. - -@node Adding symbols from an object file, Adding symbols from an archive, Differing file formats, Adding Symbols to the Hash Table -@subsubsection Adding symbols from an object file -When the @code{_bfd_link_add_symbols} routine is passed an object -file, it must add all externally visible symbols in that -object file to the hash table. The actual work of adding the -symbol to the hash table is normally handled by the function -@code{_bfd_generic_link_add_one_symbol}. The -@code{_bfd_link_add_symbols} routine is responsible for reading -all the symbols from the object file and passing the correct -information to @code{_bfd_generic_link_add_one_symbol}. - -The @code{_bfd_link_add_symbols} routine should not use -@code{bfd_canonicalize_symtab} to read the symbols. The point of -providing this routine is to avoid the overhead of converting -the symbols into generic @code{asymbol} structures. - -@findex _bfd_generic_link_add_one_symbol -@code{_bfd_generic_link_add_one_symbol} handles the details of -combining common symbols, warning about multiple definitions, -and so forth. It takes arguments which describe the symbol to -add, notably symbol flags, a section, and an offset. The -symbol flags include such things as @code{BSF_WEAK} or -@code{BSF_INDIRECT}. The section is a section in the object -file, or something like @code{bfd_und_section_ptr} for an undefined -symbol or @code{bfd_com_section_ptr} for a common symbol. - -If the @code{_bfd_final_link} routine is also going to need to -read the symbol information, the @code{_bfd_link_add_symbols} -routine should save it somewhere attached to the object file -BFD. However, the information should only be saved if the -@code{keep_memory} field of the @code{info} argument is TRUE, so -that the @code{-no-keep-memory} linker switch is effective. - -The a.out function which adds symbols from an object file is -@code{aout_link_add_object_symbols}, and most of the interesting -work is in @code{aout_link_add_symbols}. The latter saves -pointers to the hash tables entries created by -@code{_bfd_generic_link_add_one_symbol} indexed by symbol number, -so that the @code{_bfd_final_link} routine does not have to call -the hash table lookup routine to locate the entry. - -@node Adding symbols from an archive, , Adding symbols from an object file, Adding Symbols to the Hash Table -@subsubsection Adding symbols from an archive -When the @code{_bfd_link_add_symbols} routine is passed an -archive, it must look through the symbols defined by the -archive and decide which elements of the archive should be -included in the link. For each such element it must call the -@code{add_archive_element} linker callback, and it must add the -symbols from the object file to the linker hash table. - -@findex _bfd_generic_link_add_archive_symbols -In most cases the work of looking through the symbols in the -archive should be done by the -@code{_bfd_generic_link_add_archive_symbols} function. This -function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which -elements should be included. -@code{_bfd_generic_link_add_archive_symbols} is passed a function -to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the -symbols to the linker hash table. - -The function passed to -@code{_bfd_generic_link_add_archive_symbols} must read the -symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to -be included, the @code{add_archive_element} linker callback -routine must be called with the element as an argument, and -the elements symbols must be added to the linker hash table -just as though the element had itself been passed to the -@code{_bfd_link_add_symbols} function. - -When the a.out @code{_bfd_link_add_symbols} function receives an -archive, it calls @code{_bfd_generic_link_add_archive_symbols} -passing @code{aout_link_check_archive_element} as the function -argument. @code{aout_link_check_archive_element} calls -@code{aout_link_check_ar_symbols}. If the latter decides to add -the element (an element is only added if it provides a real, -non-common, definition for a previously undefined or common -symbol) it calls the @code{add_archive_element} callback and then -@code{aout_link_check_archive_element} calls -@code{aout_link_add_symbols} to actually add the symbols to the -linker hash table. - -The ECOFF back end is unusual in that it does not normally -call @code{_bfd_generic_link_add_archive_symbols}, because ECOFF -archives already contain a hash table of symbols. The ECOFF -back end searches the archive itself to avoid the overhead of -creating a new hash table. - -@node Performing the Final Link, , Adding Symbols to the Hash Table, Linker Functions -@subsection Performing the final link -@cindex _bfd_link_final_link in target vector -@cindex target vector (_bfd_final_link) -When all the input files have been processed, the linker calls -the @code{_bfd_final_link} entry point of the output BFD. This -routine is responsible for producing the final output file, -which has several aspects. It must relocate the contents of -the input sections and copy the data into the output sections. -It must build an output symbol table including any local -symbols from the input files and the global symbols from the -hash table. When producing relocatable output, it must -modify the input relocs and write them into the output file. -There may also be object format dependent work to be done. - -The linker will also call the @code{write_object_contents} entry -point when the BFD is closed. The two entry points must work -together in order to produce the correct output file. - -The details of how this works are inevitably dependent upon -the specific object file format. The a.out -@code{_bfd_final_link} routine is @code{NAME(aout,final_link)}. - -@menu -* Information provided by the linker:: -* Relocating the section contents:: -* Writing the symbol table:: -@end menu - -@node Information provided by the linker, Relocating the section contents, Performing the Final Link, Performing the Final Link -@subsubsection Information provided by the linker -Before the linker calls the @code{_bfd_final_link} entry point, -it sets up some data structures for the function to use. - -The @code{input_bfds} field of the @code{bfd_link_info} structure -will point to a list of all the input files included in the -link. These files are linked through the @code{link_next} field -of the @code{bfd} structure. - -Each section in the output file will have a list of -@code{link_order} structures attached to the @code{map_head.link_order} -field (the @code{link_order} structure is defined in -@code{bfdlink.h}). These structures describe how to create the -contents of the output section in terms of the contents of -various input sections, fill constants, and, eventually, other -types of information. They also describe relocs that must be -created by the BFD backend, but do not correspond to any input -file; this is used to support -Ur, which builds constructors -while generating a relocatable object file. - -@node Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link -@subsubsection Relocating the section contents -The @code{_bfd_final_link} function should look through the -@code{link_order} structures attached to each section of the -output file. Each @code{link_order} structure should either be -handled specially, or it should be passed to the function -@code{_bfd_default_link_order} which will do the right thing -(@code{_bfd_default_link_order} is defined in @code{linker.c}). - -For efficiency, a @code{link_order} of type -@code{bfd_indirect_link_order} whose associated section belongs -to a BFD of the same format as the output BFD must be handled -specially. This type of @code{link_order} describes part of an -output section in terms of a section belonging to one of the -input files. The @code{_bfd_final_link} function should read the -contents of the section and any associated relocs, apply the -relocs to the section contents, and write out the modified -section contents. If performing a relocatable link, the -relocs themselves must also be modified and written out. - -@findex _bfd_relocate_contents -@findex _bfd_final_link_relocate -The functions @code{_bfd_relocate_contents} and -@code{_bfd_final_link_relocate} provide some general support for -performing the actual relocations, notably overflow checking. -Their arguments include information about the symbol the -relocation is against and a @code{reloc_howto_type} argument -which describes the relocation to perform. These functions -are defined in @code{reloc.c}. - -The a.out function which handles reading, relocating, and -writing section contents is @code{aout_link_input_section}. The -actual relocation is done in @code{aout_link_input_section_std} -and @code{aout_link_input_section_ext}. - -@node Writing the symbol table, , Relocating the section contents, Performing the Final Link -@subsubsection Writing the symbol table -The @code{_bfd_final_link} function must gather all the symbols -in the input files and write them out. It must also write out -all the symbols in the global hash table. This must be -controlled by the @code{strip} and @code{discard} fields of the -@code{bfd_link_info} structure. - -The local symbols of the input files will not have been -entered into the linker hash table. The @code{_bfd_final_link} -routine must consider each input file and include the symbols -in the output file. It may be convenient to do this when -looking through the @code{link_order} structures, or it may be -done by stepping through the @code{input_bfds} list. - -The @code{_bfd_final_link} routine must also traverse the global -hash table to gather all the externally visible symbols. It -is possible that most of the externally visible symbols may be -written out when considering the symbols of each input file, -but it is still necessary to traverse the hash table since the -linker script may have defined some symbols that are not in -any of the input files. - -The @code{strip} field of the @code{bfd_link_info} structure -controls which symbols are written out. The possible values -are listed in @code{bfdlink.h}. If the value is @code{strip_some}, -then the @code{keep_hash} field of the @code{bfd_link_info} -structure is a hash table of symbols to keep; each symbol -should be looked up in this hash table, and only symbols which -are present should be included in the output file. - -If the @code{strip} field of the @code{bfd_link_info} structure -permits local symbols to be written out, the @code{discard} field -is used to further controls which local symbols are included -in the output file. If the value is @code{discard_l}, then all -local symbols which begin with a certain prefix are discarded; -this is controlled by the @code{bfd_is_local_label_name} entry point. - -The a.out backend handles symbols by calling -@code{aout_link_write_symbols} on each input BFD and then -traversing the global hash table with the function -@code{aout_link_write_other_symbol}. It builds a string table -while writing out the symbols, which is written to the output -file at the end of @code{NAME(aout,final_link)}. - -@findex bfd_link_split_section -@subsubsection @code{bfd_link_split_section} -@strong{Synopsis} -@example -bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); -@end example -@strong{Description}@* -Return nonzero if @var{sec} should be split during a -reloceatable or final link. -@example -#define bfd_link_split_section(abfd, sec) \ - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) - -@end example - -@findex bfd_section_already_linked -@subsubsection @code{bfd_section_already_linked} -@strong{Synopsis} -@example -void bfd_section_already_linked (bfd *abfd, asection *sec); -@end example -@strong{Description}@* -Check if @var{sec} has been already linked during a reloceatable -or final link. -@example -#define bfd_section_already_linked(abfd, sec) \ - BFD_SEND (abfd, _section_already_linked, (abfd, sec)) - -@end example - diff --git a/contrib/binutils/bfd/doc/mmo.texi b/contrib/binutils/bfd/doc/mmo.texi deleted file mode 100644 index b0d726aad9c..00000000000 --- a/contrib/binutils/bfd/doc/mmo.texi +++ /dev/null @@ -1,365 +0,0 @@ -@section mmo backend -The mmo object format is used exclusively together with Professor -Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator -@command{mmix} which is available at -@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz} -understands this format. That package also includes a combined -assembler and linker called @command{mmixal}. The mmo format has -no advantages feature-wise compared to e.g. ELF. It is a simple -non-relocatable object format with no support for archives or -debugging information, except for symbol value information and -line numbers (which is not yet implemented in BFD). See -@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more -information about MMIX. The ELF format is used for intermediate -object files in the BFD implementation. - -@c We want to xref the symbol table node. A feature in "chew" -@c requires that "commands" do not contain spaces in the -@c arguments. Hence the hyphen in "Symbol-table". -@menu -* File layout:: -* Symbol-table:: -* mmo section mapping:: -@end menu - -@node File layout, Symbol-table, mmo, mmo -@subsection File layout -The mmo file contents is not partitioned into named sections as -with e.g.@: ELF. Memory areas is formed by specifying the -location of the data that follows. Only the memory area -@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so -it is used for code (and constants) and the area -@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for -writable data. @xref{mmo section mapping}. - -There is provision for specifying ``special data'' of 65536 -different types. We use type 80 (decimal), arbitrarily chosen the -same as the ELF @code{e_machine} number for MMIX, filling it with -section information normally found in ELF objects. @xref{mmo -section mapping}. - -Contents is entered as 32-bit words, xor:ed over previous -contents, always zero-initialized. A word that starts with the -byte @samp{0x98} forms a command called a @samp{lopcode}, where -the next byte distinguished between the thirteen lopcodes. The -two remaining bytes, called the @samp{Y} and @samp{Z} fields, or -the @samp{YZ} field (a 16-bit big-endian number), are used for -various purposes different for each lopcode. As documented in -@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz}, -the lopcodes are: - -@table @code -@item lop_quote -0x98000001. The next word is contents, regardless of whether it -starts with 0x98 or not. - -@item lop_loc -0x9801YYZZ, where @samp{Z} is 1 or 2. This is a location -directive, setting the location for the next data to the next -32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}), -plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment -and 2 for the data segment. - -@item lop_skip -0x9802YYZZ. Increase the current location by @samp{YZ} bytes. - -@item lop_fixo -0x9803YYZZ, where @samp{Z} is 1 or 2. Store the current location -as 64 bits into the location pointed to by the next 32-bit -(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y * -2^56}. - -@item lop_fixr -0x9804YYZZ. @samp{YZ} is stored into the current location plus -@math{2 - 4 * YZ}. - -@item lop_fixrx -0x980500ZZ. @samp{Z} is 16 or 24. A value @samp{L} derived from -the following 32-bit word are used in a manner similar to -@samp{YZ} in lop_fixr: it is xor:ed into the current location -minus @math{4 * L}. The first byte of the word is 0 or 1. If it -is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0, -then @math{L = (@var{lowest 24 bits of word})}. - -@item lop_file -0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of -32-bit words. Set the file number to @samp{Y} and the line -counter to 0. The next @math{Z * 4} bytes contain the file name, -padded with zeros if the count is not a multiple of four. The -same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for -all but the first occurrence. - -@item lop_line -0x9807YYZZ. @samp{YZ} is the line number. Together with -lop_file, it forms the source location for the next 32-bit word. -Note that for each non-lopcode 32-bit word, line numbers are -assumed incremented by one. - -@item lop_spec -0x9808YYZZ. @samp{YZ} is the type number. Data until the next -lopcode other than lop_quote forms special data of type @samp{YZ}. -@xref{mmo section mapping}. - -Other types than 80, (or type 80 with a content that does not -parse) is stored in sections named @code{.MMIX.spec_data.@var{n}} -where @var{n} is the @samp{YZ}-type. The flags for such a -sections say not to allocate or load the data. The vma is 0. -Contents of multiple occurrences of special data @var{n} is -concatenated to the data of the previous lop_spec @var{n}s. The -location in data or code at which the lop_spec occurred is lost. - -@item lop_pre -0x980901ZZ. The first lopcode in a file. The @samp{Z} field forms the -length of header information in 32-bit words, where the first word -tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}. - -@item lop_post -0x980a00ZZ. @math{Z > 32}. This lopcode follows after all -content-generating lopcodes in a program. The @samp{Z} field -denotes the value of @samp{rG} at the beginning of the program. -The following @math{256 - Z} big-endian 64-bit words are loaded -into global registers @samp{$G} @dots{} @samp{$255}. - -@item lop_stab -0x980b0000. The next-to-last lopcode in a program. Must follow -immediately after the lop_post lopcode and its data. After this -lopcode follows all symbols in a compressed format -(@pxref{Symbol-table}). - -@item lop_end -0x980cYYZZ. The last lopcode in a program. It must follow the -lop_stab lopcode and its data. The @samp{YZ} field contains the -number of 32-bit words of symbol table information after the -preceding lop_stab lopcode. -@end table - -Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and -@code{lop_fixo} are not generated by BFD, but are handled. They are -generated by @code{mmixal}. - -This trivial one-label, one-instruction file: - -@example - :Main TRAP 1,2,3 -@end example - -can be represented this way in mmo: - -@example - 0x98090101 - lop_pre, one 32-bit word with timestamp. - - 0x98010002 - lop_loc, text segment, using a 64-bit address. - Note that mmixal does not emit this for the file above. - 0x00000000 - Address, high 32 bits. - 0x00000000 - Address, low 32 bits. - 0x98060002 - lop_file, 2 32-bit words for file-name. - 0x74657374 - "test" - 0x2e730000 - ".s\0\0" - 0x98070001 - lop_line, line 1. - 0x00010203 - TRAP 1,2,3 - 0x980a00ff - lop_post, setting $255 to 0. - 0x00000000 - 0x00000000 - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 @xref{Symbol-table}. - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 - 0x980c0005 - lop_end; symbol table contained five 32-bit words. -@end example -@node Symbol-table, mmo section mapping, File layout, mmo -@subsection Symbol table format -From mmixal.w (or really, the generated mmixal.tex) in -@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}): -``Symbols are stored and retrieved by means of a @samp{ternary -search trie}, following ideas of Bentley and Sedgewick. (See -ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369; -R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@: -Addison--Wesley, 1998), @samp{15.4}.) Each trie node stores a -character, and there are branches to subtries for the cases where -a given character is less than, equal to, or greater than the -character in the trie. There also is a pointer to a symbol table -entry if a symbol ends at the current node.'' - -So it's a tree encoded as a stream of bytes. The stream of bytes -acts on a single virtual global symbol, adding and removing -characters and signalling complete symbol points. Here, we read -the stream and create symbols at the completion points. - -First, there's a control byte @code{m}. If any of the listed bits -in @code{m} is nonzero, we execute what stands at the right, in -the listed order: - -@example - (MMO3_LEFT) - 0x40 - Traverse left trie. - (Read a new command byte and recurse.) - - (MMO3_SYMBITS) - 0x2f - Read the next byte as a character and store it in the - current character position; increment character position. - Test the bits of @code{m}: - - (MMO3_WCHAR) - 0x80 - The character is 16-bit (so read another byte, - merge into current character. - - (MMO3_TYPEBITS) - 0xf - We have a complete symbol; parse the type, value - and serial number and do what should be done - with a symbol. The type and length information - is in j = (m & 0xf). - - (MMO3_REGQUAL_BITS) - j == 0xf: A register variable. The following - byte tells which register. - j <= 8: An absolute symbol. Read j bytes as the - big-endian number the symbol equals. - A j = 2 with two zero bytes denotes an - unknown symbol. - j > 8: As with j <= 8, but add (0x20 << 56) - to the value in the following j - 8 - bytes. - - Then comes the serial number, as a variant of - uleb128, but better named ubeb128: - Read bytes and shift the previous value left 7 - (multiply by 128). Add in the new byte, repeat - until a byte has bit 7 set. The serial number - is the computed value minus 128. - - (MMO3_MIDDLE) - 0x20 - Traverse middle trie. (Read a new command byte - and recurse.) Decrement character position. - - (MMO3_RIGHT) - 0x10 - Traverse right trie. (Read a new command byte and - recurse.) -@end example - -Let's look again at the @code{lop_stab} for the trivial file -(@pxref{File layout}). - -@example - 0x980b0000 - lop_stab for ":Main" = 0, serial 1. - 0x203a4040 - 0x10404020 - 0x4d206120 - 0x69016e00 - 0x81000000 -@end example - -This forms the trivial trie (note that the path between ``:'' and -``M'' is redundant): - -@example - 203a ":" - 40 / - 40 / - 10 \ - 40 / - 40 / - 204d "M" - 2061 "a" - 2069 "i" - 016e "n" is the last character in a full symbol, and - with a value represented in one byte. - 00 The value is 0. - 81 The serial number is 1. -@end example - -@node mmo section mapping, , Symbol-table, mmo -@subsection mmo section mapping -The implementation in BFD uses special data type 80 (decimal) to -encapsulate and describe named sections, containing e.g.@: debug -information. If needed, any datum in the encapsulation will be -quoted using lop_quote. First comes a 32-bit word holding the -number of 32-bit words containing the zero-terminated zero-padded -segment name. After the name there's a 32-bit word holding flags -describing the section type. Then comes a 64-bit big-endian word -with the section length (in bytes), then another with the section -start address. Depending on the type of section, the contents -might follow, zero-padded to 32-bit boundary. For a loadable -section (such as data or code), the contents might follow at some -later point, not necessarily immediately, as a lop_loc with the -same start address as in the section description, followed by the -contents. This in effect forms a descriptor that must be emitted -before the actual contents. Sections described this way must not -overlap. - -For areas that don't have such descriptors, synthetic sections are -formed by BFD. Consecutive contents in the two memory areas -@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and -@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in -sections named @code{.text} and @code{.data} respectively. If an area -is not otherwise described, but would together with a neighboring -lower area be less than @samp{0x40000000} bytes long, it is joined -with the lower area and the gap is zero-filled. For other cases, -a new section is formed, named @code{.MMIX.sec.@var{n}}. Here, -@var{n} is a number, a running count through the mmo file, -starting at 0. - -A loadable section specified as: - -@example - .section secname,"ax" - TETRA 1,2,3,4,-1,-2009 - BYTE 80 -@end example - -and linked to address @samp{0x4}, is represented by the sequence: - -@example - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "secn" - 0x616d6500 - "ame\0" - 0x00000033 - flags CODE, READONLY, LOAD, ALLOC - 0x00000000 - high 32 bits of section length - 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits - 0x00000000 - high 32 bits of section address - 0x00000004 - section address is 4 - 0x98010002 - 64 bits with address of following data - 0x00000000 - high 32 bits of address - 0x00000004 - low 32 bits: data starts at address 4 - 0x00000001 - 1 - 0x00000002 - 2 - 0x00000003 - 3 - 0x00000004 - 4 - 0xffffffff - -1 - 0xfffff827 - -2009 - 0x50000000 - 80 as a byte, padded with zeros. -@end example - -Note that the lop_spec wrapping does not include the section -contents. Compare this to a non-loaded section specified as: - -@example - .section thirdsec - TETRA 200001,100002 - BYTE 38,40 -@end example - -This, when linked to address @samp{0x200000000000001c}, is -represented by: - -@example - 0x98080050 - lop_spec 80 - 0x00000002 - two 32-bit words for the section name - 0x7365636e - "thir" - 0x616d6500 - "dsec" - 0x00000010 - flag READONLY - 0x00000000 - high 32 bits of section length - 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits - 0x20000000 - high 32 bits of address - 0x0000001c - low 32 bits of address 0x200000000000001c - 0x00030d41 - 200001 - 0x000186a2 - 100002 - 0x26280000 - 38, 40 as bytes, padded with zeros -@end example - -For the latter example, the section contents must not be -loaded in memory, and is therefore specified as part of the -special data. The address is usually unimportant but might -provide information for e.g.@: the DWARF 2 debugging format. diff --git a/contrib/binutils/bfd/doc/opncls.texi b/contrib/binutils/bfd/doc/opncls.texi deleted file mode 100644 index 6b47adfbb45..00000000000 --- a/contrib/binutils/bfd/doc/opncls.texi +++ /dev/null @@ -1,365 +0,0 @@ -@section Opening and closing BFDs - - -@subsection Functions for opening and closing - - -@findex bfd_fopen -@subsubsection @code{bfd_fopen} -@strong{Synopsis} -@example -bfd *bfd_fopen (const char *filename, const char *target, - const char *mode, int fd); -@end example -@strong{Description}@* -Open the file @var{filename} with the target @var{target}. -Return a pointer to the created BFD. If @var{fd} is not -1, -then @code{fdopen} is used to open the file; otherwise, @code{fopen} -is used. @var{mode} is passed directly to @code{fopen} or -@code{fdopen}. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -The new BFD is marked as cacheable iff @var{fd} is -1. - -If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or -@code{system_call} error. - -@findex bfd_openr -@subsubsection @code{bfd_openr} -@strong{Synopsis} -@example -bfd *bfd_openr (const char *filename, const char *target); -@end example -@strong{Description}@* -Open the file @var{filename} (using @code{fopen}) with the target -@var{target}. Return a pointer to the created BFD. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or -@code{system_call} error. - -@findex bfd_fdopenr -@subsubsection @code{bfd_fdopenr} -@strong{Synopsis} -@example -bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -@end example -@strong{Description}@* -@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to -@code{fopen}. It opens a BFD on a file already described by the -@var{fd} supplied. - -When the file is later @code{bfd_close}d, the file descriptor will -be closed. If the caller desires that this file descriptor be -cached by BFD (opened as needed, closed as needed to free -descriptors for other opens), with the supplied @var{fd} used as -an initial file descriptor (but subject to closure at any time), -call bfd_set_cacheable(bfd, 1) on the returned BFD. The default -is to assume no caching; the file descriptor will remain open -until @code{bfd_close}, and will not be affected by BFD operations -on other files. - -Possible errors are @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. - -@findex bfd_openstreamr -@subsubsection @code{bfd_openstreamr} -@strong{Synopsis} -@example -bfd *bfd_openstreamr (const char *, const char *, void *); -@end example -@strong{Description}@* -Open a BFD for read access on an existing stdio stream. When -the BFD is passed to @code{bfd_close}, the stream will be closed. - -@findex bfd_openr_iovec -@subsubsection @code{bfd_openr_iovec} -@strong{Synopsis} -@example -bfd *bfd_openr_iovec (const char *filename, const char *target, - void *(*open) (struct bfd *nbfd, - void *open_closure), - void *open_closure, - file_ptr (*pread) (struct bfd *nbfd, - void *stream, - void *buf, - file_ptr nbytes, - file_ptr offset), - int (*close) (struct bfd *nbfd, - void *stream)); -@end example -@strong{Description}@* -Create and return a BFD backed by a read-only @var{stream}. -The @var{stream} is created using @var{open}, accessed using -@var{pread} and destroyed using @var{close}. - -Calls @code{bfd_find_target}, so @var{target} is interpreted as by -that function. - -Calls @var{open} (which can call @code{bfd_zalloc} and -@code{bfd_get_filename}) to obtain the read-only stream backing -the BFD. @var{open} either succeeds returning the -non-@code{NULL} @var{stream}, or fails returning @code{NULL} -(setting @code{bfd_error}). - -Calls @var{pread} to request @var{nbytes} of data from -@var{stream} starting at @var{offset} (e.g., via a call to -@code{bfd_read}). @var{pread} either succeeds returning the -number of bytes read (which can be less than @var{nbytes} when -end-of-file), or fails returning -1 (setting @code{bfd_error}). - -Calls @var{close} when the BFD is later closed using -@code{bfd_close}. @var{close} either succeeds returning 0, or -fails returning -1 (setting @code{bfd_error}). - -If @code{bfd_openr_iovec} returns @code{NULL} then an error has -occurred. Possible errors are @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. - -@findex bfd_openw -@subsubsection @code{bfd_openw} -@strong{Synopsis} -@example -bfd *bfd_openw (const char *filename, const char *target); -@end example -@strong{Description}@* -Create a BFD, associated with file @var{filename}, using the -file format @var{target}, and return a pointer to it. - -Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory}, -@code{bfd_error_invalid_target}. - -@findex bfd_close -@subsubsection @code{bfd_close} -@strong{Synopsis} -@example -bfd_boolean bfd_close (bfd *abfd); -@end example -@strong{Description}@* -Close a BFD. If the BFD was open for writing, then pending -operations are completed and the file written out and closed. -If the created file is executable, then @code{chmod} is called -to mark it as such. - -All memory attached to the BFD is released. - -The file descriptor associated with the BFD is closed (even -if it was passed in to BFD by @code{bfd_fdopenr}). - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_close_all_done -@subsubsection @code{bfd_close_all_done} -@strong{Synopsis} -@example -bfd_boolean bfd_close_all_done (bfd *); -@end example -@strong{Description}@* -Close a BFD. Differs from @code{bfd_close} since it does not -complete any pending operations. This routine would be used -if the application had just used BFD for swapping and didn't -want to use any of the writing code. - -If the created file is executable, then @code{chmod} is called -to mark it as such. - -All memory attached to the BFD is released. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_create -@subsubsection @code{bfd_create} -@strong{Synopsis} -@example -bfd *bfd_create (const char *filename, bfd *templ); -@end example -@strong{Description}@* -Create a new BFD in the manner of @code{bfd_openw}, but without -opening a file. The new BFD takes the target from the target -used by @var{template}. The format is always set to @code{bfd_object}. - -@findex bfd_make_writable -@subsubsection @code{bfd_make_writable} -@strong{Synopsis} -@example -bfd_boolean bfd_make_writable (bfd *abfd); -@end example -@strong{Description}@* -Takes a BFD as created by @code{bfd_create} and converts it -into one like as returned by @code{bfd_openw}. It does this -by converting the BFD to BFD_IN_MEMORY. It's assumed that -you will call @code{bfd_make_readable} on this bfd later. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_make_readable -@subsubsection @code{bfd_make_readable} -@strong{Synopsis} -@example -bfd_boolean bfd_make_readable (bfd *abfd); -@end example -@strong{Description}@* -Takes a BFD as created by @code{bfd_create} and -@code{bfd_make_writable} and converts it into one like as -returned by @code{bfd_openr}. It does this by writing the -contents out to the memory buffer, then reversing the -direction. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. - -@findex bfd_alloc -@subsubsection @code{bfd_alloc} -@strong{Synopsis} -@example -void *bfd_alloc (bfd *abfd, bfd_size_type wanted); -@end example -@strong{Description}@* -Allocate a block of @var{wanted} bytes of memory attached to -@code{abfd} and return a pointer to it. - -@findex bfd_alloc2 -@subsubsection @code{bfd_alloc2} -@strong{Synopsis} -@example -void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); -@end example -@strong{Description}@* -Allocate a block of @var{nmemb} elements of @var{size} bytes each -of memory attached to @code{abfd} and return a pointer to it. - -@findex bfd_zalloc -@subsubsection @code{bfd_zalloc} -@strong{Synopsis} -@example -void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); -@end example -@strong{Description}@* -Allocate a block of @var{wanted} bytes of zeroed memory -attached to @code{abfd} and return a pointer to it. - -@findex bfd_zalloc2 -@subsubsection @code{bfd_zalloc2} -@strong{Synopsis} -@example -void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size); -@end example -@strong{Description}@* -Allocate a block of @var{nmemb} elements of @var{size} bytes each -of zeroed memory attached to @code{abfd} and return a pointer to it. - -@findex bfd_calc_gnu_debuglink_crc32 -@subsubsection @code{bfd_calc_gnu_debuglink_crc32} -@strong{Synopsis} -@example -unsigned long bfd_calc_gnu_debuglink_crc32 - (unsigned long crc, const unsigned char *buf, bfd_size_type len); -@end example -@strong{Description}@* -Computes a CRC value as used in the .gnu_debuglink section. -Advances the previously computed @var{crc} value by computing -and adding in the crc32 for @var{len} bytes of @var{buf}. - -@strong{Returns}@* -Return the updated CRC32 value. - -@findex get_debug_link_info -@subsubsection @code{get_debug_link_info} -@strong{Synopsis} -@example -char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out); -@end example -@strong{Description}@* -fetch the filename and CRC32 value for any separate debuginfo -associated with @var{abfd}. Return NULL if no such info found, -otherwise return filename and update @var{crc32_out}. - -@findex separate_debug_file_exists -@subsubsection @code{separate_debug_file_exists} -@strong{Synopsis} -@example -bfd_boolean separate_debug_file_exists - (char *name, unsigned long crc32); -@end example -@strong{Description}@* -Checks to see if @var{name} is a file and if its contents -match @var{crc32}. - -@findex find_separate_debug_file -@subsubsection @code{find_separate_debug_file} -@strong{Synopsis} -@example -char *find_separate_debug_file (bfd *abfd); -@end example -@strong{Description}@* -Searches @var{abfd} for a reference to separate debugging -information, scans various locations in the filesystem, including -the file tree rooted at @var{debug_file_directory}, and returns a -filename of such debugging information if the file is found and has -matching CRC32. Returns NULL if no reference to debugging file -exists, or file cannot be found. - -@findex bfd_follow_gnu_debuglink -@subsubsection @code{bfd_follow_gnu_debuglink} -@strong{Synopsis} -@example -char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); -@end example -@strong{Description}@* -Takes a BFD and searches it for a .gnu_debuglink section. If this -section is found, it examines the section for the name and checksum -of a '.debug' file containing auxiliary debugging information. It -then searches the filesystem for this .debug file in some standard -locations, including the directory tree rooted at @var{dir}, and if -found returns the full filename. - -If @var{dir} is NULL, it will search a default path configured into -libbfd at build time. [XXX this feature is not currently -implemented]. - -@strong{Returns}@* -@code{NULL} on any errors or failure to locate the .debug file, -otherwise a pointer to a heap-allocated string containing the -filename. The caller is responsible for freeing this string. - -@findex bfd_create_gnu_debuglink_section -@subsubsection @code{bfd_create_gnu_debuglink_section} -@strong{Synopsis} -@example -struct bfd_section *bfd_create_gnu_debuglink_section - (bfd *abfd, const char *filename); -@end example -@strong{Description}@* -Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized -to be big enough to contain a link to the specified @var{filename}. - -@strong{Returns}@* -A pointer to the new section is returned if all is ok. Otherwise @code{NULL} is -returned and bfd_error is set. - -@findex bfd_fill_in_gnu_debuglink_section -@subsubsection @code{bfd_fill_in_gnu_debuglink_section} -@strong{Synopsis} -@example -bfd_boolean bfd_fill_in_gnu_debuglink_section - (bfd *abfd, struct bfd_section *sect, const char *filename); -@end example -@strong{Description}@* -Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} -and fills in the contents of the section to contain a link to the -specified @var{filename}. The filename should be relative to the -current directory. - -@strong{Returns}@* -@code{TRUE} is returned if all is ok. Otherwise @code{FALSE} is returned -and bfd_error is set. - diff --git a/contrib/binutils/bfd/doc/reloc.texi b/contrib/binutils/bfd/doc/reloc.texi deleted file mode 100644 index 0540be86255..00000000000 --- a/contrib/binutils/bfd/doc/reloc.texi +++ /dev/null @@ -1,2494 +0,0 @@ -@section Relocations -BFD maintains relocations in much the same way it maintains -symbols: they are left alone until required, then read in -en-masse and translated into an internal form. A common -routine @code{bfd_perform_relocation} acts upon the -canonical form to do the fixup. - -Relocations are maintained on a per section basis, -while symbols are maintained on a per BFD basis. - -All that a back end has to do to fit the BFD interface is to create -a @code{struct reloc_cache_entry} for each relocation -in a particular section, and fill in the right bits of the structures. - -@menu -* typedef arelent:: -* howto manager:: -@end menu - - -@node typedef arelent, howto manager, Relocations, Relocations -@subsection typedef arelent -This is the structure of a relocation entry: - - -@example - -typedef enum bfd_reloc_status -@{ - /* No errors detected. */ - bfd_reloc_ok, - - /* The relocation was performed, but there was an overflow. */ - bfd_reloc_overflow, - - /* The address to relocate was not within the section supplied. */ - bfd_reloc_outofrange, - - /* Used by special functions. */ - bfd_reloc_continue, - - /* Unsupported relocation size requested. */ - bfd_reloc_notsupported, - - /* Unused. */ - bfd_reloc_other, - - /* The symbol to relocate against was undefined. */ - bfd_reloc_undefined, - - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ - bfd_reloc_dangerous - @} - bfd_reloc_status_type; - - -typedef struct reloc_cache_entry -@{ - /* A pointer into the canonical table of pointers. */ - struct bfd_symbol **sym_ptr_ptr; - - /* offset in section. */ - bfd_size_type address; - - /* addend for relocation value. */ - bfd_vma addend; - - /* Pointer to how to perform the required relocation. */ - reloc_howto_type *howto; - -@} -arelent; - -@end example -@strong{Description}@* -Here is a description of each of the fields within an @code{arelent}: - -@itemize @bullet - -@item -@code{sym_ptr_ptr} -@end itemize -The symbol table pointer points to a pointer to the symbol -associated with the relocation request. It is the pointer -into the table returned by the back end's -@code{canonicalize_symtab} action. @xref{Symbols}. The symbol is -referenced through a pointer to a pointer so that tools like -the linker can fix up all the symbols of the same name by -modifying only one pointer. The relocation routine looks in -the symbol and uses the base of the section the symbol is -attached to and the value of the symbol as the initial -relocation offset. If the symbol pointer is zero, then the -section provided is looked up. - -@itemize @bullet - -@item -@code{address} -@end itemize -The @code{address} field gives the offset in bytes from the base of -the section data which owns the relocation record to the first -byte of relocatable information. The actual data relocated -will be relative to this point; for example, a relocation -type which modifies the bottom two bytes of a four byte word -would not touch the first byte pointed to in a big endian -world. - -@itemize @bullet - -@item -@code{addend} -@end itemize -The @code{addend} is a value provided by the back end to be added (!) -to the relocation offset. Its interpretation is dependent upon -the howto. For example, on the 68k the code: - -@example - char foo[]; - main() - @{ - return foo[0x12345678]; - @} -@end example - -Could be compiled into: - -@example - linkw fp,#-4 - moveb @@#12345678,d0 - extbl d0 - unlk fp - rts -@end example - -This could create a reloc pointing to @code{foo}, but leave the -offset in the data, something like: - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000006 32 _foo - -00000000 4e56 fffc ; linkw fp,#-4 -00000004 1039 1234 5678 ; moveb @@#12345678,d0 -0000000a 49c0 ; extbl d0 -0000000c 4e5e ; unlk fp -0000000e 4e75 ; rts -@end example - -Using coff and an 88k, some instructions don't have enough -space in them to represent the full address range, and -pointers have to be loaded in two parts. So you'd get something like: - -@example - or.u r13,r0,hi16(_foo+0x12345678) - ld.b r2,r13,lo16(_foo+0x12345678) - jmp r1 -@end example - -This should create two relocs, both pointing to @code{_foo}, and with -0x12340000 in their addend field. The data would consist of: - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000002 HVRT16 _foo+0x12340000 -00000006 LVRT16 _foo+0x12340000 - -00000000 5da05678 ; or.u r13,r0,0x5678 -00000004 1c4d5678 ; ld.b r2,r13,0x5678 -00000008 f400c001 ; jmp r1 -@end example - -The relocation routine digs out the value from the data, adds -it to the addend to get the original offset, and then adds the -value of @code{_foo}. Note that all 32 bits have to be kept around -somewhere, to cope with carry from bit 15 to bit 16. - -One further example is the sparc and the a.out format. The -sparc has a similar problem to the 88k, in that some -instructions don't have room for an entire offset, but on the -sparc the parts are created in odd sized lumps. The designers of -the a.out format chose to not use the data within the section -for storing part of the offset; all the offset is kept within -the reloc. Anything in the data should be ignored. - -@example - save %sp,-112,%sp - sethi %hi(_foo+0x12345678),%g2 - ldsb [%g2+%lo(_foo+0x12345678)],%i0 - ret - restore -@end example - -Both relocs contain a pointer to @code{foo}, and the offsets -contain junk. - -@example -RELOCATION RECORDS FOR [.text]: -offset type value -00000004 HI22 _foo+0x12345678 -00000008 LO10 _foo+0x12345678 - -00000000 9de3bf90 ; save %sp,-112,%sp -00000004 05000000 ; sethi %hi(_foo+0),%g2 -00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 -0000000c 81c7e008 ; ret -00000010 81e80000 ; restore -@end example - -@itemize @bullet - -@item -@code{howto} -@end itemize -The @code{howto} field can be imagined as a -relocation instruction. It is a pointer to a structure which -contains information on what to do with all of the other -information in the reloc record and data section. A back end -would normally have a relocation instruction set and turn -relocations into pointers to the correct structure on input - -but it would be possible to create each howto field on demand. - -@subsubsection @code{enum complain_overflow} -Indicates what sort of overflow checking should be done when -performing a relocation. - - -@example - -enum complain_overflow -@{ - /* Do not complain on overflow. */ - complain_overflow_dont, - - /* Complain if the value overflows when considered as a signed - number one bit larger than the field. ie. A bitfield of N bits - is allowed to represent -2**n to 2**n-1. */ - complain_overflow_bitfield, - - /* Complain if the value overflows when considered as a signed - number. */ - complain_overflow_signed, - - /* Complain if the value overflows when considered as an - unsigned number. */ - complain_overflow_unsigned -@}; -@end example -@subsubsection @code{reloc_howto_type} -The @code{reloc_howto_type} is a structure which contains all the -information that libbfd needs to know to tie up a back end's data. - - -@example -struct bfd_symbol; /* Forward declaration. */ - -struct reloc_howto_struct -@{ - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ - unsigned int type; - - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; - - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; - - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; - - /* Notes that the relocation is relative to the location in the - data section of the addend. The relocation function will - subtract from the relocation value the address of the location - being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; - - /* What type of overflow error should be checked for when - relocating. */ - enum complain_overflow complain_on_overflow; - - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); - - /* The textual name of the relocation type. */ - char *name; - - /* Some formats record a relocation addend in the section contents - rather than with the relocation. For ELF formats this is the - distinction between USE_REL and USE_RELA (though the code checks - for USE_REL == 1/0). The value of this field is TRUE if the - addend is recorded with the section contents; when performing a - partial link (ld -r) the section contents (the data) will be - modified. The value of this field is FALSE if addends are - recorded with the relocation (in arelent.addend); when performing - a partial link the relocation will be modified. - All relocations for all ELF USE_RELA targets should set this field - to FALSE (values of TRUE should be looked on with suspicion). - However, the converse is not true: not all relocations of all ELF - USE_REL targets set this field to TRUE. Why this is so is peculiar - to each particular target. For relocs that aren't used in partial - links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; - - /* When some formats create PC relative instructions, they leave - the value of the pc of the place being relocated in the offset - slot of the instruction, so that a PC relative relocation can - be made just by adding in an ordinary offset (e.g., sun3 a.out). - Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; -@}; - -@end example -@findex The HOWTO Macro -@subsubsection @code{The HOWTO Macro} -@strong{Description}@* -The HOWTO define is horrible and will go away. -@example -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - @{ (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC @} -@end example - -@strong{Description}@* -And will be replaced with the totally magic way. But for the -moment, we are compatible, so do it this way. -@example -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - -@end example - -@strong{Description}@* -This is used to fill in an empty howto entry in an array. -@example -#define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ - NULL, FALSE, 0, 0, FALSE) - -@end example - -@strong{Description}@* -Helper routine to turn a symbol into a relocation value. -@example -#define HOWTO_PREPARE(relocation, symbol) \ - @{ \ - if (symbol != NULL) \ - @{ \ - if (bfd_is_com_section (symbol->section)) \ - @{ \ - relocation = 0; \ - @} \ - else \ - @{ \ - relocation = symbol->value; \ - @} \ - @} \ - @} - -@end example - -@findex bfd_get_reloc_size -@subsubsection @code{bfd_get_reloc_size} -@strong{Synopsis} -@example -unsigned int bfd_get_reloc_size (reloc_howto_type *); -@end example -@strong{Description}@* -For a reloc_howto_type that operates on a fixed number of bytes, -this returns the number of bytes operated on. - -@findex arelent_chain -@subsubsection @code{arelent_chain} -@strong{Description}@* -How relocs are tied together in an @code{asection}: -@example -typedef struct relent_chain -@{ - arelent relent; - struct relent_chain *next; -@} -arelent_chain; - -@end example - -@findex bfd_check_overflow -@subsubsection @code{bfd_check_overflow} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - unsigned int addrsize, - bfd_vma relocation); -@end example -@strong{Description}@* -Perform overflow checking on @var{relocation} which has -@var{bitsize} significant bits and will be shifted right by -@var{rightshift} bits, on a machine with addresses containing -@var{addrsize} significant bits. The result is either of -@code{bfd_reloc_ok} or @code{bfd_reloc_overflow}. - -@findex bfd_perform_relocation -@subsubsection @code{bfd_perform_relocation} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, - asection *input_section, - bfd *output_bfd, - char **error_message); -@end example -@strong{Description}@* -If @var{output_bfd} is supplied to this function, the -generated image will be relocatable; the relocations are -copied to the output file after they have been changed to -reflect the new state of the world. There are two ways of -reflecting the results of partial linkage in an output file: -by modifying the output data in place, and by modifying the -relocation record. Some native formats (e.g., basic a.out and -basic coff) have no way of specifying an addend in the -relocation type, so the addend has to go in the output data. -This is no big deal since in these formats the output data -slot will always be big enough for the addend. Complex reloc -types with addends were invented to solve just this problem. -The @var{error_message} argument is set to an error message if -this return @code{bfd_reloc_dangerous}. - -@findex bfd_install_relocation -@subsubsection @code{bfd_install_relocation} -@strong{Synopsis} -@example -bfd_reloc_status_type bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - void *data, bfd_vma data_start, - asection *input_section, - char **error_message); -@end example -@strong{Description}@* -This looks remarkably like @code{bfd_perform_relocation}, except it -does not expect that the section contents have been filled in. -I.e., it's suitable for use when creating, rather than applying -a relocation. - -For now, this function should be considered reserved for the -assembler. - - -@node howto manager, , typedef arelent, Relocations -@subsection The howto manager -When an application wants to create a relocation, but doesn't -know what the target machine might call it, it can find out by -using this bit of code. - -@findex bfd_reloc_code_type -@subsubsection @code{bfd_reloc_code_type} -@strong{Description}@* -The insides of a reloc code. The idea is that, eventually, there -will be one enumerator for every type of relocation we ever do. -Pass one of these values to @code{bfd_reloc_type_lookup}, and it'll -return a howto pointer. - -This does mean that the application must determine the correct -enumerator value; you can't get a howto pointer from a random set -of attributes. - -Here are the possible values for @code{enum bfd_reloc_code_real}: - -@deffn {} BFD_RELOC_64 -@deffnx {} BFD_RELOC_32 -@deffnx {} BFD_RELOC_26 -@deffnx {} BFD_RELOC_24 -@deffnx {} BFD_RELOC_16 -@deffnx {} BFD_RELOC_14 -@deffnx {} BFD_RELOC_8 -Basic absolute relocations of N bits. -@end deffn -@deffn {} BFD_RELOC_64_PCREL -@deffnx {} BFD_RELOC_32_PCREL -@deffnx {} BFD_RELOC_24_PCREL -@deffnx {} BFD_RELOC_16_PCREL -@deffnx {} BFD_RELOC_12_PCREL -@deffnx {} BFD_RELOC_8_PCREL -PC-relative relocations. Sometimes these are relative to the address -of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. -@end deffn -@deffn {} BFD_RELOC_32_SECREL -Section relative relocations. Some targets need this for DWARF2. -@end deffn -@deffn {} BFD_RELOC_32_GOT_PCREL -@deffnx {} BFD_RELOC_16_GOT_PCREL -@deffnx {} BFD_RELOC_8_GOT_PCREL -@deffnx {} BFD_RELOC_32_GOTOFF -@deffnx {} BFD_RELOC_16_GOTOFF -@deffnx {} BFD_RELOC_LO16_GOTOFF -@deffnx {} BFD_RELOC_HI16_GOTOFF -@deffnx {} BFD_RELOC_HI16_S_GOTOFF -@deffnx {} BFD_RELOC_8_GOTOFF -@deffnx {} BFD_RELOC_64_PLT_PCREL -@deffnx {} BFD_RELOC_32_PLT_PCREL -@deffnx {} BFD_RELOC_24_PLT_PCREL -@deffnx {} BFD_RELOC_16_PLT_PCREL -@deffnx {} BFD_RELOC_8_PLT_PCREL -@deffnx {} BFD_RELOC_64_PLTOFF -@deffnx {} BFD_RELOC_32_PLTOFF -@deffnx {} BFD_RELOC_16_PLTOFF -@deffnx {} BFD_RELOC_LO16_PLTOFF -@deffnx {} BFD_RELOC_HI16_PLTOFF -@deffnx {} BFD_RELOC_HI16_S_PLTOFF -@deffnx {} BFD_RELOC_8_PLTOFF -For ELF. -@end deffn -@deffn {} BFD_RELOC_68K_GLOB_DAT -@deffnx {} BFD_RELOC_68K_JMP_SLOT -@deffnx {} BFD_RELOC_68K_RELATIVE -Relocations used by 68K ELF. -@end deffn -@deffn {} BFD_RELOC_32_BASEREL -@deffnx {} BFD_RELOC_16_BASEREL -@deffnx {} BFD_RELOC_LO16_BASEREL -@deffnx {} BFD_RELOC_HI16_BASEREL -@deffnx {} BFD_RELOC_HI16_S_BASEREL -@deffnx {} BFD_RELOC_8_BASEREL -@deffnx {} BFD_RELOC_RVA -Linkage-table relative. -@end deffn -@deffn {} BFD_RELOC_8_FFnn -Absolute 8-bit relocation, but used to form an address like 0xFFnn. -@end deffn -@deffn {} BFD_RELOC_32_PCREL_S2 -@deffnx {} BFD_RELOC_16_PCREL_S2 -@deffnx {} BFD_RELOC_23_PCREL_S2 -These PC-relative relocations are stored as word displacements -- -i.e., byte displacements shifted right two bits. The 30-bit word -displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the -SPARC. (SPARC tools generally refer to this as <>.) The -signed 16-bit displacement is used on the MIPS, and the 23-bit -displacement is used on the Alpha. -@end deffn -@deffn {} BFD_RELOC_HI22 -@deffnx {} BFD_RELOC_LO10 -High 22 bits and low 10 bits of 32-bit value, placed into lower bits of -the target word. These are used on the SPARC. -@end deffn -@deffn {} BFD_RELOC_GPREL16 -@deffnx {} BFD_RELOC_GPREL32 -For systems that allocate a Global Pointer register, these are -displacements off that register. These relocation types are -handled specially, because the value the register will have is -decided relatively late. -@end deffn -@deffn {} BFD_RELOC_I960_CALLJ -Reloc types used for i960/b.out. -@end deffn -@deffn {} BFD_RELOC_NONE -@deffnx {} BFD_RELOC_SPARC_WDISP22 -@deffnx {} BFD_RELOC_SPARC22 -@deffnx {} BFD_RELOC_SPARC13 -@deffnx {} BFD_RELOC_SPARC_GOT10 -@deffnx {} BFD_RELOC_SPARC_GOT13 -@deffnx {} BFD_RELOC_SPARC_GOT22 -@deffnx {} BFD_RELOC_SPARC_PC10 -@deffnx {} BFD_RELOC_SPARC_PC22 -@deffnx {} BFD_RELOC_SPARC_WPLT30 -@deffnx {} BFD_RELOC_SPARC_COPY -@deffnx {} BFD_RELOC_SPARC_GLOB_DAT -@deffnx {} BFD_RELOC_SPARC_JMP_SLOT -@deffnx {} BFD_RELOC_SPARC_RELATIVE -@deffnx {} BFD_RELOC_SPARC_UA16 -@deffnx {} BFD_RELOC_SPARC_UA32 -@deffnx {} BFD_RELOC_SPARC_UA64 -SPARC ELF relocations. There is probably some overlap with other -relocation types already defined. -@end deffn -@deffn {} BFD_RELOC_SPARC_BASE13 -@deffnx {} BFD_RELOC_SPARC_BASE22 -I think these are specific to SPARC a.out (e.g., Sun 4). -@end deffn -@deffn {} BFD_RELOC_SPARC_64 -@deffnx {} BFD_RELOC_SPARC_10 -@deffnx {} BFD_RELOC_SPARC_11 -@deffnx {} BFD_RELOC_SPARC_OLO10 -@deffnx {} BFD_RELOC_SPARC_HH22 -@deffnx {} BFD_RELOC_SPARC_HM10 -@deffnx {} BFD_RELOC_SPARC_LM22 -@deffnx {} BFD_RELOC_SPARC_PC_HH22 -@deffnx {} BFD_RELOC_SPARC_PC_HM10 -@deffnx {} BFD_RELOC_SPARC_PC_LM22 -@deffnx {} BFD_RELOC_SPARC_WDISP16 -@deffnx {} BFD_RELOC_SPARC_WDISP19 -@deffnx {} BFD_RELOC_SPARC_7 -@deffnx {} BFD_RELOC_SPARC_6 -@deffnx {} BFD_RELOC_SPARC_5 -@deffnx {} BFD_RELOC_SPARC_DISP64 -@deffnx {} BFD_RELOC_SPARC_PLT32 -@deffnx {} BFD_RELOC_SPARC_PLT64 -@deffnx {} BFD_RELOC_SPARC_HIX22 -@deffnx {} BFD_RELOC_SPARC_LOX10 -@deffnx {} BFD_RELOC_SPARC_H44 -@deffnx {} BFD_RELOC_SPARC_M44 -@deffnx {} BFD_RELOC_SPARC_L44 -@deffnx {} BFD_RELOC_SPARC_REGISTER -SPARC64 relocations -@end deffn -@deffn {} BFD_RELOC_SPARC_REV32 -SPARC little endian relocation -@end deffn -@deffn {} BFD_RELOC_SPARC_TLS_GD_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_GD_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_GD_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_GD_CALL -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_LDM_CALL -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_HIX22 -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_LOX10 -@deffnx {} BFD_RELOC_SPARC_TLS_LDO_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_IE_HI22 -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LO10 -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LD -@deffnx {} BFD_RELOC_SPARC_TLS_IE_LDX -@deffnx {} BFD_RELOC_SPARC_TLS_IE_ADD -@deffnx {} BFD_RELOC_SPARC_TLS_LE_HIX22 -@deffnx {} BFD_RELOC_SPARC_TLS_LE_LOX10 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF64 -@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF32 -@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF64 -SPARC TLS relocations -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP_HI16 -Alpha ECOFF and ELF relocations. Some of these treat the symbol or -"addend" in some special way. -For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when -writing; when reading, it will be the absolute section symbol. The -addend is the displacement in bytes of the "lda" instruction from -the "ldah" instruction (which is at the address of this reloc). -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP_LO16 -For GPDISP_LO16 ("ignore") relocations, the symbol is handled as -with GPDISP_HI16 relocs. The addend is ignored when writing the -relocations out, and is filled in with the file's GP value on -reading, for convenience. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPDISP -The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 -relocation except that there is no accompanying GPDISP_LO16 -relocation. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LITERAL -@deffnx {} BFD_RELOC_ALPHA_ELF_LITERAL -@deffnx {} BFD_RELOC_ALPHA_LITUSE -The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; -the assembler turns it into a LDQ instruction to load the address of -the symbol, and then fills in a register in the real instruction. - -The LITERAL reloc, at the LDQ instruction, refers to the .lita -section symbol. The addend is ignored when writing, but is filled -in with the file's GP value on reading, for convenience, as with the -GPDISP_LO16 reloc. - -The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. -It should refer to the symbol to be referenced, as with 16_GOTOFF, -but it generates output not based on the position within the .got -section, but relative to the GP value chosen for the file during the -final link stage. - -The LITUSE reloc, on the instruction using the loaded address, gives -information to the linker that it might be able to use to optimize -away some literal section references. The symbol is ignored (read -as the absolute section symbol), and the "addend" indicates the type -of instruction using the register: -1 - "memory" fmt insn -2 - byte-manipulation (byte offset reg) -3 - jsr (target of branch) -@end deffn -@deffn {} BFD_RELOC_ALPHA_HINT -The HINT relocation indicates a value that should be filled into the -"hint" field of a jmp/jsr/ret instruction, for possible branch- -prediction logic which may be provided on some processors. -@end deffn -@deffn {} BFD_RELOC_ALPHA_LINKAGE -The LINKAGE relocation outputs a linkage pair in the object file, -which is filled by the linker. -@end deffn -@deffn {} BFD_RELOC_ALPHA_CODEADDR -The CODEADDR relocation outputs a STO_CA in the object file, -which is filled by the linker. -@end deffn -@deffn {} BFD_RELOC_ALPHA_GPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_GPREL_LO16 -The GPREL_HI/LO relocations together form a 32-bit offset from the -GP register. -@end deffn -@deffn {} BFD_RELOC_ALPHA_BRSGP -Like BFD_RELOC_23_PCREL_S2, except that the source and target must -share a common GP, and the target address is adjusted for -STO_ALPHA_STD_GPLOAD. -@end deffn -@deffn {} BFD_RELOC_ALPHA_TLSGD -@deffnx {} BFD_RELOC_ALPHA_TLSLDM -@deffnx {} BFD_RELOC_ALPHA_DTPMOD64 -@deffnx {} BFD_RELOC_ALPHA_GOTDTPREL16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL64 -@deffnx {} BFD_RELOC_ALPHA_DTPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL_LO16 -@deffnx {} BFD_RELOC_ALPHA_DTPREL16 -@deffnx {} BFD_RELOC_ALPHA_GOTTPREL16 -@deffnx {} BFD_RELOC_ALPHA_TPREL64 -@deffnx {} BFD_RELOC_ALPHA_TPREL_HI16 -@deffnx {} BFD_RELOC_ALPHA_TPREL_LO16 -@deffnx {} BFD_RELOC_ALPHA_TPREL16 -Alpha thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_MIPS_JMP -Bits 27..2 of the relocation address shifted right 2 bits; -simple reloc otherwise. -@end deffn -@deffn {} BFD_RELOC_MIPS16_JMP -The MIPS16 jump instruction. -@end deffn -@deffn {} BFD_RELOC_MIPS16_GPREL -MIPS16 GP relative reloc. -@end deffn -@deffn {} BFD_RELOC_HI16 -High 16 bits of 32-bit value; simple reloc. -@end deffn -@deffn {} BFD_RELOC_HI16_S -High 16 bits of 32-bit value but the low 16 bits will be sign -extended and added to form the final result. If the low 16 -bits form a negative number, we need to add one to the high value -to compensate for the borrow when the low bits are added. -@end deffn -@deffn {} BFD_RELOC_LO16 -Low 16 bits. -@end deffn -@deffn {} BFD_RELOC_HI16_PCREL -High 16 bits of 32-bit pc-relative value -@end deffn -@deffn {} BFD_RELOC_HI16_S_PCREL -High 16 bits of 32-bit pc-relative value, adjusted -@end deffn -@deffn {} BFD_RELOC_LO16_PCREL -Low 16 bits of pc-relative value -@end deffn -@deffn {} BFD_RELOC_MIPS16_HI16 -MIPS16 high 16 bits of 32-bit value. -@end deffn -@deffn {} BFD_RELOC_MIPS16_HI16_S -MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign -extended and added to form the final result. If the low 16 -bits form a negative number, we need to add one to the high value -to compensate for the borrow when the low bits are added. -@end deffn -@deffn {} BFD_RELOC_MIPS16_LO16 -MIPS16 low 16 bits. -@end deffn -@deffn {} BFD_RELOC_MIPS_LITERAL -Relocation against a MIPS literal section. -@end deffn -@deffn {} BFD_RELOC_MIPS_GOT16 -@deffnx {} BFD_RELOC_MIPS_CALL16 -@deffnx {} BFD_RELOC_MIPS_GOT_HI16 -@deffnx {} BFD_RELOC_MIPS_GOT_LO16 -@deffnx {} BFD_RELOC_MIPS_CALL_HI16 -@deffnx {} BFD_RELOC_MIPS_CALL_LO16 -@deffnx {} BFD_RELOC_MIPS_SUB -@deffnx {} BFD_RELOC_MIPS_GOT_PAGE -@deffnx {} BFD_RELOC_MIPS_GOT_OFST -@deffnx {} BFD_RELOC_MIPS_GOT_DISP -@deffnx {} BFD_RELOC_MIPS_SHIFT5 -@deffnx {} BFD_RELOC_MIPS_SHIFT6 -@deffnx {} BFD_RELOC_MIPS_INSERT_A -@deffnx {} BFD_RELOC_MIPS_INSERT_B -@deffnx {} BFD_RELOC_MIPS_DELETE -@deffnx {} BFD_RELOC_MIPS_HIGHEST -@deffnx {} BFD_RELOC_MIPS_HIGHER -@deffnx {} BFD_RELOC_MIPS_SCN_DISP -@deffnx {} BFD_RELOC_MIPS_REL16 -@deffnx {} BFD_RELOC_MIPS_RELGOT -@deffnx {} BFD_RELOC_MIPS_JALR -@deffnx {} BFD_RELOC_MIPS_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL32 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPMOD64 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL64 -@deffnx {} BFD_RELOC_MIPS_TLS_GD -@deffnx {} BFD_RELOC_MIPS_TLS_LDM -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL_HI16 -@deffnx {} BFD_RELOC_MIPS_TLS_DTPREL_LO16 -@deffnx {} BFD_RELOC_MIPS_TLS_GOTTPREL -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL32 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL64 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_HI16 -@deffnx {} BFD_RELOC_MIPS_TLS_TPREL_LO16 -MIPS ELF relocations. -@end deffn -@deffn {} BFD_RELOC_MIPS_COPY -@deffnx {} BFD_RELOC_MIPS_JUMP_SLOT -MIPS ELF relocations (VxWorks extensions). -@end deffn -@deffn {} BFD_RELOC_FRV_LABEL16 -@deffnx {} BFD_RELOC_FRV_LABEL24 -@deffnx {} BFD_RELOC_FRV_LO16 -@deffnx {} BFD_RELOC_FRV_HI16 -@deffnx {} BFD_RELOC_FRV_GPREL12 -@deffnx {} BFD_RELOC_FRV_GPRELU12 -@deffnx {} BFD_RELOC_FRV_GPREL32 -@deffnx {} BFD_RELOC_FRV_GPRELHI -@deffnx {} BFD_RELOC_FRV_GPRELLO -@deffnx {} BFD_RELOC_FRV_GOT12 -@deffnx {} BFD_RELOC_FRV_GOTHI -@deffnx {} BFD_RELOC_FRV_GOTLO -@deffnx {} BFD_RELOC_FRV_FUNCDESC -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOT12 -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTHI -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTLO -@deffnx {} BFD_RELOC_FRV_FUNCDESC_VALUE -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFF12 -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFHI -@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFLO -@deffnx {} BFD_RELOC_FRV_GOTOFF12 -@deffnx {} BFD_RELOC_FRV_GOTOFFHI -@deffnx {} BFD_RELOC_FRV_GOTOFFLO -@deffnx {} BFD_RELOC_FRV_GETTLSOFF -@deffnx {} BFD_RELOC_FRV_TLSDESC_VALUE -@deffnx {} BFD_RELOC_FRV_GOTTLSDESC12 -@deffnx {} BFD_RELOC_FRV_GOTTLSDESCHI -@deffnx {} BFD_RELOC_FRV_GOTTLSDESCLO -@deffnx {} BFD_RELOC_FRV_TLSMOFF12 -@deffnx {} BFD_RELOC_FRV_TLSMOFFHI -@deffnx {} BFD_RELOC_FRV_TLSMOFFLO -@deffnx {} BFD_RELOC_FRV_GOTTLSOFF12 -@deffnx {} BFD_RELOC_FRV_GOTTLSOFFHI -@deffnx {} BFD_RELOC_FRV_GOTTLSOFFLO -@deffnx {} BFD_RELOC_FRV_TLSOFF -@deffnx {} BFD_RELOC_FRV_TLSDESC_RELAX -@deffnx {} BFD_RELOC_FRV_GETTLSOFF_RELAX -@deffnx {} BFD_RELOC_FRV_TLSOFF_RELAX -@deffnx {} BFD_RELOC_FRV_TLSMOFF -Fujitsu Frv Relocations. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOTOFF24 -This is a 24bit GOT-relative reloc for the mn10300. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT32 -This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT24 -This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_GOT16 -This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes -in the instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_COPY -Copy symbol at runtime. -@end deffn -@deffn {} BFD_RELOC_MN10300_GLOB_DAT -Create GOT entry. -@end deffn -@deffn {} BFD_RELOC_MN10300_JMP_SLOT -Create PLT entry. -@end deffn -@deffn {} BFD_RELOC_MN10300_RELATIVE -Adjust by program base. -@end deffn -@deffn {} BFD_RELOC_386_GOT32 -@deffnx {} BFD_RELOC_386_PLT32 -@deffnx {} BFD_RELOC_386_COPY -@deffnx {} BFD_RELOC_386_GLOB_DAT -@deffnx {} BFD_RELOC_386_JUMP_SLOT -@deffnx {} BFD_RELOC_386_RELATIVE -@deffnx {} BFD_RELOC_386_GOTOFF -@deffnx {} BFD_RELOC_386_GOTPC -@deffnx {} BFD_RELOC_386_TLS_TPOFF -@deffnx {} BFD_RELOC_386_TLS_IE -@deffnx {} BFD_RELOC_386_TLS_GOTIE -@deffnx {} BFD_RELOC_386_TLS_LE -@deffnx {} BFD_RELOC_386_TLS_GD -@deffnx {} BFD_RELOC_386_TLS_LDM -@deffnx {} BFD_RELOC_386_TLS_LDO_32 -@deffnx {} BFD_RELOC_386_TLS_IE_32 -@deffnx {} BFD_RELOC_386_TLS_LE_32 -@deffnx {} BFD_RELOC_386_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_386_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_386_TLS_TPOFF32 -@deffnx {} BFD_RELOC_386_TLS_GOTDESC -@deffnx {} BFD_RELOC_386_TLS_DESC_CALL -@deffnx {} BFD_RELOC_386_TLS_DESC -i386/elf relocations -@end deffn -@deffn {} BFD_RELOC_X86_64_GOT32 -@deffnx {} BFD_RELOC_X86_64_PLT32 -@deffnx {} BFD_RELOC_X86_64_COPY -@deffnx {} BFD_RELOC_X86_64_GLOB_DAT -@deffnx {} BFD_RELOC_X86_64_JUMP_SLOT -@deffnx {} BFD_RELOC_X86_64_RELATIVE -@deffnx {} BFD_RELOC_X86_64_GOTPCREL -@deffnx {} BFD_RELOC_X86_64_32S -@deffnx {} BFD_RELOC_X86_64_DTPMOD64 -@deffnx {} BFD_RELOC_X86_64_DTPOFF64 -@deffnx {} BFD_RELOC_X86_64_TPOFF64 -@deffnx {} BFD_RELOC_X86_64_TLSGD -@deffnx {} BFD_RELOC_X86_64_TLSLD -@deffnx {} BFD_RELOC_X86_64_DTPOFF32 -@deffnx {} BFD_RELOC_X86_64_GOTTPOFF -@deffnx {} BFD_RELOC_X86_64_TPOFF32 -@deffnx {} BFD_RELOC_X86_64_GOTOFF64 -@deffnx {} BFD_RELOC_X86_64_GOTPC32 -@deffnx {} BFD_RELOC_X86_64_GOT64 -@deffnx {} BFD_RELOC_X86_64_GOTPCREL64 -@deffnx {} BFD_RELOC_X86_64_GOTPC64 -@deffnx {} BFD_RELOC_X86_64_GOTPLT64 -@deffnx {} BFD_RELOC_X86_64_PLTOFF64 -@deffnx {} BFD_RELOC_X86_64_GOTPC32_TLSDESC -@deffnx {} BFD_RELOC_X86_64_TLSDESC_CALL -@deffnx {} BFD_RELOC_X86_64_TLSDESC -x86-64/elf relocations -@end deffn -@deffn {} BFD_RELOC_NS32K_IMM_8 -@deffnx {} BFD_RELOC_NS32K_IMM_16 -@deffnx {} BFD_RELOC_NS32K_IMM_32 -@deffnx {} BFD_RELOC_NS32K_IMM_8_PCREL -@deffnx {} BFD_RELOC_NS32K_IMM_16_PCREL -@deffnx {} BFD_RELOC_NS32K_IMM_32_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_8 -@deffnx {} BFD_RELOC_NS32K_DISP_16 -@deffnx {} BFD_RELOC_NS32K_DISP_32 -@deffnx {} BFD_RELOC_NS32K_DISP_8_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_16_PCREL -@deffnx {} BFD_RELOC_NS32K_DISP_32_PCREL -ns32k relocations -@end deffn -@deffn {} BFD_RELOC_PDP11_DISP_8_PCREL -@deffnx {} BFD_RELOC_PDP11_DISP_6_PCREL -PDP11 relocations -@end deffn -@deffn {} BFD_RELOC_PJ_CODE_HI16 -@deffnx {} BFD_RELOC_PJ_CODE_LO16 -@deffnx {} BFD_RELOC_PJ_CODE_DIR16 -@deffnx {} BFD_RELOC_PJ_CODE_DIR32 -@deffnx {} BFD_RELOC_PJ_CODE_REL16 -@deffnx {} BFD_RELOC_PJ_CODE_REL32 -Picojava relocs. Not all of these appear in object files. -@end deffn -@deffn {} BFD_RELOC_PPC_B26 -@deffnx {} BFD_RELOC_PPC_BA26 -@deffnx {} BFD_RELOC_PPC_TOC16 -@deffnx {} BFD_RELOC_PPC_B16 -@deffnx {} BFD_RELOC_PPC_B16_BRTAKEN -@deffnx {} BFD_RELOC_PPC_B16_BRNTAKEN -@deffnx {} BFD_RELOC_PPC_BA16 -@deffnx {} BFD_RELOC_PPC_BA16_BRTAKEN -@deffnx {} BFD_RELOC_PPC_BA16_BRNTAKEN -@deffnx {} BFD_RELOC_PPC_COPY -@deffnx {} BFD_RELOC_PPC_GLOB_DAT -@deffnx {} BFD_RELOC_PPC_JMP_SLOT -@deffnx {} BFD_RELOC_PPC_RELATIVE -@deffnx {} BFD_RELOC_PPC_LOCAL24PC -@deffnx {} BFD_RELOC_PPC_EMB_NADDR32 -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16 -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_LO -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_HI -@deffnx {} BFD_RELOC_PPC_EMB_NADDR16_HA -@deffnx {} BFD_RELOC_PPC_EMB_SDAI16 -@deffnx {} BFD_RELOC_PPC_EMB_SDA2I16 -@deffnx {} BFD_RELOC_PPC_EMB_SDA2REL -@deffnx {} BFD_RELOC_PPC_EMB_SDA21 -@deffnx {} BFD_RELOC_PPC_EMB_MRKREF -@deffnx {} BFD_RELOC_PPC_EMB_RELSEC16 -@deffnx {} BFD_RELOC_PPC_EMB_RELST_LO -@deffnx {} BFD_RELOC_PPC_EMB_RELST_HI -@deffnx {} BFD_RELOC_PPC_EMB_RELST_HA -@deffnx {} BFD_RELOC_PPC_EMB_BIT_FLD -@deffnx {} BFD_RELOC_PPC_EMB_RELSDA -@deffnx {} BFD_RELOC_PPC64_HIGHER -@deffnx {} BFD_RELOC_PPC64_HIGHER_S -@deffnx {} BFD_RELOC_PPC64_HIGHEST -@deffnx {} BFD_RELOC_PPC64_HIGHEST_S -@deffnx {} BFD_RELOC_PPC64_TOC16_LO -@deffnx {} BFD_RELOC_PPC64_TOC16_HI -@deffnx {} BFD_RELOC_PPC64_TOC16_HA -@deffnx {} BFD_RELOC_PPC64_TOC -@deffnx {} BFD_RELOC_PPC64_PLTGOT16 -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_HI -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_HA -@deffnx {} BFD_RELOC_PPC64_ADDR16_DS -@deffnx {} BFD_RELOC_PPC64_ADDR16_LO_DS -@deffnx {} BFD_RELOC_PPC64_GOT16_DS -@deffnx {} BFD_RELOC_PPC64_GOT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_PLT16_LO_DS -@deffnx {} BFD_RELOC_PPC64_SECTOFF_DS -@deffnx {} BFD_RELOC_PPC64_SECTOFF_LO_DS -@deffnx {} BFD_RELOC_PPC64_TOC16_DS -@deffnx {} BFD_RELOC_PPC64_TOC16_LO_DS -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_DS -@deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO_DS -Power(rs6000) and PowerPC relocations. -@end deffn -@deffn {} BFD_RELOC_PPC_TLS -@deffnx {} BFD_RELOC_PPC_DTPMOD -@deffnx {} BFD_RELOC_PPC_TPREL16 -@deffnx {} BFD_RELOC_PPC_TPREL16_LO -@deffnx {} BFD_RELOC_PPC_TPREL16_HI -@deffnx {} BFD_RELOC_PPC_TPREL16_HA -@deffnx {} BFD_RELOC_PPC_TPREL -@deffnx {} BFD_RELOC_PPC_DTPREL16 -@deffnx {} BFD_RELOC_PPC_DTPREL16_LO -@deffnx {} BFD_RELOC_PPC_DTPREL16_HI -@deffnx {} BFD_RELOC_PPC_DTPREL16_HA -@deffnx {} BFD_RELOC_PPC_DTPREL -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16 -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HA -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16 -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HA -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16 -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_LO -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HI -@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HA -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16 -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_LO -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HI -@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HA -@deffnx {} BFD_RELOC_PPC64_TPREL16_DS -@deffnx {} BFD_RELOC_PPC64_TPREL16_LO_DS -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHER -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHERA -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHEST -@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHESTA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_DS -@deffnx {} BFD_RELOC_PPC64_DTPREL16_LO_DS -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHER -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHERA -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHEST -@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHESTA -PowerPC and PowerPC64 thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_I370_D12 -IBM 370/390 relocations -@end deffn -@deffn {} BFD_RELOC_CTOR -The type of reloc used to build a constructor table - at the moment -probably a 32 bit wide absolute relocation, but the target can choose. -It generally does map to one of the other relocation types. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_BRANCH -ARM 26 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_BLX -ARM 26 bit pc-relative branch. The lowest bit must be zero and is -not stored in the instruction. The 2nd lowest bit comes from a 1 bit -field in the instruction. -@end deffn -@deffn {} BFD_RELOC_THUMB_PCREL_BLX -Thumb 22 bit pc-relative branch. The lowest bit must be zero and is -not stored in the instruction. The 2nd lowest bit comes from a 1 bit -field in the instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_CALL -ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. -@end deffn -@deffn {} BFD_RELOC_ARM_PCREL_JUMP -ARM 26-bit pc-relative branch for B or conditional BL instruction. -@end deffn -@deffn {} BFD_RELOC_THUMB_PCREL_BRANCH7 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH9 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH12 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH20 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH23 -@deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH25 -Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. -The lowest bit must be zero and is not stored in the instruction. -Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an -"nn" one smaller in all cases. Note further that BRANCH23 -corresponds to R_ARM_THM_CALL. -@end deffn -@deffn {} BFD_RELOC_ARM_OFFSET_IMM -12-bit immediate offset, used in ARM-format ldr and str instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_THUMB_OFFSET -5-bit immediate offset, used in Thumb-format ldr and str instructions. -@end deffn -@deffn {} BFD_RELOC_ARM_TARGET1 -Pc-relative or absolute relocation depending on target. Used for -entries in .init_array sections. -@end deffn -@deffn {} BFD_RELOC_ARM_ROSEGREL32 -Read-only segment base relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_SBREL32 -Data segment base relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_TARGET2 -This reloc is used for references to RTTI data from exception handling -tables. The actual definition depends on the target. It may be a -pc-relative or some form of GOT-indirect relocation. -@end deffn -@deffn {} BFD_RELOC_ARM_PREL31 -31-bit PC relative address. -@end deffn -@deffn {} BFD_RELOC_ARM_JUMP_SLOT -@deffnx {} BFD_RELOC_ARM_GLOB_DAT -@deffnx {} BFD_RELOC_ARM_GOT32 -@deffnx {} BFD_RELOC_ARM_PLT32 -@deffnx {} BFD_RELOC_ARM_RELATIVE -@deffnx {} BFD_RELOC_ARM_GOTOFF -@deffnx {} BFD_RELOC_ARM_GOTPC -Relocations for setting up GOTs and PLTs for shared libraries. -@end deffn -@deffn {} BFD_RELOC_ARM_TLS_GD32 -@deffnx {} BFD_RELOC_ARM_TLS_LDO32 -@deffnx {} BFD_RELOC_ARM_TLS_LDM32 -@deffnx {} BFD_RELOC_ARM_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_ARM_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_ARM_TLS_TPOFF32 -@deffnx {} BFD_RELOC_ARM_TLS_IE32 -@deffnx {} BFD_RELOC_ARM_TLS_LE32 -ARM thread-local storage relocations. -@end deffn -@deffn {} BFD_RELOC_ARM_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_ADRL_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_T32_IMMEDIATE -@deffnx {} BFD_RELOC_ARM_T32_IMM12 -@deffnx {} BFD_RELOC_ARM_T32_ADD_PC12 -@deffnx {} BFD_RELOC_ARM_SHIFT_IMM -@deffnx {} BFD_RELOC_ARM_SMC -@deffnx {} BFD_RELOC_ARM_SWI -@deffnx {} BFD_RELOC_ARM_MULTI -@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM -@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM_S2 -@deffnx {} BFD_RELOC_ARM_T32_CP_OFF_IMM -@deffnx {} BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 -@deffnx {} BFD_RELOC_ARM_ADR_IMM -@deffnx {} BFD_RELOC_ARM_LDR_IMM -@deffnx {} BFD_RELOC_ARM_LITERAL -@deffnx {} BFD_RELOC_ARM_IN_POOL -@deffnx {} BFD_RELOC_ARM_OFFSET_IMM8 -@deffnx {} BFD_RELOC_ARM_T32_OFFSET_U8 -@deffnx {} BFD_RELOC_ARM_T32_OFFSET_IMM -@deffnx {} BFD_RELOC_ARM_HWLITERAL -@deffnx {} BFD_RELOC_ARM_THUMB_ADD -@deffnx {} BFD_RELOC_ARM_THUMB_IMM -@deffnx {} BFD_RELOC_ARM_THUMB_SHIFT -These relocs are only used within the ARM assembler. They are not -(at present) written to any object files. -@end deffn -@deffn {} BFD_RELOC_SH_PCDISP8BY2 -@deffnx {} BFD_RELOC_SH_PCDISP12BY2 -@deffnx {} BFD_RELOC_SH_IMM3 -@deffnx {} BFD_RELOC_SH_IMM3U -@deffnx {} BFD_RELOC_SH_DISP12 -@deffnx {} BFD_RELOC_SH_DISP12BY2 -@deffnx {} BFD_RELOC_SH_DISP12BY4 -@deffnx {} BFD_RELOC_SH_DISP12BY8 -@deffnx {} BFD_RELOC_SH_DISP20 -@deffnx {} BFD_RELOC_SH_DISP20BY8 -@deffnx {} BFD_RELOC_SH_IMM4 -@deffnx {} BFD_RELOC_SH_IMM4BY2 -@deffnx {} BFD_RELOC_SH_IMM4BY4 -@deffnx {} BFD_RELOC_SH_IMM8 -@deffnx {} BFD_RELOC_SH_IMM8BY2 -@deffnx {} BFD_RELOC_SH_IMM8BY4 -@deffnx {} BFD_RELOC_SH_PCRELIMM8BY2 -@deffnx {} BFD_RELOC_SH_PCRELIMM8BY4 -@deffnx {} BFD_RELOC_SH_SWITCH16 -@deffnx {} BFD_RELOC_SH_SWITCH32 -@deffnx {} BFD_RELOC_SH_USES -@deffnx {} BFD_RELOC_SH_COUNT -@deffnx {} BFD_RELOC_SH_ALIGN -@deffnx {} BFD_RELOC_SH_CODE -@deffnx {} BFD_RELOC_SH_DATA -@deffnx {} BFD_RELOC_SH_LABEL -@deffnx {} BFD_RELOC_SH_LOOP_START -@deffnx {} BFD_RELOC_SH_LOOP_END -@deffnx {} BFD_RELOC_SH_COPY -@deffnx {} BFD_RELOC_SH_GLOB_DAT -@deffnx {} BFD_RELOC_SH_JMP_SLOT -@deffnx {} BFD_RELOC_SH_RELATIVE -@deffnx {} BFD_RELOC_SH_GOTPC -@deffnx {} BFD_RELOC_SH_GOT_LOW16 -@deffnx {} BFD_RELOC_SH_GOT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOT_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOT_HI16 -@deffnx {} BFD_RELOC_SH_GOTPLT_LOW16 -@deffnx {} BFD_RELOC_SH_GOTPLT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTPLT_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTPLT_HI16 -@deffnx {} BFD_RELOC_SH_PLT_LOW16 -@deffnx {} BFD_RELOC_SH_PLT_MEDLOW16 -@deffnx {} BFD_RELOC_SH_PLT_MEDHI16 -@deffnx {} BFD_RELOC_SH_PLT_HI16 -@deffnx {} BFD_RELOC_SH_GOTOFF_LOW16 -@deffnx {} BFD_RELOC_SH_GOTOFF_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTOFF_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTOFF_HI16 -@deffnx {} BFD_RELOC_SH_GOTPC_LOW16 -@deffnx {} BFD_RELOC_SH_GOTPC_MEDLOW16 -@deffnx {} BFD_RELOC_SH_GOTPC_MEDHI16 -@deffnx {} BFD_RELOC_SH_GOTPC_HI16 -@deffnx {} BFD_RELOC_SH_COPY64 -@deffnx {} BFD_RELOC_SH_GLOB_DAT64 -@deffnx {} BFD_RELOC_SH_JMP_SLOT64 -@deffnx {} BFD_RELOC_SH_RELATIVE64 -@deffnx {} BFD_RELOC_SH_GOT10BY4 -@deffnx {} BFD_RELOC_SH_GOT10BY8 -@deffnx {} BFD_RELOC_SH_GOTPLT10BY4 -@deffnx {} BFD_RELOC_SH_GOTPLT10BY8 -@deffnx {} BFD_RELOC_SH_GOTPLT32 -@deffnx {} BFD_RELOC_SH_SHMEDIA_CODE -@deffnx {} BFD_RELOC_SH_IMMU5 -@deffnx {} BFD_RELOC_SH_IMMS6 -@deffnx {} BFD_RELOC_SH_IMMS6BY32 -@deffnx {} BFD_RELOC_SH_IMMU6 -@deffnx {} BFD_RELOC_SH_IMMS10 -@deffnx {} BFD_RELOC_SH_IMMS10BY2 -@deffnx {} BFD_RELOC_SH_IMMS10BY4 -@deffnx {} BFD_RELOC_SH_IMMS10BY8 -@deffnx {} BFD_RELOC_SH_IMMS16 -@deffnx {} BFD_RELOC_SH_IMMU16 -@deffnx {} BFD_RELOC_SH_IMM_LOW16 -@deffnx {} BFD_RELOC_SH_IMM_LOW16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_MEDLOW16 -@deffnx {} BFD_RELOC_SH_IMM_MEDLOW16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_MEDHI16 -@deffnx {} BFD_RELOC_SH_IMM_MEDHI16_PCREL -@deffnx {} BFD_RELOC_SH_IMM_HI16 -@deffnx {} BFD_RELOC_SH_IMM_HI16_PCREL -@deffnx {} BFD_RELOC_SH_PT_16 -@deffnx {} BFD_RELOC_SH_TLS_GD_32 -@deffnx {} BFD_RELOC_SH_TLS_LD_32 -@deffnx {} BFD_RELOC_SH_TLS_LDO_32 -@deffnx {} BFD_RELOC_SH_TLS_IE_32 -@deffnx {} BFD_RELOC_SH_TLS_LE_32 -@deffnx {} BFD_RELOC_SH_TLS_DTPMOD32 -@deffnx {} BFD_RELOC_SH_TLS_DTPOFF32 -@deffnx {} BFD_RELOC_SH_TLS_TPOFF32 -Renesas / SuperH SH relocs. Not all of these appear in object files. -@end deffn -@deffn {} BFD_RELOC_ARC_B22_PCREL -ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. -@end deffn -@deffn {} BFD_RELOC_ARC_B26 -ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_IMM -ADI Blackfin 16 bit immediate absolute reloc. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_HIGH -ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. -@end deffn -@deffn {} BFD_RELOC_BFIN_4_PCREL -ADI Blackfin 'a' part of LSETUP. -@end deffn -@deffn {} BFD_RELOC_BFIN_5_PCREL -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_16_LOW -ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. -@end deffn -@deffn {} BFD_RELOC_BFIN_10_PCREL -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_11_PCREL -ADI Blackfin 'b' part of LSETUP. -@end deffn -@deffn {} BFD_RELOC_BFIN_12_PCREL_JUMP -ADI Blackfin. -@end deffn -@deffn {} BFD_RELOC_BFIN_12_PCREL_JUMP_S -ADI Blackfin Short jump, pcrel. -@end deffn -@deffn {} BFD_RELOC_BFIN_24_PCREL_CALL_X -ADI Blackfin Call.x not implemented. -@end deffn -@deffn {} BFD_RELOC_BFIN_24_PCREL_JUMP_L -ADI Blackfin Long Jump pcrel. -@end deffn -@deffn {} BFD_RELOC_BFIN_GOT17M4 -@deffnx {} BFD_RELOC_BFIN_GOTHI -@deffnx {} BFD_RELOC_BFIN_GOTLO -@deffnx {} BFD_RELOC_BFIN_FUNCDESC -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOT17M4 -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTHI -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTLO -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_VALUE -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4 -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI -@deffnx {} BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO -@deffnx {} BFD_RELOC_BFIN_GOTOFF17M4 -@deffnx {} BFD_RELOC_BFIN_GOTOFFHI -@deffnx {} BFD_RELOC_BFIN_GOTOFFLO -ADI Blackfin FD-PIC relocations. -@end deffn -@deffn {} BFD_RELOC_BFIN_GOT -ADI Blackfin GOT relocation. -@end deffn -@deffn {} BFD_RELOC_BFIN_PLTPC -ADI Blackfin PLTPC relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_PUSH -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_CONST -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_ADD -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_SUB -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_MULT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_DIV -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_MOD -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LSHIFT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_RSHIFT -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_AND -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_OR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_XOR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LAND -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LOR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_LEN -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_NEG -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_COMP -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_PAGE -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_HWPAGE -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_ARELOC_BFIN_ADDR -ADI Blackfin arithmetic relocation. -@end deffn -@deffn {} BFD_RELOC_D10V_10_PCREL_R -Mitsubishi D10V relocs. -This is a 10-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D10V_10_PCREL_L -Mitsubishi D10V relocs. -This is a 10-bit reloc with the right 2 bits -assumed to be 0. This is the same as the previous reloc -except it is in the left container, i.e., -shifted left 15 bits. -@end deffn -@deffn {} BFD_RELOC_D10V_18 -This is an 18-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D10V_18_PCREL -This is an 18-bit reloc with the right 2 bits -assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_6 -Mitsubishi D30V relocs. -This is a 6-bit absolute reloc. -@end deffn -@deffn {} BFD_RELOC_D30V_9_PCREL -This is a 6-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_9_PCREL_R -This is a 6-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_15 -This is a 12-bit absolute reloc with the -right 3 bitsassumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_15_PCREL -This is a 12-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_15_PCREL_R -This is a 12-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_21 -This is an 18-bit absolute reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_21_PCREL -This is an 18-bit pc-relative reloc with -the right 3 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_D30V_21_PCREL_R -This is an 18-bit pc-relative reloc with -the right 3 bits assumed to be 0. Same -as the previous reloc but on the right side -of the container. -@end deffn -@deffn {} BFD_RELOC_D30V_32 -This is a 32-bit absolute reloc. -@end deffn -@deffn {} BFD_RELOC_D30V_32_PCREL -This is a 32-bit pc-relative reloc. -@end deffn -@deffn {} BFD_RELOC_DLX_HI16_S -DLX relocs -@end deffn -@deffn {} BFD_RELOC_DLX_LO16 -DLX relocs -@end deffn -@deffn {} BFD_RELOC_DLX_JMP26 -DLX relocs -@end deffn -@deffn {} BFD_RELOC_M32C_HI8 -@deffnx {} BFD_RELOC_M32C_RL_JUMP -@deffnx {} BFD_RELOC_M32C_RL_1ADDR -@deffnx {} BFD_RELOC_M32C_RL_2ADDR -Renesas M16C/M32C Relocations. -@end deffn -@deffn {} BFD_RELOC_M32R_24 -Renesas M32R (formerly Mitsubishi M32R) relocs. -This is a 24 bit absolute address. -@end deffn -@deffn {} BFD_RELOC_M32R_10_PCREL -This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_18_PCREL -This is an 18-bit reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_26_PCREL -This is a 26-bit reloc with the right 2 bits assumed to be 0. -@end deffn -@deffn {} BFD_RELOC_M32R_HI16_ULO -This is a 16-bit reloc containing the high 16 bits of an address -used when the lower 16 bits are treated as unsigned. -@end deffn -@deffn {} BFD_RELOC_M32R_HI16_SLO -This is a 16-bit reloc containing the high 16 bits of an address -used when the lower 16 bits are treated as signed. -@end deffn -@deffn {} BFD_RELOC_M32R_LO16 -This is a 16-bit reloc containing the lower 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_M32R_SDA16 -This is a 16-bit reloc containing the small data area offset for use in -add3, load, and store instructions. -@end deffn -@deffn {} BFD_RELOC_M32R_GOT24 -@deffnx {} BFD_RELOC_M32R_26_PLTREL -@deffnx {} BFD_RELOC_M32R_COPY -@deffnx {} BFD_RELOC_M32R_GLOB_DAT -@deffnx {} BFD_RELOC_M32R_JMP_SLOT -@deffnx {} BFD_RELOC_M32R_RELATIVE -@deffnx {} BFD_RELOC_M32R_GOTOFF -@deffnx {} BFD_RELOC_M32R_GOTOFF_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOTOFF_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOTOFF_LO -@deffnx {} BFD_RELOC_M32R_GOTPC24 -@deffnx {} BFD_RELOC_M32R_GOT16_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOT16_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOT16_LO -@deffnx {} BFD_RELOC_M32R_GOTPC_HI_ULO -@deffnx {} BFD_RELOC_M32R_GOTPC_HI_SLO -@deffnx {} BFD_RELOC_M32R_GOTPC_LO -For PIC. -@end deffn -@deffn {} BFD_RELOC_V850_9_PCREL -This is a 9-bit reloc -@end deffn -@deffn {} BFD_RELOC_V850_22_PCREL -This is a 22-bit reloc -@end deffn -@deffn {} BFD_RELOC_V850_SDA_16_16_OFFSET -This is a 16 bit offset from the short data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_SDA_15_16_OFFSET -This is a 16 bit offset (of which only 15 bits are used) from the -short data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_16_16_OFFSET -This is a 16 bit offset from the zero data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_15_16_OFFSET -This is a 16 bit offset (of which only 15 bits are used) from the -zero data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_6_8_OFFSET -This is an 8 bit offset (of which only 6 bits are used) from the -tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_7_8_OFFSET -This is an 8bit offset (of which only 7 bits are used) from the tiny -data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_7_7_OFFSET -This is a 7 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_16_16_OFFSET -This is a 16 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_4_5_OFFSET -This is a 5 bit offset (of which only 4 bits are used) from the tiny -data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_TDA_4_4_OFFSET -This is a 4 bit offset from the tiny data area pointer. -@end deffn -@deffn {} BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET -This is a 16 bit offset from the short data area pointer, with the -bits placed non-contiguously in the instruction. -@end deffn -@deffn {} BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET -This is a 16 bit offset from the zero data area pointer, with the -bits placed non-contiguously in the instruction. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_6_7_OFFSET -This is a 6 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_CALLT_16_16_OFFSET -This is a 16 bit offset from the call table base pointer. -@end deffn -@deffn {} BFD_RELOC_V850_LONGCALL -Used for relaxing indirect function calls. -@end deffn -@deffn {} BFD_RELOC_V850_LONGJUMP -Used for relaxing indirect jumps. -@end deffn -@deffn {} BFD_RELOC_V850_ALIGN -Used to maintain alignment whilst relaxing. -@end deffn -@deffn {} BFD_RELOC_V850_LO16_SPLIT_OFFSET -This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu -instructions. -@end deffn -@deffn {} BFD_RELOC_MN10300_32_PCREL -This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the -instruction. -@end deffn -@deffn {} BFD_RELOC_MN10300_16_PCREL -This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the -instruction. -@end deffn -@deffn {} BFD_RELOC_TIC30_LDP -This is a 8bit DP reloc for the tms320c30, where the most -significant 8 bits of a 24 bit word are placed into the least -significant 8 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_PARTLS7 -This is a 7bit reloc for the tms320c54x, where the least -significant 7 bits of a 16 bit word are placed into the least -significant 7 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_PARTMS9 -This is a 9bit DP reloc for the tms320c54x, where the most -significant 9 bits of a 16 bit word are placed into the least -significant 9 bits of the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_23 -This is an extended address 23-bit reloc for the tms320c54x. -@end deffn -@deffn {} BFD_RELOC_TIC54X_16_OF_23 -This is a 16-bit reloc for the tms320c54x, where the least -significant 16 bits of a 23-bit extended address are placed into -the opcode. -@end deffn -@deffn {} BFD_RELOC_TIC54X_MS7_OF_23 -This is a reloc for the tms320c54x, where the most -significant 7 bits of a 23-bit extended address are placed into -the opcode. -@end deffn -@deffn {} BFD_RELOC_FR30_48 -This is a 48 bit reloc for the FR30 that stores 32 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_20 -This is a 32 bit reloc for the FR30 that stores 20 bits split up into -two sections. -@end deffn -@deffn {} BFD_RELOC_FR30_6_IN_4 -This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in -4 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_8_IN_8 -This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_9_IN_8 -This is a 16 bit reloc for the FR30 that stores a 9 bit short offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_10_IN_8 -This is a 16 bit reloc for the FR30 that stores a 10 bit word offset -into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_9_PCREL -This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative -short offset into 8 bits. -@end deffn -@deffn {} BFD_RELOC_FR30_12_PCREL -This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative -short offset into 11 bits. -@end deffn -@deffn {} BFD_RELOC_MCORE_PCREL_IMM8BY4 -@deffnx {} BFD_RELOC_MCORE_PCREL_IMM11BY2 -@deffnx {} BFD_RELOC_MCORE_PCREL_IMM4BY2 -@deffnx {} BFD_RELOC_MCORE_PCREL_32 -@deffnx {} BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 -@deffnx {} BFD_RELOC_MCORE_RVA -Motorola Mcore relocations. -@end deffn -@deffn {} BFD_RELOC_MMIX_GETA -@deffnx {} BFD_RELOC_MMIX_GETA_1 -@deffnx {} BFD_RELOC_MMIX_GETA_2 -@deffnx {} BFD_RELOC_MMIX_GETA_3 -These are relocations for the GETA instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_CBRANCH -@deffnx {} BFD_RELOC_MMIX_CBRANCH_J -@deffnx {} BFD_RELOC_MMIX_CBRANCH_1 -@deffnx {} BFD_RELOC_MMIX_CBRANCH_2 -@deffnx {} BFD_RELOC_MMIX_CBRANCH_3 -These are relocations for a conditional branch instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_PUSHJ -@deffnx {} BFD_RELOC_MMIX_PUSHJ_1 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_2 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_3 -@deffnx {} BFD_RELOC_MMIX_PUSHJ_STUBBABLE -These are relocations for the PUSHJ instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_JMP -@deffnx {} BFD_RELOC_MMIX_JMP_1 -@deffnx {} BFD_RELOC_MMIX_JMP_2 -@deffnx {} BFD_RELOC_MMIX_JMP_3 -These are relocations for the JMP instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_ADDR19 -This is a relocation for a relative address as in a GETA instruction or -a branch. -@end deffn -@deffn {} BFD_RELOC_MMIX_ADDR27 -This is a relocation for a relative address as in a JMP instruction. -@end deffn -@deffn {} BFD_RELOC_MMIX_REG_OR_BYTE -This is a relocation for an instruction field that may be a general -register or a value 0..255. -@end deffn -@deffn {} BFD_RELOC_MMIX_REG -This is a relocation for an instruction field that may be a general -register. -@end deffn -@deffn {} BFD_RELOC_MMIX_BASE_PLUS_OFFSET -This is a relocation for two instruction fields holding a register and -an offset, the equivalent of the relocation. -@end deffn -@deffn {} BFD_RELOC_MMIX_LOCAL -This relocation is an assertion that the expression is not allocated as -a global register. It does not modify contents. -@end deffn -@deffn {} BFD_RELOC_AVR_7_PCREL -This is a 16 bit reloc for the AVR that stores 8 bit pc relative -short offset into 7 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_13_PCREL -This is a 16 bit reloc for the AVR that stores 13 bit pc relative -short offset into 12 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_16_PM -This is a 16 bit reloc for the AVR that stores 17 bit value (usually -program memory address) into 16 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (usually -data memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of data memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of program memory address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_MS8_LDI -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of 32 bit value) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(usually data memory address) into 8 bit immediate value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 8 bit of data memory address) into 8 bit immediate value of -SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(most high 8 bit of program memory address) into 8 bit immediate value -of LDI or SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_MS8_LDI_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb -of 32 bit value) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (usually -command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit -of command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_PM -This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit -of command address) into 8 bit immediate value of LDI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_LO8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(usually command address) into 8 bit immediate value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HI8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 8 bit of 16 bit command address) into 8 bit immediate value -of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_HH8_LDI_PM_NEG -This is a 16 bit reloc for the AVR that stores negated 8 bit value -(high 6 bit of 22 bit command address) into 8 bit immediate -value of SUBI insn. -@end deffn -@deffn {} BFD_RELOC_AVR_CALL -This is a 32 bit reloc for the AVR that stores 23 bit value -into 22 bits. -@end deffn -@deffn {} BFD_RELOC_AVR_LDI -This is a 16 bit reloc for the AVR that stores all needed bits -for absolute addressing with ldi with overflow check to linktime -@end deffn -@deffn {} BFD_RELOC_AVR_6 -This is a 6 bit reloc for the AVR that stores offset for ldd/std -instructions -@end deffn -@deffn {} BFD_RELOC_AVR_6_ADIW -This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw -instructions -@end deffn -@deffn {} BFD_RELOC_390_12 -Direct 12 bit. -@end deffn -@deffn {} BFD_RELOC_390_GOT12 -12 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PLT32 -32 bit PC relative PLT address. -@end deffn -@deffn {} BFD_RELOC_390_COPY -Copy symbol at runtime. -@end deffn -@deffn {} BFD_RELOC_390_GLOB_DAT -Create GOT entry. -@end deffn -@deffn {} BFD_RELOC_390_JMP_SLOT -Create PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_RELATIVE -Adjust by program base. -@end deffn -@deffn {} BFD_RELOC_390_GOTPC -32 bit PC relative offset to GOT. -@end deffn -@deffn {} BFD_RELOC_390_GOT16 -16 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PC16DBL -PC relative 16 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT16DBL -16 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PC32DBL -PC relative 32 bit shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_PLT32DBL -32 bit PC rel. PLT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_GOTPCDBL -32 bit PC rel. GOT shifted by 1. -@end deffn -@deffn {} BFD_RELOC_390_GOT64 -64 bit GOT offset. -@end deffn -@deffn {} BFD_RELOC_390_PLT64 -64 bit PC relative PLT address. -@end deffn -@deffn {} BFD_RELOC_390_GOTENT -32 bit rel. offset to GOT entry. -@end deffn -@deffn {} BFD_RELOC_390_GOTOFF64 -64 bit offset to GOT. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT12 -12-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT16 -16-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT32 -32-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLT64 -64-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_GOTPLTENT -32-bit rel. offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF16 -16-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF32 -32-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_PLTOFF64 -64-bit rel. offset from the GOT to a PLT entry. -@end deffn -@deffn {} BFD_RELOC_390_TLS_LOAD -@deffnx {} BFD_RELOC_390_TLS_GDCALL -@deffnx {} BFD_RELOC_390_TLS_LDCALL -@deffnx {} BFD_RELOC_390_TLS_GD32 -@deffnx {} BFD_RELOC_390_TLS_GD64 -@deffnx {} BFD_RELOC_390_TLS_GOTIE12 -@deffnx {} BFD_RELOC_390_TLS_GOTIE32 -@deffnx {} BFD_RELOC_390_TLS_GOTIE64 -@deffnx {} BFD_RELOC_390_TLS_LDM32 -@deffnx {} BFD_RELOC_390_TLS_LDM64 -@deffnx {} BFD_RELOC_390_TLS_IE32 -@deffnx {} BFD_RELOC_390_TLS_IE64 -@deffnx {} BFD_RELOC_390_TLS_IEENT -@deffnx {} BFD_RELOC_390_TLS_LE32 -@deffnx {} BFD_RELOC_390_TLS_LE64 -@deffnx {} BFD_RELOC_390_TLS_LDO32 -@deffnx {} BFD_RELOC_390_TLS_LDO64 -@deffnx {} BFD_RELOC_390_TLS_DTPMOD -@deffnx {} BFD_RELOC_390_TLS_DTPOFF -@deffnx {} BFD_RELOC_390_TLS_TPOFF -s390 tls relocations. -@end deffn -@deffn {} BFD_RELOC_390_20 -@deffnx {} BFD_RELOC_390_GOT20 -@deffnx {} BFD_RELOC_390_GOTPLT20 -@deffnx {} BFD_RELOC_390_TLS_GOTIE20 -Long displacement extension. -@end deffn -@deffn {} BFD_RELOC_IP2K_FR9 -Scenix IP2K - 9-bit register number / data address -@end deffn -@deffn {} BFD_RELOC_IP2K_BANK -Scenix IP2K - 4-bit register/data bank number -@end deffn -@deffn {} BFD_RELOC_IP2K_ADDR16CJP -Scenix IP2K - low 13 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_PAGE3 -Scenix IP2K - high 3 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_LO8DATA -@deffnx {} BFD_RELOC_IP2K_HI8DATA -@deffnx {} BFD_RELOC_IP2K_EX8DATA -Scenix IP2K - ext/low/high 8 bits of data address -@end deffn -@deffn {} BFD_RELOC_IP2K_LO8INSN -@deffnx {} BFD_RELOC_IP2K_HI8INSN -Scenix IP2K - low/high 8 bits of instruction word address -@end deffn -@deffn {} BFD_RELOC_IP2K_PC_SKIP -Scenix IP2K - even/odd PC modifier to modify snb pcl.0 -@end deffn -@deffn {} BFD_RELOC_IP2K_TEXT -Scenix IP2K - 16 bit word address in text section. -@end deffn -@deffn {} BFD_RELOC_IP2K_FR_OFFSET -Scenix IP2K - 7-bit sp or dp offset -@end deffn -@deffn {} BFD_RELOC_VPE4KMATH_DATA -@deffnx {} BFD_RELOC_VPE4KMATH_INSN -Scenix VPE4K coprocessor - data/insn-space addressing -@end deffn -@deffn {} BFD_RELOC_VTABLE_INHERIT -@deffnx {} BFD_RELOC_VTABLE_ENTRY -These two relocations are used by the linker to determine which of -the entries in a C++ virtual function table are actually used. When -the --gc-sections option is given, the linker will zero out the entries -that are not used, so that the code for those functions need not be -included in the output. - -VTABLE_INHERIT is a zero-space relocation used to describe to the -linker the inheritance tree of a C++ virtual function table. The -relocation's symbol should be the parent class' vtable, and the -relocation should be located at the child vtable. - -VTABLE_ENTRY is a zero-space relocation that describes the use of a -virtual function table entry. The reloc's symbol should refer to the -table of the class mentioned in the code. Off of that base, an offset -describes the entry that is being used. For Rela hosts, this offset -is stored in the reloc's addend. For Rel hosts, we are forced to put -this offset in the reloc's section offset. -@end deffn -@deffn {} BFD_RELOC_IA64_IMM14 -@deffnx {} BFD_RELOC_IA64_IMM22 -@deffnx {} BFD_RELOC_IA64_IMM64 -@deffnx {} BFD_RELOC_IA64_DIR32MSB -@deffnx {} BFD_RELOC_IA64_DIR32LSB -@deffnx {} BFD_RELOC_IA64_DIR64MSB -@deffnx {} BFD_RELOC_IA64_DIR64LSB -@deffnx {} BFD_RELOC_IA64_GPREL22 -@deffnx {} BFD_RELOC_IA64_GPREL64I -@deffnx {} BFD_RELOC_IA64_GPREL32MSB -@deffnx {} BFD_RELOC_IA64_GPREL32LSB -@deffnx {} BFD_RELOC_IA64_GPREL64MSB -@deffnx {} BFD_RELOC_IA64_GPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF22 -@deffnx {} BFD_RELOC_IA64_LTOFF64I -@deffnx {} BFD_RELOC_IA64_PLTOFF22 -@deffnx {} BFD_RELOC_IA64_PLTOFF64I -@deffnx {} BFD_RELOC_IA64_PLTOFF64MSB -@deffnx {} BFD_RELOC_IA64_PLTOFF64LSB -@deffnx {} BFD_RELOC_IA64_FPTR64I -@deffnx {} BFD_RELOC_IA64_FPTR32MSB -@deffnx {} BFD_RELOC_IA64_FPTR32LSB -@deffnx {} BFD_RELOC_IA64_FPTR64MSB -@deffnx {} BFD_RELOC_IA64_FPTR64LSB -@deffnx {} BFD_RELOC_IA64_PCREL21B -@deffnx {} BFD_RELOC_IA64_PCREL21BI -@deffnx {} BFD_RELOC_IA64_PCREL21M -@deffnx {} BFD_RELOC_IA64_PCREL21F -@deffnx {} BFD_RELOC_IA64_PCREL22 -@deffnx {} BFD_RELOC_IA64_PCREL60B -@deffnx {} BFD_RELOC_IA64_PCREL64I -@deffnx {} BFD_RELOC_IA64_PCREL32MSB -@deffnx {} BFD_RELOC_IA64_PCREL32LSB -@deffnx {} BFD_RELOC_IA64_PCREL64MSB -@deffnx {} BFD_RELOC_IA64_PCREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22 -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32MSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR32LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB -@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB -@deffnx {} BFD_RELOC_IA64_SEGREL32MSB -@deffnx {} BFD_RELOC_IA64_SEGREL32LSB -@deffnx {} BFD_RELOC_IA64_SEGREL64MSB -@deffnx {} BFD_RELOC_IA64_SEGREL64LSB -@deffnx {} BFD_RELOC_IA64_SECREL32MSB -@deffnx {} BFD_RELOC_IA64_SECREL32LSB -@deffnx {} BFD_RELOC_IA64_SECREL64MSB -@deffnx {} BFD_RELOC_IA64_SECREL64LSB -@deffnx {} BFD_RELOC_IA64_REL32MSB -@deffnx {} BFD_RELOC_IA64_REL32LSB -@deffnx {} BFD_RELOC_IA64_REL64MSB -@deffnx {} BFD_RELOC_IA64_REL64LSB -@deffnx {} BFD_RELOC_IA64_LTV32MSB -@deffnx {} BFD_RELOC_IA64_LTV32LSB -@deffnx {} BFD_RELOC_IA64_LTV64MSB -@deffnx {} BFD_RELOC_IA64_LTV64LSB -@deffnx {} BFD_RELOC_IA64_IPLTMSB -@deffnx {} BFD_RELOC_IA64_IPLTLSB -@deffnx {} BFD_RELOC_IA64_COPY -@deffnx {} BFD_RELOC_IA64_LTOFF22X -@deffnx {} BFD_RELOC_IA64_LDXMOV -@deffnx {} BFD_RELOC_IA64_TPREL14 -@deffnx {} BFD_RELOC_IA64_TPREL22 -@deffnx {} BFD_RELOC_IA64_TPREL64I -@deffnx {} BFD_RELOC_IA64_TPREL64MSB -@deffnx {} BFD_RELOC_IA64_TPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_TPREL22 -@deffnx {} BFD_RELOC_IA64_DTPMOD64MSB -@deffnx {} BFD_RELOC_IA64_DTPMOD64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_DTPMOD22 -@deffnx {} BFD_RELOC_IA64_DTPREL14 -@deffnx {} BFD_RELOC_IA64_DTPREL22 -@deffnx {} BFD_RELOC_IA64_DTPREL64I -@deffnx {} BFD_RELOC_IA64_DTPREL32MSB -@deffnx {} BFD_RELOC_IA64_DTPREL32LSB -@deffnx {} BFD_RELOC_IA64_DTPREL64MSB -@deffnx {} BFD_RELOC_IA64_DTPREL64LSB -@deffnx {} BFD_RELOC_IA64_LTOFF_DTPREL22 -Intel IA64 Relocations. -@end deffn -@deffn {} BFD_RELOC_M68HC11_HI8 -Motorola 68HC11 reloc. -This is the 8 bit high part of an absolute address. -@end deffn -@deffn {} BFD_RELOC_M68HC11_LO8 -Motorola 68HC11 reloc. -This is the 8 bit low part of an absolute address. -@end deffn -@deffn {} BFD_RELOC_M68HC11_3B -Motorola 68HC11 reloc. -This is the 3 bit of a value. -@end deffn -@deffn {} BFD_RELOC_M68HC11_RL_JUMP -Motorola 68HC11 reloc. -This reloc marks the beginning of a jump/call instruction. -It is used for linker relaxation to correctly identify beginning -of instruction and change some branches to use PC-relative -addressing mode. -@end deffn -@deffn {} BFD_RELOC_M68HC11_RL_GROUP -Motorola 68HC11 reloc. -This reloc marks a group of several instructions that gcc generates -and for which the linker relaxation pass can modify and/or remove -some of them. -@end deffn -@deffn {} BFD_RELOC_M68HC11_LO16 -Motorola 68HC11 reloc. -This is the 16-bit lower part of an address. It is used for 'call' -instruction to specify the symbol address without any special -transformation (due to memory bank window). -@end deffn -@deffn {} BFD_RELOC_M68HC11_PAGE -Motorola 68HC11 reloc. -This is a 8-bit reloc that specifies the page number of an address. -It is used by 'call' instruction to specify the page number of -the symbol. -@end deffn -@deffn {} BFD_RELOC_M68HC11_24 -Motorola 68HC11 reloc. -This is a 24-bit reloc that represents the address with a 16-bit -value and a 8-bit page number. The symbol address is transformed -to follow the 16K memory bank of 68HC12 (seen as mapped in the window). -@end deffn -@deffn {} BFD_RELOC_M68HC12_5B -Motorola 68HC12 reloc. -This is the 5 bits of a value. -@end deffn -@deffn {} BFD_RELOC_16C_NUM08 -@deffnx {} BFD_RELOC_16C_NUM08_C -@deffnx {} BFD_RELOC_16C_NUM16 -@deffnx {} BFD_RELOC_16C_NUM16_C -@deffnx {} BFD_RELOC_16C_NUM32 -@deffnx {} BFD_RELOC_16C_NUM32_C -@deffnx {} BFD_RELOC_16C_DISP04 -@deffnx {} BFD_RELOC_16C_DISP04_C -@deffnx {} BFD_RELOC_16C_DISP08 -@deffnx {} BFD_RELOC_16C_DISP08_C -@deffnx {} BFD_RELOC_16C_DISP16 -@deffnx {} BFD_RELOC_16C_DISP16_C -@deffnx {} BFD_RELOC_16C_DISP24 -@deffnx {} BFD_RELOC_16C_DISP24_C -@deffnx {} BFD_RELOC_16C_DISP24a -@deffnx {} BFD_RELOC_16C_DISP24a_C -@deffnx {} BFD_RELOC_16C_REG04 -@deffnx {} BFD_RELOC_16C_REG04_C -@deffnx {} BFD_RELOC_16C_REG04a -@deffnx {} BFD_RELOC_16C_REG04a_C -@deffnx {} BFD_RELOC_16C_REG14 -@deffnx {} BFD_RELOC_16C_REG14_C -@deffnx {} BFD_RELOC_16C_REG16 -@deffnx {} BFD_RELOC_16C_REG16_C -@deffnx {} BFD_RELOC_16C_REG20 -@deffnx {} BFD_RELOC_16C_REG20_C -@deffnx {} BFD_RELOC_16C_ABS20 -@deffnx {} BFD_RELOC_16C_ABS20_C -@deffnx {} BFD_RELOC_16C_ABS24 -@deffnx {} BFD_RELOC_16C_ABS24_C -@deffnx {} BFD_RELOC_16C_IMM04 -@deffnx {} BFD_RELOC_16C_IMM04_C -@deffnx {} BFD_RELOC_16C_IMM16 -@deffnx {} BFD_RELOC_16C_IMM16_C -@deffnx {} BFD_RELOC_16C_IMM20 -@deffnx {} BFD_RELOC_16C_IMM20_C -@deffnx {} BFD_RELOC_16C_IMM24 -@deffnx {} BFD_RELOC_16C_IMM24_C -@deffnx {} BFD_RELOC_16C_IMM32 -@deffnx {} BFD_RELOC_16C_IMM32_C -NS CR16C Relocations. -@end deffn -@deffn {} BFD_RELOC_CRX_REL4 -@deffnx {} BFD_RELOC_CRX_REL8 -@deffnx {} BFD_RELOC_CRX_REL8_CMP -@deffnx {} BFD_RELOC_CRX_REL16 -@deffnx {} BFD_RELOC_CRX_REL24 -@deffnx {} BFD_RELOC_CRX_REL32 -@deffnx {} BFD_RELOC_CRX_REGREL12 -@deffnx {} BFD_RELOC_CRX_REGREL22 -@deffnx {} BFD_RELOC_CRX_REGREL28 -@deffnx {} BFD_RELOC_CRX_REGREL32 -@deffnx {} BFD_RELOC_CRX_ABS16 -@deffnx {} BFD_RELOC_CRX_ABS32 -@deffnx {} BFD_RELOC_CRX_NUM8 -@deffnx {} BFD_RELOC_CRX_NUM16 -@deffnx {} BFD_RELOC_CRX_NUM32 -@deffnx {} BFD_RELOC_CRX_IMM16 -@deffnx {} BFD_RELOC_CRX_IMM32 -@deffnx {} BFD_RELOC_CRX_SWITCH8 -@deffnx {} BFD_RELOC_CRX_SWITCH16 -@deffnx {} BFD_RELOC_CRX_SWITCH32 -NS CRX Relocations. -@end deffn -@deffn {} BFD_RELOC_CRIS_BDISP8 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_5 -@deffnx {} BFD_RELOC_CRIS_SIGNED_6 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_6 -@deffnx {} BFD_RELOC_CRIS_SIGNED_8 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_8 -@deffnx {} BFD_RELOC_CRIS_SIGNED_16 -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_16 -@deffnx {} BFD_RELOC_CRIS_LAPCQ_OFFSET -@deffnx {} BFD_RELOC_CRIS_UNSIGNED_4 -These relocs are only used within the CRIS assembler. They are not -(at present) written to any object files. -@end deffn -@deffn {} BFD_RELOC_CRIS_COPY -@deffnx {} BFD_RELOC_CRIS_GLOB_DAT -@deffnx {} BFD_RELOC_CRIS_JUMP_SLOT -@deffnx {} BFD_RELOC_CRIS_RELATIVE -Relocs used in ELF shared libraries for CRIS. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOT -32-bit offset to symbol-entry within GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_16_GOT -16-bit offset to symbol-entry within GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOTPLT -32-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_CRIS_16_GOTPLT -16-bit offset to symbol-entry within GOT, with PLT handling. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_GOTREL -32-bit offset to symbol, relative to GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_PLT_GOTREL -32-bit offset to symbol with PLT entry, relative to GOT. -@end deffn -@deffn {} BFD_RELOC_CRIS_32_PLT_PCREL -32-bit offset to symbol with PLT entry, relative to this relocation. -@end deffn -@deffn {} BFD_RELOC_860_COPY -@deffnx {} BFD_RELOC_860_GLOB_DAT -@deffnx {} BFD_RELOC_860_JUMP_SLOT -@deffnx {} BFD_RELOC_860_RELATIVE -@deffnx {} BFD_RELOC_860_PC26 -@deffnx {} BFD_RELOC_860_PLT26 -@deffnx {} BFD_RELOC_860_PC16 -@deffnx {} BFD_RELOC_860_LOW0 -@deffnx {} BFD_RELOC_860_SPLIT0 -@deffnx {} BFD_RELOC_860_LOW1 -@deffnx {} BFD_RELOC_860_SPLIT1 -@deffnx {} BFD_RELOC_860_LOW2 -@deffnx {} BFD_RELOC_860_SPLIT2 -@deffnx {} BFD_RELOC_860_LOW3 -@deffnx {} BFD_RELOC_860_LOGOT0 -@deffnx {} BFD_RELOC_860_SPGOT0 -@deffnx {} BFD_RELOC_860_LOGOT1 -@deffnx {} BFD_RELOC_860_SPGOT1 -@deffnx {} BFD_RELOC_860_LOGOTOFF0 -@deffnx {} BFD_RELOC_860_SPGOTOFF0 -@deffnx {} BFD_RELOC_860_LOGOTOFF1 -@deffnx {} BFD_RELOC_860_SPGOTOFF1 -@deffnx {} BFD_RELOC_860_LOGOTOFF2 -@deffnx {} BFD_RELOC_860_LOGOTOFF3 -@deffnx {} BFD_RELOC_860_LOPC -@deffnx {} BFD_RELOC_860_HIGHADJ -@deffnx {} BFD_RELOC_860_HAGOT -@deffnx {} BFD_RELOC_860_HAGOTOFF -@deffnx {} BFD_RELOC_860_HAPC -@deffnx {} BFD_RELOC_860_HIGH -@deffnx {} BFD_RELOC_860_HIGOT -@deffnx {} BFD_RELOC_860_HIGOTOFF -Intel i860 Relocations. -@end deffn -@deffn {} BFD_RELOC_OPENRISC_ABS_26 -@deffnx {} BFD_RELOC_OPENRISC_REL_26 -OpenRISC Relocations. -@end deffn -@deffn {} BFD_RELOC_H8_DIR16A8 -@deffnx {} BFD_RELOC_H8_DIR16R8 -@deffnx {} BFD_RELOC_H8_DIR24A8 -@deffnx {} BFD_RELOC_H8_DIR24R8 -@deffnx {} BFD_RELOC_H8_DIR32A16 -H8 elf Relocations. -@end deffn -@deffn {} BFD_RELOC_XSTORMY16_REL_12 -@deffnx {} BFD_RELOC_XSTORMY16_12 -@deffnx {} BFD_RELOC_XSTORMY16_24 -@deffnx {} BFD_RELOC_XSTORMY16_FPTR16 -Sony Xstormy16 Relocations. -@end deffn -@deffn {} BFD_RELOC_XC16X_PAG -@deffnx {} BFD_RELOC_XC16X_POF -@deffnx {} BFD_RELOC_XC16X_SEG -@deffnx {} BFD_RELOC_XC16X_SOF -Infineon Relocations. -@end deffn -@deffn {} BFD_RELOC_VAX_GLOB_DAT -@deffnx {} BFD_RELOC_VAX_JMP_SLOT -@deffnx {} BFD_RELOC_VAX_RELATIVE -Relocations used by VAX ELF. -@end deffn -@deffn {} BFD_RELOC_MT_PC16 -Morpho MT - 16 bit immediate relocation. -@end deffn -@deffn {} BFD_RELOC_MT_HI16 -Morpho MT - Hi 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_MT_LO16 -Morpho MT - Low 16 bits of an address. -@end deffn -@deffn {} BFD_RELOC_MT_GNU_VTINHERIT -Morpho MT - Used to tell the linker which vtable entries are used. -@end deffn -@deffn {} BFD_RELOC_MT_GNU_VTENTRY -Morpho MT - Used to tell the linker which vtable entries are used. -@end deffn -@deffn {} BFD_RELOC_MT_PCINSN8 -Morpho MT - 8 bit immediate relocation. -@end deffn -@deffn {} BFD_RELOC_MSP430_10_PCREL -@deffnx {} BFD_RELOC_MSP430_16_PCREL -@deffnx {} BFD_RELOC_MSP430_16 -@deffnx {} BFD_RELOC_MSP430_16_PCREL_BYTE -@deffnx {} BFD_RELOC_MSP430_16_BYTE -@deffnx {} BFD_RELOC_MSP430_2X_PCREL -@deffnx {} BFD_RELOC_MSP430_RL_PCREL -msp430 specific relocation codes -@end deffn -@deffn {} BFD_RELOC_IQ2000_OFFSET_16 -@deffnx {} BFD_RELOC_IQ2000_OFFSET_21 -@deffnx {} BFD_RELOC_IQ2000_UHI16 -IQ2000 Relocations. -@end deffn -@deffn {} BFD_RELOC_XTENSA_RTLD -Special Xtensa relocation used only by PLT entries in ELF shared -objects to indicate that the runtime linker should set the value -to one of its own internal functions or data structures. -@end deffn -@deffn {} BFD_RELOC_XTENSA_GLOB_DAT -@deffnx {} BFD_RELOC_XTENSA_JMP_SLOT -@deffnx {} BFD_RELOC_XTENSA_RELATIVE -Xtensa relocations for ELF shared objects. -@end deffn -@deffn {} BFD_RELOC_XTENSA_PLT -Xtensa relocation used in ELF object files for symbols that may require -PLT entries. Otherwise, this is just a generic 32-bit relocation. -@end deffn -@deffn {} BFD_RELOC_XTENSA_DIFF8 -@deffnx {} BFD_RELOC_XTENSA_DIFF16 -@deffnx {} BFD_RELOC_XTENSA_DIFF32 -Xtensa relocations to mark the difference of two local symbols. -These are only needed to support linker relaxation and can be ignored -when not relaxing. The field is set to the value of the difference -assuming no relaxation. The relocation encodes the position of the -first symbol so the linker can determine whether to adjust the field -value. -@end deffn -@deffn {} BFD_RELOC_XTENSA_SLOT0_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT1_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT2_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT3_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT4_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT5_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT6_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT7_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT8_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT9_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT10_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT11_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT12_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT13_OP -@deffnx {} BFD_RELOC_XTENSA_SLOT14_OP -Generic Xtensa relocations for instruction operands. Only the slot -number is encoded in the relocation. The relocation applies to the -last PC-relative immediate operand, or if there are no PC-relative -immediates, to the last immediate operand. -@end deffn -@deffn {} BFD_RELOC_XTENSA_SLOT0_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT1_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT2_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT3_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT4_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT5_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT6_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT7_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT8_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT9_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT10_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT11_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT12_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT13_ALT -@deffnx {} BFD_RELOC_XTENSA_SLOT14_ALT -Alternate Xtensa relocations. Only the slot is encoded in the -relocation. The meaning of these relocations is opcode-specific. -@end deffn -@deffn {} BFD_RELOC_XTENSA_OP0 -@deffnx {} BFD_RELOC_XTENSA_OP1 -@deffnx {} BFD_RELOC_XTENSA_OP2 -Xtensa relocations for backward compatibility. These have all been -replaced by BFD_RELOC_XTENSA_SLOT0_OP. -@end deffn -@deffn {} BFD_RELOC_XTENSA_ASM_EXPAND -Xtensa relocation to mark that the assembler expanded the -instructions from an original target. The expansion size is -encoded in the reloc size. -@end deffn -@deffn {} BFD_RELOC_XTENSA_ASM_SIMPLIFY -Xtensa relocation to mark that the linker should simplify -assembler-expanded instructions. This is commonly used -internally by the linker after analysis of a -BFD_RELOC_XTENSA_ASM_EXPAND. -@end deffn -@deffn {} BFD_RELOC_Z80_DISP8 -8 bit signed offset in (ix+d) or (iy+d). -@end deffn -@deffn {} BFD_RELOC_Z8K_DISP7 -DJNZ offset. -@end deffn -@deffn {} BFD_RELOC_Z8K_CALLR -CALR offset. -@end deffn -@deffn {} BFD_RELOC_Z8K_IMM4L -4 bit value. -@end deffn - -@example - -typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; -@end example -@findex bfd_reloc_type_lookup -@subsubsection @code{bfd_reloc_type_lookup} -@strong{Synopsis} -@example -reloc_howto_type *bfd_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Return a pointer to a howto structure which, when -invoked, will perform the relocation @var{code} on data from the -architecture noted. - -@findex bfd_default_reloc_type_lookup -@subsubsection @code{bfd_default_reloc_type_lookup} -@strong{Synopsis} -@example -reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Provides a default relocation lookup routine for any architecture. - -@findex bfd_get_reloc_code_name -@subsubsection @code{bfd_get_reloc_code_name} -@strong{Synopsis} -@example -const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); -@end example -@strong{Description}@* -Provides a printable name for the supplied relocation code. -Useful mainly for printing error messages. - -@findex bfd_generic_relax_section -@subsubsection @code{bfd_generic_relax_section} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - bfd_boolean *); -@end example -@strong{Description}@* -Provides default handling for relaxing for back ends which -don't do relaxing. - -@findex bfd_generic_gc_sections -@subsubsection @code{bfd_generic_gc_sections} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_gc_sections - (bfd *, struct bfd_link_info *); -@end example -@strong{Description}@* -Provides default handling for relaxing for back ends which -don't do section gc -- i.e., does nothing. - -@findex bfd_generic_merge_sections -@subsubsection @code{bfd_generic_merge_sections} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_merge_sections - (bfd *, struct bfd_link_info *); -@end example -@strong{Description}@* -Provides default handling for SEC_MERGE section merging for back ends -which don't have SEC_MERGE support -- i.e., does nothing. - -@findex bfd_generic_get_relocated_section_contents -@subsubsection @code{bfd_generic_get_relocated_section_contents} -@strong{Synopsis} -@example -bfd_byte *bfd_generic_get_relocated_section_contents - (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - bfd_boolean relocatable, - asymbol **symbols); -@end example -@strong{Description}@* -Provides default handling of relocation effort for back ends -which can't be bothered to do it efficiently. - diff --git a/contrib/binutils/bfd/doc/section.texi b/contrib/binutils/bfd/doc/section.texi deleted file mode 100644 index 4347679ef49..00000000000 --- a/contrib/binutils/bfd/doc/section.texi +++ /dev/null @@ -1,989 +0,0 @@ -@section Sections -The raw data contained within a BFD is maintained through the -section abstraction. A single BFD may have any number of -sections. It keeps hold of them by pointing to the first; -each one points to the next in the list. - -Sections are supported in BFD in @code{section.c}. - -@menu -* Section Input:: -* Section Output:: -* typedef asection:: -* section prototypes:: -@end menu - -@node Section Input, Section Output, Sections, Sections -@subsection Section input -When a BFD is opened for reading, the section structures are -created and attached to the BFD. - -Each section has a name which describes the section in the -outside world---for example, @code{a.out} would contain at least -three sections, called @code{.text}, @code{.data} and @code{.bss}. - -Names need not be unique; for example a COFF file may have several -sections named @code{.data}. - -Sometimes a BFD will contain more than the ``natural'' number of -sections. A back end may attach other sections containing -constructor data, or an application may add a section (using -@code{bfd_make_section}) to the sections attached to an already open -BFD. For example, the linker creates an extra section -@code{COMMON} for each input file's BFD to hold information about -common storage. - -The raw data is not necessarily read in when -the section descriptor is created. Some targets may leave the -data in place until a @code{bfd_get_section_contents} call is -made. Other back ends may read in all the data at once. For -example, an S-record file has to be read once to determine the -size of the data. An IEEE-695 file doesn't contain raw data in -sections, but data and relocation expressions intermixed, so -the data area has to be parsed to get out the data and -relocations. - -@node Section Output, typedef asection, Section Input, Sections -@subsection Section output -To write a new object style BFD, the various sections to be -written have to be created. They are attached to the BFD in -the same way as input sections; data is written to the -sections using @code{bfd_set_section_contents}. - -Any program that creates or combines sections (e.g., the assembler -and linker) must use the @code{asection} fields @code{output_section} and -@code{output_offset} to indicate the file sections to which each -section must be written. (If the section is being created from -scratch, @code{output_section} should probably point to the section -itself and @code{output_offset} should probably be zero.) - -The data to be written comes from input sections attached -(via @code{output_section} pointers) to -the output sections. The output section structure can be -considered a filter for the input section: the output section -determines the vma of the output data and the name, but the -input section determines the offset into the output section of -the data to be written. - -E.g., to create a section "O", starting at 0x100, 0x123 long, -containing two subsections, "A" at offset 0x0 (i.e., at vma -0x100) and "B" at offset 0x20 (i.e., at vma 0x120) the @code{asection} -structures would look like: - -@example - section name "A" - output_offset 0x00 - size 0x20 - output_section -----------> section name "O" - | vma 0x100 - section name "B" | size 0x123 - output_offset 0x20 | - size 0x103 | - output_section --------| -@end example - -@subsection Link orders -The data within a section is stored in a @dfn{link_order}. -These are much like the fixups in @code{gas}. The link_order -abstraction allows a section to grow and shrink within itself. - -A link_order knows how big it is, and which is the next -link_order and where the raw data for it is; it also points to -a list of relocations which apply to it. - -The link_order is used by the linker to perform relaxing on -final code. The compiler creates code which is as big as -necessary to make it work without relaxing, and the user can -select whether to relax. Sometimes relaxing takes a lot of -time. The linker runs around the relocations to see if any -are attached to data which can be shrunk, if so it does it on -a link_order by link_order basis. - - -@node typedef asection, section prototypes, Section Output, Sections -@subsection typedef asection -Here is the section structure: - - -@example - -typedef struct bfd_section -@{ - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ - const char *name; - - /* A unique sequence number. */ - int id; - - /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; - - /* The next section in the list belonging to the BFD, or NULL. */ - struct bfd_section *next; - - /* The previous section in the list belonging to the BFD, or NULL. */ - struct bfd_section *prev; - - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ - flagword flags; - -#define SEC_NO_FLAGS 0x000 - - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 - - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ -#define SEC_LOAD 0x002 - - /* The section contains data still to be relocated, so there is - some relocation information too. */ -#define SEC_RELOC 0x004 - - /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 - - /* The section contains code only. */ -#define SEC_CODE 0x010 - - /* The section contains data only. */ -#define SEC_DATA 0x020 - - /* The section will reside in ROM. */ -#define SEC_ROM 0x040 - - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by @code{g++}. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., @code{__CTOR_LIST__}), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called @code{__CTOR_LIST__} and relocate the data - contained within - exactly the operations it would peform on - standard data. */ -#define SEC_CONSTRUCTOR 0x080 - - /* The section has contents - a data section could be - @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be - @code{SEC_HAS_CONTENTS} */ -#define SEC_HAS_CONTENTS 0x100 - - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 - - /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 - - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 - - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 - - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ -#define SEC_DEBUGGING 0x2000 - - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by bfd_get_section_contents, - and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 - - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 - - /* The contents of this section are to be sorted based on the sum of - the symbol and addend values specified by the associated relocation - entries. Entries without associated relocation entries will be - appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 - - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 - - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0x40000 - - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ -#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000 - - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ -#define SEC_LINK_DUPLICATES_SAME_CONTENTS \ - (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) - - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x200000 - - /* This section should not be subject to garbage collection. */ -#define SEC_KEEP 0x400000 - - /* This section contains "short" data, and should be placed - "near" the GP. */ -#define SEC_SMALL_DATA 0x800000 - - /* Attempt to merge identical entities in the section. - Entity size is given in the entsize field. */ -#define SEC_MERGE 0x1000000 - - /* If given with SEC_MERGE, entities to merge are zero terminated - strings where entsize specifies character size instead of fixed - size entries. */ -#define SEC_STRINGS 0x2000000 - - /* This section contains data about section groups. */ -#define SEC_GROUP 0x4000000 - - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x10000000 - - /* This section contains data which may be shared with other - executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x20000000 - - /* When a section with this flag is being linked, then if the size of - the input section is less than a page, it should not cross a page - boundary. If the size of the input section is one page or more, - it should be aligned on a page boundary. This is for TI - TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x40000000 - - /* Conditionally link this section; do not link if there are no - references found to any symbol in the section. This is for TI - TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x80000000 - - /* End of section flags. */ - - /* Some internal packed boolean fields. */ - - /* See the vma field. */ - unsigned int user_set_vma : 1; - - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; - - /* Another mark flag used by some of the linker backends. Set for - output sections that have an input section. */ - unsigned int linker_has_input : 1; - - /* Mark flags used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; - unsigned int gc_mark_from_eh : 1; - - /* The following flags are used by the ELF linker. */ - - /* Mark sections which have been allocated to segments. */ - unsigned int segment_mark : 1; - - /* Type of sec_info information. */ - unsigned int sec_info_type:3; -#define ELF_INFO_TYPE_NONE 0 -#define ELF_INFO_TYPE_STABS 1 -#define ELF_INFO_TYPE_MERGE 2 -#define ELF_INFO_TYPE_EH_FRAME 3 -#define ELF_INFO_TYPE_JUST_SYMS 4 - - /* Nonzero if this section uses RELA relocations, rather than REL. */ - unsigned int use_rela_p:1; - - /* Bits used by various backends. The generic code doesn't touch - these fields. */ - - /* Nonzero if this section has TLS related relocations. */ - unsigned int has_tls_reloc:1; - - /* Nonzero if this section has a gp reloc. */ - unsigned int has_gp_reloc:1; - - /* Nonzero if this section needs the relax finalize pass. */ - unsigned int need_finalize_relax:1; - - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; - - /* End of internal packed boolean fields. */ - - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in @code{a.out}, where - the default address for @code{.data} is dependent on the specific - target and various flags). */ - bfd_vma vma; - - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ - bfd_vma lma; - - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of @code{.bss}). */ - bfd_size_type size; - - /* For input sections, the original size on disk of the section, in - octets. This field is used by the linker relaxation code. It is - currently only set for sections where the linker relaxation scheme - doesn't cache altered section and reloc contents (stabs, eh_frame, - SEC_MERGE, some coff relaxing targets), and thus the original size - needs to be kept to read the section multiple times. - For output sections, rawsize holds the section size calculated on - a previous linker relaxation pass. */ - bfd_size_type rawsize; - - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ - bfd_vma output_offset; - - /* The output section through which to map on output. */ - struct bfd_section *output_section; - - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ - unsigned int alignment_power; - - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ - struct reloc_cache_entry *relocation; - - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ - struct reloc_cache_entry **orelocation; - - /* The number of relocation records in one of the above. */ - unsigned reloc_count; - - /* Information below is back end specific - and not always used - or updated. */ - - /* File position of section data. */ - file_ptr filepos; - - /* File position of relocation info. */ - file_ptr rel_filepos; - - /* File position of line data. */ - file_ptr line_filepos; - - /* Pointer to data for applications. */ - void *userdata; - - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; - - /* Attached line number information. */ - alent *lineno; - - /* Number of line number records. */ - unsigned int lineno_count; - - /* Entity size for merging purposes. */ - unsigned int entsize; - - /* Points to the kept section if this section is a link-once section, - and is discarded. */ - struct bfd_section *kept_section; - - /* When a section is being output, this value changes as more - linenumbers are written out. */ - file_ptr moving_line_filepos; - - /* What the section number is in the target world. */ - int target_index; - - void *used_by_bfd; - - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ - struct relent_chain *constructor_chain; - - /* The BFD which owns the section. */ - bfd *owner; - - /* A symbol which points at this section only. */ - struct bfd_symbol *symbol; - struct bfd_symbol **symbol_ptr_ptr; - - /* Early in the link process, map_head and map_tail are used to build - a list of input sections attached to an output section. Later, - output sections use these fields for a list of bfd_link_order - structs. */ - union @{ - struct bfd_link_order *link_order; - struct bfd_section *s; - @} map_head, map_tail; -@} asection; - -/* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ -#define BFD_ABS_SECTION_NAME "*ABS*" -#define BFD_UND_SECTION_NAME "*UND*" -#define BFD_COM_SECTION_NAME "*COM*" -#define BFD_IND_SECTION_NAME "*IND*" - -/* The absolute section. */ -extern asection bfd_abs_section; -#define bfd_abs_section_ptr ((asection *) &bfd_abs_section) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -/* Pointer to the undefined section. */ -extern asection bfd_und_section; -#define bfd_und_section_ptr ((asection *) &bfd_und_section) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -/* Pointer to the common section. */ -extern asection bfd_com_section; -#define bfd_com_section_ptr ((asection *) &bfd_com_section) -/* Pointer to the indirect section. */ -extern asection bfd_ind_section; -#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) - -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) - -extern const struct bfd_symbol * const bfd_abs_symbol; -extern const struct bfd_symbol * const bfd_com_symbol; -extern const struct bfd_symbol * const bfd_und_symbol; -extern const struct bfd_symbol * const bfd_ind_symbol; - -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - @} \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - @{ \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - @} \ - else \ - @{ \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - @} \ - _abfd->section_last = _s; \ - @} \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - @{ \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - @{ \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - @} \ - else \ - @{ \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - @} \ - _abfd->sections = _s; \ - @} \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - @{ \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - @} \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - @{ \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - @} \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) - -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ - /* name, id, index, next, prev, flags, user_set_vma, */ \ - @{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ - \ - /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \ - 0, 0, 1, 0, \ - \ - /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \ - 0, 0, 0, 0, \ - \ - /* has_gp_reloc, need_finalize_relax, reloc_done, */ \ - 0, 0, 0, \ - \ - /* vma, lma, size, rawsize */ \ - 0, 0, 0, 0, \ - \ - /* output_offset, output_section, alignment_power, */ \ - 0, (struct bfd_section *) &SEC, 0, \ - \ - /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ - NULL, NULL, 0, 0, 0, \ - \ - /* line_filepos, userdata, contents, lineno, lineno_count, */ \ - 0, NULL, NULL, NULL, 0, \ - \ - /* entsize, kept_section, moving_line_filepos, */ \ - 0, NULL, 0, \ - \ - /* target_index, used_by_bfd, constructor_chain, owner, */ \ - 0, NULL, NULL, NULL, \ - \ - /* symbol, */ \ - (struct bfd_symbol *) SYM, \ - \ - /* symbol_ptr_ptr, */ \ - (struct bfd_symbol **) SYM_PTR, \ - \ - /* map_head, map_tail */ \ - @{ NULL @}, @{ NULL @} \ - @} - -@end example - -@node section prototypes, , typedef asection, Sections -@subsection Section prototypes -These are the functions exported by the section handling part of BFD. - -@findex bfd_section_list_clear -@subsubsection @code{bfd_section_list_clear} -@strong{Synopsis} -@example -void bfd_section_list_clear (bfd *); -@end example -@strong{Description}@* -Clears the section list, and also resets the section count and -hash table entries. - -@findex bfd_get_section_by_name -@subsubsection @code{bfd_get_section_by_name} -@strong{Synopsis} -@example -asection *bfd_get_section_by_name (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Run through @var{abfd} and return the one of the -@code{asection}s whose name matches @var{name}, otherwise @code{NULL}. -@xref{Sections}, for more information. - -This should only be used in special cases; the normal way to process -all sections of a given name is to use @code{bfd_map_over_sections} and -@code{strcmp} on the name (or better yet, base it on the section flags -or something else) for each section. - -@findex bfd_get_section_by_name_if -@subsubsection @code{bfd_get_section_by_name_if} -@strong{Synopsis} -@example -asection *bfd_get_section_by_name_if - (bfd *abfd, - const char *name, - bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{func} for each section -attached to the BFD @var{abfd} whose name matches @var{name}, -passing @var{obj} as an argument. The function will be called -as if by - -@example - func (abfd, the_section, obj); -@end example - -It returns the first section for which @var{func} returns true, -otherwise @code{NULL}. - -@findex bfd_get_unique_section_name -@subsubsection @code{bfd_get_unique_section_name} -@strong{Synopsis} -@example -char *bfd_get_unique_section_name - (bfd *abfd, const char *templat, int *count); -@end example -@strong{Description}@* -Invent a section name that is unique in @var{abfd} by tacking -a dot and a digit suffix onto the original @var{templat}. If -@var{count} is non-NULL, then it specifies the first number -tried as a suffix to generate a unique name. The value -pointed to by @var{count} will be incremented in this case. - -@findex bfd_make_section_old_way -@subsubsection @code{bfd_make_section_old_way} -@strong{Synopsis} -@example -asection *bfd_make_section_old_way (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Create a new empty section called @var{name} -and attach it to the end of the chain of sections for the -BFD @var{abfd}. An attempt to create a section with a name which -is already in use returns its pointer without changing the -section chain. - -It has the funny name since this is the way it used to be -before it was rewritten.... - -Possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -If output has already started for this BFD. -@item -@code{bfd_error_no_memory} - -If memory allocation fails. -@end itemize - -@findex bfd_make_section_anyway_with_flags -@subsubsection @code{bfd_make_section_anyway_with_flags} -@strong{Synopsis} -@example -asection *bfd_make_section_anyway_with_flags - (bfd *abfd, const char *name, flagword flags); -@end example -@strong{Description}@* -Create a new empty section called @var{name} and attach it to the end of -the chain of sections for @var{abfd}. Create a new section even if there -is already a section with that name. Also set the attributes of the -new section to the value @var{flags}. - -Return @code{NULL} and set @code{bfd_error} on error; possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}. -@item -@code{bfd_error_no_memory} - If memory allocation fails. -@end itemize - -@findex bfd_make_section_anyway -@subsubsection @code{bfd_make_section_anyway} -@strong{Synopsis} -@example -asection *bfd_make_section_anyway (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Create a new empty section called @var{name} and attach it to the end of -the chain of sections for @var{abfd}. Create a new section even if there -is already a section with that name. - -Return @code{NULL} and set @code{bfd_error} on error; possible errors are: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - If output has already started for @var{abfd}. -@item -@code{bfd_error_no_memory} - If memory allocation fails. -@end itemize - -@findex bfd_make_section_with_flags -@subsubsection @code{bfd_make_section_with_flags} -@strong{Synopsis} -@example -asection *bfd_make_section_with_flags - (bfd *, const char *name, flagword flags); -@end example -@strong{Description}@* -Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling -bfd_set_error ()) without changing the section chain if there is already a -section named @var{name}. Also set the attributes of the new section to -the value @var{flags}. If there is an error, return @code{NULL} and set -@code{bfd_error}. - -@findex bfd_make_section -@subsubsection @code{bfd_make_section} -@strong{Synopsis} -@example -asection *bfd_make_section (bfd *, const char *name); -@end example -@strong{Description}@* -Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling -bfd_set_error ()) without changing the section chain if there is already a -section named @var{name}. If there is an error, return @code{NULL} and set -@code{bfd_error}. - -@findex bfd_set_section_flags -@subsubsection @code{bfd_set_section_flags} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); -@end example -@strong{Description}@* -Set the attributes of the section @var{sec} in the BFD -@var{abfd} to the value @var{flags}. Return @code{TRUE} on success, -@code{FALSE} on error. Possible error returns are: - -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -The section cannot have one or more of the attributes -requested. For example, a .bss section in @code{a.out} may not -have the @code{SEC_HAS_CONTENTS} field set. -@end itemize - -@findex bfd_map_over_sections -@subsubsection @code{bfd_map_over_sections} -@strong{Synopsis} -@example -void bfd_map_over_sections - (bfd *abfd, - void (*func) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{func} for each section -attached to the BFD @var{abfd}, passing @var{obj} as an -argument. The function will be called as if by - -@example - func (abfd, the_section, obj); -@end example - -This is the preferred method for iterating over sections; an -alternative would be to use a loop: - -@example - section *p; - for (p = abfd->sections; p != NULL; p = p->next) - func (abfd, p, ...) -@end example - -@findex bfd_sections_find_if -@subsubsection @code{bfd_sections_find_if} -@strong{Synopsis} -@example -asection *bfd_sections_find_if - (bfd *abfd, - bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), - void *obj); -@end example -@strong{Description}@* -Call the provided function @var{operation} for each section -attached to the BFD @var{abfd}, passing @var{obj} as an -argument. The function will be called as if by - -@example - operation (abfd, the_section, obj); -@end example - -It returns the first section for which @var{operation} returns true. - -@findex bfd_set_section_size -@subsubsection @code{bfd_set_section_size} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); -@end example -@strong{Description}@* -Set @var{sec} to the size @var{val}. If the operation is -ok, then @code{TRUE} is returned, else @code{FALSE}. - -Possible error returns: -@itemize @bullet - -@item -@code{bfd_error_invalid_operation} - -Writing has started to the BFD, so setting the size is invalid. -@end itemize - -@findex bfd_set_section_contents -@subsubsection @code{bfd_set_section_contents} -@strong{Synopsis} -@example -bfd_boolean bfd_set_section_contents - (bfd *abfd, asection *section, const void *data, - file_ptr offset, bfd_size_type count); -@end example -@strong{Description}@* -Sets the contents of the section @var{section} in BFD -@var{abfd} to the data starting in memory at @var{data}. The -data is written to the output section starting at offset -@var{offset} for @var{count} octets. - -Normally @code{TRUE} is returned, else @code{FALSE}. Possible error -returns are: -@itemize @bullet - -@item -@code{bfd_error_no_contents} - -The output section does not have the @code{SEC_HAS_CONTENTS} -attribute, so nothing can be written to it. -@item -and some more too -@end itemize -This routine is front end to the back end function -@code{_bfd_set_section_contents}. - -@findex bfd_get_section_contents -@subsubsection @code{bfd_get_section_contents} -@strong{Synopsis} -@example -bfd_boolean bfd_get_section_contents - (bfd *abfd, asection *section, void *location, file_ptr offset, - bfd_size_type count); -@end example -@strong{Description}@* -Read data from @var{section} in BFD @var{abfd} -into memory starting at @var{location}. The data is read at an -offset of @var{offset} from the start of the input section, -and is read for @var{count} bytes. - -If the contents of a constructor with the @code{SEC_CONSTRUCTOR} -flag set are requested or if the section does not have the -@code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled -with zeroes. If no errors occur, @code{TRUE} is returned, else -@code{FALSE}. - -@findex bfd_malloc_and_get_section -@subsubsection @code{bfd_malloc_and_get_section} -@strong{Synopsis} -@example -bfd_boolean bfd_malloc_and_get_section - (bfd *abfd, asection *section, bfd_byte **buf); -@end example -@strong{Description}@* -Read all data from @var{section} in BFD @var{abfd} -into a buffer, *@var{buf}, malloc'd by this function. - -@findex bfd_copy_private_section_data -@subsubsection @code{bfd_copy_private_section_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_section_data - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); -@end example -@strong{Description}@* -Copy private section information from @var{isec} in the BFD -@var{ibfd} to the section @var{osec} in the BFD @var{obfd}. -Return @code{TRUE} on success, @code{FALSE} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{osec}. -@end itemize -@example -#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) -@end example - -@findex bfd_generic_is_group_section -@subsubsection @code{bfd_generic_is_group_section} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); -@end example -@strong{Description}@* -Returns TRUE if @var{sec} is a member of a group. - -@findex bfd_generic_discard_group -@subsubsection @code{bfd_generic_discard_group} -@strong{Synopsis} -@example -bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); -@end example -@strong{Description}@* -Remove all members of @var{group} from the output. - diff --git a/contrib/binutils/bfd/doc/syms.texi b/contrib/binutils/bfd/doc/syms.texi deleted file mode 100644 index dc56bbc7e1b..00000000000 --- a/contrib/binutils/bfd/doc/syms.texi +++ /dev/null @@ -1,461 +0,0 @@ -@section Symbols -BFD tries to maintain as much symbol information as it can when -it moves information from file to file. BFD passes information -to applications though the @code{asymbol} structure. When the -application requests the symbol table, BFD reads the table in -the native form and translates parts of it into the internal -format. To maintain more than the information passed to -applications, some targets keep some information ``behind the -scenes'' in a structure only the particular back end knows -about. For example, the coff back end keeps the original -symbol table structure as well as the canonical structure when -a BFD is read in. On output, the coff back end can reconstruct -the output symbol table so that no information is lost, even -information unique to coff which BFD doesn't know or -understand. If a coff symbol table were read, but were written -through an a.out back end, all the coff specific information -would be lost. The symbol table of a BFD -is not necessarily read in until a canonicalize request is -made. Then the BFD back end fills in a table provided by the -application with pointers to the canonical information. To -output symbols, the application provides BFD with a table of -pointers to pointers to @code{asymbol}s. This allows applications -like the linker to output a symbol as it was read, since the ``behind -the scenes'' information will be still available. -@menu -* Reading Symbols:: -* Writing Symbols:: -* Mini Symbols:: -* typedef asymbol:: -* symbol handling functions:: -@end menu - -@node Reading Symbols, Writing Symbols, Symbols, Symbols -@subsection Reading symbols -There are two stages to reading a symbol table from a BFD: -allocating storage, and the actual reading process. This is an -excerpt from an application which reads the symbol table: - -@example - long storage_needed; - asymbol **symbol_table; - long number_of_symbols; - long i; - - storage_needed = bfd_get_symtab_upper_bound (abfd); - - if (storage_needed < 0) - FAIL - - if (storage_needed == 0) - return; - - symbol_table = xmalloc (storage_needed); - ... - number_of_symbols = - bfd_canonicalize_symtab (abfd, symbol_table); - - if (number_of_symbols < 0) - FAIL - - for (i = 0; i < number_of_symbols; i++) - process_symbol (symbol_table[i]); -@end example - -All storage for the symbols themselves is in an objalloc -connected to the BFD; it is freed when the BFD is closed. - -@node Writing Symbols, Mini Symbols, Reading Symbols, Symbols -@subsection Writing symbols -Writing of a symbol table is automatic when a BFD open for -writing is closed. The application attaches a vector of -pointers to pointers to symbols to the BFD being written, and -fills in the symbol count. The close and cleanup code reads -through the table provided and performs all the necessary -operations. The BFD output code must always be provided with an -``owned'' symbol: one which has come from another BFD, or one -which has been created using @code{bfd_make_empty_symbol}. Here is an -example showing the creation of a symbol table with only one element: - -@example - #include "bfd.h" - int main (void) - @{ - bfd *abfd; - asymbol *ptrs[2]; - asymbol *new; - - abfd = bfd_openw ("foo","a.out-sunos-big"); - bfd_set_format (abfd, bfd_object); - new = bfd_make_empty_symbol (abfd); - new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way (abfd, ".text"); - new->flags = BSF_GLOBAL; - new->value = 0x12345; - - ptrs[0] = new; - ptrs[1] = 0; - - bfd_set_symtab (abfd, ptrs, 1); - bfd_close (abfd); - return 0; - @} - - ./makesym - nm foo - 00012345 A dummy_symbol -@end example - -Many formats cannot represent arbitrary symbol information; for -instance, the @code{a.out} object format does not allow an -arbitrary number of sections. A symbol pointing to a section -which is not one of @code{.text}, @code{.data} or @code{.bss} cannot -be described. - -@node Mini Symbols, typedef asymbol, Writing Symbols, Symbols -@subsection Mini Symbols -Mini symbols provide read-only access to the symbol table. -They use less memory space, but require more time to access. -They can be useful for tools like nm or objdump, which may -have to handle symbol tables of extremely large executables. - -The @code{bfd_read_minisymbols} function will read the symbols -into memory in an internal form. It will return a @code{void *} -pointer to a block of memory, a symbol count, and the size of -each symbol. The pointer is allocated using @code{malloc}, and -should be freed by the caller when it is no longer needed. - -The function @code{bfd_minisymbol_to_symbol} will take a pointer -to a minisymbol, and a pointer to a structure returned by -@code{bfd_make_empty_symbol}, and return a @code{asymbol} structure. -The return value may or may not be the same as the value from -@code{bfd_make_empty_symbol} which was passed in. - - -@node typedef asymbol, symbol handling functions, Mini Symbols, Symbols -@subsection typedef asymbol -An @code{asymbol} has the form: - - -@example - -typedef struct bfd_symbol -@{ - /* A pointer to the BFD which owns the symbol. This information - is necessary so that a back end can work out what additional - information (invisible to the application writer) is carried - with the symbol. - - This field is *almost* redundant, since you can use section->owner - instead, except that some symbols point to the global sections - bfd_@{abs,com,und@}_section. This could be fixed by making - these globals be per-bfd (or per-target-flavor). FIXME. */ - struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - - /* The text of the symbol. The name is left alone, and not copied; the - application may not alter it. */ - const char *name; - - /* The value of the symbol. This really should be a union of a - numeric value with a pointer, since some flags indicate that - a pointer to another symbol is stored here. */ - symvalue value; - - /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 - - /* The symbol has local scope; @code{static} in @code{C}. The value - is the offset into the section of the data. */ -#define BSF_LOCAL 0x01 - - /* The symbol has global scope; initialized data in @code{C}. The - value is the offset into the section of the data. */ -#define BSF_GLOBAL 0x02 - - /* The symbol has global scope and is exported. The value is - the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ - - /* A normal C symbol would be one of: - @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or - @code{BSF_GLOBAL}. */ - - /* The symbol is a debugging record. The value has an arbitrary - meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING 0x08 - - /* The symbol denotes a function entry point. Used in ELF, - perhaps others someday. */ -#define BSF_FUNCTION 0x10 - - /* Used by the linker. */ -#define BSF_KEEP 0x20 -#define BSF_KEEP_G 0x40 - - /* A weak global symbol, overridable without warnings by - a regular global symbol of the same name. */ -#define BSF_WEAK 0x80 - - /* This symbol was created to point to a section, e.g. ELF's - STT_SECTION symbols. */ -#define BSF_SECTION_SYM 0x100 - - /* The symbol used to be a common symbol, but now it is - allocated. */ -#define BSF_OLD_COMMON 0x200 - - /* The default value for common data. */ -#define BFD_FORT_COMM_DEFAULT_VALUE 0 - - /* In some files the type of a symbol sometimes alters its - location in an output file - ie in coff a @code{ISFCN} symbol - which is also @code{C_EXT} symbol appears where it was - declared and not at the end of a section. This bit is set - by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END 0x400 - - /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR 0x800 - - /* Signal that the symbol is a warning symbol. The name is a - warning. The name of the next symbol is the one to warn about; - if a reference is made to a symbol with the same name as the next - symbol, a warning is issued by the linker. */ -#define BSF_WARNING 0x1000 - - /* Signal that the symbol is indirect. This symbol is an indirect - pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT 0x2000 - - /* BSF_FILE marks symbols that contain a file name. This is used - for ELF STT_FILE symbols. */ -#define BSF_FILE 0x4000 - - /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC 0x8000 - - /* The symbol denotes a data object. Used in ELF, and perhaps - others someday. */ -#define BSF_OBJECT 0x10000 - - /* This symbol is a debugging symbol. The value is the offset - into the section of the data. BSF_DEBUGGING should be set - as well. */ -#define BSF_DEBUGGING_RELOC 0x20000 - - /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL 0x40000 - - flagword flags; - - /* A pointer to the section to which this symbol is - relative. This will always be non NULL, there are special - sections for undefined and absolute symbols. */ - struct bfd_section *section; - - /* Back end special data. */ - union - @{ - void *p; - bfd_vma i; - @} - udata; -@} -asymbol; - -@end example - -@node symbol handling functions, , typedef asymbol, Symbols -@subsection Symbol handling functions - - -@findex bfd_get_symtab_upper_bound -@subsubsection @code{bfd_get_symtab_upper_bound} -@strong{Description}@* -Return the number of bytes required to store a vector of pointers -to @code{asymbols} for all the symbols in the BFD @var{abfd}, -including a terminal NULL pointer. If there are no symbols in -the BFD, then return 0. If an error occurs, return -1. -@example -#define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) - -@end example - -@findex bfd_is_local_label -@subsubsection @code{bfd_is_local_label} -@strong{Synopsis} -@example -bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); -@end example -@strong{Description}@* -Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is -a compiler generated local label, else return FALSE. - -@findex bfd_is_local_label_name -@subsubsection @code{bfd_is_local_label_name} -@strong{Synopsis} -@example -bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); -@end example -@strong{Description}@* -Return TRUE if a symbol with the name @var{name} in the BFD -@var{abfd} is a compiler generated local label, else return -FALSE. This just checks whether the name has the form of a -local label. -@example -#define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) - -@end example - -@findex bfd_is_target_special_symbol -@subsubsection @code{bfd_is_target_special_symbol} -@strong{Synopsis} -@example -bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); -@end example -@strong{Description}@* -Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something -special to the particular target represented by the BFD. Such symbols -should normally not be mentioned to the user. -@example -#define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) - -@end example - -@findex bfd_canonicalize_symtab -@subsubsection @code{bfd_canonicalize_symtab} -@strong{Description}@* -Read the symbols from the BFD @var{abfd}, and fills in -the vector @var{location} with pointers to the symbols and -a trailing NULL. -Return the actual number of symbol pointers, not -including the NULL. -@example -#define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) - -@end example - -@findex bfd_set_symtab -@subsubsection @code{bfd_set_symtab} -@strong{Synopsis} -@example -bfd_boolean bfd_set_symtab - (bfd *abfd, asymbol **location, unsigned int count); -@end example -@strong{Description}@* -Arrange that when the output BFD @var{abfd} is closed, -the table @var{location} of @var{count} pointers to symbols -will be written. - -@findex bfd_print_symbol_vandf -@subsubsection @code{bfd_print_symbol_vandf} -@strong{Synopsis} -@example -void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); -@end example -@strong{Description}@* -Print the value and flags of the @var{symbol} supplied to the -stream @var{file}. - -@findex bfd_make_empty_symbol -@subsubsection @code{bfd_make_empty_symbol} -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd} -and return a pointer to it. - -This routine is necessary because each back end has private -information surrounding the @code{asymbol}. Building your own -@code{asymbol} and pointing to it will not create the private -information, and will cause problems later on. -@example -#define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) - -@end example - -@findex _bfd_generic_make_empty_symbol -@subsubsection @code{_bfd_generic_make_empty_symbol} -@strong{Synopsis} -@example -asymbol *_bfd_generic_make_empty_symbol (bfd *); -@end example -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd} -and return a pointer to it. Used by core file routines, -binary back-end and anywhere else where no private info -is needed. - -@findex bfd_make_debug_symbol -@subsubsection @code{bfd_make_debug_symbol} -@strong{Description}@* -Create a new @code{asymbol} structure for the BFD @var{abfd}, -to be used as a debugging symbol. Further details of its use have -yet to be worked out. -@example -#define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) - -@end example - -@findex bfd_decode_symclass -@subsubsection @code{bfd_decode_symclass} -@strong{Description}@* -Return a character corresponding to the symbol -class of @var{symbol}, or '?' for an unknown class. - -@strong{Synopsis} -@example -int bfd_decode_symclass (asymbol *symbol); -@end example -@findex bfd_is_undefined_symclass -@subsubsection @code{bfd_is_undefined_symclass} -@strong{Description}@* -Returns non-zero if the class symbol returned by -bfd_decode_symclass represents an undefined symbol. -Returns zero otherwise. - -@strong{Synopsis} -@example -bfd_boolean bfd_is_undefined_symclass (int symclass); -@end example -@findex bfd_symbol_info -@subsubsection @code{bfd_symbol_info} -@strong{Description}@* -Fill in the basic info about symbol that nm needs. -Additional info may be added by the back-ends after -calling this function. - -@strong{Synopsis} -@example -void bfd_symbol_info (asymbol *symbol, symbol_info *ret); -@end example -@findex bfd_copy_private_symbol_data -@subsubsection @code{bfd_copy_private_symbol_data} -@strong{Synopsis} -@example -bfd_boolean bfd_copy_private_symbol_data - (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); -@end example -@strong{Description}@* -Copy private symbol information from @var{isym} in the BFD -@var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}. -Return @code{TRUE} on success, @code{FALSE} on error. Possible error -returns are: - -@itemize @bullet - -@item -@code{bfd_error_no_memory} - -Not enough memory exists to create private data for @var{osec}. -@end itemize -@example -#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) - -@end example - diff --git a/contrib/binutils/bfd/doc/targets.texi b/contrib/binutils/bfd/doc/targets.texi deleted file mode 100644 index a85c8491108..00000000000 --- a/contrib/binutils/bfd/doc/targets.texi +++ /dev/null @@ -1,551 +0,0 @@ -@section Targets - - -@strong{Description}@* -Each port of BFD to a different machine requires the creation -of a target back end. All the back end provides to the root -part of BFD is a structure containing pointers to functions -which perform certain low level operations on files. BFD -translates the applications's requests through a pointer into -calls to the back end routines. - -When a file is opened with @code{bfd_openr}, its format and -target are unknown. BFD uses various mechanisms to determine -how to interpret the file. The operations performed are: - -@itemize @bullet - -@item -Create a BFD by calling the internal routine -@code{_bfd_new_bfd}, then call @code{bfd_find_target} with the -target string supplied to @code{bfd_openr} and the new BFD pointer. - -@item -If a null target string was provided to @code{bfd_find_target}, -look up the environment variable @code{GNUTARGET} and use -that as the target string. - -@item -If the target string is still @code{NULL}, or the target string is -@code{default}, then use the first item in the target vector -as the target type, and set @code{target_defaulted} in the BFD to -cause @code{bfd_check_format} to loop through all the targets. -@xref{bfd_target}. @xref{Formats}. - -@item -Otherwise, inspect the elements in the target vector -one by one, until a match on target name is found. When found, -use it. - -@item -Otherwise return the error @code{bfd_error_invalid_target} to -@code{bfd_openr}. - -@item -@code{bfd_openr} attempts to open the file using -@code{bfd_open_file}, and returns the BFD. -@end itemize -Once the BFD has been opened and the target selected, the file -format may be determined. This is done by calling -@code{bfd_check_format} on the BFD with a suggested format. -If @code{target_defaulted} has been set, each possible target -type is tried to see if it recognizes the specified format. -@code{bfd_check_format} returns @code{TRUE} when the caller guesses right. -@menu -* bfd_target:: -@end menu - -@node bfd_target, , Targets, Targets - -@subsection bfd_target - - -@strong{Description}@* -This structure contains everything that BFD knows about a -target. It includes things like its byte order, name, and which -routines to call to do various operations. - -Every BFD points to a target structure with its @code{xvec} -member. - -The macros below are used to dispatch to functions through the -@code{bfd_target} vector. They are used in a number of macros further -down in @file{bfd.h}, and are also used when calling various -routines by hand inside the BFD implementation. The @var{arglist} -argument must be parenthesized; it contains all the arguments -to the called function. - -They make the documentation (more) unpleasant to read, so if -someone wants to fix this and not break the above, please do. -@example -#define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) - -#ifdef DEBUG_BFD_SEND -#undef BFD_SEND -#define BFD_SEND(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - ((*((bfd)->xvec->message)) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) -#endif -@end example -For operations which index on the BFD format: -@example -#define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) - -#ifdef DEBUG_BFD_SEND -#undef BFD_SEND_FMT -#define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ - (bfd_assert (__FILE__,__LINE__), NULL)) -#endif - -@end example -This is the structure which defines the type of BFD this is. The -@code{xvec} member of the struct @code{bfd} itself points here. Each -module that implements access to a different target under BFD, -defines one of these. - -FIXME, these names should be rationalised with the names of -the entry points which call them. Too bad we can't have one -macro to define them both! -@example -enum bfd_flavour -@{ - bfd_target_unknown_flavour, - bfd_target_aout_flavour, - bfd_target_coff_flavour, - bfd_target_ecoff_flavour, - bfd_target_xcoff_flavour, - bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, - bfd_target_tekhex_flavour, - bfd_target_srec_flavour, - bfd_target_ihex_flavour, - bfd_target_som_flavour, - bfd_target_os9k_flavour, - bfd_target_versados_flavour, - bfd_target_msdos_flavour, - bfd_target_ovax_flavour, - bfd_target_evax_flavour, - bfd_target_mmo_flavour, - bfd_target_mach_o_flavour, - bfd_target_pef_flavour, - bfd_target_pef_xlib_flavour, - bfd_target_sym_flavour -@}; - -enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @}; - -/* Forward declaration. */ -typedef struct bfd_link_info _bfd_link_info; - -typedef struct bfd_target -@{ - /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; - - /* The "flavour" of a back end is a general indication about - the contents of a file. */ - enum bfd_flavour flavour; - - /* The order of bytes within the data area of a file. */ - enum bfd_endian byteorder; - - /* The order of bytes within the header parts of a file. */ - enum bfd_endian header_byteorder; - - /* A mask of all the flags which an executable may have set - - from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. */ - flagword object_flags; - - /* A mask of all the flags which a section may have set - from - the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. */ - flagword section_flags; - - /* The character normally found at the front of a symbol. - (if any), perhaps `_'. */ - char symbol_leading_char; - - /* The pad character for file names within an archive header. */ - char ar_pad_char; - - /* The maximum number of characters in an archive header. */ - unsigned short ar_max_namelen; - - /* Entries for byte swapping for data. These are different from the - other entry points, since they don't take a BFD as the first argument. - Certain other handlers could do the same. */ - bfd_uint64_t (*bfd_getx64) (const void *); - bfd_int64_t (*bfd_getx_signed_64) (const void *); - void (*bfd_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_getx32) (const void *); - bfd_signed_vma (*bfd_getx_signed_32) (const void *); - void (*bfd_putx32) (bfd_vma, void *); - bfd_vma (*bfd_getx16) (const void *); - bfd_signed_vma (*bfd_getx_signed_16) (const void *); - void (*bfd_putx16) (bfd_vma, void *); - - /* Byte swapping for the headers. */ - bfd_uint64_t (*bfd_h_getx64) (const void *); - bfd_int64_t (*bfd_h_getx_signed_64) (const void *); - void (*bfd_h_putx64) (bfd_uint64_t, void *); - bfd_vma (*bfd_h_getx32) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); - void (*bfd_h_putx32) (bfd_vma, void *); - bfd_vma (*bfd_h_getx16) (const void *); - bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); - void (*bfd_h_putx16) (bfd_vma, void *); - - /* Format dependent routines: these are vectors of entry points - within the target vector structure, one for each format to check. */ - - /* Check the format of a file being read. Return a @code{bfd_target *} or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); - - /* Set the format of a file being written. */ - bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); - - /* Write cached information into a file being written, at @code{bfd_close}. */ - bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); - -@end example -The general target vector. These vectors are initialized using the -BFD_JUMP_TABLE macros. -@example - - /* Generic entry points. */ -#define BFD_JUMP_TABLE_GENERIC(NAME) \ - NAME##_close_and_cleanup, \ - NAME##_bfd_free_cached_info, \ - NAME##_new_section_hook, \ - NAME##_get_section_contents, \ - NAME##_get_section_contents_in_window - - /* Called when the BFD is being closed to do any necessary cleanup. */ - bfd_boolean (*_close_and_cleanup) (bfd *); - /* Ask the BFD to free all cached information. */ - bfd_boolean (*_bfd_free_cached_info) (bfd *); - /* Called when a new section is created. */ - bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); - /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); - - /* Entry points to copy private data. */ -#define BFD_JUMP_TABLE_COPY(NAME) \ - NAME##_bfd_copy_private_bfd_data, \ - NAME##_bfd_merge_private_bfd_data, \ - _bfd_generic_init_private_section_data, \ - NAME##_bfd_copy_private_section_data, \ - NAME##_bfd_copy_private_symbol_data, \ - NAME##_bfd_copy_private_header_data, \ - NAME##_bfd_set_private_flags, \ - NAME##_bfd_print_private_bfd_data - - /* Called to copy BFD general private data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); - /* Called to merge BFD general private data from one object file - to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); - /* Called to initialize BFD private section data from one object file - to another. */ -#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); - /* Called to copy BFD private section data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); - /* Called to copy BFD private symbol data from one symbol - to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); - /* Called to copy BFD private header data from one object file - to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); - /* Called to set private backend flags. */ - bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); - - /* Called to print private BFD data. */ - bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); - - /* Core file entry points. */ -#define BFD_JUMP_TABLE_CORE(NAME) \ - NAME##_core_file_failing_command, \ - NAME##_core_file_failing_signal, \ - NAME##_core_file_matches_executable_p - - char * (*_core_file_failing_command) (bfd *); - int (*_core_file_failing_signal) (bfd *); - bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); - - /* Archive entry points. */ -#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ - NAME##_slurp_armap, \ - NAME##_slurp_extended_name_table, \ - NAME##_construct_extended_name_table, \ - NAME##_truncate_arname, \ - NAME##_write_armap, \ - NAME##_read_ar_hdr, \ - NAME##_openr_next_archived_file, \ - NAME##_get_elt_at_index, \ - NAME##_generic_stat_arch_elt, \ - NAME##_update_armap_timestamp - - bfd_boolean (*_bfd_slurp_armap) (bfd *); - bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); - void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); - void * (*_bfd_read_ar_hdr_fn) (bfd *); - bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); - int (*_bfd_stat_arch_elt) (bfd *, struct stat *); - bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); - - /* Entry points used for symbols. */ -#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ - NAME##_get_symtab_upper_bound, \ - NAME##_canonicalize_symtab, \ - NAME##_make_empty_symbol, \ - NAME##_print_symbol, \ - NAME##_get_symbol_info, \ - NAME##_bfd_is_local_label_name, \ - NAME##_bfd_is_target_special_symbol, \ - NAME##_get_lineno, \ - NAME##_find_nearest_line, \ - _bfd_generic_find_line, \ - NAME##_find_inliner_info, \ - NAME##_bfd_make_debug_symbol, \ - NAME##_read_minisymbols, \ - NAME##_minisymbol_to_symbol - - long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); - struct bfd_symbol * - (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) - bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); - bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); - alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); - bfd_boolean (*_bfd_find_inliner_info) - (bfd *, const char **, const char **, unsigned int *); - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); -#define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); -#define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); - - /* Routines for relocs. */ -#define BFD_JUMP_TABLE_RELOCS(NAME) \ - NAME##_get_reloc_upper_bound, \ - NAME##_canonicalize_reloc, \ - NAME##_bfd_reloc_type_lookup - - long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); - /* See documentation on reloc types. */ - reloc_howto_type * - (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); - - /* Routines used when writing an object file. */ -#define BFD_JUMP_TABLE_WRITE(NAME) \ - NAME##_set_arch_mach, \ - NAME##_set_section_contents - - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); - - /* Routines used by the linker. */ -#define BFD_JUMP_TABLE_LINK(NAME) \ - NAME##_sizeof_headers, \ - NAME##_bfd_get_relocated_section_contents, \ - NAME##_bfd_relax_section, \ - NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ - NAME##_bfd_link_add_symbols, \ - NAME##_bfd_link_just_syms, \ - NAME##_bfd_final_link, \ - NAME##_bfd_link_split_section, \ - NAME##_bfd_gc_sections, \ - NAME##_bfd_merge_sections, \ - NAME##_bfd_is_group_section, \ - NAME##_bfd_discard_group, \ - NAME##_section_already_linked \ - - int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); - - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); - - /* Create a hash table for the linker. Different backends store - different information in this table. */ - struct bfd_link_hash_table * - (*_bfd_link_hash_table_create) (bfd *); - - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - - /* Add symbols from this object file into the hash table. */ - bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); - - /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - - /* Do a link based on the link_order structures attached to each - section of the BFD. */ - bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); - - /* Should this section be split up into smaller pieces during linking. */ - bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); - - /* Remove sections that are not referenced from the output. */ - bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); - - /* Attempt to merge SEC_MERGE sections. */ - bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); - - /* Is this section a member of a group? */ - bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); - - /* Discard members of a group. */ - bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); - - /* Check if SEC has been already linked during a reloceatable or - final link. */ - void (*_section_already_linked) (bfd *, struct bfd_section *); - - /* Routines to handle dynamic symbols and relocs. */ -#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ - NAME##_get_dynamic_symtab_upper_bound, \ - NAME##_canonicalize_dynamic_symtab, \ - NAME##_get_synthetic_symtab, \ - NAME##_get_dynamic_reloc_upper_bound, \ - NAME##_canonicalize_dynamic_reloc - - /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); - /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); - /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); - /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); - /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); - -@end example -A pointer to an alternative bfd_target in case the current one is not -satisfactory. This can happen when the target cpu supports both big -and little endian code, and target chosen by the linker has the wrong -endianness. The function open_output() in ld/ldlang.c uses this field -to find an alternative output format that is suitable. -@example - /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; - - /* Data for use by back-end routines, which isn't - generic enough to belong in this structure. */ - const void *backend_data; - -@} bfd_target; - -@end example - -@findex bfd_set_default_target -@subsubsection @code{bfd_set_default_target} -@strong{Synopsis} -@example -bfd_boolean bfd_set_default_target (const char *name); -@end example -@strong{Description}@* -Set the default target vector to use when recognizing a BFD. -This takes the name of the target, which may be a BFD target -name or a configuration triplet. - -@findex bfd_find_target -@subsubsection @code{bfd_find_target} -@strong{Synopsis} -@example -const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); -@end example -@strong{Description}@* -Return a pointer to the transfer vector for the object target -named @var{target_name}. If @var{target_name} is @code{NULL}, choose the -one in the environment variable @code{GNUTARGET}; if that is null or not -defined, then choose the first entry in the target list. -Passing in the string "default" or setting the environment -variable to "default" will cause the first entry in the target -list to be returned, and "target_defaulted" will be set in the -BFD. This causes @code{bfd_check_format} to loop over all the -targets to find the one that matches the file being read. - -@findex bfd_target_list -@subsubsection @code{bfd_target_list} -@strong{Synopsis} -@example -const char ** bfd_target_list (void); -@end example -@strong{Description}@* -Return a freshly malloced NULL-terminated -vector of the names of all the valid BFD targets. Do not -modify the names. - -@findex bfd_seach_for_target -@subsubsection @code{bfd_seach_for_target} -@strong{Synopsis} -@example -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); -@end example -@strong{Description}@* -Return a pointer to the first transfer vector in the list of -transfer vectors maintained by BFD that produces a non-zero -result when passed to the function @var{search_func}. The -parameter @var{data} is passed, unexamined, to the search -function. - diff --git a/contrib/binutils/bfd/dwarf1.c b/contrib/binutils/bfd/dwarf1.c index 5d6c1e359e5..d722df37152 100644 --- a/contrib/binutils/bfd/dwarf1.c +++ b/contrib/binutils/bfd/dwarf1.c @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c index ae68d188681..411a7154b5e 100644 --- a/contrib/binutils/bfd/dwarf2.c +++ b/contrib/binutils/bfd/dwarf2.c @@ -1,6 +1,6 @@ /* DWARF 2 support. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -29,8 +29,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" @@ -93,8 +93,10 @@ struct dwarf2_debug /* Pointer to the end of the .debug_info section memory buffer. */ bfd_byte *info_ptr_end; - /* Pointer to the section and address of the beginning of the - section. */ + /* Pointer to the bfd, section and address of the beginning of the + section. The bfd might be different than expected because of + gnu_debuglink sections. */ + bfd * bfd; asection *sec; bfd_byte *sec_info_ptr; @@ -874,24 +876,45 @@ concat_filename (struct line_info_table *table, unsigned int file) filename = table->files[file - 1].name; - if (! IS_ABSOLUTE_PATH (filename)) + if (!IS_ABSOLUTE_PATH (filename)) { - char *dirname = (table->files[file - 1].dir - ? table->dirs[table->files[file - 1].dir - 1] - : table->comp_dir); + char *dirname = NULL; + char *subdirname = NULL; + char *name; + size_t len; - /* Not all tools set DW_AT_comp_dir, so dirname may be unknown. - The best we can do is return the filename part. */ - if (dirname != NULL) + if (table->files[file - 1].dir) + subdirname = table->dirs[table->files[file - 1].dir - 1]; + + if (!subdirname || !IS_ABSOLUTE_PATH (subdirname)) + dirname = table->comp_dir; + + if (!dirname) { - unsigned int len = strlen (dirname) + strlen (filename) + 2; - char * name; + dirname = subdirname; + subdirname = NULL; + } + if (!dirname) + return strdup (filename); + + len = strlen (dirname) + strlen (filename) + 2; + + if (subdirname) + { + len += strlen (subdirname) + 1; + name = bfd_malloc (len); + if (name) + sprintf (name, "%s/%s/%s", dirname, subdirname, filename); + } + else + { name = bfd_malloc (len); if (name) sprintf (name, "%s/%s", dirname, filename); - return name; } + + return name; } return strdup (filename); @@ -1117,7 +1140,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) unsigned int line = 1; unsigned int column = 0; int is_stmt = lh.default_is_stmt; - int basic_block = 0; int end_sequence = 0; /* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some compilers generate address sequences that are wildly out of @@ -1142,7 +1164,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) line += lh.line_base + (adj_opcode % lh.line_range); /* Append row to matrix using current values. */ add_line_info (table, address, filename, line, column, 0); - basic_block = 1; if (address < low_pc) low_pc = address; if (address > high_pc) @@ -1214,7 +1235,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) break; case DW_LNS_copy: add_line_info (table, address, filename, line, column, 0); - basic_block = 0; if (address < low_pc) low_pc = address; if (address > high_pc) @@ -1250,7 +1270,6 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) is_stmt = (!is_stmt); break; case DW_LNS_set_basic_block: - basic_block = 1; break; case DW_LNS_const_add_pc: address += lh.minimum_instruction_length @@ -1625,7 +1644,7 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs if (low_pc == -1UL && high_pc != -1UL) base_address = high_pc; else - arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc); + arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc); } } @@ -1871,8 +1890,7 @@ scan_unit_for_symbols (struct comp_unit *unit) to get to the line number information for the compilation unit. */ static struct comp_unit * -parse_comp_unit (bfd *abfd, - struct dwarf2_debug *stash, +parse_comp_unit (struct dwarf2_debug *stash, bfd_vma unit_length, bfd_byte *info_ptr_unit, unsigned int offset_size) @@ -1890,6 +1908,7 @@ parse_comp_unit (bfd *abfd, bfd_size_type amt; bfd_vma low_pc = 0; bfd_vma high_pc = 0; + bfd *abfd = stash->bfd; version = read_2_bytes (abfd, info_ptr); info_ptr += 2; @@ -2175,17 +2194,14 @@ find_debug_info (bfd *abfd, asection *after_sec) { asection * msec; - if (after_sec) - msec = after_sec->next; - else - msec = abfd->sections; + msec = after_sec != NULL ? after_sec->next : abfd->sections; while (msec) { if (strcmp (msec->name, DWARF2_DEBUG_INFO) == 0) return msec; - if (strncmp (msec->name, GNU_LINKONCE_INFO, strlen (GNU_LINKONCE_INFO)) == 0) + if (CONST_STRNEQ (msec->name, GNU_LINKONCE_INFO)) return msec; msec = msec->next; @@ -2285,11 +2301,293 @@ place_sections (bfd *abfd, struct dwarf2_debug *stash) return TRUE; } -/* The DWARF2 version of find_nearest_line. Return TRUE if the line - is found without error. ADDR_SIZE is the number of bytes in the - initial .debug_info length field and in the abbreviation offset. - You may use zero to indicate that the default value should be - used. */ +/* Find the source code location of SYMBOL. If SYMBOL is NULL + then find the nearest source code location corresponding to + the address SECTION + OFFSET. + Returns TRUE if the line is found without error and fills in + FILENAME_PTR and LINENUMBER_PTR. In the case where SYMBOL was + NULL the FUNCTIONNAME_PTR is also filled in. + SYMBOLS contains the symbol table for ABFD. + ADDR_SIZE is the number of bytes in the initial .debug_info length + field and in the abbreviation offset, or zero to indicate that the + default value should be used. */ + +static bfd_boolean +find_line (bfd *abfd, + asection *section, + bfd_vma offset, + asymbol *symbol, + asymbol **symbols, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *linenumber_ptr, + unsigned int addr_size, + void **pinfo) +{ + /* Read each compilation unit from the section .debug_info, and check + to see if it contains the address we are searching for. If yes, + lookup the address, and return the line number info. If no, go + on to the next compilation unit. + + We keep a list of all the previously read compilation units, and + a pointer to the next un-read compilation unit. Check the + previously read units before reading more. */ + struct dwarf2_debug *stash; + /* What address are we looking for? */ + bfd_vma addr; + struct comp_unit* each; + bfd_vma found = FALSE; + bfd_boolean do_line; + + stash = *pinfo; + + if (! stash) + { + bfd_size_type amt = sizeof (struct dwarf2_debug); + + stash = bfd_zalloc (abfd, amt); + if (! stash) + return FALSE; + } + + /* In a relocatable file, 2 functions may have the same address. + We change the section vma so that they won't overlap. */ + if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) + { + if (! place_sections (abfd, stash)) + return FALSE; + } + + do_line = (section == NULL + && offset == 0 + && functionname_ptr == NULL + && symbol != NULL); + if (do_line) + { + addr = symbol->value; + section = bfd_get_section (symbol); + } + else if (section != NULL + && functionname_ptr != NULL + && symbol == NULL) + addr = offset; + else + abort (); + + if (section->output_section) + addr += section->output_section->vma + section->output_offset; + else + addr += section->vma; + *filename_ptr = NULL; + *functionname_ptr = NULL; + *linenumber_ptr = 0; + + if (! *pinfo) + { + bfd *debug_bfd; + bfd_size_type total_size; + asection *msec; + + *pinfo = stash; + + msec = find_debug_info (abfd, NULL); + if (msec == NULL) + { + char * debug_filename = bfd_follow_gnu_debuglink (abfd, DEBUGDIR); + + if (debug_filename == NULL) + /* No dwarf2 info, and no gnu_debuglink to follow. + Note that at this point the stash has been allocated, but + contains zeros. This lets future calls to this function + fail more quickly. */ + goto done; + + if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL + || ! bfd_check_format (debug_bfd, bfd_object) + || (msec = find_debug_info (debug_bfd, NULL)) == NULL) + { + if (debug_bfd) + bfd_close (debug_bfd); + /* FIXME: Should we report our failure to follow the debuglink ? */ + free (debug_filename); + goto done; + } + } + else + debug_bfd = abfd; + + /* There can be more than one DWARF2 info section in a BFD these days. + Read them all in and produce one large stash. We do this in two + passes - in the first pass we just accumulate the section sizes. + In the second pass we read in the section's contents. The allows + us to avoid reallocing the data as we add sections to the stash. */ + for (total_size = 0; msec; msec = find_debug_info (debug_bfd, msec)) + total_size += msec->size; + + stash->info_ptr = bfd_alloc (debug_bfd, total_size); + if (stash->info_ptr == NULL) + goto done; + + stash->info_ptr_end = stash->info_ptr; + + for (msec = find_debug_info (debug_bfd, NULL); + msec; + msec = find_debug_info (debug_bfd, msec)) + { + bfd_size_type size; + bfd_size_type start; + + size = msec->size; + if (size == 0) + continue; + + start = stash->info_ptr_end - stash->info_ptr; + + if ((bfd_simple_get_relocated_section_contents + (debug_bfd, msec, stash->info_ptr + start, symbols)) == NULL) + continue; + + stash->info_ptr_end = stash->info_ptr + start + size; + } + + BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); + + stash->sec = find_debug_info (debug_bfd, NULL); + stash->sec_info_ptr = stash->info_ptr; + stash->syms = symbols; + stash->bfd = debug_bfd; + } + + /* A null info_ptr indicates that there is no dwarf2 info + (or that an error occured while setting up the stash). */ + if (! stash->info_ptr) + goto done; + + stash->inliner_chain = NULL; + + /* Check the previously read comp. units first. */ + for (each = stash->all_comp_units; each; each = each->next_unit) + { + if (do_line) + found = (((symbol->flags & BSF_FUNCTION) == 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_line (each, symbol, addr, + filename_ptr, linenumber_ptr, + stash)); + else + found = (comp_unit_contains_address (each, addr) + && comp_unit_find_nearest_line (each, addr, + filename_ptr, + functionname_ptr, + linenumber_ptr, + stash)); + if (found) + goto done; + } + + /* The DWARF2 spec says that the initial length field, and the + offset of the abbreviation table, should both be 4-byte values. + However, some compilers do things differently. */ + if (addr_size == 0) + addr_size = 4; + BFD_ASSERT (addr_size == 4 || addr_size == 8); + + /* Read each remaining comp. units checking each as they are read. */ + while (stash->info_ptr < stash->info_ptr_end) + { + bfd_vma length; + unsigned int offset_size = addr_size; + bfd_byte *info_ptr_unit = stash->info_ptr; + + length = read_4_bytes (stash->bfd, stash->info_ptr); + /* A 0xffffff length is the DWARF3 way of indicating + we use 64-bit offsets, instead of 32-bit offsets. */ + if (length == 0xffffffff) + { + offset_size = 8; + length = read_8_bytes (stash->bfd, stash->info_ptr + 4); + stash->info_ptr += 12; + } + /* A zero length is the IRIX way of indicating 64-bit offsets, + mostly because the 64-bit length will generally fit in 32 + bits, and the endianness helps. */ + else if (length == 0) + { + offset_size = 8; + length = read_4_bytes (stash->bfd, stash->info_ptr + 4); + stash->info_ptr += 8; + } + /* In the absence of the hints above, we assume 32-bit DWARF2 + offsets even for targets with 64-bit addresses, because: + a) most of the time these targets will not have generated + more than 2Gb of debug info and so will not need 64-bit + offsets, + and + b) if they do use 64-bit offsets but they are not using + the size hints that are tested for above then they are + not conforming to the DWARF3 standard anyway. */ + else if (addr_size == 8) + { + offset_size = 4; + stash->info_ptr += 4; + } + else + stash->info_ptr += 4; + + if (length > 0) + { + each = parse_comp_unit (stash, length, info_ptr_unit, + offset_size); + stash->info_ptr += length; + + if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) + == stash->sec->size) + { + stash->sec = find_debug_info (stash->bfd, stash->sec); + stash->sec_info_ptr = stash->info_ptr; + } + + if (each) + { + each->next_unit = stash->all_comp_units; + stash->all_comp_units = each; + + /* DW_AT_low_pc and DW_AT_high_pc are optional for + compilation units. If we don't have them (i.e., + unit->high == 0), we need to consult the line info + table to see if a compilation unit contains the given + address. */ + if (do_line) + found = (((symbol->flags & BSF_FUNCTION) == 0 + || each->arange.high == 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_line (each, symbol, addr, + filename_ptr, + linenumber_ptr, + stash)); + else + found = ((each->arange.high == 0 + || comp_unit_contains_address (each, addr)) + && comp_unit_find_nearest_line (each, addr, + filename_ptr, + functionname_ptr, + linenumber_ptr, + stash)); + if (found) + goto done; + } + } + } + +done: + if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) + unset_sections (stash); + + return found; +} + +/* The DWARF2 version of find_nearest_line. + Return TRUE if the line is found without error. */ bfd_boolean _bfd_dwarf2_find_nearest_line (bfd *abfd, @@ -2302,214 +2600,13 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd, unsigned int addr_size, void **pinfo) { - /* Read each compilation unit from the section .debug_info, and check - to see if it contains the address we are searching for. If yes, - lookup the address, and return the line number info. If no, go - on to the next compilation unit. - - We keep a list of all the previously read compilation units, and - a pointer to the next un-read compilation unit. Check the - previously read units before reading more. */ - struct dwarf2_debug *stash; - - /* What address are we looking for? */ - bfd_vma addr; - - struct comp_unit* each; - - bfd_vma found = FALSE; - - stash = *pinfo; - - if (! stash) - { - bfd_size_type amt = sizeof (struct dwarf2_debug); - - stash = bfd_zalloc (abfd, amt); - if (! stash) - return FALSE; - } - - /* In a relocatable file, 2 functions may have the same address. - We change the section vma so that they won't overlap. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - { - if (! place_sections (abfd, stash)) - return FALSE; - } - - addr = offset; - if (section->output_section) - addr += section->output_section->vma + section->output_offset; - else - addr += section->vma; - *filename_ptr = NULL; - *functionname_ptr = NULL; - *linenumber_ptr = 0; - - /* The DWARF2 spec says that the initial length field, and the - offset of the abbreviation table, should both be 4-byte values. - However, some compilers do things differently. */ - if (addr_size == 0) - addr_size = 4; - BFD_ASSERT (addr_size == 4 || addr_size == 8); - - if (! *pinfo) - { - bfd_size_type total_size; - asection *msec; - - *pinfo = stash; - - msec = find_debug_info (abfd, NULL); - if (! msec) - /* No dwarf2 info. Note that at this point the stash - has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ - goto done; - - /* There can be more than one DWARF2 info section in a BFD these days. - Read them all in and produce one large stash. We do this in two - passes - in the first pass we just accumulate the section sizes. - In the second pass we read in the section's contents. The allows - us to avoid reallocing the data as we add sections to the stash. */ - for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) - total_size += msec->size; - - stash->info_ptr = bfd_alloc (abfd, total_size); - if (stash->info_ptr == NULL) - goto done; - - stash->info_ptr_end = stash->info_ptr; - - for (msec = find_debug_info (abfd, NULL); - msec; - msec = find_debug_info (abfd, msec)) - { - bfd_size_type size; - bfd_size_type start; - - size = msec->size; - if (size == 0) - continue; - - start = stash->info_ptr_end - stash->info_ptr; - - if ((bfd_simple_get_relocated_section_contents - (abfd, msec, stash->info_ptr + start, symbols)) == NULL) - continue; - - stash->info_ptr_end = stash->info_ptr + start + size; - } - - BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); - - stash->sec = find_debug_info (abfd, NULL); - stash->sec_info_ptr = stash->info_ptr; - stash->syms = symbols; - } - - /* A null info_ptr indicates that there is no dwarf2 info - (or that an error occured while setting up the stash). */ - if (! stash->info_ptr) - goto done; - - stash->inliner_chain = NULL; - - /* Check the previously read comp. units first. */ - for (each = stash->all_comp_units; each; each = each->next_unit) - if (comp_unit_contains_address (each, addr) - && comp_unit_find_nearest_line (each, addr, filename_ptr, - functionname_ptr, - linenumber_ptr, stash)) - { - found = TRUE; - goto done; - } - - /* Read each remaining comp. units checking each as they are read. */ - while (stash->info_ptr < stash->info_ptr_end) - { - bfd_vma length; - unsigned int offset_size = addr_size; - bfd_byte *info_ptr_unit = stash->info_ptr; - - length = read_4_bytes (abfd, stash->info_ptr); - /* A 0xffffff length is the DWARF3 way of indicating we use - 64-bit offsets, instead of 32-bit offsets. */ - if (length == 0xffffffff) - { - offset_size = 8; - length = read_8_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 12; - } - /* A zero length is the IRIX way of indicating 64-bit offsets, - mostly because the 64-bit length will generally fit in 32 - bits, and the endianness helps. */ - else if (length == 0) - { - offset_size = 8; - length = read_4_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 8; - } - /* In the absence of the hints above, we assume addr_size-sized - offsets, for backward-compatibility with pre-DWARF3 64-bit - platforms. */ - else if (addr_size == 8) - { - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += 8; - } - else - stash->info_ptr += 4; - - if (length > 0) - { - each = parse_comp_unit (abfd, stash, length, info_ptr_unit, - offset_size); - stash->info_ptr += length; - - if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) - == stash->sec->size) - { - stash->sec = find_debug_info (abfd, stash->sec); - stash->sec_info_ptr = stash->info_ptr; - } - - if (each) - { - each->next_unit = stash->all_comp_units; - stash->all_comp_units = each; - - /* DW_AT_low_pc and DW_AT_high_pc are optional for - compilation units. If we don't have them (i.e., - unit->high == 0), we need to consult the line info - table to see if a compilation unit contains the given - address. */ - if ((each->arange.high == 0 - || comp_unit_contains_address (each, addr)) - && comp_unit_find_nearest_line (each, addr, - filename_ptr, - functionname_ptr, - linenumber_ptr, - stash)) - { - found = TRUE; - goto done; - } - } - } - } - -done: - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - unset_sections (stash); - - return found; + return find_line (abfd, section, offset, NULL, symbols, filename_ptr, + functionname_ptr, linenumber_ptr, addr_size, + pinfo); } -/* The DWARF2 version of find_line. Return TRUE if the line is found - without error. */ +/* The DWARF2 version of find_line. + Return TRUE if the line is found without error. */ bfd_boolean _bfd_dwarf2_find_line (bfd *abfd, @@ -2520,213 +2617,9 @@ _bfd_dwarf2_find_line (bfd *abfd, unsigned int addr_size, void **pinfo) { - /* Read each compilation unit from the section .debug_info, and check - to see if it contains the address we are searching for. If yes, - lookup the address, and return the line number info. If no, go - on to the next compilation unit. - - We keep a list of all the previously read compilation units, and - a pointer to the next un-read compilation unit. Check the - previously read units before reading more. */ - struct dwarf2_debug *stash; - - /* What address are we looking for? */ - bfd_vma addr; - - struct comp_unit* each; - - asection *section; - - bfd_boolean found = FALSE; - - section = bfd_get_section (symbol); - - stash = *pinfo; - - if (! stash) - { - bfd_size_type amt = sizeof (struct dwarf2_debug); - - stash = bfd_zalloc (abfd, amt); - if (! stash) - return FALSE; - } - - /* In a relocatable file, 2 functions may have the same address. - We change the section vma so that they won't overlap. */ - if (!stash && (abfd->flags & (EXEC_P | DYNAMIC)) == 0) - { - if (! place_sections (abfd, stash)) - return FALSE; - } - - addr = symbol->value; - if (section->output_section) - addr += section->output_section->vma + section->output_offset; - else - addr += section->vma; - - *filename_ptr = NULL; - *filename_ptr = NULL; - *linenumber_ptr = 0; - - if (! *pinfo) - { - bfd_size_type total_size; - asection *msec; - - *pinfo = stash; - - msec = find_debug_info (abfd, NULL); - if (! msec) - /* No dwarf2 info. Note that at this point the stash - has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ - goto done; - - /* There can be more than one DWARF2 info section in a BFD these days. - Read them all in and produce one large stash. We do this in two - passes - in the first pass we just accumulate the section sizes. - In the second pass we read in the section's contents. The allows - us to avoid reallocing the data as we add sections to the stash. */ - for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) - total_size += msec->size; - - stash->info_ptr = bfd_alloc (abfd, total_size); - if (stash->info_ptr == NULL) - goto done; - - stash->info_ptr_end = stash->info_ptr; - - for (msec = find_debug_info (abfd, NULL); - msec; - msec = find_debug_info (abfd, msec)) - { - bfd_size_type size; - bfd_size_type start; - - size = msec->size; - if (size == 0) - continue; - - start = stash->info_ptr_end - stash->info_ptr; - - if ((bfd_simple_get_relocated_section_contents - (abfd, msec, stash->info_ptr + start, symbols)) == NULL) - continue; - - stash->info_ptr_end = stash->info_ptr + start + size; - } - - BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size); - - stash->sec = find_debug_info (abfd, NULL); - stash->sec_info_ptr = stash->info_ptr; - stash->syms = symbols; - } - - /* A null info_ptr indicates that there is no dwarf2 info - (or that an error occured while setting up the stash). */ - if (! stash->info_ptr) - goto done; - - stash->inliner_chain = NULL; - - /* Check the previously read comp. units first. */ - for (each = stash->all_comp_units; each; each = each->next_unit) - if ((symbol->flags & BSF_FUNCTION) == 0 - || comp_unit_contains_address (each, addr)) - { - found = comp_unit_find_line (each, symbol, addr, filename_ptr, - linenumber_ptr, stash); - if (found) - goto done; - } - - /* The DWARF2 spec says that the initial length field, and the - offset of the abbreviation table, should both be 4-byte values. - However, some compilers do things differently. */ - if (addr_size == 0) - addr_size = 4; - BFD_ASSERT (addr_size == 4 || addr_size == 8); - - /* Read each remaining comp. units checking each as they are read. */ - while (stash->info_ptr < stash->info_ptr_end) - { - bfd_vma length; - unsigned int offset_size = addr_size; - bfd_byte *info_ptr_unit = stash->info_ptr; - - length = read_4_bytes (abfd, stash->info_ptr); - /* A 0xffffff length is the DWARF3 way of indicating we use - 64-bit offsets, instead of 32-bit offsets. */ - if (length == 0xffffffff) - { - offset_size = 8; - length = read_8_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 12; - } - /* A zero length is the IRIX way of indicating 64-bit offsets, - mostly because the 64-bit length will generally fit in 32 - bits, and the endianness helps. */ - else if (length == 0) - { - offset_size = 8; - length = read_4_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 8; - } - /* In the absence of the hints above, we assume addr_size-sized - offsets, for backward-compatibility with pre-DWARF3 64-bit - platforms. */ - else if (addr_size == 8) - { - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += 8; - } - else - stash->info_ptr += 4; - - if (length > 0) - { - each = parse_comp_unit (abfd, stash, length, info_ptr_unit, - offset_size); - stash->info_ptr += length; - - if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) - == stash->sec->size) - { - stash->sec = find_debug_info (abfd, stash->sec); - stash->sec_info_ptr = stash->info_ptr; - } - - if (each) - { - each->next_unit = stash->all_comp_units; - stash->all_comp_units = each; - - /* DW_AT_low_pc and DW_AT_high_pc are optional for - compilation units. If we don't have them (i.e., - unit->high == 0), we need to consult the line info - table to see if a compilation unit contains the given - address. */ - found = (((symbol->flags & BSF_FUNCTION) == 0 - || each->arange.high <= 0 - || comp_unit_contains_address (each, addr)) - && comp_unit_find_line (each, symbol, addr, - filename_ptr, - linenumber_ptr, - stash)); - if (found) - goto done; - } - } - } - -done: - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - unset_sections (stash); - - return found; + return find_line (abfd, NULL, 0, symbol, symbols, filename_ptr, + NULL, linenumber_ptr, addr_size, + pinfo); } bfd_boolean @@ -2742,17 +2635,18 @@ _bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, if (stash) { struct funcinfo *func = stash->inliner_chain; + if (func && func->caller_func) { *filename_ptr = func->caller_file; *functionname_ptr = func->caller_func->name; *linenumber_ptr = func->caller_line; stash->inliner_chain = func->caller_func; - return (TRUE); + return TRUE; } } - return (FALSE); + return FALSE; } void diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c index 75e1cc2a398..45cdb1ddb43 100644 --- a/contrib/binutils/bfd/ecoff.c +++ b/contrib/binutils/bfd/ecoff.c @@ -1,6 +1,6 @@ /* Generic ECOFF (Extended-COFF) routines. Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "aout/ar.h" @@ -140,8 +140,7 @@ _bfd_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr) /* Initialize a new section. */ bfd_boolean -_bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED, - asection *section) +_bfd_ecoff_new_section_hook (bfd *abfd, asection *section) { unsigned int i; static struct @@ -181,7 +180,7 @@ _bfd_ecoff_new_section_hook (bfd *abfd ATTRIBUTE_UNUSED, uncertain about .init on some systems and I don't know how shared libraries work. */ - return TRUE; + return _bfd_generic_new_section_hook (abfd, section); } /* Determine the machine architecture and type. This is called from @@ -1863,7 +1862,8 @@ _bfd_ecoff_set_arch_mach (bfd *abfd, /* Get the size of the section headers. */ int -_bfd_ecoff_sizeof_headers (bfd *abfd, bfd_boolean reloc ATTRIBUTE_UNUSED) +_bfd_ecoff_sizeof_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *current; int c; @@ -1937,7 +1937,7 @@ ecoff_compute_section_file_positions (bfd *abfd) const bfd_vma round = ecoff_backend (abfd)->round; bfd_size_type amt; - sofar = _bfd_ecoff_sizeof_headers (abfd, FALSE); + sofar = _bfd_ecoff_sizeof_headers (abfd, NULL); file_sofar = sofar; /* Sort the sections by VMA. */ @@ -2358,7 +2358,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd) } if ((abfd->flags & D_PAGED) != 0) - text_size = _bfd_ecoff_sizeof_headers (abfd, FALSE); + text_size = _bfd_ecoff_sizeof_headers (abfd, NULL); else text_size = 0; text_start = 0; @@ -2861,7 +2861,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd) bfd_slurp_armap, but that seems inappropriate since no other target uses this format. Instead, we check directly for a COFF armap. */ - if (strneq (nextname, "/ ", 16)) + if (CONST_STRNEQ (nextname, "/ ")) return bfd_slurp_armap (abfd); /* See if the first element is an armap. */ @@ -3087,7 +3087,7 @@ _bfd_ecoff_write_armap (bfd *abfd, last_elt = current; for (i = 0; i < orl_count; i++) { - unsigned int hash, rehash; + unsigned int hash, rehash = 0; /* Advance firstreal to the file position of this archive element. */ @@ -3097,7 +3097,7 @@ _bfd_ecoff_write_armap (bfd *abfd, { firstreal += arelt_size (current) + sizeof (struct ar_hdr); firstreal += firstreal % 2; - current = current->next; + current = current->archive_next; } while (current != map[i].u.abfd); } @@ -3757,7 +3757,7 @@ ecoff_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) while (*pundef != NULL) { struct bfd_link_hash_entry *h; - unsigned int hash, rehash; + unsigned int hash, rehash = 0; unsigned int file_offset; const char *name; bfd *element; diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c index 4246e94f393..8ee68e06625 100644 --- a/contrib/binutils/bfd/ecofflink.c +++ b/contrib/binutils/bfd/ecofflink.c @@ -1,6 +1,6 @@ /* Routines to link ECOFF debugging information. Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "objalloc.h" @@ -782,7 +782,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, fdr_ptr += fdr_add, i++) { FDR fdr; - bfd_vma fdr_adr; bfd_byte *sym_out; bfd_byte *lraw_src; bfd_byte *lraw_end; @@ -799,8 +798,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, else (*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr); - fdr_adr = fdr.adr; - /* FIXME: It is conceivable that this FDR points to the .init or .fini section, in which case this will not do the right thing. */ diff --git a/contrib/binutils/bfd/efi-app-ia32.c b/contrib/binutils/bfd/efi-app-ia32.c index b186f907ce6..06ed8059870 100644 --- a/contrib/binutils/bfd/efi-app-ia32.c +++ b/contrib/binutils/bfd/efi-app-ia32.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel IA-32 EFI application files. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #define TARGET_SYM bfd_efi_app_ia32_vec #define TARGET_NAME "efi-app-ia32" diff --git a/contrib/binutils/bfd/efi-app-ia64.c b/contrib/binutils/bfd/efi-app-ia64.c index c2a77aca55b..b60ca738eda 100644 --- a/contrib/binutils/bfd/efi-app-ia64.c +++ b/contrib/binutils/bfd/efi-app-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 EFI application files. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #define TARGET_SYM bfd_efi_app_ia64_vec #define TARGET_NAME "efi-app-ia64" diff --git a/contrib/binutils/bfd/elf-attrs.c b/contrib/binutils/bfd/elf-attrs.c new file mode 100644 index 00000000000..d1a64f4bed9 --- /dev/null +++ b/contrib/binutils/bfd/elf-attrs.c @@ -0,0 +1,628 @@ +/* ELF attributes support (based on ARM EABI attributes). + Copyright 2005, 2006, 2007 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libiberty.h" +#include "libbfd.h" +#include "elf-bfd.h" + +/* Return the number of bytes needed by I in uleb128 format. */ +static int +uleb128_size (unsigned int i) +{ + int size; + size = 1; + while (i >= 0x80) + { + i >>= 7; + size++; + } + return size; +} + +/* Return TRUE if the attribute has the default value (0/""). */ +static bfd_boolean +is_default_attr (obj_attribute *attr) +{ + if ((attr->type & 1) && attr->i != 0) + return FALSE; + if ((attr->type & 2) && attr->s && *attr->s) + return FALSE; + + return TRUE; +} + +/* Return the size of a single attribute. */ +static bfd_vma +obj_attr_size (int tag, obj_attribute *attr) +{ + bfd_vma size; + + if (is_default_attr (attr)) + return 0; + + size = uleb128_size (tag); + if (attr->type & 1) + size += uleb128_size (attr->i); + if (attr->type & 2) + size += strlen ((char *)attr->s) + 1; + return size; +} + +/* Return the vendor name for a given object attributes section. */ +static const char * +vendor_obj_attr_name (bfd *abfd, int vendor) +{ + return (vendor == OBJ_ATTR_PROC + ? get_elf_backend_data (abfd)->obj_attrs_vendor + : "gnu"); +} + +/* Return the size of the object attributes section for VENDOR + (OBJ_ATTR_PROC or OBJ_ATTR_GNU), or 0 if there are no attributes + for that vendor to record and the vendor is OBJ_ATTR_GNU. */ +static bfd_vma +vendor_obj_attr_size (bfd *abfd, int vendor) +{ + bfd_vma size; + obj_attribute *attr; + obj_attribute_list *list; + int i; + const char *vendor_name = vendor_obj_attr_name (abfd, vendor); + + if (!vendor_name) + return 0; + + attr = elf_known_obj_attributes (abfd)[vendor]; + size = 0; + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + size += obj_attr_size (i, &attr[i]); + + for (list = elf_other_obj_attributes (abfd)[vendor]; + list; + list = list->next) + size += obj_attr_size (list->tag, &list->attr); + + /* NUL 0x1 */ + return ((size || vendor == OBJ_ATTR_PROC) + ? size + 10 + strlen (vendor_name) + : 0); +} + +/* Return the size of the object attributes section. */ +bfd_vma +bfd_elf_obj_attr_size (bfd *abfd) +{ + bfd_vma size; + + size = vendor_obj_attr_size (abfd, OBJ_ATTR_PROC); + size += vendor_obj_attr_size (abfd, OBJ_ATTR_GNU); + + /* 'A' */ + return (size ? size + 1 : 0); +} + +/* Write VAL in uleb128 format to P, returning a pointer to the + following byte. */ +static bfd_byte * +write_uleb128 (bfd_byte *p, unsigned int val) +{ + bfd_byte c; + do + { + c = val & 0x7f; + val >>= 7; + if (val) + c |= 0x80; + *(p++) = c; + } + while (val); + return p; +} + +/* Write attribute ATTR to butter P, and return a pointer to the following + byte. */ +static bfd_byte * +write_obj_attribute (bfd_byte *p, int tag, obj_attribute *attr) +{ + /* Suppress default entries. */ + if (is_default_attr (attr)) + return p; + + p = write_uleb128 (p, tag); + if (attr->type & 1) + p = write_uleb128 (p, attr->i); + if (attr->type & 2) + { + int len; + + len = strlen (attr->s) + 1; + memcpy (p, attr->s, len); + p += len; + } + + return p; +} + +/* Write the contents of the object attributes section (length SIZE) + for VENDOR to CONTENTS. */ +static void +vendor_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size, + int vendor) +{ + bfd_byte *p; + obj_attribute *attr; + obj_attribute_list *list; + int i; + const char *vendor_name = vendor_obj_attr_name (abfd, vendor); + size_t vendor_length = strlen (vendor_name) + 1; + + p = contents; + bfd_put_32 (abfd, size, p); + p += 4; + memcpy (p, vendor_name, vendor_length); + p += vendor_length; + *(p++) = Tag_File; + bfd_put_32 (abfd, size - 4 - vendor_length, p); + p += 4; + + attr = elf_known_obj_attributes (abfd)[vendor]; + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + p = write_obj_attribute (p, i, &attr[i]); + + for (list = elf_other_obj_attributes (abfd)[vendor]; + list; + list = list->next) + p = write_obj_attribute (p, list->tag, &list->attr); +} + +/* Write the contents of the object attributes section to CONTENTS. */ +void +bfd_elf_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size) +{ + bfd_byte *p; + int vendor; + bfd_vma my_size; + + p = contents; + *(p++) = 'A'; + my_size = 1; + for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) + { + bfd_vma vendor_size = vendor_obj_attr_size (abfd, vendor); + if (vendor_size) + vendor_set_obj_attr_contents (abfd, p, vendor_size, vendor); + p += vendor_size; + my_size += vendor_size; + } + + if (size != my_size) + abort (); +} + +/* Allocate/find an object attribute. */ +static obj_attribute * +elf_new_obj_attr (bfd *abfd, int vendor, int tag) +{ + obj_attribute *attr; + obj_attribute_list *list; + obj_attribute_list *p; + obj_attribute_list **lastp; + + + if (tag < NUM_KNOWN_OBJ_ATTRIBUTES) + { + /* Knwon tags are preallocated. */ + attr = &elf_known_obj_attributes (abfd)[vendor][tag]; + } + else + { + /* Create a new tag. */ + list = (obj_attribute_list *) + bfd_alloc (abfd, sizeof (obj_attribute_list)); + memset (list, 0, sizeof (obj_attribute_list)); + list->tag = tag; + /* Keep the tag list in order. */ + lastp = &elf_other_obj_attributes (abfd)[vendor]; + for (p = *lastp; p; p = p->next) + { + if (tag < p->tag) + break; + lastp = &p->next; + } + list->next = *lastp; + *lastp = list; + attr = &list->attr; + } + + return attr; +} + +/* Return the value of an integer object attribute. */ +int +bfd_elf_get_obj_attr_int (bfd *abfd, int vendor, int tag) +{ + obj_attribute_list *p; + + if (tag < NUM_KNOWN_OBJ_ATTRIBUTES) + { + /* Knwon tags are preallocated. */ + return elf_known_obj_attributes (abfd)[vendor][tag].i; + } + else + { + for (p = elf_other_obj_attributes (abfd)[vendor]; + p; + p = p->next) + { + if (tag == p->tag) + return p->attr.i; + if (tag < p->tag) + break; + } + return 0; + } +} + +/* Add an integer object attribute. */ +void +bfd_elf_add_obj_attr_int (bfd *abfd, int vendor, int tag, unsigned int i) +{ + obj_attribute *attr; + + attr = elf_new_obj_attr (abfd, vendor, tag); + attr->type = 1; + attr->i = i; +} + +/* Duplicate an object attribute string value. */ +char * +_bfd_elf_attr_strdup (bfd *abfd, const char * s) +{ + char * p; + int len; + + len = strlen (s) + 1; + p = (char *) bfd_alloc (abfd, len); + return memcpy (p, s, len); +} + +/* Add a string object attribute. */ +void +bfd_elf_add_obj_attr_string (bfd *abfd, int vendor, int tag, const char *s) +{ + obj_attribute *attr; + + attr = elf_new_obj_attr (abfd, vendor, tag); + attr->type = 2; + attr->s = _bfd_elf_attr_strdup (abfd, s); +} + +/* Add a Tag_compatibility object attribute. */ +void +bfd_elf_add_obj_attr_compat (bfd *abfd, int vendor, unsigned int i, + const char *s) +{ + obj_attribute_list *list; + obj_attribute_list *p; + obj_attribute_list **lastp; + + list = (obj_attribute_list *) + bfd_alloc (abfd, sizeof (obj_attribute_list)); + memset (list, 0, sizeof (obj_attribute_list)); + list->tag = Tag_compatibility; + list->attr.type = 3; + list->attr.i = i; + list->attr.s = _bfd_elf_attr_strdup (abfd, s); + + lastp = &elf_other_obj_attributes (abfd)[vendor]; + for (p = *lastp; p; p = p->next) + { + int cmp; + if (p->tag != Tag_compatibility) + break; + cmp = strcmp(s, p->attr.s); + if (cmp < 0 || (cmp == 0 && i < p->attr.i)) + break; + lastp = &p->next; + } + list->next = *lastp; + *lastp = list; +} + +/* Copy the object attributes from IBFD to OBFD. */ +void +_bfd_elf_copy_obj_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + obj_attribute_list *list; + int i; + int vendor; + + for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) + { + in_attr = &elf_known_obj_attributes (ibfd)[vendor][4]; + out_attr = &elf_known_obj_attributes (obfd)[vendor][4]; + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + { + out_attr->type = in_attr->type; + out_attr->i = in_attr->i; + if (in_attr->s && *in_attr->s) + out_attr->s = _bfd_elf_attr_strdup (obfd, in_attr->s); + in_attr++; + out_attr++; + } + + for (list = elf_other_obj_attributes (ibfd)[vendor]; + list; + list = list->next) + { + in_attr = &list->attr; + switch (in_attr->type) + { + case 1: + bfd_elf_add_obj_attr_int (obfd, vendor, list->tag, in_attr->i); + break; + case 2: + bfd_elf_add_obj_attr_string (obfd, vendor, list->tag, + in_attr->s); + break; + case 3: + bfd_elf_add_obj_attr_compat (obfd, vendor, in_attr->i, + in_attr->s); + break; + default: + abort (); + } + } + } +} + +/* Determine whether a GNU object attribute tag takes an integer, a + string or both. */ +static int +gnu_obj_attrs_arg_type (int tag) +{ + /* Except for Tag_compatibility, for GNU attributes we follow the + same rule ARM ones > 32 follow: odd-numbered tags take strings + and even-numbered tags take integers. In addition, tag & 2 is + nonzero for architecture-independent tags and zero for + architecture-dependent ones. */ + if (tag == Tag_compatibility) + return 3; + else + return (tag & 1) != 0 ? 2 : 1; +} + +/* Determine what arguments an attribute tag takes. */ +int +_bfd_elf_obj_attrs_arg_type (bfd *abfd, int vendor, int tag) +{ + switch (vendor) + { + case OBJ_ATTR_PROC: + return get_elf_backend_data (abfd)->obj_attrs_arg_type (tag); + break; + case OBJ_ATTR_GNU: + return gnu_obj_attrs_arg_type (tag); + break; + default: + abort (); + } +} + +/* Parse an object attributes section. */ +void +_bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) +{ + bfd_byte *contents; + bfd_byte *p; + bfd_vma len; + const char *std_section; + + contents = bfd_malloc (hdr->sh_size); + if (!contents) + return; + if (!bfd_get_section_contents (abfd, hdr->bfd_section, contents, 0, + hdr->sh_size)) + { + free (contents); + return; + } + p = contents; + std_section = get_elf_backend_data (abfd)->obj_attrs_vendor; + if (*(p++) == 'A') + { + len = hdr->sh_size - 1; + while (len > 0) + { + int namelen; + bfd_vma section_len; + int vendor; + + section_len = bfd_get_32 (abfd, p); + p += 4; + if (section_len > len) + section_len = len; + len -= section_len; + namelen = strlen ((char *)p) + 1; + section_len -= namelen + 4; + if (std_section && strcmp ((char *)p, std_section) == 0) + vendor = OBJ_ATTR_PROC; + else if (strcmp ((char *)p, "gnu") == 0) + vendor = OBJ_ATTR_GNU; + else + { + /* Other vendor section. Ignore it. */ + p += namelen + section_len; + continue; + } + + p += namelen; + while (section_len > 0) + { + int tag; + unsigned int n; + unsigned int val; + bfd_vma subsection_len; + bfd_byte *end; + + tag = read_unsigned_leb128 (abfd, p, &n); + p += n; + subsection_len = bfd_get_32 (abfd, p); + p += 4; + if (subsection_len > section_len) + subsection_len = section_len; + section_len -= subsection_len; + subsection_len -= n + 4; + end = p + subsection_len; + switch (tag) + { + case Tag_File: + while (p < end) + { + int type; + + tag = read_unsigned_leb128 (abfd, p, &n); + p += n; + type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); + switch (type) + { + case 3: + val = read_unsigned_leb128 (abfd, p, &n); + p += n; + bfd_elf_add_obj_attr_compat (abfd, vendor, val, + (char *)p); + p += strlen ((char *)p) + 1; + break; + case 2: + bfd_elf_add_obj_attr_string (abfd, vendor, tag, + (char *)p); + p += strlen ((char *)p) + 1; + break; + case 1: + val = read_unsigned_leb128 (abfd, p, &n); + p += n; + bfd_elf_add_obj_attr_int (abfd, vendor, tag, val); + break; + default: + abort (); + } + } + break; + case Tag_Section: + case Tag_Symbol: + /* Don't have anywhere convenient to attach these. + Fall through for now. */ + default: + /* Ignore things we don't kow about. */ + p += subsection_len; + subsection_len = 0; + break; + } + } + } + } + free (contents); +} + +/* Merge common object attributes from IBFD into OBFD. Raise an error + if there are conflicting attributes. Any processor-specific + attributes have already been merged. This must be called from the + bfd_elfNN_bfd_merge_private_bfd_data hook for each individual + target, along with any target-specific merging. Because there are + no common attributes other than Tag_compatibility at present, and + non-"gnu" Tag_compatibility is not expected in "gnu" sections, this + is not presently called for targets without their own + attributes. */ + +bfd_boolean +_bfd_elf_merge_object_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + obj_attribute_list *in_list; + obj_attribute_list *out_list; + int vendor; + + /* The only common attribute is currently Tag_compatibility, + accepted in both processor and "gnu" sections. */ + for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) + { + in_list = elf_other_obj_attributes (ibfd)[vendor]; + out_list = elf_other_obj_attributes (ibfd)[vendor]; + while (in_list && in_list->tag == Tag_compatibility) + { + in_attr = &in_list->attr; + if (in_attr->i == 0) + continue; + if (in_attr->i == 1 && strcmp (in_attr->s, "gnu") != 0) + { + _bfd_error_handler + (_("ERROR: %B: Must be processed by '%s' toolchain"), + ibfd, in_attr->s); + return FALSE; + } + if (!out_list || out_list->tag != Tag_compatibility + || strcmp (in_attr->s, out_list->attr.s) != 0) + { + /* Add this compatibility tag to the output. */ + bfd_elf_add_proc_attr_compat (obfd, in_attr->i, in_attr->s); + continue; + } + out_attr = &out_list->attr; + /* Check all the input tags with the same identifier. */ + for (;;) + { + if (out_list->tag != Tag_compatibility + || in_attr->i != out_attr->i + || strcmp (in_attr->s, out_attr->s) != 0) + { + _bfd_error_handler + (_("ERROR: %B: Incompatible object tag '%s':%d"), + ibfd, in_attr->s, in_attr->i); + return FALSE; + } + in_list = in_list->next; + if (in_list->tag != Tag_compatibility + || strcmp (in_attr->s, in_list->attr.s) != 0) + break; + in_attr = &in_list->attr; + out_list = out_list->next; + if (out_list) + out_attr = &out_list->attr; + } + + /* Check the output doesn't have extra tags with this identifier. */ + if (out_list && out_list->tag == Tag_compatibility + && strcmp (in_attr->s, out_list->attr.s) == 0) + { + _bfd_error_handler + (_("ERROR: %B: Incompatible object tag '%s':%d"), + ibfd, in_attr->s, out_list->attr.i); + return FALSE; + } + } + } + + return TRUE; +} diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h index 3fba1c228f0..f4c3a0a3203 100644 --- a/contrib/binutils/bfd/elf-bfd.h +++ b/contrib/binutils/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -155,6 +155,8 @@ struct elf_link_hash_entry unsigned int hidden : 1; /* Symbol was forced to local scope due to a version script file. */ unsigned int forced_local : 1; + /* Symbol was forced to be dynamic due to a version script file. */ + unsigned int dynamic : 1; /* Symbol was marked during garbage collection. */ unsigned int mark : 1; /* Symbol is referenced by a non-GOT/non-PLT relocation. This is @@ -259,31 +261,6 @@ struct elf_link_loaded_list }; /* Structures used by the eh_frame optimization code. */ -struct cie_header -{ - unsigned int length; - unsigned int id; -}; - -struct cie -{ - struct cie_header hdr; - unsigned char version; - char augmentation[20]; - bfd_vma code_align; - bfd_signed_vma data_align; - bfd_vma ra_column; - bfd_vma augmentation_size; - struct elf_link_hash_entry *personality; - unsigned char per_encoding; - unsigned char lsda_encoding; - unsigned char fde_encoding; - unsigned char initial_insn_length; - unsigned char make_relative; - unsigned char make_lsda_relative; - unsigned char initial_instructions[50]; -}; - struct eh_cie_fde { /* For FDEs, this points to the CIE used. */ @@ -302,12 +279,12 @@ struct eh_cie_fde unsigned int make_lsda_relative : 1; unsigned int need_lsda_relative : 1; unsigned int per_encoding_relative : 1; + unsigned int *set_loc; }; struct eh_frame_sec_info { unsigned int count; - unsigned int alloced; struct eh_cie_fde entry[1]; }; @@ -317,11 +294,11 @@ struct eh_frame_array_ent bfd_vma fde; }; +struct htab; + struct eh_frame_hdr_info { - struct cie last_cie; - asection *last_cie_sec; - struct eh_cie_fde *last_cie_inf; + struct htab *cies; asection *hdr_sec; unsigned int fde_count, array_count; struct eh_frame_array_ent *array; @@ -342,6 +319,10 @@ struct elf_link_hash_table when linking against or generating a shared object. */ bfd_boolean dynamic_sections_created; + /* True if this target has relocatable executables, so needs dynamic + section symbols. */ + bfd_boolean is_relocatable_executable; + /* The BFD used to hold special sections created by the linker. This will be the first BFD found which requires these sections to be created. */ @@ -375,6 +356,12 @@ struct elf_link_hash_table included in the link. */ struct bfd_link_needed_list *needed; + /* Sections in the output bfd that provides a section symbol + to be used by relocations emitted against local symbols. + Most targets will not use data_index_section. */ + asection *text_index_section; + asection *data_index_section; + /* The _GLOBAL_OFFSET_TABLE_ symbol. */ struct elf_link_hash_entry *hgot; @@ -403,10 +390,6 @@ struct elf_link_hash_table /* A linked list of BFD's loaded in the link. */ struct elf_link_loaded_list *loaded; - - /* True if this target has relocatable executables, so needs dynamic - section symbols. */ - bfd_boolean is_relocatable_executable; }; /* Look up an entry in an ELF linker hash table. */ @@ -466,7 +449,7 @@ struct elf_size_info { (*write_shdrs_and_ehdr) (bfd *); void (*write_relocs) (bfd *, asection *, void *); - void (*swap_symbol_in) + bfd_boolean (*swap_symbol_in) (bfd *, const void *, const void *, Elf_Internal_Sym *); void (*swap_symbol_out) (bfd *, const Elf_Internal_Sym *, void *, void *); @@ -555,6 +538,10 @@ enum action_discarded PRETEND = 2 }; +typedef asection * (*elf_gc_mark_hook_fn) + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); + struct elf_backend_data { /* The architecture for this backend. */ @@ -563,6 +550,9 @@ struct elf_backend_data /* The ELF machine code (EM_xxxx) for this backend. */ int elf_machine_code; + /* EI_OSABI. */ + int elf_osabi; + /* The maximum page size for this backend. */ bfd_vma maxpagesize; @@ -571,6 +561,9 @@ struct elf_backend_data pages at least this large. May be smaller than maxpagesize. */ bfd_vma minpagesize; + /* The common page size for this backend. */ + bfd_vma commonpagesize; + /* The BFD flags applied to sections created for dynamic linking. */ flagword dynamic_sec_flags; @@ -725,6 +718,13 @@ struct elf_backend_data bfd_boolean (*check_directives) (bfd *abfd, struct bfd_link_info *info); + /* The AS_NEEDED_CLEANUP function is called once per --as-needed + input file that was not needed by the add_symbols phase of the + ELF backend linker. The function must undo any target specific + changes in the symbol hash table. */ + bfd_boolean (*as_needed_cleanup) + (bfd *abfd, struct bfd_link_info *info); + /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend linker for every symbol which is defined by a dynamic object and referenced by a regular object. This is called after all the @@ -760,6 +760,11 @@ struct elf_backend_data bfd_boolean (*elf_backend_size_dynamic_sections) (bfd *output_bfd, struct bfd_link_info *info); + /* Set TEXT_INDEX_SECTION and DATA_INDEX_SECTION, the output sections + we keep to use as a base for relocs and symbols. */ + void (*elf_backend_init_index_section) + (bfd *output_bfd, struct bfd_link_info *info); + /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -787,8 +792,11 @@ struct elf_backend_data STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted - accordingly. */ - bfd_boolean (*elf_backend_relocate_section) + accordingly. + + Returns FALSE on error, TRUE on success, 2 if successful and + relocations should be written for this section. */ + int (*elf_backend_relocate_section) (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, asection **local_sections); @@ -826,13 +834,18 @@ struct elf_backend_data return the number of additional program segments which this BFD will need. It should return -1 on error. */ int (*elf_backend_additional_program_headers) - (bfd *); + (bfd *, struct bfd_link_info *); /* This function is called to modify an existing segment map in a backend specific fashion. */ bfd_boolean (*elf_backend_modify_segment_map) (bfd *, struct bfd_link_info *); + /* This function is called to modify program headers just before + they are written. */ + bfd_boolean (*elf_backend_modify_program_headers) + (bfd *, struct bfd_link_info *); + /* This function is called during section garbage collection to mark sections that define global symbols. */ bfd_boolean (*gc_mark_dynamic_ref) @@ -840,9 +853,12 @@ struct elf_backend_data /* This function is called during section gc to discover the section a particular relocation refers to. */ - asection * (*gc_mark_hook) - (asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *h, Elf_Internal_Sym *); + elf_gc_mark_hook_fn gc_mark_hook; + + /* This function, if defined, is called after the first gc marking pass + to allow the backend to mark additional sections. */ + bfd_boolean (*gc_mark_extra_sections) + (struct bfd_link_info *info, elf_gc_mark_hook_fn gc_mark_hook); /* This function, if defined, is called during the sweep phase of gc in order that a backend might update any data structures it might @@ -865,8 +881,16 @@ struct elf_backend_data /* This function, if defined, is called after all local symbols and global symbols converted to locals are emitted into the symtab - section. It allows the backend to emit special global symbols + section. It allows the backend to emit special local symbols not handled in the hash table. */ + bfd_boolean (*elf_backend_output_arch_local_syms) + (bfd *, struct bfd_link_info *, void *, + bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *)); + + /* This function, if defined, is called after all symbols are emitted + into the symtab section. It allows the backend to emit special + global symbols not handled in the hash table. */ bfd_boolean (*elf_backend_output_arch_syms) (bfd *, struct bfd_link_info *, void *, bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *, @@ -913,15 +937,19 @@ struct elf_backend_data (asection *, Elf_Internal_Rela *); /* This function, if defined, is called when an NT_PRSTATUS note is found - in a core file. */ + in a core file. */ bfd_boolean (*elf_backend_grok_prstatus) (bfd *, Elf_Internal_Note *); /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO - note is found in a core file. */ + note is found in a core file. */ bfd_boolean (*elf_backend_grok_psinfo) (bfd *, Elf_Internal_Note *); + /* This function, if defined, is called to write a note to a corefile. */ + char *(*elf_backend_write_core_note) + (bfd *abfd, char *buf, int *bufsiz, int note_type, ...); + /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ void (* elf_backend_sprintf_vma) (bfd *, char *, bfd_vma); @@ -974,7 +1002,7 @@ struct elf_backend_data /* This function, if defined, may write out the given section. Returns TRUE if it did so and FALSE if the caller should. */ bfd_boolean (*elf_backend_write_section) - (bfd *, asection *, bfd_byte *); + (bfd *, struct bfd_link_info *, asection *, bfd_byte *); /* The level of IRIX compatibility we're striving for. MIPS ELF specific function. */ @@ -1022,6 +1050,12 @@ struct elf_backend_data bfd_boolean *, bfd_boolean *, bfd *, asection **); + /* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + bfd_boolean (*elf_hash_symbol) (struct elf_link_hash_entry *); + + /* Return TRUE if type is a function symbol type. */ + bfd_boolean (*is_function_type) (unsigned int type); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -1041,6 +1075,19 @@ struct elf_backend_data so-called reserved entries on some systems. */ bfd_vma got_header_size; + /* The vendor name to use for a processor-standard attributes section. */ + const char *obj_attrs_vendor; + + /* The section name to use for a processor-standard attributes section. */ + const char *obj_attrs_section; + + /* Return 1, 2 or 3 to indicate what type of arguments a + processor-specific tag takes. */ + int (*obj_attrs_arg_type) (int); + + /* The section type to use for an attributes section. */ + unsigned int obj_attrs_section_type; + /* This is TRUE if the linker should act like collect and gather global constructors and destructors by name. This is TRUE for MIPS ELF because the Irix 5 tools can not handle the .init @@ -1088,10 +1135,17 @@ struct elf_backend_data unsigned can_refcount : 1; unsigned want_got_sym : 1; unsigned want_dynbss : 1; - /* Targets which do not support physical addressing often require - that the p_paddr field in the section header to be set to zero. - This field indicates whether this behavior is required. */ + + /* Targets which do not support physical addressing often require + that the p_paddr field in the section header to be set to zero. + This field indicates whether this behavior is required. */ unsigned want_p_paddr_set_to_zero : 1; + + /* True if an object file lacking a .note.GNU-stack section + should be assumed to be requesting exec stack. At least one + other file in the link needs to have a .note.GNU-stack section + for a PT_GNU_STACK segment to be created. */ + unsigned default_execstack : 1; }; /* Information stored for each BFD section in an ELF file. This @@ -1160,12 +1214,12 @@ struct bfd_elf_section_data struct bfd_symbol *id; } group; - /* Optional information about section group; NULL if it doesn't - belongs to any section group. */ + /* For a member of a group, points to the SHT_GROUP section. + NULL for the SHT_GROUP section itself and non-group sections. */ asection *sec_group; - /* A linked list of sections in the group. Circular when used by - the linker. */ + /* A linked list of member sections in the group. Circular when used by + the linker. For the SHT_GROUP section, points at first member. */ asection *next_in_group; /* A pointer used for various section optimizations. */ @@ -1181,15 +1235,11 @@ struct bfd_elf_section_data #define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) #define elf_sec_group(sec) (elf_section_data(sec)->sec_group) -/* Return TRUE if section has been discarded. */ -#define elf_discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) +#define xvec_get_elf_backend_data(xvec) \ + ((struct elf_backend_data *) (xvec)->backend_data) #define get_elf_backend_data(abfd) \ - ((const struct elf_backend_data *) (abfd)->xvec->backend_data) + xvec_get_elf_backend_data ((abfd)->xvec) /* This struct is used to pass information to routines called via elf_link_hash_traverse which must return failure. */ @@ -1231,6 +1281,46 @@ struct elf_find_verdep_info bfd_boolean failed; }; +/* The maximum number of known object attributes for any target. */ +#define NUM_KNOWN_OBJ_ATTRIBUTES 32 + +/* The value of an object attribute. type & 1 indicates whether there + is an integer value; type & 2 indicates whether there is a string + value. */ + +typedef struct obj_attribute +{ + int type; + unsigned int i; + char *s; +} obj_attribute; + +typedef struct obj_attribute_list +{ + struct obj_attribute_list *next; + int tag; + obj_attribute attr; +} obj_attribute_list; + +/* Object attributes may either be defined by the processor ABI, index + OBJ_ATTR_PROC in the *_obj_attributes arrays, or be GNU-specific + (and possibly also processor-specific), index OBJ_ATTR_GNU. */ +#define OBJ_ATTR_PROC 0 +#define OBJ_ATTR_GNU 1 +#define OBJ_ATTR_FIRST OBJ_ATTR_PROC +#define OBJ_ATTR_LAST OBJ_ATTR_GNU + +/* The following object attribute tags are taken as generic, for all + targets and for "gnu" where there is no target standard. */ +enum +{ + Tag_NULL = 0, + Tag_File = 1, + Tag_Section = 2, + Tag_Symbol = 3, + Tag_compatibility = 32 +}; + /* Some private data is stashed away for future use using the tdata pointer in the bfd structure. */ @@ -1317,6 +1407,7 @@ struct elf_obj_tdata MIPS ELF linker. FIXME: We should figure out some way to only include this field for a MIPS ELF target. */ asection **local_stubs; + asection **local_call_stubs; /* Used to determine if PT_GNU_EH_FRAME segment header should be created. */ @@ -1368,6 +1459,12 @@ struct elf_obj_tdata /* Used to determine if the e_flags field has been initialized */ bfd_boolean flags_init; + + /* Symbol buffer. */ + void *symbuf; + + obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES]; + obj_attribute_list *other_obj_attributes[2]; }; #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) @@ -1397,6 +1494,12 @@ struct elf_obj_tdata #define elf_dyn_lib_class(bfd) (elf_tdata(bfd) -> dyn_lib_class) #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab) #define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init) +#define elf_known_obj_attributes(bfd) (elf_tdata (bfd) -> known_obj_attributes) +#define elf_other_obj_attributes(bfd) (elf_tdata (bfd) -> other_obj_attributes) +#define elf_known_obj_attributes_proc(bfd) \ + (elf_known_obj_attributes (bfd) [OBJ_ATTR_PROC]) +#define elf_other_obj_attributes_proc(bfd) \ + (elf_other_obj_attributes (bfd) [OBJ_ATTR_PROC]) extern void _bfd_elf_swap_verdef_in (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *); @@ -1462,6 +1565,8 @@ extern bfd_vma _bfd_elf_section_offset extern unsigned long bfd_elf_hash (const char *); +extern unsigned long bfd_elf_gnu_hash + (const char *); extern bfd_reloc_status_type bfd_elf_generic_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); @@ -1500,11 +1605,11 @@ extern bfd_boolean _bfd_elf_match_sections_by_type extern bfd_boolean bfd_elf_is_group_section (bfd *, const struct bfd_section *); extern void _bfd_elf_section_already_linked - (bfd *, struct bfd_section *); + (bfd *, struct bfd_section *, struct bfd_link_info *); extern void bfd_elf_set_group_contents (bfd *, asection *, void *); extern asection *_bfd_elf_check_kept_section - (asection *); + (asection *, struct bfd_link_info *); extern void _bfd_elf_link_just_syms (asection *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_copy_private_header_data @@ -1562,7 +1667,7 @@ extern bfd_boolean _bfd_elf_find_inliner_info #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_new_section_hook (bfd *, asection *); extern bfd_boolean _bfd_elf_init_reloc_shdr @@ -1632,6 +1737,8 @@ extern bfd_boolean _bfd_elf_merge_symbol struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *, bfd_boolean *, bfd_boolean *); +extern bfd_boolean _bfd_elf_hash_symbol (struct elf_link_hash_entry *); + extern bfd_boolean _bfd_elf_add_default_symbol (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, const char *, Elf_Internal_Sym *, asection **, bfd_vma *, @@ -1668,6 +1775,10 @@ extern bfd_boolean _bfd_elf_create_got_section (bfd *, struct bfd_link_info *); extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym (bfd *, struct bfd_link_info *, asection *, const char *); +extern void _bfd_elf_init_1_index_section + (bfd *, struct bfd_link_info *); +extern void _bfd_elf_init_2_index_sections + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elfcore_make_pseudosection (bfd *, char *, size_t, ufile_ptr); @@ -1690,6 +1801,9 @@ extern bfd_boolean _bfd_elf_fix_symbol_flags extern bfd_boolean _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *, void *); +extern bfd_boolean _bfd_elf_adjust_dynamic_copy + (struct elf_link_hash_entry *, asection *); + extern bfd_boolean _bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *, void *); @@ -1700,11 +1814,23 @@ extern bfd_boolean _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); extern bfd_boolean bfd_elf_match_symbols_in_sections - (asection *sec1, asection *sec2); + (asection *, asection *, struct bfd_link_info *); + +extern void bfd_elf_perform_complex_relocation + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + Elf_Internal_Sym * local_syms, + asection ** local_sections); extern bfd_boolean _bfd_elf_setup_sections (bfd *); +extern void _bfd_elf_set_osabi (bfd * , struct bfd_link_info *); + extern const bfd_target *bfd_elf32_object_p (bfd *); extern const bfd_target *bfd_elf32_core_file_p @@ -1716,7 +1842,7 @@ extern int bfd_elf32_core_file_failing_signal extern bfd_boolean bfd_elf32_core_file_matches_executable_p (bfd *, bfd *); -extern void bfd_elf32_swap_symbol_in +extern bfd_boolean bfd_elf32_swap_symbol_in (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf32_swap_symbol_out (bfd *, const Elf_Internal_Sym *, void *, void *); @@ -1758,7 +1884,7 @@ extern int bfd_elf64_core_file_failing_signal extern bfd_boolean bfd_elf64_core_file_matches_executable_p (bfd *, bfd *); -extern void bfd_elf64_swap_symbol_in +extern bfd_boolean bfd_elf64_swap_symbol_in (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf64_swap_symbol_out (bfd *, const Elf_Internal_Sym *, void *, void *); @@ -1802,6 +1928,10 @@ extern bfd_boolean bfd_elf_link_record_dynamic_symbol extern int bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *, bfd *, long); +extern void bfd_elf_link_mark_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *); + extern bfd_boolean _bfd_elf_close_and_cleanup (bfd *); @@ -1836,6 +1966,10 @@ extern bfd_boolean bfd_elf_gc_record_vtinherit extern bfd_boolean bfd_elf_gc_record_vtentry (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); +extern asection *_bfd_elf_gc_mark_hook + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); + extern bfd_boolean _bfd_elf_gc_mark (struct bfd_link_info *, asection *, asection * (*) (asection *, struct bfd_link_info *, Elf_Internal_Rela *, @@ -1850,10 +1984,14 @@ extern bfd_boolean bfd_elf_gc_common_final_link extern bfd_boolean bfd_elf_reloc_symbol_deleted_p (bfd_vma, void *); -extern struct elf_segment_map * -_bfd_elf_make_dynamic_segment +extern struct elf_segment_map * _bfd_elf_make_dynamic_segment (bfd *, asection *); +extern bfd_boolean _bfd_elf_map_sections_to_segments + (bfd *, struct bfd_link_info *); + +extern bfd_boolean _bfd_elf_is_function_type (unsigned int); + /* Exported interface for writing elf corefile notes. */ extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); @@ -1877,6 +2015,26 @@ extern bfd *_bfd_elf64_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma, bfd_byte *, int)); +extern bfd_vma bfd_elf_obj_attr_size (bfd *); +extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma); +extern int bfd_elf_get_obj_attr_int (bfd *, int, int); +extern void bfd_elf_add_obj_attr_int (bfd *, int, int, unsigned int); +#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \ + bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE)) +extern void bfd_elf_add_obj_attr_string (bfd *, int, int, const char *); +#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \ + bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE)) +extern void bfd_elf_add_obj_attr_compat (bfd *, int, unsigned int, + const char *); +#define bfd_elf_add_proc_attr_compat(BFD, INTVAL, STRVAL) \ + bfd_elf_add_obj_attr_compat ((BFD), OBJ_ATTR_PROC, (INTVAL), (STRVAL)) + +extern char *_bfd_elf_attr_strdup (bfd *, const char *); +extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *); +extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, int); +extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *); +extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *); + /* Large common section. */ extern asection _bfd_elf_large_com_section; @@ -1936,7 +2094,7 @@ extern bfd_boolean _sh_elf_set_mach_from_flags else if (info->unresolved_syms_in_objects == RM_IGNORE \ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \ ; \ - else \ + else if (!info->relocatable) \ { \ bfd_boolean err; \ err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \ @@ -1952,4 +2110,9 @@ extern bfd_boolean _sh_elf_set_mach_from_flags } \ while (0) +/* Will a symbol be bound to the the definition within the shared + library, if any. */ +#define SYMBOLIC_BIND(INFO, H) \ + ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic)) + #endif /* _LIBELF_H_ */ diff --git a/contrib/binutils/bfd/elf-eh-frame.c b/contrib/binutils/bfd/elf-eh-frame.c index 5100e72938d..092c2c57ec3 100644 --- a/contrib/binutils/bfd/elf-eh-frame.c +++ b/contrib/binutils/bfd/elf-eh-frame.c @@ -1,5 +1,6 @@ /* .eh_frame section optimization. - Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -18,14 +19,42 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/dwarf2.h" #define EH_FRAME_HDR_SIZE 8 +struct cie +{ + unsigned int length; + unsigned int hash; + unsigned char version; + unsigned char local_personality; + char augmentation[20]; + bfd_vma code_align; + bfd_signed_vma data_align; + bfd_vma ra_column; + bfd_vma augmentation_size; + union { + struct elf_link_hash_entry *h; + bfd_vma val; + } personality; + asection *output_sec; + struct eh_cie_fde *cie_inf; + unsigned char per_encoding; + unsigned char lsda_encoding; + unsigned char fde_encoding; + unsigned char initial_insn_length; + unsigned char make_relative; + unsigned char make_lsda_relative; + unsigned char initial_instructions[50]; +}; + + + /* If *ITER hasn't reached END yet, read the next byte into *RESULT and move onto the next byte. Return true on success. */ @@ -180,20 +209,27 @@ write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width) } } -/* Return zero if C1 and C2 CIEs can be merged. */ +/* Return one if C1 and C2 CIEs can be merged. */ -static -int cie_compare (struct cie *c1, struct cie *c2) +static int +cie_eq (const void *e1, const void *e2) { - if (c1->hdr.length == c2->hdr.length + const struct cie *c1 = e1; + const struct cie *c2 = e2; + + if (c1->hash == c2->hash + && c1->length == c2->length && c1->version == c2->version + && c1->local_personality == c2->local_personality && strcmp (c1->augmentation, c2->augmentation) == 0 && strcmp (c1->augmentation, "eh") != 0 && c1->code_align == c2->code_align && c1->data_align == c2->data_align && c1->ra_column == c2->ra_column && c1->augmentation_size == c2->augmentation_size - && c1->personality == c2->personality + && memcmp (&c1->personality, &c2->personality, + sizeof (c1->personality)) == 0 + && c1->output_sec == c2->output_sec && c1->per_encoding == c2->per_encoding && c1->lsda_encoding == c2->lsda_encoding && c1->fde_encoding == c2->fde_encoding @@ -201,9 +237,38 @@ int cie_compare (struct cie *c1, struct cie *c2) && memcmp (c1->initial_instructions, c2->initial_instructions, c1->initial_insn_length) == 0) - return 0; + return 1; - return 1; + return 0; +} + +static hashval_t +cie_hash (const void *e) +{ + const struct cie *c = e; + return c->hash; +} + +static hashval_t +cie_compute_hash (struct cie *c) +{ + hashval_t h = 0; + h = iterative_hash_object (c->length, h); + h = iterative_hash_object (c->version, h); + h = iterative_hash (c->augmentation, strlen (c->augmentation) + 1, h); + h = iterative_hash_object (c->code_align, h); + h = iterative_hash_object (c->data_align, h); + h = iterative_hash_object (c->ra_column, h); + h = iterative_hash_object (c->augmentation_size, h); + h = iterative_hash_object (c->personality, h); + h = iterative_hash_object (c->output_sec, h); + h = iterative_hash_object (c->per_encoding, h); + h = iterative_hash_object (c->lsda_encoding, h); + h = iterative_hash_object (c->fde_encoding, h); + h = iterative_hash_object (c->initial_insn_length, h); + h = iterative_hash (c->initial_instructions, c->initial_insn_length, h); + c->hash = h; + return h; } /* Return the number of extra bytes that we'll be inserting into @@ -273,11 +338,14 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) if (!read_byte (iter, end, &op)) return FALSE; - switch (op & 0x80 ? op & 0xc0 : op) + switch (op & 0xc0 ? op & 0xc0 : op) { case DW_CFA_nop: case DW_CFA_advance_loc: case DW_CFA_restore: + case DW_CFA_remember_state: + case DW_CFA_restore_state: + case DW_CFA_GNU_window_save: /* No arguments. */ return TRUE; @@ -292,6 +360,8 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) /* One leb128 argument. */ return skip_leb128 (iter, end); + case DW_CFA_val_offset: + case DW_CFA_val_offset_sf: case DW_CFA_offset_extended: case DW_CFA_register: case DW_CFA_def_cfa: @@ -308,6 +378,7 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) && skip_bytes (iter, end, length)); case DW_CFA_expression: + case DW_CFA_val_expression: /* A leb128 followed by a variable-length argument. */ return (skip_leb128 (iter, end) && read_uleb128 (iter, end, &length) @@ -339,7 +410,8 @@ skip_cfa_op (bfd_byte **iter, bfd_byte *end, unsigned int encoded_ptr_width) ENCODED_PTR_WIDTH is as for skip_cfa_op. */ static bfd_byte * -skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width) +skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width, + unsigned int *set_loc_count) { bfd_byte *last; @@ -349,6 +421,8 @@ skip_non_nops (bfd_byte *buf, bfd_byte *end, unsigned int encoded_ptr_width) buf++; else { + if (*buf == DW_CFA_set_loc) + ++*set_loc_count; if (!skip_cfa_op (&buf, end, encoded_ptr_width)) return 0; last = buf; @@ -374,15 +448,24 @@ _bfd_elf_discard_section_eh_frame while (0) bfd_byte *ehbuf = NULL, *buf; - bfd_byte *last_cie, *last_fde; - struct eh_cie_fde *ent, *last_cie_inf, *this_inf; - struct cie_header hdr; - struct cie cie; + bfd_byte *last_fde; + struct eh_cie_fde *ent, *this_inf; + unsigned int hdr_length, hdr_id; + struct extended_cie + { + struct cie cie; + unsigned int offset; + unsigned int usage_count; + unsigned int entry; + } *ecies = NULL, *ecie; + unsigned int ecie_count = 0, ecie_alloced = 0; + struct cie *cie; struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; struct eh_frame_sec_info *sec_info = NULL; - unsigned int cie_usage_count, offset; + unsigned int offset; unsigned int ptr_size; + unsigned int entry_alloced; if (sec->size == 0) { @@ -390,8 +473,7 @@ _bfd_elf_discard_section_eh_frame return FALSE; } - if ((sec->output_section != NULL - && bfd_is_abs_section (sec->output_section))) + if (bfd_is_abs_section (sec->output_section)) { /* At least one of the sections is being discarded from the link, so we should just ignore them. */ @@ -401,6 +483,9 @@ _bfd_elf_discard_section_eh_frame htab = elf_hash_table (info); hdr_info = &htab->eh_info; + if (hdr_info->cies == NULL && !info->relocatable) + hdr_info->cies = htab_try_create (1, cie_hash, cie_eq, free); + /* Read the frame unwind information from abfd. */ REQUIRE (bfd_malloc_and_get_section (abfd, sec, &ehbuf)); @@ -423,15 +508,11 @@ _bfd_elf_discard_section_eh_frame REQUIRE (ptr_size != 0); buf = ehbuf; - last_cie = NULL; - last_cie_inf = NULL; - memset (&cie, 0, sizeof (cie)); - cie_usage_count = 0; sec_info = bfd_zmalloc (sizeof (struct eh_frame_sec_info) + 99 * sizeof (struct eh_cie_fde)); REQUIRE (sec_info); - sec_info->alloced = 100; + entry_alloced = 100; #define ENSURE_NO_RELOCS(buf) \ REQUIRE (!(cookie->rel < cookie->relend \ @@ -454,118 +535,84 @@ _bfd_elf_discard_section_eh_frame for (;;) { char *aug; - bfd_byte *start, *end, *insns; + bfd_byte *start, *end, *insns, *insns_end; bfd_size_type length; + unsigned int set_loc_count; - if (sec_info->count == sec_info->alloced) + if (sec_info->count == entry_alloced) { - struct eh_cie_fde *old_entry = sec_info->entry; sec_info = bfd_realloc (sec_info, sizeof (struct eh_frame_sec_info) - + ((sec_info->alloced + 99) + + ((entry_alloced + 99) * sizeof (struct eh_cie_fde))); REQUIRE (sec_info); - memset (&sec_info->entry[sec_info->alloced], 0, + memset (&sec_info->entry[entry_alloced], 0, 100 * sizeof (struct eh_cie_fde)); - sec_info->alloced += 100; - - /* Now fix any pointers into the array. */ - if (last_cie_inf >= old_entry - && last_cie_inf < old_entry + sec_info->count) - last_cie_inf = sec_info->entry + (last_cie_inf - old_entry); + entry_alloced += 100; } this_inf = sec_info->entry + sec_info->count; last_fde = buf; - /* If we are at the end of the section, we still need to decide - on whether to output or discard last encountered CIE (if any). */ + if ((bfd_size_type) (buf - ehbuf) == sec->size) + break; + + /* Read the length of the entry. */ + REQUIRE (skip_bytes (&buf, ehbuf + sec->size, 4)); + hdr_length = bfd_get_32 (abfd, buf - 4); + + /* 64-bit .eh_frame is not supported. */ + REQUIRE (hdr_length != 0xffffffff); + + /* The CIE/FDE must be fully contained in this input section. */ + REQUIRE ((bfd_size_type) (buf - ehbuf) + hdr_length <= sec->size); + end = buf + hdr_length; + + this_inf->offset = last_fde - ehbuf; + this_inf->size = 4 + hdr_length; + + if (hdr_length == 0) { - hdr.length = 0; - hdr.id = (unsigned int) -1; - end = buf; - } - else - { - /* Read the length of the entry. */ - REQUIRE (skip_bytes (&buf, ehbuf + sec->size, 4)); - hdr.length = bfd_get_32 (abfd, buf - 4); - - /* 64-bit .eh_frame is not supported. */ - REQUIRE (hdr.length != 0xffffffff); - - /* The CIE/FDE must be fully contained in this input section. */ - REQUIRE ((bfd_size_type) (buf - ehbuf) + hdr.length <= sec->size); - end = buf + hdr.length; - - this_inf->offset = last_fde - ehbuf; - this_inf->size = 4 + hdr.length; - - if (hdr.length == 0) - { - /* A zero-length CIE should only be found at the end of - the section. */ - REQUIRE ((bfd_size_type) (buf - ehbuf) == sec->size); - ENSURE_NO_RELOCS (buf); - sec_info->count++; - /* Now just finish last encountered CIE processing and break - the loop. */ - hdr.id = (unsigned int) -1; - } - else - { - REQUIRE (skip_bytes (&buf, end, 4)); - hdr.id = bfd_get_32 (abfd, buf - 4); - REQUIRE (hdr.id != (unsigned int) -1); - } + /* A zero-length CIE should only be found at the end of + the section. */ + REQUIRE ((bfd_size_type) (buf - ehbuf) == sec->size); + ENSURE_NO_RELOCS (buf); + sec_info->count++; + break; } - if (hdr.id == 0 || hdr.id == (unsigned int) -1) + REQUIRE (skip_bytes (&buf, end, 4)); + hdr_id = bfd_get_32 (abfd, buf - 4); + + if (hdr_id == 0) { unsigned int initial_insn_length; /* CIE */ - if (last_cie != NULL) - { - /* Now check if this CIE is identical to the last CIE, - in which case we can remove it provided we adjust - all FDEs. Also, it can be removed if we have removed - all FDEs using it. */ - if ((!info->relocatable - && hdr_info->last_cie_sec - && (sec->output_section - == hdr_info->last_cie_sec->output_section) - && cie_compare (&cie, &hdr_info->last_cie) == 0) - || cie_usage_count == 0) - last_cie_inf->removed = 1; - else - { - hdr_info->last_cie = cie; - hdr_info->last_cie_sec = sec; - last_cie_inf->make_relative = cie.make_relative; - last_cie_inf->make_lsda_relative = cie.make_lsda_relative; - last_cie_inf->per_encoding_relative - = (cie.per_encoding & 0x70) == DW_EH_PE_pcrel; - } - } - - if (hdr.id == (unsigned int) -1) - break; - - last_cie_inf = this_inf; this_inf->cie = 1; - cie_usage_count = 0; - memset (&cie, 0, sizeof (cie)); - cie.hdr = hdr; - REQUIRE (read_byte (&buf, end, &cie.version)); + if (ecie_count == ecie_alloced) + { + ecies = bfd_realloc (ecies, + (ecie_alloced + 20) * sizeof (*ecies)); + REQUIRE (ecies); + memset (&ecies[ecie_alloced], 0, 20 * sizeof (*ecies)); + ecie_alloced += 20; + } + + cie = &ecies[ecie_count].cie; + ecies[ecie_count].offset = this_inf->offset; + ecies[ecie_count++].entry = sec_info->count; + cie->length = hdr_length; + start = buf; + REQUIRE (read_byte (&buf, end, &cie->version)); /* Cannot handle unknown versions. */ - REQUIRE (cie.version == 1 || cie.version == 3); - REQUIRE (strlen ((char *) buf) < sizeof (cie.augmentation)); + REQUIRE (cie->version == 1 || cie->version == 3); + REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation)); - strcpy (cie.augmentation, (char *) buf); + strcpy (cie->augmentation, (char *) buf); buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1; ENSURE_NO_RELOCS (buf); if (buf[0] == 'e' && buf[1] == 'h') @@ -577,26 +624,26 @@ _bfd_elf_discard_section_eh_frame REQUIRE (skip_bytes (&buf, end, ptr_size)); SKIP_RELOCS (buf); } - REQUIRE (read_uleb128 (&buf, end, &cie.code_align)); - REQUIRE (read_sleb128 (&buf, end, &cie.data_align)); - if (cie.version == 1) + REQUIRE (read_uleb128 (&buf, end, &cie->code_align)); + REQUIRE (read_sleb128 (&buf, end, &cie->data_align)); + if (cie->version == 1) { REQUIRE (buf < end); - cie.ra_column = *buf++; + cie->ra_column = *buf++; } else - REQUIRE (read_uleb128 (&buf, end, &cie.ra_column)); + REQUIRE (read_uleb128 (&buf, end, &cie->ra_column)); ENSURE_NO_RELOCS (buf); - cie.lsda_encoding = DW_EH_PE_omit; - cie.fde_encoding = DW_EH_PE_omit; - cie.per_encoding = DW_EH_PE_omit; - aug = cie.augmentation; + cie->lsda_encoding = DW_EH_PE_omit; + cie->fde_encoding = DW_EH_PE_omit; + cie->per_encoding = DW_EH_PE_omit; + aug = cie->augmentation; if (aug[0] != 'e' || aug[1] != 'h') { if (*aug == 'z') { aug++; - REQUIRE (read_uleb128 (&buf, end, &cie.augmentation_size)); + REQUIRE (read_uleb128 (&buf, end, &cie->augmentation_size)); ENSURE_NO_RELOCS (buf); } @@ -604,14 +651,14 @@ _bfd_elf_discard_section_eh_frame switch (*aug++) { case 'L': - REQUIRE (read_byte (&buf, end, &cie.lsda_encoding)); + REQUIRE (read_byte (&buf, end, &cie->lsda_encoding)); ENSURE_NO_RELOCS (buf); - REQUIRE (get_DW_EH_PE_width (cie.lsda_encoding, ptr_size)); + REQUIRE (get_DW_EH_PE_width (cie->lsda_encoding, ptr_size)); break; case 'R': - REQUIRE (read_byte (&buf, end, &cie.fde_encoding)); + REQUIRE (read_byte (&buf, end, &cie->fde_encoding)); ENSURE_NO_RELOCS (buf); - REQUIRE (get_DW_EH_PE_width (cie.fde_encoding, ptr_size)); + REQUIRE (get_DW_EH_PE_width (cie->fde_encoding, ptr_size)); break; case 'S': break; @@ -619,18 +666,17 @@ _bfd_elf_discard_section_eh_frame { int per_width; - REQUIRE (read_byte (&buf, end, &cie.per_encoding)); - per_width = get_DW_EH_PE_width (cie.per_encoding, + REQUIRE (read_byte (&buf, end, &cie->per_encoding)); + per_width = get_DW_EH_PE_width (cie->per_encoding, ptr_size); REQUIRE (per_width); - if ((cie.per_encoding & 0xf0) == DW_EH_PE_aligned) + if ((cie->per_encoding & 0xf0) == DW_EH_PE_aligned) { length = -(buf - ehbuf) & (per_width - 1); REQUIRE (skip_bytes (&buf, end, length)); } ENSURE_NO_RELOCS (buf); - /* Ensure we have a reloc here, against - a global symbol. */ + /* Ensure we have a reloc here. */ if (GET_RELOC (buf) != NULL) { unsigned long r_symndx; @@ -641,7 +687,9 @@ _bfd_elf_discard_section_eh_frame else #endif r_symndx = ELF32_R_SYM (cookie->rel->r_info); - if (r_symndx >= cookie->locsymcount) + if (r_symndx >= cookie->locsymcount + || ELF_ST_BIND (cookie->locsyms[r_symndx] + .st_info) != STB_LOCAL) { struct elf_link_hash_entry *h; @@ -653,14 +701,39 @@ _bfd_elf_discard_section_eh_frame h = (struct elf_link_hash_entry *) h->root.u.i.link; - cie.personality = h; + cie->personality.h = h; } + else + { + Elf_Internal_Sym *sym; + asection *sym_sec; + bfd_vma val; + + sym = &cookie->locsyms[r_symndx]; + sym_sec = (bfd_section_from_elf_index + (abfd, sym->st_shndx)); + if (sym_sec != NULL) + { + if (sym_sec->kept_section != NULL) + sym_sec = sym_sec->kept_section; + if (sym_sec->output_section != NULL) + { + val = (sym->st_value + + sym_sec->output_offset + + sym_sec->output_section->vma); + cie->personality.val = val; + cie->local_personality = 1; + } + } + } + /* Cope with MIPS-style composite relocations. */ do cookie->rel++; while (GET_RELOC (buf) != NULL); } REQUIRE (skip_bytes (&buf, end, per_width)); + REQUIRE (cie->local_personality || cie->personality.h); } break; default: @@ -676,18 +749,18 @@ _bfd_elf_discard_section_eh_frame ->elf_backend_can_make_relative_eh_frame (abfd, info, sec))) { - if ((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr) - cie.make_relative = 1; + if ((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr) + cie->make_relative = 1; /* If the CIE doesn't already have an 'R' entry, it's fairly easy to add one, provided that there's no aligned data after the augmentation string. */ - else if (cie.fde_encoding == DW_EH_PE_omit - && (cie.per_encoding & 0xf0) != DW_EH_PE_aligned) + else if (cie->fde_encoding == DW_EH_PE_omit + && (cie->per_encoding & 0xf0) != DW_EH_PE_aligned) { - if (*cie.augmentation == 0) + if (*cie->augmentation == 0) this_inf->add_augmentation_size = 1; this_inf->add_fde_encoding = 1; - cie.make_relative = 1; + cie->make_relative = 1; } } @@ -695,30 +768,36 @@ _bfd_elf_discard_section_eh_frame && (get_elf_backend_data (abfd) ->elf_backend_can_make_lsda_relative_eh_frame (abfd, info, sec)) - && (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr) - cie.make_lsda_relative = 1; + && (cie->lsda_encoding & 0xf0) == DW_EH_PE_absptr) + cie->make_lsda_relative = 1; /* If FDE encoding was not specified, it defaults to DW_EH_absptr. */ - if (cie.fde_encoding == DW_EH_PE_omit) - cie.fde_encoding = DW_EH_PE_absptr; + if (cie->fde_encoding == DW_EH_PE_omit) + cie->fde_encoding = DW_EH_PE_absptr; initial_insn_length = end - buf; - if (initial_insn_length <= 50) + if (initial_insn_length <= sizeof (cie->initial_instructions)) { - cie.initial_insn_length = initial_insn_length; - memcpy (cie.initial_instructions, buf, initial_insn_length); + cie->initial_insn_length = initial_insn_length; + memcpy (cie->initial_instructions, buf, initial_insn_length); } insns = buf; buf += initial_insn_length; ENSURE_NO_RELOCS (buf); - last_cie = last_fde; } else { - /* Ensure this FDE uses the last CIE encountered. */ - REQUIRE (last_cie); - REQUIRE (hdr.id == (unsigned int) (buf - 4 - last_cie)); + /* Find the corresponding CIE. */ + unsigned int cie_offset = this_inf->offset + 4 - hdr_id; + for (ecie = ecies; ecie < ecies + ecie_count; ++ecie) + if (cie_offset == ecie->offset) + break; + + /* Ensure this FDE references one of the CIEs in this input + section. */ + REQUIRE (ecie != ecies + ecie_count); + cie = &ecie->cie; ENSURE_NO_RELOCS (buf); REQUIRE (GET_RELOC (buf)); @@ -730,26 +809,31 @@ _bfd_elf_discard_section_eh_frame else { if (info->shared - && (((cie.fde_encoding & 0xf0) == DW_EH_PE_absptr - && cie.make_relative == 0) - || (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned)) + && (((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr + && cie->make_relative == 0) + || (cie->fde_encoding & 0xf0) == DW_EH_PE_aligned)) { /* If a shared library uses absolute pointers which we cannot turn into PC relative, don't create the binary search table, since it is affected by runtime relocations. */ hdr_info->table = FALSE; + (*info->callbacks->einfo) + (_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr" + " table being created.\n"), abfd, sec); } - cie_usage_count++; + ecie->usage_count++; hdr_info->fde_count++; + this_inf->cie_inf = (void *) (ecie - ecies); } + /* Skip the initial location and address range. */ start = buf; - length = get_DW_EH_PE_width (cie.fde_encoding, ptr_size); + length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size); REQUIRE (skip_bytes (&buf, end, 2 * length)); /* Skip the augmentation size, if present. */ - if (cie.augmentation[0] == 'z') + if (cie->augmentation[0] == 'z') REQUIRE (read_uleb128 (&buf, end, &length)); else length = 0; @@ -757,12 +841,12 @@ _bfd_elf_discard_section_eh_frame /* Of the supported augmentation characters above, only 'L' adds augmentation data to the FDE. This code would need to be adjusted if any future augmentations do the same thing. */ - if (cie.lsda_encoding != DW_EH_PE_omit) + if (cie->lsda_encoding != DW_EH_PE_omit) { this_inf->lsda_offset = buf - start; /* If there's no 'z' augmentation, we don't know where the CFA insns begin. Assume no padding. */ - if (cie.augmentation[0] != 'z') + if (cie->augmentation[0] != 'z') length = end - buf; } @@ -770,57 +854,131 @@ _bfd_elf_discard_section_eh_frame REQUIRE (skip_bytes (&buf, end, length)); insns = buf; - buf = last_fde + 4 + hdr.length; + buf = last_fde + 4 + hdr_length; SKIP_RELOCS (buf); } /* Try to interpret the CFA instructions and find the first padding nop. Shrink this_inf's size so that it doesn't - including the padding. */ - length = get_DW_EH_PE_width (cie.fde_encoding, ptr_size); - insns = skip_non_nops (insns, end, length); - if (insns != 0) - this_inf->size -= end - insns; + include the padding. */ + length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size); + set_loc_count = 0; + insns_end = skip_non_nops (insns, end, length, &set_loc_count); + /* If we don't understand the CFA instructions, we can't know + what needs to be adjusted there. */ + if (insns_end == NULL + /* For the time being we don't support DW_CFA_set_loc in + CIE instructions. */ + || (set_loc_count && this_inf->cie)) + goto free_no_table; + this_inf->size -= end - insns_end; + if (insns_end != end && this_inf->cie) + { + cie->initial_insn_length -= end - insns_end; + cie->length -= end - insns_end; + } + if (set_loc_count + && ((cie->fde_encoding & 0xf0) == DW_EH_PE_pcrel + || cie->make_relative)) + { + unsigned int cnt; + bfd_byte *p; - this_inf->fde_encoding = cie.fde_encoding; - this_inf->lsda_encoding = cie.lsda_encoding; + this_inf->set_loc = bfd_malloc ((set_loc_count + 1) + * sizeof (unsigned int)); + REQUIRE (this_inf->set_loc); + this_inf->set_loc[0] = set_loc_count; + p = insns; + cnt = 0; + while (p < end) + { + if (*p == DW_CFA_set_loc) + this_inf->set_loc[++cnt] = p + 1 - start; + REQUIRE (skip_cfa_op (&p, end, length)); + } + } + + this_inf->fde_encoding = cie->fde_encoding; + this_inf->lsda_encoding = cie->lsda_encoding; sec_info->count++; } elf_section_data (sec)->sec_info = sec_info; sec->sec_info_type = ELF_INFO_TYPE_EH_FRAME; + /* Look at all CIEs in this section and determine which can be + removed as unused, which can be merged with previous duplicate + CIEs and which need to be kept. */ + for (ecie = ecies; ecie < ecies + ecie_count; ++ecie) + { + if (ecie->usage_count == 0) + { + sec_info->entry[ecie->entry].removed = 1; + continue; + } + ecie->cie.output_sec = sec->output_section; + ecie->cie.cie_inf = sec_info->entry + ecie->entry; + cie_compute_hash (&ecie->cie); + if (hdr_info->cies != NULL) + { + void **loc = htab_find_slot_with_hash (hdr_info->cies, &ecie->cie, + ecie->cie.hash, INSERT); + if (loc != NULL) + { + if (*loc != HTAB_EMPTY_ENTRY) + { + sec_info->entry[ecie->entry].removed = 1; + ecie->cie.cie_inf = ((struct cie *) *loc)->cie_inf; + continue; + } + + *loc = malloc (sizeof (struct cie)); + if (*loc == NULL) + *loc = HTAB_DELETED_ENTRY; + else + memcpy (*loc, &ecie->cie, sizeof (struct cie)); + } + } + ecie->cie.cie_inf->make_relative = ecie->cie.make_relative; + ecie->cie.cie_inf->make_lsda_relative = ecie->cie.make_lsda_relative; + ecie->cie.cie_inf->per_encoding_relative + = (ecie->cie.per_encoding & 0x70) == DW_EH_PE_pcrel; + } + /* Ok, now we can assign new offsets. */ offset = 0; - last_cie_inf = hdr_info->last_cie_inf; for (ent = sec_info->entry; ent < sec_info->entry + sec_info->count; ++ent) if (!ent->removed) { - if (ent->cie) - last_cie_inf = ent; - else - ent->cie_inf = last_cie_inf; + if (!ent->cie) + { + ecie = ecies + (unsigned long) ent->cie_inf; + ent->cie_inf = ecie->cie.cie_inf; + } ent->new_offset = offset; offset += size_of_output_cie_fde (ent, ptr_size); } - hdr_info->last_cie_inf = last_cie_inf; /* Resize the sec as needed. */ sec->rawsize = sec->size; sec->size = offset; - if (sec->size == 0) - sec->flags |= SEC_EXCLUDE; free (ehbuf); + if (ecies) + free (ecies); return offset != sec->rawsize; free_no_table: + (*info->callbacks->einfo) + (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"), + abfd, sec); if (ehbuf) free (ehbuf); if (sec_info) free (sec_info); + if (ecies) + free (ecies); hdr_info->table = FALSE; - hdr_info->last_cie.hdr.length = 0; return FALSE; #undef REQUIRE @@ -839,6 +997,13 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) htab = elf_hash_table (info); hdr_info = &htab->eh_info; + + if (hdr_info->cies != NULL) + { + htab_delete (hdr_info->cies); + hdr_info->cies = NULL; + } + sec = hdr_info->hdr_sec; if (sec == NULL) return FALSE; @@ -847,8 +1012,6 @@ _bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) if (hdr_info->table) sec->size += 4 + hdr_info->fde_count * 8; - /* Request program headers to be recalculated. */ - elf_tdata (abfd)->program_header_size = 0; elf_tdata (abfd)->eh_frame_hdr = sec; return TRUE; } @@ -968,6 +1131,23 @@ _bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, return (bfd_vma) -2; } + /* If converting to DW_EH_PE_pcrel, there will be no need for run-time + relocation against DW_CFA_set_loc's arguments. */ + if (sec_info->entry[mid].set_loc + && (sec_info->entry[mid].cie + ? sec_info->entry[mid].make_relative + : sec_info->entry[mid].cie_inf->make_relative) + && (offset >= sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].set_loc[1])) + { + unsigned int cnt; + + for (cnt = 1; cnt <= sec_info->entry[mid].set_loc[0]; cnt++) + if (offset == sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].set_loc[cnt]) + return (bfd_vma) -2; + } + if (hdr_info->offsets_adjusted) offset -= sec->output_offset; /* Any new augmentation bytes go before the first relocation. */ @@ -1192,6 +1372,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, /* FDE */ bfd_vma value, address; unsigned int width; + bfd_byte *start; /* Skip length. */ buf += 4; @@ -1228,6 +1409,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, write_value (abfd, buf, value, width); } + start = buf; + if (hdr_info) { hdr_info->array[hdr_info->array_count].initial_loc = address; @@ -1260,12 +1443,42 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, memmove (buf + 1, buf, end - buf); *buf = 0; } + + if (ent->set_loc) + { + /* Adjust DW_CFA_set_loc. */ + unsigned int cnt, width; + bfd_vma new_offset; + + width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size); + new_offset = ent->new_offset + 8 + + extra_augmentation_string_bytes (ent) + + extra_augmentation_data_bytes (ent); + + for (cnt = 1; cnt <= ent->set_loc[0]; cnt++) + { + bfd_vma value; + buf = start + ent->set_loc[cnt]; + + value = read_value (abfd, buf, width, + get_DW_EH_PE_signed (ent->fde_encoding)); + if (!value) + continue; + + if ((ent->fde_encoding & 0xf0) == DW_EH_PE_pcrel) + value += ent->offset + 8 - new_offset; + if (ent->cie_inf->make_relative) + value -= sec->output_section->vma + new_offset + + ent->set_loc[cnt]; + write_value (abfd, buf, value, width); + } + } } } /* We don't align the section to its section alignment since the runtime library only expects all CIE/FDE records aligned at - the pointer size. _bfd_elf_discard_section_eh_frame should + the pointer size. _bfd_elf_discard_section_eh_frame should have padded CIE/FDE records to multiple of pointer size with size_of_output_cie_fde. */ if ((sec->size % ptr_size) != 0) diff --git a/contrib/binutils/bfd/elf-strtab.c b/contrib/binutils/bfd/elf-strtab.c index a0ce1d79ea8..f5d6db1c10c 100644 --- a/contrib/binutils/bfd/elf-strtab.c +++ b/contrib/binutils/bfd/elf-strtab.c @@ -1,5 +1,6 @@ /* ELF strtab with GC and suffix merging support. - Copyright 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "hashtab.h" diff --git a/contrib/binutils/bfd/elf-vxworks.c b/contrib/binutils/bfd/elf-vxworks.c index 90e620a9055..7b0d5909097 100644 --- a/contrib/binutils/bfd/elf-vxworks.c +++ b/contrib/binutils/bfd/elf-vxworks.c @@ -1,5 +1,5 @@ /* VxWorks support for ELF - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,15 +20,34 @@ /* This file provides routines used by all VxWorks targets. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf-vxworks.h" +/* Return true if symbol NAME, as defined by ABFD, is one of the special + __GOTT_BASE__ or __GOTT_INDEX__ symbols. */ + +static bfd_boolean +elf_vxworks_gott_symbol_p (bfd *abfd, const char *name) +{ + char leading; + + leading = bfd_get_symbol_leading_char (abfd); + if (leading) + { + if (*name != leading) + return FALSE; + name++; + } + return (strcmp (name, "__GOTT_BASE__") == 0 + || strcmp (name, "__GOTT_INDEX__") == 0); +} + /* Tweak magic VxWorks symbols as they are loaded. */ bfd_boolean -elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED, +elf_vxworks_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym, const char **namep, @@ -45,8 +64,7 @@ elf_vxworks_add_symbol_hook (bfd *abfd ATTRIBUTE_UNUSED, This transformation will be undone in elf_i386_vxworks_link_output_symbol_hook. */ if ((info->shared || abfd->flags & DYNAMIC) - && (strcmp (*namep, "__GOTT_INDEX__") == 0 - || strcmp (*namep, "__GOTT_BASE__") == 0)) + && elf_vxworks_gott_symbol_p (abfd, *namep)) { sym->st_info = ELF_ST_INFO (STB_WEAK, ELF_ST_TYPE (sym->st_info)); *flagsp |= BSF_WEAK; @@ -114,16 +132,12 @@ elf_vxworks_link_output_symbol_hook (struct bfd_link_info *info const char *name, Elf_Internal_Sym *sym, asection *input_sec ATTRIBUTE_UNUSED, - struct elf_link_hash_entry *h - ATTRIBUTE_UNUSED) + struct elf_link_hash_entry *h) { - /* Ignore the first dummy symbol. */ - if (!name) - return TRUE; - /* Reverse the effects of the hack in elf_vxworks_add_symbol_hook. */ - if (strcmp (name, "__GOTT_INDEX__") == 0 - || strcmp (name, "__GOTT_BASE__") == 0) + if (h + && h->root.type == bfd_link_hash_undefweak + && elf_vxworks_gott_symbol_p (h->root.u.undef.abfd, name)) sym->st_info = ELF_ST_INFO (STB_GLOBAL, ELF_ST_TYPE (sym->st_info)); return TRUE; @@ -156,7 +170,8 @@ elf_vxworks_emit_relocs (bfd *output_bfd, && *rel_hash && (*rel_hash)->def_dynamic && !(*rel_hash)->def_regular - && (*rel_hash)->root.type == bfd_link_hash_defined + && ((*rel_hash)->root.type == bfd_link_hash_defined + || (*rel_hash)->root.type == bfd_link_hash_defweak) && (*rel_hash)->root.u.def.section->output_section != NULL) { /* This is a relocation from an executable or shared library @@ -171,8 +186,7 @@ elf_vxworks_emit_relocs (bfd *output_bfd, for (j = 0; j < bed->s->int_rels_per_ext_rel; j++) { asection *sec = (*rel_hash)->root.u.def.section; - int this_idx = - elf_section_data (sec->output_section)->this_idx; + int this_idx = sec->output_section->target_index; irela[j].r_info = ELF32_R_INFO (this_idx, ELF32_R_TYPE (irela[j].r_info)); diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c index c2ee684fb15..e8196099c5c 100644 --- a/contrib/binutils/bfd/elf.c +++ b/contrib/binutils/bfd/elf.c @@ -1,7 +1,7 @@ /* ELF executable support for BFD. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -37,8 +37,8 @@ SECTION /* For sparc64-cross-sparc32. */ #define _SYSCALL32 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #define ARCH_SIZE 0 @@ -210,16 +210,32 @@ bfd_elf_hash (const char *namearg) return h & 0xffffffff; } +/* DT_GNU_HASH hash function. Do not change this function; you will + cause invalid hash tables to be generated. */ + +unsigned long +bfd_elf_gnu_hash (const char *namearg) +{ + const unsigned char *name = (const unsigned char *) namearg; + unsigned long h = 5381; + unsigned char ch; + + while ((ch = *name++) != '\0') + h = (h << 5) + h + ch; + return h & 0xffffffff; +} + bfd_boolean bfd_elf_mkobject (bfd *abfd) { - /* This just does initialization. */ - /* coff_mkobject zalloc's space for tdata.coff_obj_data ... */ - elf_tdata (abfd) = bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); - if (elf_tdata (abfd) == 0) - return FALSE; - /* Since everything is done at close time, do we need any - initialization? */ + if (abfd->tdata.any == NULL) + { + abfd->tdata.any = bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); + if (abfd->tdata.any == NULL) + return FALSE; + } + + elf_tdata (abfd)->program_header_size = (bfd_size_type) -1; return TRUE; } @@ -240,7 +256,9 @@ bfd_elf_get_str_section (bfd *abfd, unsigned int shindex) bfd_size_type shstrtabsize; i_shdrp = elf_elfsections (abfd); - if (i_shdrp == 0 || i_shdrp[shindex] == 0) + if (i_shdrp == 0 + || shindex >= elf_numsections (abfd) + || i_shdrp[shindex] == 0) return NULL; shstrtab = i_shdrp[shindex]->contents; @@ -279,6 +297,9 @@ bfd_elf_string_from_elf_section (bfd *abfd, if (strindex == 0) return ""; + if (elf_elfsections (abfd) == NULL || shindex >= elf_numsections (abfd)) + return NULL; + hdr = elf_elfsections (abfd)[shindex]; if (hdr->contents == NULL @@ -388,7 +409,15 @@ bfd_elf_get_elf_syms (bfd *ibfd, for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf; isym < isymend; esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL) - (*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym); + if (!(*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym)) + { + symoffset += (esym - (bfd_byte *) extsym_buf) / extsym_size; + (*_bfd_error_handler) (_("%B symbol number %lu references " + "nonexistent SHT_SYMTAB_SHNDX section"), + ibfd, (unsigned long) symoffset); + intsym_buf = NULL; + goto out; + } out: if (alloc_ext != NULL) @@ -481,10 +510,18 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) section with just a flag word (ie. sh_size is 4), ignore it. */ shnum = elf_numsections (abfd); num_group = 0; + +#define IS_VALID_GROUP_SECTION_HEADER(shdr) \ + ( (shdr)->sh_type == SHT_GROUP \ + && (shdr)->sh_size >= (2 * GRP_ENTRY_SIZE) \ + && (shdr)->sh_entsize == GRP_ENTRY_SIZE \ + && ((shdr)->sh_size % GRP_ENTRY_SIZE) == 0) + for (i = 0; i < shnum; i++) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; - if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) + + if (IS_VALID_GROUP_SECTION_HEADER (shdr)) num_group += 1; } @@ -509,7 +546,8 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) for (i = 0; i < shnum; i++) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; - if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) + + if (IS_VALID_GROUP_SECTION_HEADER (shdr)) { unsigned char *src; Elf_Internal_Group *dest; @@ -523,8 +561,18 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) amt = shdr->sh_size * sizeof (*dest) / 4; shdr->contents = bfd_alloc2 (abfd, shdr->sh_size, sizeof (*dest) / 4); - if (shdr->contents == NULL - || bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 + /* PR binutils/4110: Handle corrupt group headers. */ + if (shdr->contents == NULL) + { + _bfd_error_handler + (_("%B: Corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + memset (shdr->contents, 0, amt); + + if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 || (bfd_bread (shdr->contents, shdr->sh_size, abfd) != shdr->sh_size)) return FALSE; @@ -804,24 +852,24 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, int len; } debug_sections [] = { - { "debug", 5 }, /* 'd' */ + { STRING_COMMA_LEN ("debug") }, /* 'd' */ { NULL, 0 }, /* 'e' */ { NULL, 0 }, /* 'f' */ - { "gnu.linkonce.wi.", 17 }, /* 'g' */ + { STRING_COMMA_LEN ("gnu.linkonce.wi.") }, /* 'g' */ { NULL, 0 }, /* 'h' */ { NULL, 0 }, /* 'i' */ { NULL, 0 }, /* 'j' */ { NULL, 0 }, /* 'k' */ - { "line", 4 }, /* 'l' */ + { STRING_COMMA_LEN ("line") }, /* 'l' */ { NULL, 0 }, /* 'm' */ { NULL, 0 }, /* 'n' */ { NULL, 0 }, /* 'o' */ { NULL, 0 }, /* 'p' */ { NULL, 0 }, /* 'q' */ { NULL, 0 }, /* 'r' */ - { "stab", 4 } /* 's' */ + { STRING_COMMA_LEN ("stab") } /* 's' */ }; - + if (name [0] == '.') { int i = name [1] - 'd'; @@ -840,7 +888,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0 + if (CONST_STRNEQ (name, ".gnu.linkonce") && elf_next_in_group (newsect) == NULL) flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; @@ -858,8 +906,8 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, unsigned int i; /* Look through the phdrs to see if we need to adjust the lma. - If all the p_paddr fields are zero, we ignore them, since - some ELF linkers produce such output. */ + If all the p_paddr fields are zero, we ignore them, since + some ELF linkers produce such output. */ phdr = elf_tdata (abfd)->phdr; for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++) { @@ -880,9 +928,9 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, refuse to set the LMA if it was 0. This is wrong though, as a perfectly valid initialised segment can have a p_paddr of zero. Some architectures, eg ARM, - place special significance on the address 0 and - executables need to be able to have a segment which - covers this address. */ + place special significance on the address 0 and + executables need to be able to have a segment which + covers this address. */ if (phdr->p_type == PT_LOAD && (bfd_vma) hdr->sh_offset >= phdr->p_offset && (hdr->sh_offset + hdr->sh_size @@ -1069,6 +1117,10 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd) elf_gp (obfd) = elf_gp (ibfd); elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + return TRUE; } @@ -1243,6 +1295,7 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg) case DT_AUXILIARY: name = "AUXILIARY"; stringp = TRUE; break; case DT_USED: name = "USED"; break; case DT_FILTER: name = "FILTER"; stringp = TRUE; break; + case DT_GNU_HASH: name = "GNU_HASH"; break; } fprintf (f, " %-11s ", name); @@ -1476,9 +1529,9 @@ _bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry, memset (&ret->size, 0, (sizeof (struct elf_link_hash_entry) - offsetof (struct elf_link_hash_entry, size))); /* Assume that we have been called by a non-ELF symbol reader. - This flag is then reset by the code which reads an ELF input - file. This ensures that a symbol created by a non-ELF symbol - reader will have the flag set correctly. */ + This flag is then reset by the code which reads an ELF input + file. This ensures that a symbol created by a non-ELF symbol + reader will have the flag set correctly. */ ret->non_elf = 1; } @@ -1571,27 +1624,13 @@ _bfd_elf_link_hash_table_init bfd_boolean ret; int can_refcount = get_elf_backend_data (abfd)->can_refcount; - table->dynamic_sections_created = FALSE; - table->dynobj = NULL; + memset (table, 0, sizeof * table); table->init_got_refcount.refcount = can_refcount - 1; table->init_plt_refcount.refcount = can_refcount - 1; table->init_got_offset.offset = -(bfd_vma) 1; table->init_plt_offset.offset = -(bfd_vma) 1; /* The first dynamic symbol is a dummy. */ table->dynsymcount = 1; - table->dynstr = NULL; - table->bucketcount = 0; - table->needed = NULL; - table->hgot = NULL; - table->merge_info = NULL; - memset (&table->stab_info, 0, sizeof (table->stab_info)); - memset (&table->eh_info, 0, sizeof (table->eh_info)); - table->dynlocal = NULL; - table->runpath = NULL; - table->tls_sec = NULL; - table->tls_size = 0; - table->loaded = NULL; - table->is_relocatable_executable = FALSE; ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc, entsize); table->root.type = bfd_link_elf_hash_table; @@ -1646,7 +1685,7 @@ bfd_elf_get_dyn_lib_class (bfd *abfd) } void -bfd_elf_set_dyn_lib_class (bfd *abfd, int lib_class) +bfd_elf_set_dyn_lib_class (bfd *abfd, enum dynamic_lib_link_class lib_class) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && bfd_get_format (abfd) == bfd_object) @@ -1826,6 +1865,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) case SHT_FINI_ARRAY: /* .fini_array section. */ case SHT_PREINIT_ARRAY: /* .preinit_array section. */ case SHT_GNU_LIBLIST: /* .gnu.liblist section. */ + case SHT_GNU_HASH: /* .gnu.hash section. */ return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); case SHT_DYNAMIC: /* Dynamic linking information. */ @@ -1877,11 +1917,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) abfd->flags |= HAS_SYMS; /* Sometimes a shared object will map in the symbol table. If - SHF_ALLOC is set, and this is a shared object, then we also - treat this section as a BFD section. We can not base the - decision purely on SHF_ALLOC, because that flag is sometimes - set in a relocatable object file, which would confuse the - linker. */ + SHF_ALLOC is set, and this is a shared object, then we also + treat this section as a BFD section. We can not base the + decision purely on SHF_ALLOC, because that flag is sometimes + set in a relocatable object file, which would confuse the + linker. */ if ((hdr->sh_flags & SHF_ALLOC) != 0 && (abfd->flags & DYNAMIC) != 0 && ! _bfd_elf_make_section_from_shdr (abfd, hdr, name, @@ -2103,13 +2143,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) abfd->flags |= HAS_RELOC; return TRUE; } - break; case SHT_GNU_verdef: elf_dynverdef (abfd) = shindex; elf_tdata (abfd)->dynverdef_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); - break; case SHT_GNU_versym: if (hdr->sh_entsize != sizeof (Elf_External_Versym)) @@ -2117,13 +2155,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) elf_dynversym (abfd) = shindex; elf_tdata (abfd)->dynversym_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); - break; case SHT_GNU_verneed: elf_dynverref (abfd) = shindex; elf_tdata (abfd)->dynverref_hdr = *hdr; return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); - break; case SHT_SHLIB: return TRUE; @@ -2132,7 +2168,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* We need a BFD section for objcopy and relocatable linking, and it's handy to have the signature available as the section name. */ - if (hdr->sh_entsize != GRP_ENTRY_SIZE) + if (! IS_VALID_GROUP_SECTION_HEADER (hdr)) return FALSE; name = group_signature (abfd, hdr); if (name == NULL) @@ -2142,7 +2178,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) if (hdr->contents != NULL) { Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents; - unsigned int n_elt = hdr->sh_size / 4; + unsigned int n_elt = hdr->sh_size / GRP_ENTRY_SIZE; asection *s; if (idx->flags & GRP_COMDAT) @@ -2152,19 +2188,78 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* We try to keep the same section order as it comes in. */ idx += n_elt; while (--n_elt != 0) - if ((s = (--idx)->shdr->bfd_section) != NULL - && elf_next_in_group (s) != NULL) - { - elf_next_in_group (hdr->bfd_section) = s; - break; - } + { + --idx; + + if (idx->shdr != NULL + && (s = idx->shdr->bfd_section) != NULL + && elf_next_in_group (s) != NULL) + { + elf_next_in_group (hdr->bfd_section) = s; + break; + } + } } break; default: + /* Possibly an attributes section. */ + if (hdr->sh_type == SHT_GNU_ATTRIBUTES + || hdr->sh_type == bed->obj_attrs_section_type) + { + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) + return FALSE; + _bfd_elf_parse_attributes (abfd, hdr); + return TRUE; + } + /* Check for any processor-specific section types. */ - return bed->elf_backend_section_from_shdr (abfd, hdr, name, - shindex); + if (bed->elf_backend_section_from_shdr (abfd, hdr, name, shindex)) + return TRUE; + + if (hdr->sh_type >= SHT_LOUSER && hdr->sh_type <= SHT_HIUSER) + { + if ((hdr->sh_flags & SHF_ALLOC) != 0) + /* FIXME: How to properly handle allocated section reserved + for applications? */ + (*_bfd_error_handler) + (_("%B: don't know how to handle allocated, application " + "specific section `%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else + /* Allow sections reserved for applications. */ + return _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex); + } + else if (hdr->sh_type >= SHT_LOPROC + && hdr->sh_type <= SHT_HIPROC) + /* FIXME: We should handle this section. */ + (*_bfd_error_handler) + (_("%B: don't know how to handle processor specific section " + "`%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else if (hdr->sh_type >= SHT_LOOS && hdr->sh_type <= SHT_HIOS) + { + /* Unrecognised OS-specific sections. */ + if ((hdr->sh_flags & SHF_OS_NONCONFORMING) != 0) + /* SHF_OS_NONCONFORMING indicates that special knowledge is + required to correctly process the section and the file should + be rejected with an error message. */ + (*_bfd_error_handler) + (_("%B: don't know how to handle OS specific section " + "`%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else + /* Otherwise it should be processed. */ + return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + } + else + /* FIXME: We should handle this section. */ + (*_bfd_error_handler) + (_("%B: don't know how to handle section `%s' [0x%8x]"), + abfd, name, hdr->sh_type); + + return FALSE; } return TRUE; @@ -2224,108 +2319,111 @@ bfd_section_from_elf_index (bfd *abfd, unsigned int index) static const struct bfd_elf_special_section special_sections_b[] = { - { ".bss", 4, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".bss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_c[] = { - { ".comment", 8, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".comment"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_d[] = { - { ".data", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".data1", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".debug", 6, 0, SHT_PROGBITS, 0 }, - { ".debug_line", 11, 0, SHT_PROGBITS, 0 }, - { ".debug_info", 11, 0, SHT_PROGBITS, 0 }, - { ".debug_abbrev", 13, 0, SHT_PROGBITS, 0 }, - { ".debug_aranges", 14, 0, SHT_PROGBITS, 0 }, - { ".dynamic", 8, 0, SHT_DYNAMIC, SHF_ALLOC }, - { ".dynstr", 7, 0, SHT_STRTAB, SHF_ALLOC }, - { ".dynsym", 7, 0, SHT_DYNSYM, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".data1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".debug"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_line"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_info"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_abbrev"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".debug_aranges"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, SHF_ALLOC }, + { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, SHF_ALLOC }, + { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_f[] = { - { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_g[] = { - { ".gnu.linkonce.b",15, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".got", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".gnu.version", 12, 0, SHT_GNU_versym, 0 }, - { ".gnu.version_d", 14, 0, SHT_GNU_verdef, 0 }, - { ".gnu.version_r", 14, 0, SHT_GNU_verneed, 0 }, - { ".gnu.liblist", 12, 0, SHT_GNU_LIBLIST, SHF_ALLOC }, - { ".gnu.conflict", 13, 0, SHT_RELA, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".gnu.linkonce.b"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 }, + { STRING_COMMA_LEN (".gnu.version_d"), 0, SHT_GNU_verdef, 0 }, + { STRING_COMMA_LEN (".gnu.version_r"), 0, SHT_GNU_verneed, 0 }, + { STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC }, + { STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC }, + { STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_h[] = { - { ".hash", 5, 0, SHT_HASH, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_i[] = { - { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { ".interp", 7, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_l[] = { - { ".line", 5, 0, SHT_PROGBITS, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".line"), 0, SHT_PROGBITS, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_n[] = { - { ".note.GNU-stack",15, 0, SHT_PROGBITS, 0 }, - { ".note", 5, -1, SHT_NOTE, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".note.GNU-stack"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".note"), -1, SHT_NOTE, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_p[] = { - { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_r[] = { - { ".rodata", 7, -2, SHT_PROGBITS, SHF_ALLOC }, - { ".rodata1", 8, 0, SHT_PROGBITS, SHF_ALLOC }, - { ".rela", 5, -1, SHT_RELA, 0 }, - { ".rel", 4, -1, SHT_REL, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".rodata"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 }, + { STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_s[] = { - { ".shstrtab", 9, 0, SHT_STRTAB, 0 }, - { ".strtab", 7, 0, SHT_STRTAB, 0 }, - { ".symtab", 7, 0, SHT_SYMTAB, 0 }, - { ".stabstr", 5, 3, SHT_STRTAB, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".shstrtab"), 0, SHT_STRTAB, 0 }, + { STRING_COMMA_LEN (".strtab"), 0, SHT_STRTAB, 0 }, + { STRING_COMMA_LEN (".symtab"), 0, SHT_SYMTAB, 0 }, + /* See struct bfd_elf_special_section declaration for the semantics of + this special case where .prefix_length != strlen (.prefix). */ + { ".stabstr", 5, 3, SHT_STRTAB, 0 }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section special_sections_t[] = { - { ".text", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".tbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, - { ".tdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".text"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, + { STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, + { NULL, 0, 0, 0, 0 } }; static const struct bfd_elf_special_section *special_sections[] = @@ -2456,10 +2554,13 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec) bed = get_elf_backend_data (abfd); sec->use_rela_p = bed->default_use_rela_p; - /* When we read a file, we don't need section type and flags unless - it is a linker created section. They will be overridden in - _bfd_elf_make_section_from_shdr anyway. */ - if (abfd->direction != read_direction + /* When we read a file, we don't need to set ELF section type and + flags. They will be overridden in _bfd_elf_make_section_from_shdr + anyway. We will set ELF section type and flags for all linker + created sections. If user specifies BFD section flags, we will + set ELF section type and flags based on BFD section flags in + elf_fake_sections. */ + if ((!sec->flags && abfd->direction != read_direction) || (sec->flags & SEC_LINKER_CREATED) != 0) { ssect = (*bed->get_sec_type_attr) (abfd, sec); @@ -2470,7 +2571,7 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec) } } - return TRUE; + return _bfd_generic_new_section_hook (abfd, sec); } /* Create a new bfd section from an ELF program header. @@ -2661,11 +2762,12 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) const struct elf_backend_data *bed = get_elf_backend_data (abfd); bfd_boolean *failedptr = failedptrarg; Elf_Internal_Shdr *this_hdr; + unsigned int sh_type; if (*failedptr) { /* We already failed; just get out of the bfd_map_over_sections - loop. */ + loop. */ return; } @@ -2704,8 +2806,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) if ((asect->flags & SEC_GROUP) != 0) this_hdr->sh_type = SHT_GROUP; else if ((asect->flags & SEC_ALLOC) != 0 - && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) - || (asect->flags & SEC_NEVER_LOAD) != 0)) + && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) + || (asect->flags & SEC_NEVER_LOAD) != 0)) this_hdr->sh_type = SHT_NOBITS; else this_hdr->sh_type = SHT_PROGBITS; @@ -2754,8 +2856,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) case SHT_GNU_verdef: this_hdr->sh_entsize = 0; /* objcopy or strip will copy over sh_info, but may not set - cverdefs. The linker will set cverdefs, but sh_info will be - zero. */ + cverdefs. The linker will set cverdefs, but sh_info will be + zero. */ if (this_hdr->sh_info == 0) this_hdr->sh_info = elf_tdata (abfd)->cverdefs; else @@ -2766,8 +2868,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) case SHT_GNU_verneed: this_hdr->sh_entsize = 0; /* objcopy or strip will copy over sh_info, but may not set - cverrefs. The linker will set cverrefs, but sh_info will be - zero. */ + cverrefs. The linker will set cverrefs, but sh_info will be + zero. */ if (this_hdr->sh_info == 0) this_hdr->sh_info = elf_tdata (abfd)->cverrefs; else @@ -2776,7 +2878,11 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) break; case SHT_GROUP: - this_hdr->sh_entsize = 4; + this_hdr->sh_entsize = GRP_ENTRY_SIZE; + break; + + case SHT_GNU_HASH: + this_hdr->sh_entsize = bed->s->arch_size == 64 ? 0 : 4; break; } @@ -2814,10 +2920,18 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) } /* Check for processor-specific section types. */ + sh_type = this_hdr->sh_type; if (bed->elf_backend_fake_sections && !(*bed->elf_backend_fake_sections) (abfd, this_hdr, asect)) *failedptr = TRUE; + if (sh_type == SHT_NOBITS && asect->size != 0) + { + /* Don't change the header type from NOBITS if we are being + called for objcopy --only-keep-debug. */ + this_hdr->sh_type = sh_type; + } + /* If the section has relocs, set up a section header for the SHT_REL[A] section. If two relocation sections are required for this section, it is up to the processor-specific back-end to @@ -2939,14 +3053,14 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) d = elf_section_data (sec); if (d->this_hdr.sh_type == SHT_GROUP) - { + { if (sec->flags & SEC_LINKER_CREATED) { /* Remove the linker created SHT_GROUP sections. */ bfd_section_list_remove (abfd, sec); abfd->section_count--; } - else + else { if (section_number == SHN_LORESERVE) section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; @@ -3100,7 +3214,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) s, s->owner); /* Point to the kept section if it has the same size as the discarded one. */ - kept = _bfd_elf_check_kept_section (s); + kept = _bfd_elf_check_kept_section (s, link_info); if (kept == NULL) { bfd_set_error (bfd_error_bad_value); @@ -3133,7 +3247,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) The Intel C compiler generates SHT_IA_64_UNWIND with SHF_LINK_ORDER. But it doesn't set the sh_link or sh_info fields. Hence we could get the situation - where s is NULL. */ + where s is NULL. */ const struct elf_backend_data *bed = get_elf_backend_data (abfd); if (bed->link_order_error_handler) @@ -3173,7 +3287,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) string section. We look for a section with the same name but without the trailing ``str'', and set its sh_link field to point to this section. */ - if (strncmp (sec->name, ".stab", sizeof ".stab" - 1) == 0 + if (CONST_STRNEQ (sec->name, ".stab") && strcmp (sec->name + strlen (sec->name) - 3, "str") == 0) { size_t len; @@ -3213,9 +3327,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) case SHT_GNU_LIBLIST: /* sh_link is the section header index of the prelink library - list - used for the dynamic entries, or the symbol table, or the - version strings. */ + list used for the dynamic entries, or the symbol table, or + the version strings. */ s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC) ? ".dynstr" : ".gnu.libstr"); if (s != NULL) @@ -3223,6 +3336,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) break; case SHT_HASH: + case SHT_GNU_HASH: case SHT_GNU_versym: /* sh_link is the section header index of the symbol table this hash table or version table is for. */ @@ -3248,7 +3362,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) /* Map symbol from it's internal number to the external number, moving all local symbols to be at the head of the list. */ -static int +static bfd_boolean sym_is_global (bfd *abfd, asymbol *sym) { /* If the backend has a special mapping, use it. */ @@ -3261,6 +3375,20 @@ sym_is_global (bfd *abfd, asymbol *sym) || bfd_is_com_section (bfd_get_section (sym))); } +/* Don't output section symbols for sections that are not going to be + output. Also, don't output section symbols for reloc and other + special sections. */ + +static bfd_boolean +ignore_section_sym (bfd *abfd, asymbol *sym) +{ + return ((sym->flags & BSF_SECTION_SYM) != 0 + && (sym->value != 0 + || (sym->section->owner != abfd + && (sym->section->output_section->owner != abfd + || sym->section->output_offset != 0)))); +} + static bfd_boolean elf_map_symbols (bfd *abfd) { @@ -3301,51 +3429,29 @@ elf_map_symbols (bfd *abfd) asymbol *sym = syms[idx]; if ((sym->flags & BSF_SECTION_SYM) != 0 - && sym->value == 0) + && !ignore_section_sym (abfd, sym)) { - asection *sec; + asection *sec = sym->section; - sec = sym->section; + if (sec->owner != abfd) + sec = sec->output_section; - if (sec->owner != NULL) - { - if (sec->owner != abfd) - { - if (sec->output_offset != 0) - continue; - - sec = sec->output_section; - - /* Empty sections in the input files may have had a - section symbol created for them. (See the comment - near the end of _bfd_generic_link_output_symbols in - linker.c). If the linker script discards such - sections then we will reach this point. Since we know - that we cannot avoid this case, we detect it and skip - the abort and the assignment to the sect_syms array. - To reproduce this particular case try running the - linker testsuite test ld-scripts/weak.exp for an ELF - port that uses the generic linker. */ - if (sec->owner == NULL) - continue; - - BFD_ASSERT (sec->owner == abfd); - } - sect_syms[sec->index] = syms[idx]; - } + sect_syms[sec->index] = syms[idx]; } } /* Classify all of the symbols. */ for (idx = 0; idx < symcount; idx++) { + if (ignore_section_sym (abfd, syms[idx])) + continue; if (!sym_is_global (abfd, syms[idx])) num_locals++; else num_globals++; } - /* We will be adding a section symbol for each BFD section. Most normal + /* We will be adding a section symbol for each normal BFD section. Most sections will already have a section symbol in outsymbols, but eg. SHT_GROUP sections will not, and we need the section symbol mapped at least in that case. */ @@ -3371,6 +3477,8 @@ elf_map_symbols (bfd *abfd) asymbol *sym = syms[idx]; unsigned int i; + if (ignore_section_sym (abfd, sym)) + continue; if (!sym_is_global (abfd, sym)) i = num_locals2++; else @@ -3522,7 +3630,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd, elf_tdata (abfd)->next_file_pos = off; /* Now that we know where the .strtab section goes, write it - out. */ + out. */ if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 || ! _bfd_stringtab_emit (abfd, strtab)) return FALSE; @@ -3534,6 +3642,90 @@ _bfd_elf_compute_section_file_positions (bfd *abfd, return TRUE; } +/* Make an initial estimate of the size of the program header. If we + get the number wrong here, we'll redo section placement. */ + +static bfd_size_type +get_program_header_size (bfd *abfd, struct bfd_link_info *info) +{ + size_t segs; + asection *s; + const struct elf_backend_data *bed; + + /* Assume we will need exactly two PT_LOAD segments: one for text + and one for data. */ + segs = 2; + + s = bfd_get_section_by_name (abfd, ".interp"); + if (s != NULL && (s->flags & SEC_LOAD) != 0) + { + /* If we have a loadable interpreter section, we need a + PT_INTERP segment. In this case, assume we also need a + PT_PHDR segment, although that may not be true for all + targets. */ + segs += 2; + } + + if (bfd_get_section_by_name (abfd, ".dynamic") != NULL) + { + /* We need a PT_DYNAMIC segment. */ + ++segs; + + if (elf_tdata (abfd)->relro) + { + /* We need a PT_GNU_RELRO segment only when there is a + PT_DYNAMIC segment. */ + ++segs; + } + } + + if (elf_tdata (abfd)->eh_frame_hdr) + { + /* We need a PT_GNU_EH_FRAME segment. */ + ++segs; + } + + if (elf_tdata (abfd)->stack_flags) + { + /* We need a PT_GNU_STACK segment. */ + ++segs; + } + + for (s = abfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LOAD) != 0 + && CONST_STRNEQ (s->name, ".note")) + { + /* We need a PT_NOTE segment. */ + ++segs; + } + } + + for (s = abfd->sections; s != NULL; s = s->next) + { + if (s->flags & SEC_THREAD_LOCAL) + { + /* We need a PT_TLS segment. */ + ++segs; + break; + } + } + + /* Let the backend count up any program headers it might need. */ + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_additional_program_headers) + { + int a; + + a = (*bed->elf_backend_additional_program_headers) (abfd, info); + if (a == -1) + abort (); + segs += a; + } + + return segs * bed->s->sizeof_phdr; +} + /* Create a mapping from a set of sections to a program segment. */ static struct elf_segment_map * @@ -3584,363 +3776,421 @@ _bfd_elf_make_dynamic_segment (bfd *abfd, asection *dynsec) m->p_type = PT_DYNAMIC; m->count = 1; m->sections[0] = dynsec; - + return m; } +/* Possibly add or remove segments from the segment map. */ + +static bfd_boolean +elf_modify_segment_map (bfd *abfd, struct bfd_link_info *info) +{ + struct elf_segment_map **m; + const struct elf_backend_data *bed; + + /* The placement algorithm assumes that non allocated sections are + not in PT_LOAD segments. We ensure this here by removing such + sections from the segment map. We also remove excluded + sections. Finally, any PT_LOAD segment without sections is + removed. */ + m = &elf_tdata (abfd)->segment_map; + while (*m) + { + unsigned int i, new_count; + + for (new_count = 0, i = 0; i < (*m)->count; i++) + { + if (((*m)->sections[i]->flags & SEC_EXCLUDE) == 0 + && (((*m)->sections[i]->flags & SEC_ALLOC) != 0 + || (*m)->p_type != PT_LOAD)) + { + (*m)->sections[new_count] = (*m)->sections[i]; + new_count++; + } + } + (*m)->count = new_count; + + if ((*m)->p_type == PT_LOAD && (*m)->count == 0) + *m = (*m)->next; + else + m = &(*m)->next; + } + + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_modify_segment_map != NULL) + { + if (!(*bed->elf_backend_modify_segment_map) (abfd, info)) + return FALSE; + } + + return TRUE; +} + /* Set up a mapping from BFD sections to program segments. */ -static bfd_boolean -map_sections_to_segments (bfd *abfd) +bfd_boolean +_bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) { - asection **sections = NULL; - asection *s; - unsigned int i; unsigned int count; - struct elf_segment_map *mfirst; - struct elf_segment_map **pm; struct elf_segment_map *m; - asection *last_hdr; - bfd_vma last_size; - unsigned int phdr_index; - bfd_vma maxpagesize; - asection **hdrpp; - bfd_boolean phdr_in_segment = TRUE; - bfd_boolean writable; - int tls_count = 0; - asection *first_tls = NULL; - asection *dynsec, *eh_frame_hdr; - bfd_size_type amt; + asection **sections = NULL; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - if (elf_tdata (abfd)->segment_map != NULL) - return TRUE; - - if (bfd_count_sections (abfd) == 0) - return TRUE; - - /* Select the allocated sections, and sort them. */ - - sections = bfd_malloc2 (bfd_count_sections (abfd), sizeof (asection *)); - if (sections == NULL) - goto error_return; - - i = 0; - for (s = abfd->sections; s != NULL; s = s->next) + if (elf_tdata (abfd)->segment_map == NULL + && bfd_count_sections (abfd) != 0) { - if ((s->flags & SEC_ALLOC) != 0) - { - sections[i] = s; - ++i; - } - } - BFD_ASSERT (i <= bfd_count_sections (abfd)); - count = i; + asection *s; + unsigned int i; + struct elf_segment_map *mfirst; + struct elf_segment_map **pm; + asection *last_hdr; + bfd_vma last_size; + unsigned int phdr_index; + bfd_vma maxpagesize; + asection **hdrpp; + bfd_boolean phdr_in_segment = TRUE; + bfd_boolean writable; + int tls_count = 0; + asection *first_tls = NULL; + asection *dynsec, *eh_frame_hdr; + bfd_size_type amt; - qsort (sections, (size_t) count, sizeof (asection *), elf_sort_sections); + /* Select the allocated sections, and sort them. */ - /* Build the mapping. */ - - mfirst = NULL; - pm = &mfirst; - - /* If we have a .interp section, then create a PT_PHDR segment for - the program headers and a PT_INTERP segment for the .interp - section. */ - s = bfd_get_section_by_name (abfd, ".interp"); - if (s != NULL && (s->flags & SEC_LOAD) != 0) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_PHDR; - /* FIXME: UnixWare and Solaris set PF_X, Irix 5 does not. */ - m->p_flags = PF_R | PF_X; - m->p_flags_valid = 1; - m->includes_phdrs = 1; - - *pm = m; - pm = &m->next; - - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_INTERP; - m->count = 1; - m->sections[0] = s; - - *pm = m; - pm = &m->next; - } - - /* Look through the sections. We put sections in the same program - segment when the start of the second section can be placed within - a few bytes of the end of the first section. */ - last_hdr = NULL; - last_size = 0; - phdr_index = 0; - maxpagesize = get_elf_backend_data (abfd)->maxpagesize; - writable = FALSE; - dynsec = bfd_get_section_by_name (abfd, ".dynamic"); - if (dynsec != NULL - && (dynsec->flags & SEC_LOAD) == 0) - dynsec = NULL; - - /* Deal with -Ttext or something similar such that the first section - is not adjacent to the program headers. This is an - approximation, since at this point we don't know exactly how many - program headers we will need. */ - if (count > 0) - { - bfd_size_type phdr_size; - - phdr_size = elf_tdata (abfd)->program_header_size; - if (phdr_size == 0) - phdr_size = get_elf_backend_data (abfd)->s->sizeof_phdr; - if ((abfd->flags & D_PAGED) == 0 - || sections[0]->lma < phdr_size - || sections[0]->lma % maxpagesize < phdr_size % maxpagesize) - phdr_in_segment = FALSE; - } - - for (i = 0, hdrpp = sections; i < count; i++, hdrpp++) - { - asection *hdr; - bfd_boolean new_segment; - - hdr = *hdrpp; - - /* See if this section and the last one will fit in the same - segment. */ - - if (last_hdr == NULL) - { - /* If we don't have a segment yet, then we don't need a new - one (we build the last one after this loop). */ - new_segment = FALSE; - } - else if (last_hdr->lma - last_hdr->vma != hdr->lma - hdr->vma) - { - /* If this section has a different relation between the - virtual address and the load address, then we need a new - segment. */ - new_segment = TRUE; - } - else if (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) - < BFD_ALIGN (hdr->lma, maxpagesize)) - { - /* If putting this section in this segment would force us to - skip a page in the segment, then we need a new segment. */ - new_segment = TRUE; - } - else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 - && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) - { - /* We don't want to put a loadable section after a - nonloadable section in the same segment. - Consider .tbss sections as loadable for this purpose. */ - new_segment = TRUE; - } - else if ((abfd->flags & D_PAGED) == 0) - { - /* If the file is not demand paged, which means that we - don't require the sections to be correctly aligned in the - file, then there is no other reason for a new segment. */ - new_segment = FALSE; - } - else if (! writable - && (hdr->flags & SEC_READONLY) == 0 - && (((last_hdr->lma + last_size - 1) - & ~(maxpagesize - 1)) - != (hdr->lma & ~(maxpagesize - 1)))) - { - /* We don't want to put a writable section in a read only - segment, unless they are on the same page in memory - anyhow. We already know that the last section does not - bring us past the current section on the page, so the - only case in which the new section is not on the same - page as the previous section is when the previous section - ends precisely on a page boundary. */ - new_segment = TRUE; - } - else - { - /* Otherwise, we can use the same segment. */ - new_segment = FALSE; - } - - if (! new_segment) - { - if ((hdr->flags & SEC_READONLY) == 0) - writable = TRUE; - last_hdr = hdr; - /* .tbss sections effectively have zero size. */ - if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) - last_size = hdr->size; - else - last_size = 0; - continue; - } - - /* We need a new program segment. We must create a new program - header holding all the sections from phdr_index until hdr. */ - - m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); - if (m == NULL) + sections = bfd_malloc2 (bfd_count_sections (abfd), sizeof (asection *)); + if (sections == NULL) goto error_return; - *pm = m; - pm = &m->next; + i = 0; + for (s = abfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_ALLOC) != 0) + { + sections[i] = s; + ++i; + } + } + BFD_ASSERT (i <= bfd_count_sections (abfd)); + count = i; - if ((hdr->flags & SEC_READONLY) == 0) - writable = TRUE; - else - writable = FALSE; + qsort (sections, (size_t) count, sizeof (asection *), elf_sort_sections); - last_hdr = hdr; - /* .tbss sections effectively have zero size. */ - if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) - last_size = hdr->size; - else - last_size = 0; - phdr_index = i; - phdr_in_segment = FALSE; - } + /* Build the mapping. */ - /* Create a final PT_LOAD program segment. */ - if (last_hdr != NULL) - { - m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); - if (m == NULL) - goto error_return; + mfirst = NULL; + pm = &mfirst; - *pm = m; - pm = &m->next; - } - - /* If there is a .dynamic section, throw in a PT_DYNAMIC segment. */ - if (dynsec != NULL) - { - m = _bfd_elf_make_dynamic_segment (abfd, dynsec); - if (m == NULL) - goto error_return; - *pm = m; - pm = &m->next; - } - - /* For each loadable .note section, add a PT_NOTE segment. We don't - use bfd_get_section_by_name, because if we link together - nonloadable .note sections and loadable .note sections, we will - generate two .note sections in the output file. FIXME: Using - names for section types is bogus anyhow. */ - for (s = abfd->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LOAD) != 0 - && strncmp (s->name, ".note", 5) == 0) + /* If we have a .interp section, then create a PT_PHDR segment for + the program headers and a PT_INTERP segment for the .interp + section. */ + s = bfd_get_section_by_name (abfd, ".interp"); + if (s != NULL && (s->flags & SEC_LOAD) != 0) { amt = sizeof (struct elf_segment_map); m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; - m->p_type = PT_NOTE; + m->p_type = PT_PHDR; + /* FIXME: UnixWare and Solaris set PF_X, Irix 5 does not. */ + m->p_flags = PF_R | PF_X; + m->p_flags_valid = 1; + m->includes_phdrs = 1; + + *pm = m; + pm = &m->next; + + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_INTERP; m->count = 1; m->sections[0] = s; *pm = m; pm = &m->next; } - if (s->flags & SEC_THREAD_LOCAL) - { - if (! tls_count) - first_tls = s; - tls_count++; - } - } - /* If there are any SHF_TLS output sections, add PT_TLS segment. */ - if (tls_count > 0) - { - int i; + /* Look through the sections. We put sections in the same program + segment when the start of the second section can be placed within + a few bytes of the end of the first section. */ + last_hdr = NULL; + last_size = 0; + phdr_index = 0; + maxpagesize = bed->maxpagesize; + writable = FALSE; + dynsec = bfd_get_section_by_name (abfd, ".dynamic"); + if (dynsec != NULL + && (dynsec->flags & SEC_LOAD) == 0) + dynsec = NULL; - amt = sizeof (struct elf_segment_map); - amt += (tls_count - 1) * sizeof (asection *); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_TLS; - m->count = tls_count; - /* Mandated PF_R. */ - m->p_flags = PF_R; - m->p_flags_valid = 1; - for (i = 0; i < tls_count; ++i) + /* Deal with -Ttext or something similar such that the first section + is not adjacent to the program headers. This is an + approximation, since at this point we don't know exactly how many + program headers we will need. */ + if (count > 0) { - BFD_ASSERT (first_tls->flags & SEC_THREAD_LOCAL); - m->sections[i] = first_tls; - first_tls = first_tls->next; + bfd_size_type phdr_size = elf_tdata (abfd)->program_header_size; + + if (phdr_size == (bfd_size_type) -1) + phdr_size = get_program_header_size (abfd, info); + if ((abfd->flags & D_PAGED) == 0 + || sections[0]->lma < phdr_size + || sections[0]->lma % maxpagesize < phdr_size % maxpagesize) + phdr_in_segment = FALSE; } - *pm = m; - pm = &m->next; + for (i = 0, hdrpp = sections; i < count; i++, hdrpp++) + { + asection *hdr; + bfd_boolean new_segment; + + hdr = *hdrpp; + + /* See if this section and the last one will fit in the same + segment. */ + + if (last_hdr == NULL) + { + /* If we don't have a segment yet, then we don't need a new + one (we build the last one after this loop). */ + new_segment = FALSE; + } + else if (last_hdr->lma - last_hdr->vma != hdr->lma - hdr->vma) + { + /* If this section has a different relation between the + virtual address and the load address, then we need a new + segment. */ + new_segment = TRUE; + } + else if (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + < BFD_ALIGN (hdr->lma, maxpagesize)) + { + /* If putting this section in this segment would force us to + skip a page in the segment, then we need a new segment. */ + new_segment = TRUE; + } + else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 + && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) + { + /* We don't want to put a loadable section after a + nonloadable section in the same segment. + Consider .tbss sections as loadable for this purpose. */ + new_segment = TRUE; + } + else if ((abfd->flags & D_PAGED) == 0) + { + /* If the file is not demand paged, which means that we + don't require the sections to be correctly aligned in the + file, then there is no other reason for a new segment. */ + new_segment = FALSE; + } + else if (! writable + && (hdr->flags & SEC_READONLY) == 0 + && (((last_hdr->lma + last_size - 1) + & ~(maxpagesize - 1)) + != (hdr->lma & ~(maxpagesize - 1)))) + { + /* We don't want to put a writable section in a read only + segment, unless they are on the same page in memory + anyhow. We already know that the last section does not + bring us past the current section on the page, so the + only case in which the new section is not on the same + page as the previous section is when the previous section + ends precisely on a page boundary. */ + new_segment = TRUE; + } + else + { + /* Otherwise, we can use the same segment. */ + new_segment = FALSE; + } + + /* Allow interested parties a chance to override our decision. */ + if (last_hdr && info->callbacks->override_segment_assignment) + new_segment = info->callbacks->override_segment_assignment (info, abfd, hdr, last_hdr, new_segment); + + if (! new_segment) + { + if ((hdr->flags & SEC_READONLY) == 0) + writable = TRUE; + last_hdr = hdr; + /* .tbss sections effectively have zero size. */ + if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) + != SEC_THREAD_LOCAL) + last_size = hdr->size; + else + last_size = 0; + continue; + } + + /* We need a new program segment. We must create a new program + header holding all the sections from phdr_index until hdr. */ + + m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); + if (m == NULL) + goto error_return; + + *pm = m; + pm = &m->next; + + if ((hdr->flags & SEC_READONLY) == 0) + writable = TRUE; + else + writable = FALSE; + + last_hdr = hdr; + /* .tbss sections effectively have zero size. */ + if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) + last_size = hdr->size; + else + last_size = 0; + phdr_index = i; + phdr_in_segment = FALSE; + } + + /* Create a final PT_LOAD program segment. */ + if (last_hdr != NULL) + { + m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); + if (m == NULL) + goto error_return; + + *pm = m; + pm = &m->next; + } + + /* If there is a .dynamic section, throw in a PT_DYNAMIC segment. */ + if (dynsec != NULL) + { + m = _bfd_elf_make_dynamic_segment (abfd, dynsec); + if (m == NULL) + goto error_return; + *pm = m; + pm = &m->next; + } + + /* For each loadable .note section, add a PT_NOTE segment. We don't + use bfd_get_section_by_name, because if we link together + nonloadable .note sections and loadable .note sections, we will + generate two .note sections in the output file. FIXME: Using + names for section types is bogus anyhow. */ + for (s = abfd->sections; s != NULL; s = s->next) + { + if ((s->flags & SEC_LOAD) != 0 + && CONST_STRNEQ (s->name, ".note")) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_NOTE; + m->count = 1; + m->sections[0] = s; + + *pm = m; + pm = &m->next; + } + if (s->flags & SEC_THREAD_LOCAL) + { + if (! tls_count) + first_tls = s; + tls_count++; + } + } + + /* If there are any SHF_TLS output sections, add PT_TLS segment. */ + if (tls_count > 0) + { + int i; + + amt = sizeof (struct elf_segment_map); + amt += (tls_count - 1) * sizeof (asection *); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_TLS; + m->count = tls_count; + /* Mandated PF_R. */ + m->p_flags = PF_R; + m->p_flags_valid = 1; + for (i = 0; i < tls_count; ++i) + { + BFD_ASSERT (first_tls->flags & SEC_THREAD_LOCAL); + m->sections[i] = first_tls; + first_tls = first_tls->next; + } + + *pm = m; + pm = &m->next; + } + + /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME + segment. */ + eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; + if (eh_frame_hdr != NULL + && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_EH_FRAME; + m->count = 1; + m->sections[0] = eh_frame_hdr->output_section; + + *pm = m; + pm = &m->next; + } + + if (elf_tdata (abfd)->stack_flags) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_STACK; + m->p_flags = elf_tdata (abfd)->stack_flags; + m->p_flags_valid = 1; + + *pm = m; + pm = &m->next; + } + + if (dynsec != NULL && elf_tdata (abfd)->relro) + { + /* We make a PT_GNU_RELRO segment only when there is a + PT_DYNAMIC segment. */ + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_RELRO; + m->p_flags = PF_R; + m->p_flags_valid = 1; + + *pm = m; + pm = &m->next; + } + + free (sections); + elf_tdata (abfd)->segment_map = mfirst; } - /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME - segment. */ - eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; - if (eh_frame_hdr != NULL - && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_GNU_EH_FRAME; - m->count = 1; - m->sections[0] = eh_frame_hdr->output_section; + if (!elf_modify_segment_map (abfd, info)) + return FALSE; - *pm = m; - pm = &m->next; - } + for (count = 0, m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + ++count; + elf_tdata (abfd)->program_header_size = count * bed->s->sizeof_phdr; - if (elf_tdata (abfd)->stack_flags) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_GNU_STACK; - m->p_flags = elf_tdata (abfd)->stack_flags; - m->p_flags_valid = 1; - - *pm = m; - pm = &m->next; - } - - if (elf_tdata (abfd)->relro) - { - amt = sizeof (struct elf_segment_map); - m = bfd_zalloc (abfd, amt); - if (m == NULL) - goto error_return; - m->next = NULL; - m->p_type = PT_GNU_RELRO; - m->p_flags = PF_R; - m->p_flags_valid = 1; - - *pm = m; - pm = &m->next; - } - - free (sections); - sections = NULL; - - elf_tdata (abfd)->segment_map = mfirst; return TRUE; error_return: @@ -4027,7 +4277,7 @@ elf_sort_sections (const void *arg1, const void *arg2) adjustment = vma_offset + bed->maxpagesize - off_offset; else adjustment = vma_offset - off_offset; - + which can can be collapsed into the expression below. */ static file_ptr @@ -4036,154 +4286,69 @@ vma_page_aligned_bias (bfd_vma vma, ufile_ptr off, bfd_vma maxpagesize) return ((vma - off) % maxpagesize); } -static void -print_segment_map (bfd *abfd) -{ - struct elf_segment_map *m; - unsigned int i, j; - - fprintf (stderr, _(" Section to Segment mapping:\n")); - fprintf (stderr, _(" Segment Sections...\n")); - - for (i= 0, m = elf_tdata (abfd)->segment_map; - m != NULL; - i++, m = m->next) - { - const char *pt = get_segment_type (m->p_type); - char buf[32]; - - if (pt == NULL) - { - if (m->p_type >= PT_LOPROC && m->p_type <= PT_HIPROC) - sprintf (buf, "LOPROC+%7.7x", - (unsigned int) (m->p_type - PT_LOPROC)); - else if (m->p_type >= PT_LOOS && m->p_type <= PT_HIOS) - sprintf (buf, "LOOS+%7.7x", - (unsigned int) (m->p_type - PT_LOOS)); - else - snprintf (buf, sizeof (buf), "%8.8x", - (unsigned int) m->p_type); - pt = buf; - } - fprintf (stderr, " %2.2d: %14.14s: ", i, pt); - for (j = 0; j < m->count; j++) - fprintf (stderr, "%s ", m->sections [j]->name); - putc ('\n',stderr); - } -} - /* Assign file positions to the sections based on the mapping from sections to segments. This function also sets up some fields in - the file header, and writes out the program headers. */ + the file header. */ static bfd_boolean -assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) +assign_file_positions_for_load_sections (bfd *abfd, + struct bfd_link_info *link_info) { const struct elf_backend_data *bed = get_elf_backend_data (abfd); - unsigned int count; struct elf_segment_map *m; - unsigned int alloc; Elf_Internal_Phdr *phdrs; - file_ptr off, voff; - bfd_vma filehdr_vaddr, filehdr_paddr; - bfd_vma phdrs_vaddr, phdrs_paddr; Elf_Internal_Phdr *p; + file_ptr off; + bfd_size_type maxpagesize; + unsigned int alloc; + unsigned int i, j; - if (elf_tdata (abfd)->segment_map == NULL) - { - if (! map_sections_to_segments (abfd)) - return FALSE; - } - else - { - /* The placement algorithm assumes that non allocated sections are - not in PT_LOAD segments. We ensure this here by removing such - sections from the segment map. We also remove excluded - sections. */ - for (m = elf_tdata (abfd)->segment_map; - m != NULL; - m = m->next) - { - unsigned int new_count; - unsigned int i; + if (link_info == NULL + && !elf_modify_segment_map (abfd, link_info)) + return FALSE; - new_count = 0; - for (i = 0; i < m->count; i ++) - { - if ((m->sections[i]->flags & SEC_EXCLUDE) == 0 - && ((m->sections[i]->flags & SEC_ALLOC) != 0 - || m->p_type != PT_LOAD)) - { - if (i != new_count) - m->sections[new_count] = m->sections[i]; - - new_count ++; - } - } - - if (new_count != m->count) - m->count = new_count; - } - } - - if (bed->elf_backend_modify_segment_map) - { - if (! (*bed->elf_backend_modify_segment_map) (abfd, link_info)) - return FALSE; - } - - count = 0; + alloc = 0; for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - ++count; + ++alloc; elf_elfheader (abfd)->e_phoff = bed->s->sizeof_ehdr; elf_elfheader (abfd)->e_phentsize = bed->s->sizeof_phdr; - elf_elfheader (abfd)->e_phnum = count; + elf_elfheader (abfd)->e_phnum = alloc; - if (count == 0) + if (elf_tdata (abfd)->program_header_size == (bfd_size_type) -1) + elf_tdata (abfd)->program_header_size = alloc * bed->s->sizeof_phdr; + else + BFD_ASSERT (elf_tdata (abfd)->program_header_size + >= alloc * bed->s->sizeof_phdr); + + if (alloc == 0) { elf_tdata (abfd)->next_file_pos = bed->s->sizeof_ehdr; return TRUE; } - /* If we already counted the number of program segments, make sure - that we allocated enough space. This happens when SIZEOF_HEADERS - is used in a linker script. */ - alloc = elf_tdata (abfd)->program_header_size / bed->s->sizeof_phdr; - if (alloc != 0 && count > alloc) - { - ((*_bfd_error_handler) - (_("%B: Not enough room for program headers (allocated %u, need %u)"), - abfd, alloc, count)); - print_segment_map (abfd); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - - if (alloc == 0) - alloc = count; - phdrs = bfd_alloc2 (abfd, alloc, sizeof (Elf_Internal_Phdr)); + elf_tdata (abfd)->phdr = phdrs; if (phdrs == NULL) return FALSE; + maxpagesize = 1; + if ((abfd->flags & D_PAGED) != 0) + maxpagesize = bed->maxpagesize; + off = bed->s->sizeof_ehdr; off += alloc * bed->s->sizeof_phdr; - filehdr_vaddr = 0; - filehdr_paddr = 0; - phdrs_vaddr = 0; - phdrs_paddr = 0; - - for (m = elf_tdata (abfd)->segment_map, p = phdrs; + for (m = elf_tdata (abfd)->segment_map, p = phdrs, j = 0; m != NULL; - m = m->next, p++) + m = m->next, p++, j++) { - unsigned int i; asection **secpp; + bfd_vma off_adjust; + bfd_boolean no_contents; /* If elf_segment_map is not from map_sections_to_segments, the - sections may not be correctly ordered. NOTE: sorting should + sections may not be correctly ordered. NOTE: sorting should not be done to the PT_NOTE section of a corefile, which may contain several pseudo-sections artificially created by bfd. Sorting these pseudo-sections breaks things badly. */ @@ -4197,58 +4362,109 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) number of sections with contents contributing to both p_filesz and p_memsz, followed by a number of sections with no contents that just contribute to p_memsz. In this loop, OFF tracks next - available file offset for PT_LOAD and PT_NOTE segments. VOFF is - an adjustment we use for segments that have no file contents - but need zero filled memory allocation. */ - voff = 0; + available file offset for PT_LOAD and PT_NOTE segments. */ p->p_type = m->p_type; p->p_flags = m->p_flags; + if (m->count == 0) + p->p_vaddr = 0; + else + p->p_vaddr = m->sections[0]->vma - m->p_vaddr_offset; + + if (m->p_paddr_valid) + p->p_paddr = m->p_paddr; + else if (m->count == 0) + p->p_paddr = 0; + else + p->p_paddr = m->sections[0]->lma - m->p_vaddr_offset; + + if (p->p_type == PT_LOAD + && (abfd->flags & D_PAGED) != 0) + { + /* p_align in demand paged PT_LOAD segments effectively stores + the maximum page size. When copying an executable with + objcopy, we set m->p_align from the input file. Use this + value for maxpagesize rather than bed->maxpagesize, which + may be different. Note that we use maxpagesize for PT_TLS + segment alignment later in this function, so we are relying + on at least one PT_LOAD segment appearing before a PT_TLS + segment. */ + if (m->p_align_valid) + maxpagesize = m->p_align; + + p->p_align = maxpagesize; + } + else if (m->count == 0) + p->p_align = 1 << bed->s->log_file_align; + else if (m->p_align_valid) + p->p_align = m->p_align; + else + p->p_align = 0; + + no_contents = FALSE; + off_adjust = 0; if (p->p_type == PT_LOAD && m->count > 0) { bfd_size_type align; - bfd_vma adjust; unsigned int align_power = 0; - for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) + if (m->p_align_valid) + align = p->p_align; + else { - unsigned int secalign; - - secalign = bfd_get_section_alignment (abfd, *secpp); - if (secalign > align_power) - align_power = secalign; - } - align = (bfd_size_type) 1 << align_power; - - if ((abfd->flags & D_PAGED) != 0 && bed->maxpagesize > align) - align = bed->maxpagesize; - - adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align); - off += adjust; - if (adjust != 0 - && !m->includes_filehdr - && !m->includes_phdrs - && (ufile_ptr) off >= align) - { - /* If the first section isn't loadable, the same holds for - any other sections. Since the segment won't need file - space, we can make p_offset overlap some prior segment. - However, .tbss is special. If a segment starts with - .tbss, we need to look at the next section to decide - whether the segment has any loadable sections. */ - i = 0; - while ((m->sections[i]->flags & SEC_LOAD) == 0) + for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) { - if ((m->sections[i]->flags & SEC_THREAD_LOCAL) == 0 - || ++i >= m->count) - { - off -= adjust; - voff = adjust - align; - break; - } + unsigned int secalign; + + secalign = bfd_get_section_alignment (abfd, *secpp); + if (secalign > align_power) + align_power = secalign; + } + align = (bfd_size_type) 1 << align_power; + if (align < maxpagesize) + align = maxpagesize; + } + + for (i = 0; i < m->count; i++) + if ((m->sections[i]->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) + /* If we aren't making room for this section, then + it must be SHT_NOBITS regardless of what we've + set via struct bfd_elf_special_section. */ + elf_section_type (m->sections[i]) = SHT_NOBITS; + + /* Find out whether this segment contains any loadable + sections. If the first section isn't loadable, the same + holds for any other sections. */ + i = 0; + while (elf_section_type (m->sections[i]) == SHT_NOBITS) + { + /* If a segment starts with .tbss, we need to look + at the next section to decide whether the segment + has any loadable sections. */ + if ((elf_section_flags (m->sections[i]) & SHF_TLS) == 0 + || ++i >= m->count) + { + no_contents = TRUE; + break; } } + + off_adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align); + off += off_adjust; + if (no_contents) + { + /* We shouldn't need to align the segment on disk since + the segment doesn't need file space, but the gABI + arguably requires the alignment and glibc ld.so + checks it. So to comply with the alignment + requirement but not waste file space, we adjust + p_offset for just this segment. (OFF_ADJUST is + subtracted from OFF later.) This may put p_offset + past the end of file, but that shouldn't matter. */ + } + else + off_adjust = 0; } /* Make sure the .dynamic section is the first section in the PT_DYNAMIC segment. */ @@ -4263,35 +4479,14 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) return FALSE; } - if (m->count == 0) - p->p_vaddr = 0; - else - p->p_vaddr = m->sections[0]->vma; - - if (m->p_paddr_valid) - p->p_paddr = m->p_paddr; - else if (m->count == 0) - p->p_paddr = 0; - else - p->p_paddr = m->sections[0]->lma; - - if (p->p_type == PT_LOAD - && (abfd->flags & D_PAGED) != 0) - p->p_align = bed->maxpagesize; - else if (m->count == 0) - p->p_align = 1 << bed->s->log_file_align; - else - p->p_align = 0; - p->p_offset = 0; p->p_filesz = 0; p->p_memsz = 0; if (m->includes_filehdr) { - if (! m->p_flags_valid) + if (!m->p_flags_valid) p->p_flags |= PF_R; - p->p_offset = 0; p->p_filesz = bed->s->sizeof_ehdr; p->p_memsz = bed->s->sizeof_ehdr; if (m->count > 0) @@ -4308,30 +4503,17 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) } p->p_vaddr -= off; - if (! m->p_paddr_valid) + if (!m->p_paddr_valid) p->p_paddr -= off; } - if (p->p_type == PT_LOAD) - { - filehdr_vaddr = p->p_vaddr; - filehdr_paddr = p->p_paddr; - } } if (m->includes_phdrs) { - if (! m->p_flags_valid) + if (!m->p_flags_valid) p->p_flags |= PF_R; - if (m->includes_filehdr) - { - if (p->p_type == PT_LOAD) - { - phdrs_vaddr = p->p_vaddr + bed->s->sizeof_ehdr; - phdrs_paddr = p->p_paddr + bed->s->sizeof_ehdr; - } - } - else + if (!m->includes_filehdr) { p->p_offset = bed->s->sizeof_ehdr; @@ -4339,17 +4521,9 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) { BFD_ASSERT (p->p_type == PT_LOAD); p->p_vaddr -= off - p->p_offset; - if (! m->p_paddr_valid) + if (!m->p_paddr_valid) p->p_paddr -= off - p->p_offset; } - - if (p->p_type == PT_LOAD) - { - phdrs_vaddr = p->p_vaddr; - phdrs_paddr = p->p_paddr; - } - else - phdrs_vaddr = bed->maxpagesize + bed->s->sizeof_ehdr; } p->p_filesz += alloc * bed->s->sizeof_phdr; @@ -4359,36 +4533,44 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) if (p->p_type == PT_LOAD || (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core)) { - if (! m->includes_filehdr && ! m->includes_phdrs) - p->p_offset = off + voff; + if (!m->includes_filehdr && !m->includes_phdrs) + p->p_offset = off; else { file_ptr adjust; adjust = off - (p->p_offset + p->p_filesz); - p->p_filesz += adjust; + if (!no_contents) + p->p_filesz += adjust; p->p_memsz += adjust; } } + /* Set up p_filesz, p_memsz, p_align and p_flags from the section + maps. Set filepos for sections in PT_LOAD segments, and in + core files, for sections in PT_NOTE segments. + assign_file_positions_for_non_load_sections will set filepos + for other sections and update p_filesz for other segments. */ for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) { asection *sec; - flagword flags; bfd_size_type align; + Elf_Internal_Shdr *this_hdr; sec = *secpp; - flags = sec->flags; - align = 1 << bfd_get_section_alignment (abfd, sec); + this_hdr = &elf_section_data (sec)->this_hdr; + align = (bfd_size_type) 1 << bfd_get_section_alignment (abfd, sec); if (p->p_type == PT_LOAD || p->p_type == PT_TLS) { - bfd_signed_vma adjust; + bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_memsz); - if ((flags & SEC_LOAD) != 0) + if (this_hdr->sh_type != SHT_NOBITS + || ((this_hdr->sh_flags & SHF_ALLOC) != 0 + && ((this_hdr->sh_flags & SHF_TLS) == 0 + || p->p_type == PT_TLS))) { - adjust = sec->lma - (p->p_paddr + p->p_filesz); if (adjust < 0) { (*_bfd_error_handler) @@ -4396,24 +4578,13 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) abfd, sec, (unsigned long) sec->lma); adjust = 0; } - off += adjust; - p->p_filesz += adjust; - p->p_memsz += adjust; - } - /* .tbss is special. It doesn't contribute to p_memsz of - normal segments. */ - else if ((flags & SEC_THREAD_LOCAL) == 0 - || p->p_type == PT_TLS) - { - /* The section VMA must equal the file position - modulo the page size. */ - bfd_size_type page = align; - if ((abfd->flags & D_PAGED) != 0 && bed->maxpagesize > page) - page = bed->maxpagesize; - adjust = vma_page_aligned_bias (sec->vma, - p->p_vaddr + p->p_memsz, - page); p->p_memsz += adjust; + + if (this_hdr->sh_type != SHT_NOBITS) + { + off += adjust; + p->p_filesz += adjust; + } } } @@ -4423,9 +4594,9 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) everything. */ if (i == 0) { - sec->filepos = off; - off += sec->size; - p->p_filesz = sec->size; + this_hdr->sh_offset = sec->filepos = off; + off += this_hdr->sh_size; + p->p_filesz = this_hdr->sh_size; p->p_memsz = 0; p->p_align = 1; } @@ -4442,96 +4613,200 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) { if (p->p_type == PT_LOAD) { - sec->filepos = off; - /* FIXME: The SEC_HAS_CONTENTS test here dates back to - 1997, and the exact reason for it isn't clear. One - plausible explanation is that it is to work around - a problem we have with linker scripts using data - statements in NOLOAD sections. I don't think it - makes a great deal of sense to have such a section - assigned to a PT_LOAD segment, but apparently - people do this. The data statement results in a - bfd_data_link_order being built, and these need - section contents to write into. Eventually, we get - to _bfd_elf_write_object_contents which writes any - section with contents to the output. Make room - here for the write, so that following segments are - not trashed. */ - if ((flags & SEC_LOAD) != 0 - || (flags & SEC_HAS_CONTENTS) != 0) - off += sec->size; + this_hdr->sh_offset = sec->filepos = off; + if (this_hdr->sh_type != SHT_NOBITS) + off += this_hdr->sh_size; } - if ((flags & SEC_LOAD) != 0) + if (this_hdr->sh_type != SHT_NOBITS) { - p->p_filesz += sec->size; - p->p_memsz += sec->size; + p->p_filesz += this_hdr->sh_size; + /* A load section without SHF_ALLOC is something like + a note section in a PT_NOTE segment. These take + file space but are not loaded into memory. */ + if ((this_hdr->sh_flags & SHF_ALLOC) != 0) + p->p_memsz += this_hdr->sh_size; } - /* PR ld/594: Sections in note segments which are not loaded - contribute to the file size but not the in-memory size. */ - else if (p->p_type == PT_NOTE - && (flags & SEC_HAS_CONTENTS) != 0) - p->p_filesz += sec->size; - - /* .tbss is special. It doesn't contribute to p_memsz of - normal segments. */ - else if ((flags & SEC_THREAD_LOCAL) == 0 - || p->p_type == PT_TLS) - p->p_memsz += sec->size; - - if (p->p_type == PT_TLS - && sec->size == 0 - && (sec->flags & SEC_HAS_CONTENTS) == 0) + else if ((this_hdr->sh_flags & SHF_ALLOC) != 0) { - struct bfd_link_order *o = sec->map_tail.link_order; - if (o != NULL) - p->p_memsz += o->offset + o->size; + if (p->p_type == PT_TLS) + p->p_memsz += this_hdr->sh_size; + + /* .tbss is special. It doesn't contribute to p_memsz of + normal segments. */ + else if ((this_hdr->sh_flags & SHF_TLS) == 0) + p->p_memsz += this_hdr->sh_size; } - if (align > p->p_align - && (p->p_type != PT_LOAD || (abfd->flags & D_PAGED) == 0)) + if (p->p_type == PT_GNU_RELRO) + p->p_align = 1; + else if (align > p->p_align + && !m->p_align_valid + && (p->p_type != PT_LOAD + || (abfd->flags & D_PAGED) == 0)) p->p_align = align; } - if (! m->p_flags_valid) + if (!m->p_flags_valid) { p->p_flags |= PF_R; - if ((flags & SEC_CODE) != 0) + if ((this_hdr->sh_flags & SHF_EXECINSTR) != 0) p->p_flags |= PF_X; - if ((flags & SEC_READONLY) == 0) + if ((this_hdr->sh_flags & SHF_WRITE) != 0) p->p_flags |= PF_W; } } + off -= off_adjust; + + /* Check that all sections are in a PT_LOAD segment. + Don't check funky gdb generated core files. */ + if (p->p_type == PT_LOAD && bfd_get_format (abfd) != bfd_core) + for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) + { + Elf_Internal_Shdr *this_hdr; + asection *sec; + + sec = *secpp; + this_hdr = &(elf_section_data(sec)->this_hdr); + if (this_hdr->sh_size != 0 + && !ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, p)) + { + (*_bfd_error_handler) + (_("%B: section `%A' can't be allocated in segment %d"), + abfd, sec, j); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + } + + elf_tdata (abfd)->next_file_pos = off; + return TRUE; +} + +/* Assign file positions for the other sections. */ + +static bfd_boolean +assign_file_positions_for_non_load_sections (bfd *abfd, + struct bfd_link_info *link_info) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + Elf_Internal_Shdr **i_shdrpp; + Elf_Internal_Shdr **hdrpp; + Elf_Internal_Phdr *phdrs; + Elf_Internal_Phdr *p; + struct elf_segment_map *m; + bfd_vma filehdr_vaddr, filehdr_paddr; + bfd_vma phdrs_vaddr, phdrs_paddr; + file_ptr off; + unsigned int num_sec; + unsigned int i; + unsigned int count; + + i_shdrpp = elf_elfsections (abfd); + num_sec = elf_numsections (abfd); + off = elf_tdata (abfd)->next_file_pos; + for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++) + { + struct elf_obj_tdata *tdata = elf_tdata (abfd); + Elf_Internal_Shdr *hdr; + + hdr = *hdrpp; + if (hdr->bfd_section != NULL + && (hdr->bfd_section->filepos != 0 + || (hdr->sh_type == SHT_NOBITS + && hdr->contents == NULL))) + BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos); + else if ((hdr->sh_flags & SHF_ALLOC) != 0) + { + if (hdr->sh_size != 0) + ((*_bfd_error_handler) + (_("%B: warning: allocated section `%s' not in segment"), + abfd, + (hdr->bfd_section == NULL + ? "*unknown*" + : hdr->bfd_section->name))); + /* We don't need to page align empty sections. */ + if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0) + off += vma_page_aligned_bias (hdr->sh_addr, off, + bed->maxpagesize); + else + off += vma_page_aligned_bias (hdr->sh_addr, off, + hdr->sh_addralign); + off = _bfd_elf_assign_file_position_for_section (hdr, off, + FALSE); + } + else if (((hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA) + && hdr->bfd_section == NULL) + || hdr == i_shdrpp[tdata->symtab_section] + || hdr == i_shdrpp[tdata->symtab_shndx_section] + || hdr == i_shdrpp[tdata->strtab_section]) + hdr->sh_offset = -1; + else + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); + + if (i == SHN_LORESERVE - 1) + { + i += SHN_HIRESERVE + 1 - SHN_LORESERVE; + hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE; + } } /* Now that we have set the section file positions, we can set up the file positions for the non PT_LOAD segments. */ + count = 0; + filehdr_vaddr = 0; + filehdr_paddr = 0; + phdrs_vaddr = bed->maxpagesize + bed->s->sizeof_ehdr; + phdrs_paddr = 0; + phdrs = elf_tdata (abfd)->phdr; for (m = elf_tdata (abfd)->segment_map, p = phdrs; m != NULL; m = m->next, p++) { - if (p->p_type != PT_LOAD && m->count > 0) - { - BFD_ASSERT (! m->includes_filehdr && ! m->includes_phdrs); - /* If the section has not yet been assigned a file position, - do so now. The ARM BPABI requires that .dynamic section - not be marked SEC_ALLOC because it is not part of any - PT_LOAD segment, so it will not be processed above. */ - if (p->p_type == PT_DYNAMIC && m->sections[0]->filepos == 0) - { - unsigned int i; - Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); + ++count; + if (p->p_type != PT_LOAD) + continue; - i = 1; - while (i_shdrpp[i]->bfd_section != m->sections[0]) - ++i; - off = (_bfd_elf_assign_file_position_for_section - (i_shdrpp[i], off, TRUE)); - p->p_filesz = m->sections[0]->size; - } - p->p_offset = m->sections[0]->filepos; + if (m->includes_filehdr) + { + filehdr_vaddr = p->p_vaddr; + filehdr_paddr = p->p_paddr; } - if (m->count == 0) + if (m->includes_phdrs) + { + phdrs_vaddr = p->p_vaddr; + phdrs_paddr = p->p_paddr; + if (m->includes_filehdr) + { + phdrs_vaddr += bed->s->sizeof_ehdr; + phdrs_paddr += bed->s->sizeof_ehdr; + } + } + } + + for (m = elf_tdata (abfd)->segment_map, p = phdrs; + m != NULL; + m = m->next, p++) + { + if (m->count != 0) + { + if (p->p_type != PT_LOAD + && (p->p_type != PT_NOTE || bfd_get_format (abfd) != bfd_core)) + { + Elf_Internal_Shdr *hdr; + BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs); + + hdr = &elf_section_data (m->sections[m->count - 1])->this_hdr; + p->p_filesz = (m->sections[m->count - 1]->filepos + - m->sections[0]->filepos); + if (hdr->sh_type != SHT_NOBITS) + p->p_filesz += hdr->sh_size; + + p->p_offset = m->sections[0]->filepos; + } + } + else { if (m->includes_filehdr) { @@ -4554,8 +4829,8 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) if (lp->p_type == PT_LOAD && lp->p_vaddr <= link_info->relro_end && lp->p_vaddr >= link_info->relro_start - && lp->p_vaddr + lp->p_filesz - >= link_info->relro_end) + && (lp->p_vaddr + lp->p_filesz + >= link_info->relro_end)) break; } @@ -4579,131 +4854,11 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) } } - /* Clear out any program headers we allocated but did not use. */ - for (; count < alloc; count++, p++) - { - memset (p, 0, sizeof *p); - p->p_type = PT_NULL; - } - - elf_tdata (abfd)->phdr = phdrs; - elf_tdata (abfd)->next_file_pos = off; - /* Write out the program headers. */ - if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 - || bed->s->write_out_phdrs (abfd, phdrs, alloc) != 0) - return FALSE; - return TRUE; } -/* Get the size of the program header. - - If this is called by the linker before any of the section VMA's are set, it - can't calculate the correct value for a strange memory layout. This only - happens when SIZEOF_HEADERS is used in a linker script. In this case, - SORTED_HDRS is NULL and we assume the normal scenario of one text and one - data segment (exclusive of .interp and .dynamic). - - ??? User written scripts must either not use SIZEOF_HEADERS, or assume there - will be two segments. */ - -static bfd_size_type -get_program_header_size (bfd *abfd) -{ - size_t segs; - asection *s; - const struct elf_backend_data *bed = get_elf_backend_data (abfd); - - /* We can't return a different result each time we're called. */ - if (elf_tdata (abfd)->program_header_size != 0) - return elf_tdata (abfd)->program_header_size; - - if (elf_tdata (abfd)->segment_map != NULL) - { - struct elf_segment_map *m; - - segs = 0; - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) - ++segs; - elf_tdata (abfd)->program_header_size = segs * bed->s->sizeof_phdr; - return elf_tdata (abfd)->program_header_size; - } - - /* Assume we will need exactly two PT_LOAD segments: one for text - and one for data. */ - segs = 2; - - s = bfd_get_section_by_name (abfd, ".interp"); - if (s != NULL && (s->flags & SEC_LOAD) != 0) - { - /* If we have a loadable interpreter section, we need a - PT_INTERP segment. In this case, assume we also need a - PT_PHDR segment, although that may not be true for all - targets. */ - segs += 2; - } - - if (bfd_get_section_by_name (abfd, ".dynamic") != NULL) - { - /* We need a PT_DYNAMIC segment. */ - ++segs; - } - - if (elf_tdata (abfd)->eh_frame_hdr) - { - /* We need a PT_GNU_EH_FRAME segment. */ - ++segs; - } - - if (elf_tdata (abfd)->stack_flags) - { - /* We need a PT_GNU_STACK segment. */ - ++segs; - } - - if (elf_tdata (abfd)->relro) - { - /* We need a PT_GNU_RELRO segment. */ - ++segs; - } - - for (s = abfd->sections; s != NULL; s = s->next) - { - if ((s->flags & SEC_LOAD) != 0 - && strncmp (s->name, ".note", 5) == 0) - { - /* We need a PT_NOTE segment. */ - ++segs; - } - } - - for (s = abfd->sections; s != NULL; s = s->next) - { - if (s->flags & SEC_THREAD_LOCAL) - { - /* We need a PT_TLS segment. */ - ++segs; - break; - } - } - - /* Let the backend count up any program headers it might need. */ - if (bed->elf_backend_additional_program_headers) - { - int a; - - a = (*bed->elf_backend_additional_program_headers) (abfd); - if (a == -1) - abort (); - segs += a; - } - - elf_tdata (abfd)->program_header_size = segs * bed->s->sizeof_phdr; - return elf_tdata (abfd)->program_header_size; -} - /* Work out the file positions of all the sections. This is called by _bfd_elf_compute_section_file_positions. All the section sizes and VMAs must be known before this is called. @@ -4722,16 +4877,16 @@ static bfd_boolean assign_file_positions_except_relocs (bfd *abfd, struct bfd_link_info *link_info) { - struct elf_obj_tdata * const tdata = elf_tdata (abfd); - Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd); - Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); - unsigned int num_sec = elf_numsections (abfd); + struct elf_obj_tdata *tdata = elf_tdata (abfd); + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); file_ptr off; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 && bfd_get_format (abfd) != bfd_core) { + Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); + unsigned int num_sec = elf_numsections (abfd); Elf_Internal_Shdr **hdrpp; unsigned int i; @@ -4766,58 +4921,30 @@ assign_file_positions_except_relocs (bfd *abfd, } else { - unsigned int i; - Elf_Internal_Shdr **hdrpp; + unsigned int alloc; /* Assign file positions for the loaded sections based on the - assignment of sections to segments. */ - if (! assign_file_positions_for_segments (abfd, link_info)) + assignment of sections to segments. */ + if (!assign_file_positions_for_load_sections (abfd, link_info)) return FALSE; - /* Assign file positions for the other sections. */ + /* And for non-load sections. */ + if (!assign_file_positions_for_non_load_sections (abfd, link_info)) + return FALSE; - off = elf_tdata (abfd)->next_file_pos; - for (i = 1, hdrpp = i_shdrpp + 1; i < num_sec; i++, hdrpp++) + if (bed->elf_backend_modify_program_headers != NULL) { - Elf_Internal_Shdr *hdr; - - hdr = *hdrpp; - if (hdr->bfd_section != NULL - && hdr->bfd_section->filepos != 0) - hdr->sh_offset = hdr->bfd_section->filepos; - else if ((hdr->sh_flags & SHF_ALLOC) != 0) - { - if (hdr->sh_size != 0) - ((*_bfd_error_handler) - (_("%B: warning: allocated section `%s' not in segment"), - abfd, - (hdr->bfd_section == NULL - ? "*unknown*" - : hdr->bfd_section->name))); - if ((abfd->flags & D_PAGED) != 0) - off += vma_page_aligned_bias (hdr->sh_addr, off, - bed->maxpagesize); - else - off += vma_page_aligned_bias (hdr->sh_addr, off, - hdr->sh_addralign); - off = _bfd_elf_assign_file_position_for_section (hdr, off, - FALSE); - } - else if (((hdr->sh_type == SHT_REL || hdr->sh_type == SHT_RELA) - && hdr->bfd_section == NULL) - || hdr == i_shdrpp[tdata->symtab_section] - || hdr == i_shdrpp[tdata->symtab_shndx_section] - || hdr == i_shdrpp[tdata->strtab_section]) - hdr->sh_offset = -1; - else - off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); - - if (i == SHN_LORESERVE - 1) - { - i += SHN_HIRESERVE + 1 - SHN_LORESERVE; - hdrpp += SHN_HIRESERVE + 1 - SHN_LORESERVE; - } + if (!(*bed->elf_backend_modify_program_headers) (abfd, link_info)) + return FALSE; } + + /* Write out the program headers. */ + alloc = tdata->program_header_size / bed->s->sizeof_phdr; + if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 + || bed->s->write_out_phdrs (abfd, tdata->phdr, alloc) != 0) + return FALSE; + + off = tdata->next_file_pos; } /* Place the section headers. */ @@ -4825,7 +4952,7 @@ assign_file_positions_except_relocs (bfd *abfd, i_ehdrp->e_shoff = off; off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize; - elf_tdata (abfd)->next_file_pos = off; + tdata->next_file_pos = off; return TRUE; } @@ -4994,7 +5121,7 @@ _bfd_elf_write_object_contents (bfd *abfd) /* Write out the section header names. */ if (elf_shstrtab (abfd) != NULL && (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 - || ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd)))) + || !_bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd)))) return FALSE; if (bed->elf_backend_final_write_processing) @@ -5066,13 +5193,14 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr) && (flags & BSF_SECTION_SYM) && asym_ptr->section) { + asection *sec; int indx; - if (asym_ptr->section->output_section != NULL) - indx = asym_ptr->section->output_section->index; - else - indx = asym_ptr->section->index; - if (indx < elf_num_section_syms (abfd) + sec = asym_ptr->section; + if (sec->owner != abfd && sec->output_section != NULL) + sec = sec->output_section; + if (sec->owner == abfd + && (indx = sec->index) < elf_num_section_syms (abfd) && elf_section_syms (abfd)[indx] != NULL) asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i; } @@ -5082,7 +5210,7 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr) if (idx == 0) { /* This case can occur when using --strip-symbol on a symbol - which is used in a relocation entry. */ + which is used in a relocation entry. */ (*_bfd_error_handler) (_("%B: symbol `%s' required but not present"), abfd, bfd_asymbol_name (asym_ptr)); @@ -5161,7 +5289,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) && bfd_get_format (ibfd) == bfd_core \ && s->vma == 0 && s->lma == 0 \ && (bfd_vma) s->filepos >= p->p_offset \ - && ((bfd_vma) s->filepos + s->size \ + && ((bfd_vma) s->filepos + s->size \ <= p->p_offset + p->p_filesz)) /* The complicated case when p_vaddr is 0 is to handle the Solaris @@ -5175,13 +5303,13 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) && (s->flags & SEC_HAS_CONTENTS) != 0 \ && s->size > 0 \ && (bfd_vma) s->filepos >= p->p_offset \ - && ((bfd_vma) s->filepos + s->size \ + && ((bfd_vma) s->filepos + s->size \ <= p->p_offset + p->p_filesz)) /* Decide if the given section should be included in the given segment. A section will be included if: 1. It is within the address space of the segment -- we use the LMA - if that is set for the segment and the VMA otherwise, + if that is set for the segment and the VMA otherwise, 2. It is an allocated segment, 3. There is an output section associated with it, 4. The section has not already been allocated to a previous segment. @@ -5189,14 +5317,13 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) 6. PT_TLS segment includes only SHF_TLS sections. 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. 8. PT_DYNAMIC should not contain empty sections at the beginning - (with the possible exception of .dynamic). */ -#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \ + (with the possible exception of .dynamic). */ +#define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \ ((((segment->p_paddr \ ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ : IS_CONTAINED_BY_VMA (section, segment)) \ && (section->flags & SEC_ALLOC) != 0) \ || IS_COREFILE_NOTE (segment, section)) \ - && section->output_section != NULL \ && segment->p_type != PT_GNU_STACK \ && (segment->p_type != PT_TLS \ || (section->flags & SEC_THREAD_LOCAL)) \ @@ -5206,12 +5333,18 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) && (segment->p_type != PT_DYNAMIC \ || SECTION_SIZE (section, segment) > 0 \ || (segment->p_paddr \ - ? segment->p_paddr != section->lma \ - : segment->p_vaddr != section->vma) \ + ? segment->p_paddr != section->lma \ + : segment->p_vaddr != section->vma) \ || (strcmp (bfd_get_section_name (ibfd, section), ".dynamic") \ - == 0)) \ + == 0)) \ && ! section->segment_mark) +/* If the output section of a section in the input segment is NULL, + it is removed from the corresponding output segment. */ +#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \ + (IS_SECTION_IN_INPUT_SEGMENT (section, segment, bed) \ + && section->output_section != NULL) + /* Returns TRUE iff seg1 starts after the end of seg2. */ #define SEGMENT_AFTER_SEGMENT(seg1, seg2, field) \ (seg1->field >= SEGMENT_END (seg2, seg2->field)) @@ -5224,9 +5357,9 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) LMA. */ #define SEGMENT_OVERLAPS(seg1, seg2) \ ( !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_vaddr) \ - || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \ && !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_paddr) \ - || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr))) + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr))) /* Initialise the segment mark field. */ for (section = ibfd->sections; section != NULL; section = section->next) @@ -5269,7 +5402,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) if (segment2->p_vaddr < segment->p_vaddr) { /* Extend SEGMENT2 to include SEGMENT and then delete - SEGMENT. */ + SEGMENT. */ extra_length = SEGMENT_END (segment, segment->p_vaddr) - SEGMENT_END (segment2, segment2->p_vaddr); @@ -5290,7 +5423,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) else { /* Extend SEGMENT to include SEGMENT2 and then delete - SEGMENT2. */ + SEGMENT2. */ extra_length = SEGMENT_END (segment2, segment2->p_vaddr) - SEGMENT_END (segment, segment->p_vaddr); @@ -5319,22 +5452,33 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) bfd_vma suggested_lma; unsigned int j; bfd_size_type amt; + asection * first_section; if (segment->p_type == PT_NULL) continue; + first_section = NULL; /* Compute how many sections might be placed into this segment. */ for (section = ibfd->sections, section_count = 0; section != NULL; section = section->next) - if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed)) - ++section_count; + { + /* Find the first section in the input segment, which may be + removed from the corresponding output segment. */ + if (IS_SECTION_IN_INPUT_SEGMENT (section, segment, bed)) + { + if (first_section == NULL) + first_section = section; + if (section->output_section != NULL) + ++section_count; + } + } /* Allocate a segment map big enough to contain all of the sections we have selected. */ amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); - map = bfd_alloc (obfd, amt); + map = bfd_zalloc (obfd, amt); if (map == NULL) return FALSE; @@ -5344,8 +5488,15 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) map->p_type = segment->p_type; map->p_flags = segment->p_flags; map->p_flags_valid = 1; - map->p_paddr = segment->p_paddr; - map->p_paddr_valid = 1; + + /* If the first section in the input segment is removed, there is + no need to preserve segment physical address in the corresponding + output segment. */ + if (!first_section || first_section->output_section != NULL) + { + map->p_paddr = segment->p_paddr; + map->p_paddr_valid = 1; + } /* Determine if this segment contains the ELF file header and if it contains the program headers themselves. */ @@ -5462,8 +5613,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) || IS_COREFILE_NOTE (segment, section) || (bed->want_p_paddr_set_to_zero && - IS_CONTAINED_BY_VMA (output_section, segment)) - ) + IS_CONTAINED_BY_VMA (output_section, segment))) { if (matching_lma == 0) matching_lma = output_section->lma; @@ -5492,6 +5642,13 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) *pointer_to_map = map; pointer_to_map = &map->next; + if (matching_lma != map->p_paddr + && !map->includes_filehdr && !map->includes_phdrs) + /* There is some padding before the first section in the + segment. So, we must account for that in the output + segment's vma. */ + map->p_vaddr_offset = matching_lma - map->p_paddr; + free (sections); continue; } @@ -5675,6 +5832,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) #undef IS_CONTAINED_BY_LMA #undef IS_COREFILE_NOTE #undef IS_SOLARIS_PT_INTERP +#undef IS_SECTION_IN_INPUT_SEGMENT #undef INCLUDE_SECTION_IN_SEGMENT #undef SEGMENT_AFTER_SEGMENT #undef SEGMENT_OVERLAPS @@ -5709,6 +5867,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) unsigned int section_count; bfd_size_type amt; Elf_Internal_Shdr *this_hdr; + asection *first_section = NULL; /* FIXME: Do we need to copy PT_NULL segment? */ if (segment->p_type == PT_NULL) @@ -5721,7 +5880,11 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) { this_hdr = &(elf_section_data(section)->this_hdr); if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment)) - section_count++; + { + if (!first_section) + first_section = section; + section_count++; + } } /* Allocate a segment map big enough to contain @@ -5729,7 +5892,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) amt = sizeof (struct elf_segment_map); if (section_count != 0) amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); - map = bfd_alloc (obfd, amt); + map = bfd_zalloc (obfd, amt); if (map == NULL) return FALSE; @@ -5741,6 +5904,9 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) map->p_flags_valid = 1; map->p_paddr = segment->p_paddr; map->p_paddr_valid = 1; + map->p_align = segment->p_align; + map->p_align_valid = 1; + map->p_vaddr_offset = 0; /* Determine if this segment contains the ELF file header and if it contains the program headers themselves. */ @@ -5760,17 +5926,26 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) phdr_included = TRUE; } + if (!map->includes_phdrs && !map->includes_filehdr) + /* There is some other padding before the first section. */ + map->p_vaddr_offset = ((first_section ? first_section->lma : 0) + - segment->p_paddr); + if (section_count != 0) { unsigned int isec = 0; - for (section = ibfd->sections; + for (section = first_section; section != NULL; section = section->next) { this_hdr = &(elf_section_data(section)->this_hdr); if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment)) - map->sections[isec++] = section->output_section; + { + map->sections[isec++] = section->output_section; + if (isec == section_count) + break; + } } } @@ -5798,8 +5973,8 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) if (ibfd->xvec == obfd->xvec) { - /* Check if any sections in the input BFD covered by ELF program - header are changed. */ + /* Check to see if any sections in the input BFD + covered by ELF program header have changed. */ Elf_Internal_Phdr *segment; asection *section, *osec; unsigned int i, num_segments; @@ -5815,6 +5990,15 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) i < num_segments; i++, segment++) { + /* PR binutils/3535. The Solaris linker always sets the p_paddr + and p_memsz fields of special segments (DYNAMIC, INTERP) to 0 + which severly confuses things, so always regenerate the segment + map in this case. */ + if (segment->p_paddr == 0 + && segment->p_memsz == 0 + && (segment->p_type == PT_INTERP || segment->p_type == PT_DYNAMIC)) + goto rewrite; + for (section = ibfd->sections; section != NULL; section = section->next) { @@ -5842,7 +6026,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) } } - /* Check to see if any output section doesn't come from the + /* Check to see if any output section do not come from the input BFD. */ for (section = obfd->sections; section != NULL; section = section->next) @@ -5877,16 +6061,22 @@ _bfd_elf_init_private_section_data (bfd *ibfd, || obfd->xvec->flavour != bfd_target_elf_flavour) return TRUE; - /* FIXME: What if the output ELF section type has been set to - something different? */ - if (elf_section_type (osec) == SHT_NULL) + /* Don't copy the output ELF section type from input if the + output BFD section flags have been set to something different. + elf_fake_sections will set ELF section type based on BFD + section flags. */ + if (elf_section_type (osec) == SHT_NULL + && (osec->flags == isec->flags || !osec->flags)) elf_section_type (osec) = elf_section_type (isec); + /* FIXME: Is this correct for all OS/PROC specific flags? */ + elf_section_flags (osec) |= (elf_section_flags (isec) + & (SHF_MASKOS | SHF_MASKPROC)); + /* Set things up for objcopy and relocatable link. The output SHT_GROUP section will have its elf_next_in_group pointing back to the input group members. Ignore linker created group section. See elfNN_ia64_object_p in elfxx-ia64.c. */ - if (need_group) { if (elf_sec_group (isec) == NULL @@ -5951,6 +6141,8 @@ _bfd_elf_copy_private_section_data (bfd *ibfd, bfd_boolean _bfd_elf_copy_private_header_data (bfd *ibfd, bfd *obfd) { + asection *isec; + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return TRUE; @@ -5966,6 +6158,27 @@ _bfd_elf_copy_private_header_data (bfd *ibfd, bfd *obfd) return FALSE; } + /* _bfd_elf_copy_private_section_data copied over the SHF_GROUP flag + but this might be wrong if we deleted the group section. */ + for (isec = ibfd->sections; isec != NULL; isec = isec->next) + if (elf_section_type (isec) == SHT_GROUP + && isec->output_section == NULL) + { + asection *first = elf_next_in_group (isec); + asection *s = first; + while (s != NULL) + { + if (s->output_section != NULL) + { + elf_section_flags (s->output_section) &= ~SHF_GROUP; + elf_group_name (s->output_section) = NULL; + } + s = elf_next_in_group (s); + if (s == first) + break; + } + } + return TRUE; } @@ -6238,6 +6451,10 @@ Unable to find equivalent output section for symbol '%s' from section '%s'"), type = STT_FUNC; else if ((flags & BSF_OBJECT) != 0) type = STT_OBJECT; + else if ((flags & BSF_RELC) != 0) + type = STT_RELC; + else if ((flags & BSF_SRELC) != 0) + type = STT_SRELC; else type = STT_NOTYPE; @@ -7036,13 +7253,31 @@ _bfd_elf_find_inliner_info (bfd *abfd, } int -_bfd_elf_sizeof_headers (bfd *abfd, bfd_boolean reloc) +_bfd_elf_sizeof_headers (bfd *abfd, struct bfd_link_info *info) { - int ret; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + int ret = bed->s->sizeof_ehdr; + + if (!info->relocatable) + { + bfd_size_type phdr_size = elf_tdata (abfd)->program_header_size; + + if (phdr_size == (bfd_size_type) -1) + { + struct elf_segment_map *m; + + phdr_size = 0; + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + phdr_size += bed->s->sizeof_phdr; + + if (phdr_size == 0) + phdr_size = get_program_header_size (abfd, info); + } + + elf_tdata (abfd)->program_header_size = phdr_size; + ret += phdr_size; + } - ret = get_elf_backend_data (abfd)->s->sizeof_ehdr; - if (! reloc) - ret += get_program_header_size (abfd); return ret; } @@ -7178,7 +7413,7 @@ _bfd_elf_close_and_cleanup (bfd *abfd) { if (bfd_get_format (abfd) == bfd_object) { - if (elf_shstrtab (abfd) != NULL) + if (elf_tdata (abfd) != NULL && elf_shstrtab (abfd) != NULL) _bfd_elf_strtab_free (elf_shstrtab (abfd)); _bfd_dwarf2_cleanup_debug_info (abfd); } @@ -7232,13 +7467,12 @@ elfcore_maybe_make_sect (bfd *abfd, char *name, asection *sect) if (bfd_get_section_by_name (abfd, name) != NULL) return TRUE; - sect2 = bfd_make_section (abfd, name); + sect2 = bfd_make_section_with_flags (abfd, name, sect->flags); if (sect2 == NULL) return FALSE; sect2->size = sect->size; sect2->filepos = sect->filepos; - sect2->flags = sect->flags; sect2->alignment_power = sect->alignment_power; return TRUE; } @@ -7270,12 +7504,12 @@ _bfd_elfcore_make_pseudosection (bfd *abfd, return FALSE; memcpy (threaded_name, buf, len); - sect = bfd_make_section_anyway (abfd, threaded_name); + sect = bfd_make_section_anyway_with_flags (abfd, threaded_name, + SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = size; sect->filepos = filepos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; return elfcore_maybe_make_sect (abfd, name, sect); @@ -7554,7 +7788,7 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) return FALSE; memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; @@ -7569,7 +7803,6 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_reg); #endif - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; if (!elfcore_maybe_make_sect (abfd, ".reg", sect)) @@ -7584,7 +7817,7 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) return FALSE; memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; @@ -7599,7 +7832,6 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_fpreg); #endif - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; return elfcore_maybe_make_sect (abfd, ".reg2", sect); @@ -7640,7 +7872,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; @@ -7648,7 +7880,6 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) sect->filepos = (note->descpos + offsetof (struct win32_pstatus, data.thread_info.thread_context)); - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; if (pstatus.data.thread_info.is_active_thread) @@ -7668,14 +7899,13 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) memcpy (name, buf, len); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; break; @@ -7745,13 +7975,13 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) case NT_AUXV: { - asection *sect = bfd_make_section_anyway (abfd, ".auxv"); + asection *sect = bfd_make_section_anyway_with_flags (abfd, ".auxv", + SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; return TRUE; @@ -7776,7 +8006,6 @@ elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp) static bfd_boolean elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note) { - /* Signal number at offset 0x08. */ elf_tdata (abfd)->core_signal = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08); @@ -7804,9 +8033,9 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) if (note->type == NT_NETBSDCORE_PROCINFO) { /* NetBSD-specific core "procinfo". Note that we expect to - find this note before any of the others, which is fine, - since the kernel writes this note out first when it - creates a core file. */ + find this note before any of the others, which is fine, + since the kernel writes this note out first when it + creates a core file. */ return elfcore_grok_netbsd_procinfo (abfd, note); } @@ -7822,44 +8051,44 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) switch (bfd_get_arch (abfd)) { - /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 and - PT_GETFPREGS == mach+2. */ + /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0 and + PT_GETFPREGS == mach+2. */ case bfd_arch_alpha: case bfd_arch_sparc: switch (note->type) - { - case NT_NETBSDCORE_FIRSTMACH+0: - return elfcore_make_note_pseudosection (abfd, ".reg", note); + { + case NT_NETBSDCORE_FIRSTMACH+0: + return elfcore_make_note_pseudosection (abfd, ".reg", note); - case NT_NETBSDCORE_FIRSTMACH+2: - return elfcore_make_note_pseudosection (abfd, ".reg2", note); + case NT_NETBSDCORE_FIRSTMACH+2: + return elfcore_make_note_pseudosection (abfd, ".reg2", note); - default: - return TRUE; - } + default: + return TRUE; + } - /* On all other arch's, PT_GETREGS == mach+1 and - PT_GETFPREGS == mach+3. */ + /* On all other arch's, PT_GETREGS == mach+1 and + PT_GETFPREGS == mach+3. */ default: switch (note->type) - { - case NT_NETBSDCORE_FIRSTMACH+1: - return elfcore_make_note_pseudosection (abfd, ".reg", note); + { + case NT_NETBSDCORE_FIRSTMACH+1: + return elfcore_make_note_pseudosection (abfd, ".reg", note); - case NT_NETBSDCORE_FIRSTMACH+3: - return elfcore_make_note_pseudosection (abfd, ".reg2", note); + case NT_NETBSDCORE_FIRSTMACH+3: + return elfcore_make_note_pseudosection (abfd, ".reg2", note); - default: - return TRUE; - } + default: + return TRUE; + } } /* NOTREACHED */ } static bfd_boolean -elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) +elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, long *tid) { void *ddata = note->descdata; char buf[100]; @@ -7891,20 +8120,19 @@ elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) elf_tdata (abfd)->core_lwpid = *tid; /* Make a ".qnx_core_status/%d" section. */ - sprintf (buf, ".qnx_core_status/%ld", (long) *tid); + sprintf (buf, ".qnx_core_status/%ld", *tid); name = bfd_alloc (abfd, strlen (buf) + 1); if (name == NULL) return FALSE; strcpy (name, buf); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; return (elfcore_maybe_make_sect (abfd, ".qnx_core_status", sect)); @@ -7913,7 +8141,7 @@ elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) static bfd_boolean elfcore_grok_nto_regs (bfd *abfd, Elf_Internal_Note *note, - pid_t tid, + long tid, char *base) { char buf[100]; @@ -7921,20 +8149,19 @@ elfcore_grok_nto_regs (bfd *abfd, asection *sect; /* Make a "(base)/%d" section. */ - sprintf (buf, "%s/%ld", base, (long) tid); + sprintf (buf, "%s/%ld", base, tid); name = bfd_alloc (abfd, strlen (buf) + 1); if (name == NULL) return FALSE; strcpy (name, buf); - sect = bfd_make_section_anyway (abfd, name); + sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS); if (sect == NULL) return FALSE; sect->size = note->descsz; sect->filepos = note->descpos; - sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; /* This is the current thread. */ @@ -7955,7 +8182,7 @@ elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note) /* Every GREG section has a STATUS section before it. Store the tid from the previous call to pass down to the next gregs function. */ - static pid_t tid = 1; + static long tid = 1; switch (note->type) { @@ -7975,45 +8202,42 @@ elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note) /* Function: elfcore_write_note Inputs: - buffer to hold note + buffer to hold note, and current size of buffer name of note type of note data for note size of data for note + Writes note to end of buffer. ELF64 notes are written exactly as + for ELF32, despite the current (as of 2006) ELF gabi specifying + that they ought to have 8-byte namesz and descsz field, and have + 8-byte alignment. Other writers, eg. Linux kernel, do the same. + Return: - End of buffer containing note. */ + Pointer to realloc'd buffer, *BUFSIZ updated. */ char * -elfcore_write_note (bfd *abfd, +elfcore_write_note (bfd *abfd, char *buf, - int *bufsiz, + int *bufsiz, const char *name, - int type, + int type, const void *input, - int size) + int size) { Elf_External_Note *xnp; size_t namesz; - size_t pad; size_t newspace; - char *p, *dest; + char *dest; namesz = 0; - pad = 0; if (name != NULL) - { - const struct elf_backend_data *bed; + namesz = strlen (name) + 1; - namesz = strlen (name) + 1; - bed = get_elf_backend_data (abfd); - pad = -namesz & ((1 << bed->s->log_file_align) - 1); - } + newspace = 12 + ((namesz + 3) & -4) + ((size + 3) & -4); - newspace = 12 + namesz + pad + size; - - p = realloc (buf, *bufsiz + newspace); - dest = p + *bufsiz; + buf = realloc (buf, *bufsiz + newspace); + dest = buf + *bufsiz; *bufsiz += newspace; xnp = (Elf_External_Note *) dest; H_PUT_32 (abfd, namesz, xnp->namesz); @@ -8024,14 +8248,20 @@ elfcore_write_note (bfd *abfd, { memcpy (dest, name, namesz); dest += namesz; - while (pad != 0) + while (namesz & 3) { *dest++ = '\0'; - --pad; + ++namesz; } } memcpy (dest, input, size); - return p; + dest += size; + while (size & 3) + { + *dest++ = '\0'; + ++size; + } + return buf; } #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) @@ -8042,22 +8272,52 @@ elfcore_write_prpsinfo (bfd *abfd, const char *fname, const char *psargs) { - int note_type; - char *note_name = "CORE"; + const char *note_name = "CORE"; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); -#if defined (HAVE_PSINFO_T) - psinfo_t data; - note_type = NT_PSINFO; + if (bed->elf_backend_write_core_note != NULL) + { + char *ret; + ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz, + NT_PRPSINFO, fname, psargs); + if (ret != NULL) + return ret; + } + +#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) + if (bed->s->elfclass == ELFCLASS32) + { +#if defined (HAVE_PSINFO32_T) + psinfo32_t data; + int note_type = NT_PSINFO; #else - prpsinfo_t data; - note_type = NT_PRPSINFO; + prpsinfo32_t data; + int note_type = NT_PRPSINFO; #endif - memset (&data, 0, sizeof (data)); - strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); - strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); - return elfcore_write_note (abfd, buf, bufsiz, - note_name, note_type, &data, sizeof (data)); + memset (&data, 0, sizeof (data)); + strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); + strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, note_type, &data, sizeof (data)); + } + else +#endif + { +#if defined (HAVE_PSINFO_T) + psinfo_t data; + int note_type = NT_PSINFO; +#else + prpsinfo_t data; + int note_type = NT_PRPSINFO; +#endif + + memset (&data, 0, sizeof (data)); + strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); + strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); + return elfcore_write_note (abfd, buf, bufsiz, + note_name, note_type, &data, sizeof (data)); + } } #endif /* PSINFO_T or PRPSINFO_T */ @@ -8070,15 +8330,43 @@ elfcore_write_prstatus (bfd *abfd, int cursig, const void *gregs) { - prstatus_t prstat; - char *note_name = "CORE"; + const char *note_name = "CORE"; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - memset (&prstat, 0, sizeof (prstat)); - prstat.pr_pid = pid; - prstat.pr_cursig = cursig; - memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); - return elfcore_write_note (abfd, buf, bufsiz, - note_name, NT_PRSTATUS, &prstat, sizeof (prstat)); + if (bed->elf_backend_write_core_note != NULL) + { + char *ret; + ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz, + NT_PRSTATUS, + pid, cursig, gregs); + if (ret != NULL) + return ret; + } + +#if defined (HAVE_PRSTATUS32_T) + if (bed->s->elfclass == ELFCLASS32) + { + prstatus32_t prstat; + + memset (&prstat, 0, sizeof (prstat)); + prstat.pr_pid = pid; + prstat.pr_cursig = cursig; + memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); + return elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PRSTATUS, &prstat, sizeof (prstat)); + } + else +#endif + { + prstatus_t prstat; + + memset (&prstat, 0, sizeof (prstat)); + prstat.pr_pid = pid; + prstat.pr_cursig = cursig; + memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); + return elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PRSTATUS, &prstat, sizeof (prstat)); + } } #endif /* HAVE_PRSTATUS_T */ @@ -8092,7 +8380,7 @@ elfcore_write_lwpstatus (bfd *abfd, const void *gregs) { lwpstatus_t lwpstat; - char *note_name = "CORE"; + const char *note_name = "CORE"; memset (&lwpstat, 0, sizeof (lwpstat)); lwpstat.pr_lwpid = pid >> 16; @@ -8122,14 +8410,31 @@ elfcore_write_pstatus (bfd *abfd, int cursig ATTRIBUTE_UNUSED, const void *gregs ATTRIBUTE_UNUSED) { - pstatus_t pstat; - char *note_name = "CORE"; + const char *note_name = "CORE"; +#if defined (HAVE_PSTATUS32_T) + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - memset (&pstat, 0, sizeof (pstat)); - pstat.pr_pid = pid & 0xffff; - buf = elfcore_write_note (abfd, buf, bufsiz, note_name, - NT_PSTATUS, &pstat, sizeof (pstat)); - return buf; + if (bed->s->elfclass == ELFCLASS32) + { + pstatus32_t pstat; + + memset (&pstat, 0, sizeof (pstat)); + pstat.pr_pid = pid & 0xffff; + buf = elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PSTATUS, &pstat, sizeof (pstat)); + return buf; + } + else +#endif + { + pstatus_t pstat; + + memset (&pstat, 0, sizeof (pstat)); + pstat.pr_pid = pid & 0xffff; + buf = elfcore_write_note (abfd, buf, bufsiz, note_name, + NT_PSTATUS, &pstat, sizeof (pstat)); + return buf; + } } #endif /* HAVE_PSTATUS_T */ @@ -8140,7 +8445,7 @@ elfcore_write_prfpreg (bfd *abfd, const void *fpregs, int size) { - char *note_name = "CORE"; + const char *note_name = "CORE"; return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_FPREGSET, fpregs, size); } @@ -8196,21 +8501,21 @@ elfcore_read_notes (bfd *abfd, file_ptr offset, bfd_size_type size) in.descdata = in.namedata + BFD_ALIGN (in.namesz, 4); in.descpos = offset + (in.descdata - buf); - if (strncmp (in.namedata, "NetBSD-CORE", 11) == 0) - { - if (! elfcore_grok_netbsd_note (abfd, &in)) - goto error; - } - else if (strncmp (in.namedata, "QNX", 3) == 0) + if (CONST_STRNEQ (in.namedata, "NetBSD-CORE")) + { + if (! elfcore_grok_netbsd_note (abfd, &in)) + goto error; + } + else if (CONST_STRNEQ (in.namedata, "QNX")) { if (! elfcore_grok_nto_note (abfd, &in)) goto error; } else - { - if (! elfcore_grok_note (abfd, &in)) - goto error; - } + { + if (! elfcore_grok_note (abfd, &in)) + goto error; + } p = in.descdata + BFD_ALIGN (in.descsz, 4); } @@ -8516,39 +8821,41 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, return n; } -/* Sort symbol by binding and section. We want to put definitions - sorted by section at the beginning. */ +struct elf_symbuf_symbol +{ + unsigned long st_name; /* Symbol name, index in string tbl */ + unsigned char st_info; /* Type and binding attributes */ + unsigned char st_other; /* Visibilty, and target specific */ +}; + +struct elf_symbuf_head +{ + struct elf_symbuf_symbol *ssym; + bfd_size_type count; + unsigned int st_shndx; +}; + +struct elf_symbol +{ + union + { + Elf_Internal_Sym *isym; + struct elf_symbuf_symbol *ssym; + } u; + const char *name; +}; + +/* Sort references to symbols by ascending section number. */ static int elf_sort_elf_symbol (const void *arg1, const void *arg2) { - const Elf_Internal_Sym *s1; - const Elf_Internal_Sym *s2; - int shndx; + const Elf_Internal_Sym *s1 = *(const Elf_Internal_Sym **) arg1; + const Elf_Internal_Sym *s2 = *(const Elf_Internal_Sym **) arg2; - /* Make sure that undefined symbols are at the end. */ - s1 = (const Elf_Internal_Sym *) arg1; - if (s1->st_shndx == SHN_UNDEF) - return 1; - s2 = (const Elf_Internal_Sym *) arg2; - if (s2->st_shndx == SHN_UNDEF) - return -1; - - /* Sorted by section index. */ - shndx = s1->st_shndx - s2->st_shndx; - if (shndx != 0) - return shndx; - - /* Sorted by binding. */ - return ELF_ST_BIND (s1->st_info) - ELF_ST_BIND (s2->st_info); + return s1->st_shndx - s2->st_shndx; } -struct elf_symbol -{ - Elf_Internal_Sym *sym; - const char *name; -}; - static int elf_sym_name_compare (const void *arg1, const void *arg2) { @@ -8557,20 +8864,79 @@ elf_sym_name_compare (const void *arg1, const void *arg2) return strcmp (s1->name, s2->name); } +static struct elf_symbuf_head * +elf_create_symbuf (bfd_size_type symcount, Elf_Internal_Sym *isymbuf) +{ + Elf_Internal_Sym **ind, **indbufend, **indbuf + = bfd_malloc2 (symcount, sizeof (*indbuf)); + struct elf_symbuf_symbol *ssym; + struct elf_symbuf_head *ssymbuf, *ssymhead; + bfd_size_type i, shndx_count; + + if (indbuf == NULL) + return NULL; + + for (ind = indbuf, i = 0; i < symcount; i++) + if (isymbuf[i].st_shndx != SHN_UNDEF) + *ind++ = &isymbuf[i]; + indbufend = ind; + + qsort (indbuf, indbufend - indbuf, sizeof (Elf_Internal_Sym *), + elf_sort_elf_symbol); + + shndx_count = 0; + if (indbufend > indbuf) + for (ind = indbuf, shndx_count++; ind < indbufend - 1; ind++) + if (ind[0]->st_shndx != ind[1]->st_shndx) + shndx_count++; + + ssymbuf = bfd_malloc ((shndx_count + 1) * sizeof (*ssymbuf) + + (indbufend - indbuf) * sizeof (*ssymbuf)); + if (ssymbuf == NULL) + { + free (indbuf); + return NULL; + } + + ssym = (struct elf_symbuf_symbol *) (ssymbuf + shndx_count); + ssymbuf->ssym = NULL; + ssymbuf->count = shndx_count; + ssymbuf->st_shndx = 0; + for (ssymhead = ssymbuf, ind = indbuf; ind < indbufend; ssym++, ind++) + { + if (ind == indbuf || ssymhead->st_shndx != (*ind)->st_shndx) + { + ssymhead++; + ssymhead->ssym = ssym; + ssymhead->count = 0; + ssymhead->st_shndx = (*ind)->st_shndx; + } + ssym->st_name = (*ind)->st_name; + ssym->st_info = (*ind)->st_info; + ssym->st_other = (*ind)->st_other; + ssymhead->count++; + } + BFD_ASSERT ((bfd_size_type) (ssymhead - ssymbuf) == shndx_count); + + free (indbuf); + return ssymbuf; +} + /* Check if 2 sections define the same set of local and global symbols. */ bfd_boolean -bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) +bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, + struct bfd_link_info *info) { bfd *bfd1, *bfd2; const struct elf_backend_data *bed1, *bed2; Elf_Internal_Shdr *hdr1, *hdr2; bfd_size_type symcount1, symcount2; Elf_Internal_Sym *isymbuf1, *isymbuf2; - Elf_Internal_Sym *isymstart1 = NULL, *isymstart2 = NULL, *isym; - Elf_Internal_Sym *isymend; - struct elf_symbol *symp, *symtable1 = NULL, *symtable2 = NULL; + struct elf_symbuf_head *ssymbuf1, *ssymbuf2; + Elf_Internal_Sym *isym, *isymend; + struct elf_symbol *symtable1 = NULL, *symtable2 = NULL; bfd_size_type count1, count2, i; int shndx1, shndx2; bfd_boolean result; @@ -8580,10 +8946,8 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) /* If both are .gnu.linkonce sections, they have to have the same section name. */ - if (strncmp (sec1->name, ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0 - && strncmp (sec2->name, ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0) + if (CONST_STRNEQ (sec1->name, ".gnu.linkonce") + && CONST_STRNEQ (sec2->name, ".gnu.linkonce")) return strcmp (sec1->name + sizeof ".gnu.linkonce", sec2->name + sizeof ".gnu.linkonce") == 0; @@ -8619,84 +8983,155 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) if (symcount1 == 0 || symcount2 == 0) return FALSE; - isymbuf1 = bfd_elf_get_elf_syms (bfd1, hdr1, symcount1, 0, - NULL, NULL, NULL); - isymbuf2 = bfd_elf_get_elf_syms (bfd2, hdr2, symcount2, 0, - NULL, NULL, NULL); - result = FALSE; - if (isymbuf1 == NULL || isymbuf2 == NULL) - goto done; + isymbuf1 = NULL; + isymbuf2 = NULL; + ssymbuf1 = elf_tdata (bfd1)->symbuf; + ssymbuf2 = elf_tdata (bfd2)->symbuf; - /* Sort symbols by binding and section. Global definitions are at - the beginning. */ - qsort (isymbuf1, symcount1, sizeof (Elf_Internal_Sym), - elf_sort_elf_symbol); - qsort (isymbuf2, symcount2, sizeof (Elf_Internal_Sym), - elf_sort_elf_symbol); + if (ssymbuf1 == NULL) + { + isymbuf1 = bfd_elf_get_elf_syms (bfd1, hdr1, symcount1, 0, + NULL, NULL, NULL); + if (isymbuf1 == NULL) + goto done; + + if (!info->reduce_memory_overheads) + elf_tdata (bfd1)->symbuf = ssymbuf1 + = elf_create_symbuf (symcount1, isymbuf1); + } + + if (ssymbuf1 == NULL || ssymbuf2 == NULL) + { + isymbuf2 = bfd_elf_get_elf_syms (bfd2, hdr2, symcount2, 0, + NULL, NULL, NULL); + if (isymbuf2 == NULL) + goto done; + + if (ssymbuf1 != NULL && !info->reduce_memory_overheads) + elf_tdata (bfd2)->symbuf = ssymbuf2 + = elf_create_symbuf (symcount2, isymbuf2); + } + + if (ssymbuf1 != NULL && ssymbuf2 != NULL) + { + /* Optimized faster version. */ + bfd_size_type lo, hi, mid; + struct elf_symbol *symp; + struct elf_symbuf_symbol *ssym, *ssymend; + + lo = 0; + hi = ssymbuf1->count; + ssymbuf1++; + count1 = 0; + while (lo < hi) + { + mid = (lo + hi) / 2; + if ((unsigned int) shndx1 < ssymbuf1[mid].st_shndx) + hi = mid; + else if ((unsigned int) shndx1 > ssymbuf1[mid].st_shndx) + lo = mid + 1; + else + { + count1 = ssymbuf1[mid].count; + ssymbuf1 += mid; + break; + } + } + + lo = 0; + hi = ssymbuf2->count; + ssymbuf2++; + count2 = 0; + while (lo < hi) + { + mid = (lo + hi) / 2; + if ((unsigned int) shndx2 < ssymbuf2[mid].st_shndx) + hi = mid; + else if ((unsigned int) shndx2 > ssymbuf2[mid].st_shndx) + lo = mid + 1; + else + { + count2 = ssymbuf2[mid].count; + ssymbuf2 += mid; + break; + } + } + + if (count1 == 0 || count2 == 0 || count1 != count2) + goto done; + + symtable1 = bfd_malloc (count1 * sizeof (struct elf_symbol)); + symtable2 = bfd_malloc (count2 * sizeof (struct elf_symbol)); + if (symtable1 == NULL || symtable2 == NULL) + goto done; + + symp = symtable1; + for (ssym = ssymbuf1->ssym, ssymend = ssym + count1; + ssym < ssymend; ssym++, symp++) + { + symp->u.ssym = ssym; + symp->name = bfd_elf_string_from_elf_section (bfd1, + hdr1->sh_link, + ssym->st_name); + } + + symp = symtable2; + for (ssym = ssymbuf2->ssym, ssymend = ssym + count2; + ssym < ssymend; ssym++, symp++) + { + symp->u.ssym = ssym; + symp->name = bfd_elf_string_from_elf_section (bfd2, + hdr2->sh_link, + ssym->st_name); + } + + /* Sort symbol by name. */ + qsort (symtable1, count1, sizeof (struct elf_symbol), + elf_sym_name_compare); + qsort (symtable2, count1, sizeof (struct elf_symbol), + elf_sym_name_compare); + + for (i = 0; i < count1; i++) + /* Two symbols must have the same binding, type and name. */ + if (symtable1 [i].u.ssym->st_info != symtable2 [i].u.ssym->st_info + || symtable1 [i].u.ssym->st_other != symtable2 [i].u.ssym->st_other + || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) + goto done; + + result = TRUE; + goto done; + } + + symtable1 = bfd_malloc (symcount1 * sizeof (struct elf_symbol)); + symtable2 = bfd_malloc (symcount2 * sizeof (struct elf_symbol)); + if (symtable1 == NULL || symtable2 == NULL) + goto done; /* Count definitions in the section. */ count1 = 0; - for (isym = isymbuf1, isymend = isym + symcount1; - isym < isymend; isym++) - { - if (isym->st_shndx == (unsigned int) shndx1) - { - if (count1 == 0) - isymstart1 = isym; - count1++; - } - - if (count1 && isym->st_shndx != (unsigned int) shndx1) - break; - } + for (isym = isymbuf1, isymend = isym + symcount1; isym < isymend; isym++) + if (isym->st_shndx == (unsigned int) shndx1) + symtable1[count1++].u.isym = isym; count2 = 0; - for (isym = isymbuf2, isymend = isym + symcount2; - isym < isymend; isym++) - { - if (isym->st_shndx == (unsigned int) shndx2) - { - if (count2 == 0) - isymstart2 = isym; - count2++; - } - - if (count2 && isym->st_shndx != (unsigned int) shndx2) - break; - } + for (isym = isymbuf2, isymend = isym + symcount2; isym < isymend; isym++) + if (isym->st_shndx == (unsigned int) shndx2) + symtable2[count2++].u.isym = isym; if (count1 == 0 || count2 == 0 || count1 != count2) goto done; - symtable1 = bfd_malloc (count1 * sizeof (struct elf_symbol)); - symtable2 = bfd_malloc (count1 * sizeof (struct elf_symbol)); + for (i = 0; i < count1; i++) + symtable1[i].name + = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, + symtable1[i].u.isym->st_name); - if (symtable1 == NULL || symtable2 == NULL) - goto done; + for (i = 0; i < count2; i++) + symtable2[i].name + = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, + symtable2[i].u.isym->st_name); - symp = symtable1; - for (isym = isymstart1, isymend = isym + count1; - isym < isymend; isym++) - { - symp->sym = isym; - symp->name = bfd_elf_string_from_elf_section (bfd1, - hdr1->sh_link, - isym->st_name); - symp++; - } - - symp = symtable2; - for (isym = isymstart2, isymend = isym + count1; - isym < isymend; isym++) - { - symp->sym = isym; - symp->name = bfd_elf_string_from_elf_section (bfd2, - hdr2->sh_link, - isym->st_name); - symp++; - } - /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), elf_sym_name_compare); @@ -8705,8 +9140,8 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2) for (i = 0; i < count1; i++) /* Two symbols must have the same binding, type and name. */ - if (symtable1 [i].sym->st_info != symtable2 [i].sym->st_info - || symtable1 [i].sym->st_other != symtable2 [i].sym->st_other + if (symtable1 [i].u.isym->st_info != symtable2 [i].u.isym->st_info + || symtable1 [i].u.isym->st_other != symtable2 [i].u.isym->st_other || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) goto done; @@ -8728,8 +9163,7 @@ done: /* It is only used by x86-64 so far. */ asection _bfd_elf_large_com_section = BFD_FAKE_SECTION (_bfd_elf_large_com_section, - SEC_IS_COMMON, NULL, NULL, "LARGE_COMMON", - 0); + SEC_IS_COMMON, NULL, "LARGE_COMMON", 0); /* Return TRUE if 2 section types are compatible. */ @@ -8745,3 +9179,25 @@ _bfd_elf_match_sections_by_type (bfd *abfd, const asection *asec, return elf_section_type (asec) == elf_section_type (bsec); } + +void +_bfd_elf_set_osabi (bfd * abfd, + struct bfd_link_info * link_info ATTRIBUTE_UNUSED) +{ + Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ + + i_ehdrp = elf_elfheader (abfd); + + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; +} + + +/* Return TRUE for ELF symbol types that represent functions. + This is the default version of this function, which is sufficient for + most targets. It returns true if TYPE is STT_FUNC. */ + +bfd_boolean +_bfd_elf_is_function_type (unsigned int type) +{ + return (type == STT_FUNC); +} diff --git a/contrib/binutils/bfd/elf32-arc.c b/contrib/binutils/bfd/elf32-arc.c index a6011bdb32d..58d63010783 100644 --- a/contrib/binutils/bfd/elf32-arc.c +++ b/contrib/binutils/bfd/elf32-arc.c @@ -1,5 +1,5 @@ /* ARC-specific support for 32-bit ELF - Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005 + Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/arc.h" @@ -147,6 +147,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_arc_howto_table) / sizeof (elf_arc_howto_table[0]); + i++) + if (elf_arc_howto_table[i].name != NULL + && strcasecmp (elf_arc_howto_table[i].name, r_name) == 0) + return &elf_arc_howto_table[i]; + + return NULL; +} + /* Set the howto pointer for an ARC ELF reloc. */ static void diff --git a/contrib/binutils/bfd/elf32-arm.c b/contrib/binutils/bfd/elf32-arm.c index 4c65de1663a..8e1caa8be7a 100644 --- a/contrib/binutils/bfd/elf32-arm.c +++ b/contrib/binutils/bfd/elf32-arm.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - 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. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "libbfd.h" #include "elf-bfd.h" @@ -66,7 +66,7 @@ #define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM #endif -static const struct elf_backend_data elf32_arm_vxworks_bed; +static struct elf_backend_data elf32_arm_vxworks_bed; /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO @@ -134,19 +134,19 @@ static reloc_howto_type elf32_arm_howto_table_1[] = TRUE), /* pcrel_offset */ /* 8 bit absolute - R_ARM_LDR_PC_G0 in AAELF */ - HOWTO (R_ARM_PC13, /* type */ + HOWTO (R_ARM_LDR_PC_G0, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ + 32, /* bitsize */ + TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield,/* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PC13", /* name */ + "R_ARM_LDR_PC_G0", /* name */ FALSE, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* 16 bit absolute */ HOWTO (R_ARM_ABS16, /* type */ @@ -221,11 +221,10 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* FIXME: Has two more bits of offset in Thumb32. */ HOWTO (R_ARM_THM_CALL, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 23, /* bitsize */ + 25, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ @@ -839,12 +838,12 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 13, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed,/* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_ALU_PREL_11_0",/* name */ FALSE, /* partial_inplace */ - 0x040070ff, /* src_mask */ - 0x040070ff, /* dst_mask */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_ARM_THM_PC12, /* type */ @@ -853,12 +852,12 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 13, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed,/* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC12", /* name */ FALSE, /* partial_inplace */ - 0x040070ff, /* src_mask */ - 0x040070ff, /* dst_mask */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_ARM_ABS32_NOI, /* type */ @@ -888,13 +887,389 @@ static reloc_howto_type elf32_arm_howto_table_1[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ -}; -/* Relocations 57 .. 83 are the "group relocations" which we do not - support. */ + /* Group relocations. */ + + HOWTO (R_ARM_ALU_PC_G0_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G0_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G1_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G1_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_PC_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_PC_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_PC_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_PC_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_PC_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_PC_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_PC_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_PC_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G0_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G0_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G1_NC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G1_NC", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_ALU_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ALU_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDR_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDR_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDRS_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDRS_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_SB_G0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_SB_G0", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_SB_G1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_SB_G1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_ARM_LDC_SB_G2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_LDC_SB_G2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* End of group relocations. */ -static reloc_howto_type elf32_arm_howto_table_2[] = -{ HOWTO (R_ARM_MOVW_BREL_NC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1234,7 +1609,7 @@ static reloc_howto_type elf32_arm_howto_table_2[] = 249-255 extended, currently unused, relocations: */ -static reloc_howto_type elf32_arm_howto_table_3[4] = +static reloc_howto_type elf32_arm_howto_table_2[4] = { HOWTO (R_ARM_RREL32, /* type */ 0, /* rightshift */ @@ -1299,13 +1674,9 @@ elf32_arm_howto_from_type (unsigned int r_type) if (r_type < NUM_ELEM (elf32_arm_howto_table_1)) return &elf32_arm_howto_table_1[r_type]; - if (r_type >= R_ARM_MOVW_BREL_NC - && r_type < R_ARM_MOVW_BREL_NC + NUM_ELEM (elf32_arm_howto_table_2)) - return &elf32_arm_howto_table_2[r_type - R_ARM_MOVW_BREL_NC]; - if (r_type >= R_ARM_RREL32 && r_type < R_ARM_RREL32 + NUM_ELEM (elf32_arm_howto_table_2)) - return &elf32_arm_howto_table_3[r_type - R_ARM_RREL32]; + return &elf32_arm_howto_table_2[r_type - R_ARM_RREL32]; return NULL; } @@ -1370,6 +1741,42 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = {BFD_RELOC_ARM_TLS_LE32, R_ARM_TLS_LE32}, {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY}, + {BFD_RELOC_ARM_MOVW, R_ARM_MOVW_ABS_NC}, + {BFD_RELOC_ARM_MOVT, R_ARM_MOVT_ABS}, + {BFD_RELOC_ARM_MOVW_PCREL, R_ARM_MOVW_PREL_NC}, + {BFD_RELOC_ARM_MOVT_PCREL, R_ARM_MOVT_PREL}, + {BFD_RELOC_ARM_THUMB_MOVW, R_ARM_THM_MOVW_ABS_NC}, + {BFD_RELOC_ARM_THUMB_MOVT, R_ARM_THM_MOVT_ABS}, + {BFD_RELOC_ARM_THUMB_MOVW_PCREL, R_ARM_THM_MOVW_PREL_NC}, + {BFD_RELOC_ARM_THUMB_MOVT_PCREL, R_ARM_THM_MOVT_PREL}, + {BFD_RELOC_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0_NC}, + {BFD_RELOC_ARM_ALU_PC_G0, R_ARM_ALU_PC_G0}, + {BFD_RELOC_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1_NC}, + {BFD_RELOC_ARM_ALU_PC_G1, R_ARM_ALU_PC_G1}, + {BFD_RELOC_ARM_ALU_PC_G2, R_ARM_ALU_PC_G2}, + {BFD_RELOC_ARM_LDR_PC_G0, R_ARM_LDR_PC_G0}, + {BFD_RELOC_ARM_LDR_PC_G1, R_ARM_LDR_PC_G1}, + {BFD_RELOC_ARM_LDR_PC_G2, R_ARM_LDR_PC_G2}, + {BFD_RELOC_ARM_LDRS_PC_G0, R_ARM_LDRS_PC_G0}, + {BFD_RELOC_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G1}, + {BFD_RELOC_ARM_LDRS_PC_G2, R_ARM_LDRS_PC_G2}, + {BFD_RELOC_ARM_LDC_PC_G0, R_ARM_LDC_PC_G0}, + {BFD_RELOC_ARM_LDC_PC_G1, R_ARM_LDC_PC_G1}, + {BFD_RELOC_ARM_LDC_PC_G2, R_ARM_LDC_PC_G2}, + {BFD_RELOC_ARM_ALU_SB_G0_NC, R_ARM_ALU_SB_G0_NC}, + {BFD_RELOC_ARM_ALU_SB_G0, R_ARM_ALU_SB_G0}, + {BFD_RELOC_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1_NC}, + {BFD_RELOC_ARM_ALU_SB_G1, R_ARM_ALU_SB_G1}, + {BFD_RELOC_ARM_ALU_SB_G2, R_ARM_ALU_SB_G2}, + {BFD_RELOC_ARM_LDR_SB_G0, R_ARM_LDR_SB_G0}, + {BFD_RELOC_ARM_LDR_SB_G1, R_ARM_LDR_SB_G1}, + {BFD_RELOC_ARM_LDR_SB_G2, R_ARM_LDR_SB_G2}, + {BFD_RELOC_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G0}, + {BFD_RELOC_ARM_LDRS_SB_G1, R_ARM_LDRS_SB_G1}, + {BFD_RELOC_ARM_LDRS_SB_G2, R_ARM_LDRS_SB_G2}, + {BFD_RELOC_ARM_LDC_SB_G0, R_ARM_LDC_SB_G0}, + {BFD_RELOC_ARM_LDC_SB_G1, R_ARM_LDC_SB_G1}, + {BFD_RELOC_ARM_LDC_SB_G2, R_ARM_LDC_SB_G2} }; static reloc_howto_type * @@ -1384,6 +1791,31 @@ elf32_arm_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +static reloc_howto_type * +elf32_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf32_arm_howto_table_1) + / sizeof (elf32_arm_howto_table_1[0])); + i++) + if (elf32_arm_howto_table_1[i].name != NULL + && strcasecmp (elf32_arm_howto_table_1[i].name, r_name) == 0) + return &elf32_arm_howto_table_1[i]; + + for (i = 0; + i < (sizeof (elf32_arm_howto_table_2) + / sizeof (elf32_arm_howto_table_2[0])); + i++) + if (elf32_arm_howto_table_2[i].name != NULL + && strcasecmp (elf32_arm_howto_table_2[i].name, r_name) == 0) + return &elf32_arm_howto_table_2[i]; + + return NULL; +} + /* Support for core dump NOTE sections */ static bfd_boolean elf32_arm_nabi_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) @@ -1485,6 +1917,9 @@ typedef unsigned short int insn16; #define ARM2THUMB_GLUE_SECTION_NAME ".glue_7" #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" +#define VFP11_ERRATUM_VENEER_SECTION_NAME ".vfp11_veneer" +#define VFP11_ERRATUM_VENEER_ENTRY_NAME "__vfp11_veneer_%x" + /* The name of the dynamic interpreter. This is put in the .interp section. */ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" @@ -1597,11 +2032,46 @@ typedef struct elf32_elf_section_map } elf32_arm_section_map; +/* Information about a VFP11 erratum veneer, or a branch to such a veneer. */ + +typedef enum +{ + VFP11_ERRATUM_BRANCH_TO_ARM_VENEER, + VFP11_ERRATUM_BRANCH_TO_THUMB_VENEER, + VFP11_ERRATUM_ARM_VENEER, + VFP11_ERRATUM_THUMB_VENEER +} +elf32_vfp11_erratum_type; + +typedef struct elf32_vfp11_erratum_list +{ + struct elf32_vfp11_erratum_list *next; + bfd_vma vma; + union + { + struct + { + struct elf32_vfp11_erratum_list *veneer; + unsigned int vfp_insn; + } b; + struct + { + struct elf32_vfp11_erratum_list *branch; + unsigned int id; + } v; + } u; + elf32_vfp11_erratum_type type; +} +elf32_vfp11_erratum_list; + typedef struct _arm_elf_section_data { struct bfd_elf_section_data elf; unsigned int mapcount; + unsigned int mapsize; elf32_arm_section_map *map; + unsigned int erratumcount; + elf32_vfp11_erratum_list *erratumlist; } _arm_elf_section_data; @@ -1611,22 +2081,6 @@ _arm_elf_section_data; /* The size of the thread control block. */ #define TCB_SIZE 8 -#define NUM_KNOWN_ATTRIBUTES 32 - -typedef struct aeabi_attribute -{ - int type; - unsigned int i; - char *s; -} aeabi_attribute; - -typedef struct aeabi_attribute_list -{ - struct aeabi_attribute_list *next; - int tag; - aeabi_attribute attr; -} aeabi_attribute_list; - struct elf32_arm_obj_tdata { struct elf_obj_tdata root; @@ -1634,8 +2088,8 @@ struct elf32_arm_obj_tdata /* tls_type for each local got entry. */ char *local_got_tls_type; - aeabi_attribute known_eabi_attributes[NUM_KNOWN_ATTRIBUTES]; - aeabi_attribute_list *other_eabi_attributes; + /* Zero to warn when linking objects with incompatible enum sizes. */ + int no_enum_size_warning; }; #define elf32_arm_tdata(abfd) \ @@ -1647,11 +2101,14 @@ struct elf32_arm_obj_tdata static bfd_boolean elf32_arm_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf32_arm_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf32_arm_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* The ARM linker needs to keep track of the number of relocs that it @@ -1698,6 +2155,10 @@ struct elf32_arm_link_hash_entry #define GOT_TLS_GD 2 #define GOT_TLS_IE 4 unsigned char tls_type; + + /* The symbol marking the real symbol location for exported thumb + symbols with Arm stubs. */ + struct elf_link_hash_entry *export_glue; }; /* Traverse an arm ELF linker hash table. */ @@ -1723,6 +2184,10 @@ struct elf32_arm_link_hash_table /* The size in bytes of the section containing the ARM-to-Thumb glue. */ bfd_size_type arm_glue_size; + /* The size in bytes of the section containing glue for VFP11 erratum + veneers. */ + bfd_size_type vfp11_erratum_glue_size; + /* An arbitrary input BFD chosen to hold the glue sections. */ bfd * bfd_of_glue_owner; @@ -1730,7 +2195,7 @@ struct elf32_arm_link_hash_table int byteswap_code; /* Zero if R_ARM_TARGET1 means R_ARM_ABS32. - Nonzero if R_ARM_TARGET1 means R_ARM_ABS32. */ + Nonzero if R_ARM_TARGET1 means R_ARM_REL32. */ int target1_is_rel; /* The relocation to use for R_ARM_TARGET2 relocations. */ @@ -1742,6 +2207,16 @@ struct elf32_arm_link_hash_table /* Nonzero if the ARM/Thumb BLX instructions are available for use. */ int use_blx; + /* What sort of code sequences we should look for which may trigger the + VFP11 denorm erratum. */ + bfd_arm_vfp11_fix vfp11_fix; + + /* Global counter for the number of fixes we have emitted. */ + int num_vfp11_fixes; + + /* Nonzero to force PIC branch veneers. */ + int pic_veneer; + /* The number of bytes in the initial entry in the PLT. */ bfd_size_type plt_header_size; @@ -1809,6 +2284,7 @@ elf32_arm_link_hash_newfunc (struct bfd_hash_entry * entry, ret->tls_type = GOT_UNKNOWN; ret->plt_thumb_refcount = 0; ret->plt_got_offset = -1; + ret->export_glue = NULL; } return (struct bfd_hash_entry *) ret; @@ -1822,9 +2298,9 @@ reloc_section_p (struct elf32_arm_link_hash_table *htab, const char *name, asection *s) { if (htab->use_rel) - return strncmp (name, ".rel", 4) == 0 && strcmp (s->name, name + 4) == 0; + return CONST_STRNEQ (name, ".rel") && strcmp (s->name, name + 4) == 0; else - return strncmp (name, ".rela", 5) == 0 && strcmp (s->name, name + 5) == 0; + return CONST_STRNEQ (name, ".rela") && strcmp (s->name, name + 5) == 0; } /* Create .got, .gotplt, and .rel(a).got sections in DYNOBJ, and set up @@ -1957,15 +2433,17 @@ elf32_arm_copy_indirect_symbol (struct bfd_link_info *info, eind->relocs_copied = NULL; } - /* Copy over PLT info. */ - edir->plt_thumb_refcount += eind->plt_thumb_refcount; - eind->plt_thumb_refcount = 0; - - if (ind->root.type == bfd_link_hash_indirect - && dir->got.refcount <= 0) + if (ind->root.type == bfd_link_hash_indirect) { - edir->tls_type = eind->tls_type; - eind->tls_type = GOT_UNKNOWN; + /* Copy over PLT info. */ + edir->plt_thumb_refcount += eind->plt_thumb_refcount; + eind->plt_thumb_refcount = 0; + + if (dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } } _bfd_elf_link_hash_copy_indirect (info, dir, ind); @@ -2001,6 +2479,9 @@ elf32_arm_link_hash_table_create (bfd *abfd) ret->srelplt2 = NULL; ret->thumb_glue_size = 0; ret->arm_glue_size = 0; + ret->vfp11_fix = BFD_ARM_VFP11_FIX_NONE; + ret->vfp11_erratum_glue_size = 0; + ret->num_vfp11_fixes = 0; ret->bfd_of_glue_owner = NULL; ret->byteswap_code = 0; ret->target1_is_rel = 0; @@ -2029,7 +2510,7 @@ elf32_arm_link_hash_table_create (bfd *abfd) static struct elf_link_hash_entry * find_thumb_glue (struct bfd_link_info *link_info, const char *name, - bfd *input_bfd) + char **error_message) { char *tmp_name; struct elf_link_hash_entry *hash; @@ -2049,9 +2530,8 @@ find_thumb_glue (struct bfd_link_info *link_info, (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (hash == NULL) - /* xgettext:c-format */ - (*_bfd_error_handler) (_("%B: unable to find THUMB glue '%s' for `%s'"), - input_bfd, tmp_name, name); + asprintf (error_message, _("unable to find THUMB glue '%s' for '%s'"), + tmp_name, name); free (tmp_name); @@ -2063,7 +2543,7 @@ find_thumb_glue (struct bfd_link_info *link_info, static struct elf_link_hash_entry * find_arm_glue (struct bfd_link_info *link_info, const char *name, - bfd *input_bfd) + char **error_message) { char *tmp_name; struct elf_link_hash_entry *myh; @@ -2083,9 +2563,8 @@ find_arm_glue (struct bfd_link_info *link_info, (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) - /* xgettext:c-format */ - (*_bfd_error_handler) (_("%B: unable to find ARM glue '%s' for `%s'"), - input_bfd, tmp_name, name); + asprintf (error_message, _("unable to find ARM glue '%s' for '%s'"), + tmp_name, name); free (tmp_name); @@ -2101,6 +2580,13 @@ find_arm_glue (struct bfd_link_info *link_info, __func_addr: .word func @ behave as if you saw a ARM_32 reloc. + (v5t static images) + .arm + __func_from_arm: + ldr pc, __func_addr + __func_addr: + .word func @ behave as if you saw a ARM_32 reloc. + (relocatable images) .arm __func_from_arm: @@ -2116,6 +2602,10 @@ static const insn32 a2t1_ldr_insn = 0xe59fc000; static const insn32 a2t2_bx_r12_insn = 0xe12fff1c; static const insn32 a2t3_func_addr_insn = 0x00000001; +#define ARM2THUMB_V5_STATIC_GLUE_SIZE 8 +static const insn32 a2t1v5_ldr_insn = 0xe51ff004; +static const insn32 a2t2v5_func_addr_insn = 0x00000001; + #define ARM2THUMB_PIC_GLUE_SIZE 16 static const insn32 a2t1p_ldr_insn = 0xe59fc004; static const insn32 a2t2p_add_pc_insn = 0xe08cc00f; @@ -2142,6 +2632,8 @@ static const insn16 t2a1_bx_pc_insn = 0x4778; static const insn16 t2a2_noop_insn = 0x46c0; static const insn32 t2a3_b_insn = 0xea000000; +#define VFP11_ERRATUM_VENEER_SIZE 8 + #ifndef ELFARM_NABI_C_INCLUDED bfd_boolean bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info) @@ -2165,7 +2657,7 @@ bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info) foo = bfd_alloc (globals->bfd_of_glue_owner, globals->arm_glue_size); - s->size = globals->arm_glue_size; + BFD_ASSERT (s->size == globals->arm_glue_size); s->contents = foo; } @@ -2180,14 +2672,32 @@ bfd_elf32_arm_allocate_interworking_sections (struct bfd_link_info * info) foo = bfd_alloc (globals->bfd_of_glue_owner, globals->thumb_glue_size); - s->size = globals->thumb_glue_size; + BFD_ASSERT (s->size == globals->thumb_glue_size); + s->contents = foo; + } + + if (globals->vfp11_erratum_glue_size != 0) + { + BFD_ASSERT (globals->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name + (globals->bfd_of_glue_owner, VFP11_ERRATUM_VENEER_SECTION_NAME); + + BFD_ASSERT (s != NULL); + + foo = bfd_alloc (globals->bfd_of_glue_owner, + globals->vfp11_erratum_glue_size); + + BFD_ASSERT (s->size == globals->vfp11_erratum_glue_size); s->contents = foo; } return TRUE; } -static void +/* Allocate space and symbols for calling a Thumb function from Arm mode. + returns the symbol identifying teh stub. */ +static struct elf_link_hash_entry * record_arm_to_thumb_glue (struct bfd_link_info * link_info, struct elf_link_hash_entry * h) { @@ -2198,6 +2708,7 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info, struct bfd_link_hash_entry * bh; struct elf32_arm_link_hash_table * globals; bfd_vma val; + bfd_size_type size; globals = elf32_arm_hash_table (link_info); @@ -2222,7 +2733,7 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info, { /* We've already seen this guy. */ free (tmp_name); - return; + return myh; } /* The only trick here is using hash_table->arm_glue_size as the value. @@ -2240,12 +2751,18 @@ record_arm_to_thumb_glue (struct bfd_link_info * link_info, free (tmp_name); - if ((link_info->shared || globals->root.is_relocatable_executable)) - globals->arm_glue_size += ARM2THUMB_PIC_GLUE_SIZE; + if (link_info->shared || globals->root.is_relocatable_executable + || globals->pic_veneer) + size = ARM2THUMB_PIC_GLUE_SIZE; + else if (globals->use_blx) + size = ARM2THUMB_V5_STATIC_GLUE_SIZE; else - globals->arm_glue_size += ARM2THUMB_STATIC_GLUE_SIZE; + size = ARM2THUMB_STATIC_GLUE_SIZE; - return; + s->size += size; + globals->arm_glue_size += size; + + return myh; } static void @@ -2319,11 +2836,162 @@ record_thumb_to_arm_glue (struct bfd_link_info *link_info, free (tmp_name); + s->size += THUMB2ARM_GLUE_SIZE; hash_table->thumb_glue_size += THUMB2ARM_GLUE_SIZE; return; } + +/* Add an entry to the code/data map for section SEC. */ + +static void +elf32_arm_section_map_add (asection *sec, char type, bfd_vma vma) +{ + struct _arm_elf_section_data *sec_data = elf32_arm_section_data (sec); + unsigned int newidx; + + if (sec_data->map == NULL) + { + sec_data->map = bfd_malloc (sizeof (elf32_arm_section_map)); + sec_data->mapcount = 0; + sec_data->mapsize = 1; + } + + newidx = sec_data->mapcount++; + + if (sec_data->mapcount > sec_data->mapsize) + { + sec_data->mapsize *= 2; + sec_data->map = bfd_realloc (sec_data->map, sec_data->mapsize + * sizeof (elf32_arm_section_map)); + } + + sec_data->map[newidx].vma = vma; + sec_data->map[newidx].type = type; +} + + +/* Record information about a VFP11 denorm-erratum veneer. Only ARM-mode + veneers are handled for now. */ + +static bfd_vma +record_vfp11_erratum_veneer (struct bfd_link_info *link_info, + elf32_vfp11_erratum_list *branch, + bfd *branch_bfd, + asection *branch_sec, + unsigned int offset) +{ + asection *s; + struct elf32_arm_link_hash_table *hash_table; + char *tmp_name; + struct elf_link_hash_entry *myh; + struct bfd_link_hash_entry *bh; + bfd_vma val; + struct _arm_elf_section_data *sec_data; + int errcount; + elf32_vfp11_erratum_list *newerr; + + hash_table = elf32_arm_hash_table (link_info); + + BFD_ASSERT (hash_table != NULL); + BFD_ASSERT (hash_table->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name + (hash_table->bfd_of_glue_owner, VFP11_ERRATUM_VENEER_SECTION_NAME); + + sec_data = elf32_arm_section_data (s); + + BFD_ASSERT (s != NULL); + + tmp_name = bfd_malloc ((bfd_size_type) strlen + (VFP11_ERRATUM_VENEER_ENTRY_NAME) + 10); + + BFD_ASSERT (tmp_name); + + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME, + hash_table->num_vfp11_fixes); + + myh = elf_link_hash_lookup + (&(hash_table)->root, tmp_name, FALSE, FALSE, FALSE); + + BFD_ASSERT (myh == NULL); + + bh = NULL; + val = hash_table->vfp11_erratum_glue_size; + _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, + tmp_name, BSF_FUNCTION | BSF_LOCAL, s, val, + NULL, TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_FUNC); + myh->forced_local = 1; + + /* Link veneer back to calling location. */ + errcount = ++(sec_data->erratumcount); + newerr = bfd_zmalloc (sizeof (elf32_vfp11_erratum_list)); + + newerr->type = VFP11_ERRATUM_ARM_VENEER; + newerr->vma = -1; + newerr->u.v.branch = branch; + newerr->u.v.id = hash_table->num_vfp11_fixes; + branch->u.b.veneer = newerr; + + newerr->next = sec_data->erratumlist; + sec_data->erratumlist = newerr; + + /* A symbol for the return from the veneer. */ + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME "_r", + hash_table->num_vfp11_fixes); + + myh = elf_link_hash_lookup + (&(hash_table)->root, tmp_name, FALSE, FALSE, FALSE); + + if (myh != NULL) + abort (); + + bh = NULL; + val = offset + 4; + _bfd_generic_link_add_one_symbol (link_info, branch_bfd, tmp_name, BSF_LOCAL, + branch_sec, val, NULL, TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_FUNC); + myh->forced_local = 1; + + free (tmp_name); + + /* Generate a mapping symbol for the veneer section, and explicitly add an + entry for that symbol to the code/data map for the section. */ + if (hash_table->vfp11_erratum_glue_size == 0) + { + bh = NULL; + /* FIXME: Creates an ARM symbol. Thumb mode will need attention if it + ever requires this erratum fix. */ + _bfd_generic_link_add_one_symbol (link_info, + hash_table->bfd_of_glue_owner, "$a", + BSF_LOCAL, s, 0, NULL, + TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE); + myh->forced_local = 1; + + /* The elf32_arm_init_maps function only cares about symbols from input + BFDs. We must make a note of this generated mapping symbol + ourselves so that code byteswapping works properly in + elf32_arm_write_section. */ + elf32_arm_section_map_add (s, 'a', 0); + } + + s->size += VFP11_ERRATUM_VENEER_SIZE; + hash_table->vfp11_erratum_glue_size += VFP11_ERRATUM_VENEER_SIZE; + hash_table->num_vfp11_fixes++; + + /* The offset of the veneer. */ + return val; +} + /* Add the glue sections to ABFD. This function is called from the linker scripts in ld/emultempl/{armelf}.em. */ @@ -2346,7 +3014,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd, /* Note: we do not include the flag SEC_LINKER_CREATED, as this will prevent elf_link_input_bfd() from processing the contents of this section. */ - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME, @@ -2365,8 +3034,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd, if (sec == NULL) { - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_CODE | SEC_READONLY; + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); sec = bfd_make_section_with_flags (abfd, THUMB2ARM_GLUE_SECTION_NAME, @@ -2379,6 +3048,24 @@ bfd_elf32_arm_add_glue_sections_to_bfd (bfd *abfd, sec->gc_mark = 1; } + sec = bfd_get_section_by_name (abfd, VFP11_ERRATUM_VENEER_SECTION_NAME); + + if (sec == NULL) + { + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_CODE | SEC_READONLY); + + sec = bfd_make_section_with_flags (abfd, + VFP11_ERRATUM_VENEER_SECTION_NAME, + flags); + + if (sec == NULL + || !bfd_set_section_alignment (abfd, sec, 2)) + return FALSE; + + sec->gc_mark = 1; + } + return TRUE; } @@ -2414,14 +3101,14 @@ bfd_elf32_arm_get_bfd_for_interworking (bfd *abfd, struct bfd_link_info *info) static void check_use_blx(struct elf32_arm_link_hash_table *globals) { - if (elf32_arm_get_eabi_attr_int (globals->obfd, Tag_CPU_arch) > 2) + if (bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC, + Tag_CPU_arch) > 2) globals->use_blx = 1; } bfd_boolean bfd_elf32_arm_process_before_allocation (bfd *abfd, - struct bfd_link_info *link_info, - int byteswap_code) + struct bfd_link_info *link_info) { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *internal_relocs = NULL; @@ -2444,13 +3131,12 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - if (byteswap_code && !bfd_big_endian (abfd)) + if (globals->byteswap_code && !bfd_big_endian (abfd)) { _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."), abfd); return FALSE; } - globals->byteswap_code = byteswap_code; /* Rummage around all the relocs and map the glue vectors. */ sec = abfd->sections; @@ -2463,6 +3149,9 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, if (sec->reloc_count == 0) continue; + if ((sec->flags & SEC_EXCLUDE) != 0) + continue; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Load the relocs. */ @@ -2546,7 +3235,8 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, /* This one is a call from thumb code. We look up the target of the call. If it is not a thumb target, we insert glue. */ - if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC && !globals->use_blx) + if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC && !globals->use_blx + && h->root.type != bfd_link_hash_undefweak) record_thumb_to_arm_glue (link_info, h); break; @@ -2581,14 +3271,654 @@ error_return: #endif +/* Initialise maps of ARM/Thumb/data for input BFDs. */ + +void +bfd_elf32_arm_init_maps (bfd *abfd) +{ + Elf_Internal_Sym *isymbuf; + Elf_Internal_Shdr *hdr; + unsigned int i, localsyms; + + if ((abfd->flags & DYNAMIC) != 0) + return; + + hdr = &elf_tdata (abfd)->symtab_hdr; + localsyms = hdr->sh_info; + + /* Obtain a buffer full of symbols for this BFD. The hdr->sh_info field + should contain the number of local symbols, which should come before any + global symbols. Mapping symbols are always local. */ + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, localsyms, 0, NULL, NULL, + NULL); + + /* No internal symbols read? Skip this BFD. */ + if (isymbuf == NULL) + return; + + for (i = 0; i < localsyms; i++) + { + Elf_Internal_Sym *isym = &isymbuf[i]; + asection *sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + const char *name; + + if (sec != NULL + && ELF_ST_BIND (isym->st_info) == STB_LOCAL) + { + name = bfd_elf_string_from_elf_section (abfd, + hdr->sh_link, isym->st_name); + + if (bfd_is_arm_special_symbol_name (name, + BFD_ARM_SPECIAL_SYM_TYPE_MAP)) + elf32_arm_section_map_add (sec, name[1], isym->st_value); + } + } +} + + +void +bfd_elf32_arm_set_vfp11_fix (bfd *obfd, struct bfd_link_info *link_info) +{ + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info); + obj_attribute *out_attr = elf_known_obj_attributes_proc (obfd); + + /* We assume that ARMv7+ does not need the VFP11 denorm erratum fix. */ + if (out_attr[Tag_CPU_arch].i >= TAG_CPU_ARCH_V7) + { + switch (globals->vfp11_fix) + { + case BFD_ARM_VFP11_FIX_DEFAULT: + case BFD_ARM_VFP11_FIX_NONE: + globals->vfp11_fix = BFD_ARM_VFP11_FIX_NONE; + break; + + default: + /* Give a warning, but do as the user requests anyway. */ + (*_bfd_error_handler) (_("%B: warning: selected VFP11 erratum " + "workaround is not necessary for target architecture"), obfd); + } + } + else if (globals->vfp11_fix == BFD_ARM_VFP11_FIX_DEFAULT) + /* For earlier architectures, we might need the workaround, but do not + enable it by default. If users is running with broken hardware, they + must enable the erratum fix explicitly. */ + globals->vfp11_fix = BFD_ARM_VFP11_FIX_NONE; +} + + +enum bfd_arm_vfp11_pipe { + VFP11_FMAC, + VFP11_LS, + VFP11_DS, + VFP11_BAD +}; + +/* Return a VFP register number. This is encoded as RX:X for single-precision + registers, or X:RX for double-precision registers, where RX is the group of + four bits in the instruction encoding and X is the single extension bit. + RX and X fields are specified using their lowest (starting) bit. The return + value is: + + 0...31: single-precision registers s0...s31 + 32...63: double-precision registers d0...d31. + + Although X should be zero for VFP11 (encoding d0...d15 only), we might + encounter VFP3 instructions, so we allow the full range for DP registers. */ + +static unsigned int +bfd_arm_vfp11_regno (unsigned int insn, bfd_boolean is_double, unsigned int rx, + unsigned int x) +{ + if (is_double) + return (((insn >> rx) & 0xf) | (((insn >> x) & 1) << 4)) + 32; + else + return (((insn >> rx) & 0xf) << 1) | ((insn >> x) & 1); +} + +/* Set bits in *WMASK according to a register number REG as encoded by + bfd_arm_vfp11_regno(). Ignore d16-d31. */ + +static void +bfd_arm_vfp11_write_mask (unsigned int *wmask, unsigned int reg) +{ + if (reg < 32) + *wmask |= 1 << reg; + else if (reg < 48) + *wmask |= 3 << ((reg - 32) * 2); +} + +/* Return TRUE if WMASK overwrites anything in REGS. */ + +static bfd_boolean +bfd_arm_vfp11_antidependency (unsigned int wmask, int *regs, int numregs) +{ + int i; + + for (i = 0; i < numregs; i++) + { + unsigned int reg = regs[i]; + + if (reg < 32 && (wmask & (1 << reg)) != 0) + return TRUE; + + reg -= 32; + + if (reg >= 16) + continue; + + if ((wmask & (3 << (reg * 2))) != 0) + return TRUE; + } + + return FALSE; +} + +/* In this function, we're interested in two things: finding input registers + for VFP data-processing instructions, and finding the set of registers which + arbitrary VFP instructions may write to. We use a 32-bit unsigned int to + hold the written set, so FLDM etc. are easy to deal with (we're only + interested in 32 SP registers or 16 dp registers, due to the VFP version + implemented by the chip in question). DP registers are marked by setting + both SP registers in the write mask). */ + +static enum bfd_arm_vfp11_pipe +bfd_arm_vfp11_insn_decode (unsigned int insn, unsigned int *destmask, int *regs, + int *numregs) +{ + enum bfd_arm_vfp11_pipe pipe = VFP11_BAD; + bfd_boolean is_double = ((insn & 0xf00) == 0xb00) ? 1 : 0; + + if ((insn & 0x0f000e10) == 0x0e000a00) /* A data-processing insn. */ + { + unsigned int pqrs; + unsigned int fd = bfd_arm_vfp11_regno (insn, is_double, 12, 22); + unsigned int fm = bfd_arm_vfp11_regno (insn, is_double, 0, 5); + + pqrs = ((insn & 0x00800000) >> 20) + | ((insn & 0x00300000) >> 19) + | ((insn & 0x00000040) >> 6); + + switch (pqrs) + { + case 0: /* fmac[sd]. */ + case 1: /* fnmac[sd]. */ + case 2: /* fmsc[sd]. */ + case 3: /* fnmsc[sd]. */ + pipe = VFP11_FMAC; + bfd_arm_vfp11_write_mask (destmask, fd); + regs[0] = fd; + regs[1] = bfd_arm_vfp11_regno (insn, is_double, 16, 7); /* Fn. */ + regs[2] = fm; + *numregs = 3; + break; + + case 4: /* fmul[sd]. */ + case 5: /* fnmul[sd]. */ + case 6: /* fadd[sd]. */ + case 7: /* fsub[sd]. */ + pipe = VFP11_FMAC; + goto vfp_binop; + + case 8: /* fdiv[sd]. */ + pipe = VFP11_DS; + vfp_binop: + bfd_arm_vfp11_write_mask (destmask, fd); + regs[0] = bfd_arm_vfp11_regno (insn, is_double, 16, 7); /* Fn. */ + regs[1] = fm; + *numregs = 2; + break; + + case 15: /* extended opcode. */ + { + unsigned int extn = ((insn >> 15) & 0x1e) + | ((insn >> 7) & 1); + + switch (extn) + { + case 0: /* fcpy[sd]. */ + case 1: /* fabs[sd]. */ + case 2: /* fneg[sd]. */ + case 8: /* fcmp[sd]. */ + case 9: /* fcmpe[sd]. */ + case 10: /* fcmpz[sd]. */ + case 11: /* fcmpez[sd]. */ + case 16: /* fuito[sd]. */ + case 17: /* fsito[sd]. */ + case 24: /* ftoui[sd]. */ + case 25: /* ftouiz[sd]. */ + case 26: /* ftosi[sd]. */ + case 27: /* ftosiz[sd]. */ + /* These instructions will not bounce due to underflow. */ + *numregs = 0; + pipe = VFP11_FMAC; + break; + + case 3: /* fsqrt[sd]. */ + /* fsqrt cannot underflow, but it can (perhaps) overwrite + registers to cause the erratum in previous instructions. */ + bfd_arm_vfp11_write_mask (destmask, fd); + pipe = VFP11_DS; + break; + + case 15: /* fcvt{ds,sd}. */ + { + int rnum = 0; + + bfd_arm_vfp11_write_mask (destmask, fd); + + /* Only FCVTSD can underflow. */ + if ((insn & 0x100) != 0) + regs[rnum++] = fm; + + *numregs = rnum; + + pipe = VFP11_FMAC; + } + break; + + default: + return VFP11_BAD; + } + } + break; + + default: + return VFP11_BAD; + } + } + /* Two-register transfer. */ + else if ((insn & 0x0fe00ed0) == 0x0c400a10) + { + unsigned int fm = bfd_arm_vfp11_regno (insn, is_double, 0, 5); + + if ((insn & 0x100000) == 0) + { + if (is_double) + bfd_arm_vfp11_write_mask (destmask, fm); + else + { + bfd_arm_vfp11_write_mask (destmask, fm); + bfd_arm_vfp11_write_mask (destmask, fm + 1); + } + } + + pipe = VFP11_LS; + } + else if ((insn & 0x0e100e00) == 0x0c100a00) /* A load insn. */ + { + int fd = bfd_arm_vfp11_regno (insn, is_double, 12, 22); + unsigned int puw = ((insn >> 21) & 0x1) | (((insn >> 23) & 3) << 1); + + switch (puw) + { + case 0: /* Two-reg transfer. We should catch these above. */ + abort (); + + case 2: /* fldm[sdx]. */ + case 3: + case 5: + { + unsigned int i, offset = insn & 0xff; + + if (is_double) + offset >>= 1; + + for (i = fd; i < fd + offset; i++) + bfd_arm_vfp11_write_mask (destmask, i); + } + break; + + case 4: /* fld[sd]. */ + case 6: + bfd_arm_vfp11_write_mask (destmask, fd); + break; + + default: + return VFP11_BAD; + } + + pipe = VFP11_LS; + } + /* Single-register transfer. Note L==0. */ + else if ((insn & 0x0f100e10) == 0x0e000a10) + { + unsigned int opcode = (insn >> 21) & 7; + unsigned int fn = bfd_arm_vfp11_regno (insn, is_double, 16, 7); + + switch (opcode) + { + case 0: /* fmsr/fmdlr. */ + case 1: /* fmdhr. */ + /* Mark fmdhr and fmdlr as writing to the whole of the DP + destination register. I don't know if this is exactly right, + but it is the conservative choice. */ + bfd_arm_vfp11_write_mask (destmask, fn); + break; + + case 7: /* fmxr. */ + break; + } + + pipe = VFP11_LS; + } + + return pipe; +} + + +static int elf32_arm_compare_mapping (const void * a, const void * b); + + +/* Look for potentially-troublesome code sequences which might trigger the + VFP11 denormal/antidependency erratum. See, e.g., the ARM1136 errata sheet + (available from ARM) for details of the erratum. A short version is + described in ld.texinfo. */ + +bfd_boolean +bfd_elf32_arm_vfp11_erratum_scan (bfd *abfd, struct bfd_link_info *link_info) +{ + asection *sec; + bfd_byte *contents = NULL; + int state = 0; + int regs[3], numregs = 0; + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info); + int use_vector = (globals->vfp11_fix == BFD_ARM_VFP11_FIX_VECTOR); + + /* We use a simple FSM to match troublesome VFP11 instruction sequences. + The states transition as follows: + + 0 -> 1 (vector) or 0 -> 2 (scalar) + A VFP FMAC-pipeline instruction has been seen. Fill + regs[0]..regs[numregs-1] with its input operands. Remember this + instruction in 'first_fmac'. + + 1 -> 2 + Any instruction, except for a VFP instruction which overwrites + regs[*]. + + 1 -> 3 [ -> 0 ] or + 2 -> 3 [ -> 0 ] + A VFP instruction has been seen which overwrites any of regs[*]. + We must make a veneer! Reset state to 0 before examining next + instruction. + + 2 -> 0 + If we fail to match anything in state 2, reset to state 0 and reset + the instruction pointer to the instruction after 'first_fmac'. + + If the VFP11 vector mode is in use, there must be at least two unrelated + instructions between anti-dependent VFP11 instructions to properly avoid + triggering the erratum, hence the use of the extra state 1. + */ + + /* If we are only performing a partial link do not bother + to construct any glue. */ + if (link_info->relocatable) + return TRUE; + + /* We should have chosen a fix type by the time we get here. */ + BFD_ASSERT (globals->vfp11_fix != BFD_ARM_VFP11_FIX_DEFAULT); + + if (globals->vfp11_fix == BFD_ARM_VFP11_FIX_NONE) + return TRUE; + + /* Skip if this bfd does not correspond to an ELF image. */ + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return TRUE; + + for (sec = abfd->sections; sec != NULL; sec = sec->next) + { + unsigned int i, span, first_fmac = 0, veneer_of_insn = 0; + struct _arm_elf_section_data *sec_data; + + /* If we don't have executable progbits, we're not interested in this + section. Also skip if section is to be excluded. */ + if (elf_section_type (sec) != SHT_PROGBITS + || (elf_section_flags (sec) & SHF_EXECINSTR) == 0 + || (sec->flags & SEC_EXCLUDE) != 0 + || strcmp (sec->name, VFP11_ERRATUM_VENEER_SECTION_NAME) == 0) + continue; + + sec_data = elf32_arm_section_data (sec); + + if (sec_data->mapcount == 0) + continue; + + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else if (! bfd_malloc_and_get_section (abfd, sec, &contents)) + goto error_return; + + qsort (sec_data->map, sec_data->mapcount, sizeof (elf32_arm_section_map), + elf32_arm_compare_mapping); + + for (span = 0; span < sec_data->mapcount; span++) + { + unsigned int span_start = sec_data->map[span].vma; + unsigned int span_end = (span == sec_data->mapcount - 1) + ? sec->size : sec_data->map[span + 1].vma; + char span_type = sec_data->map[span].type; + + /* FIXME: Only ARM mode is supported at present. We may need to + support Thumb-2 mode also at some point. */ + if (span_type != 'a') + continue; + + for (i = span_start; i < span_end;) + { + unsigned int next_i = i + 4; + unsigned int insn = bfd_big_endian (abfd) + ? (contents[i] << 24) + | (contents[i + 1] << 16) + | (contents[i + 2] << 8) + | contents[i + 3] + : (contents[i + 3] << 24) + | (contents[i + 2] << 16) + | (contents[i + 1] << 8) + | contents[i]; + unsigned int writemask = 0; + enum bfd_arm_vfp11_pipe pipe; + + switch (state) + { + case 0: + pipe = bfd_arm_vfp11_insn_decode (insn, &writemask, regs, + &numregs); + /* I'm assuming the VFP11 erratum can trigger with denorm + operands on either the FMAC or the DS pipeline. This might + lead to slightly overenthusiastic veneer insertion. */ + if (pipe == VFP11_FMAC || pipe == VFP11_DS) + { + state = use_vector ? 1 : 2; + first_fmac = i; + veneer_of_insn = insn; + } + break; + + case 1: + { + int other_regs[3], other_numregs; + pipe = bfd_arm_vfp11_insn_decode (insn, &writemask, + other_regs, + &other_numregs); + if (pipe != VFP11_BAD + && bfd_arm_vfp11_antidependency (writemask, regs, + numregs)) + state = 3; + else + state = 2; + } + break; + + case 2: + { + int other_regs[3], other_numregs; + pipe = bfd_arm_vfp11_insn_decode (insn, &writemask, + other_regs, + &other_numregs); + if (pipe != VFP11_BAD + && bfd_arm_vfp11_antidependency (writemask, regs, + numregs)) + state = 3; + else + { + state = 0; + next_i = first_fmac + 4; + } + } + break; + + case 3: + abort (); /* Should be unreachable. */ + } + + if (state == 3) + { + elf32_vfp11_erratum_list *newerr + = bfd_zmalloc (sizeof (elf32_vfp11_erratum_list)); + int errcount; + + errcount = ++(elf32_arm_section_data (sec)->erratumcount); + + newerr->u.b.vfp_insn = veneer_of_insn; + + switch (span_type) + { + case 'a': + newerr->type = VFP11_ERRATUM_BRANCH_TO_ARM_VENEER; + break; + + default: + abort (); + } + + record_vfp11_erratum_veneer (link_info, newerr, abfd, sec, + first_fmac); + + newerr->vma = -1; + + newerr->next = sec_data->erratumlist; + sec_data->erratumlist = newerr; + + state = 0; + } + + i = next_i; + } + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + contents = NULL; + } + + return TRUE; + +error_return: + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + + return FALSE; +} + +/* Find virtual-memory addresses for VFP11 erratum veneers and return locations + after sections have been laid out, using specially-named symbols. */ + +void +bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *abfd, + struct bfd_link_info *link_info) +{ + asection *sec; + struct elf32_arm_link_hash_table *globals; + char *tmp_name; + + if (link_info->relocatable) + return; + + /* Skip if this bfd does not correspond to an ELF image. */ + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return; + + globals = elf32_arm_hash_table (link_info); + + tmp_name = bfd_malloc ((bfd_size_type) strlen + (VFP11_ERRATUM_VENEER_ENTRY_NAME) + 10); + + for (sec = abfd->sections; sec != NULL; sec = sec->next) + { + struct _arm_elf_section_data *sec_data = elf32_arm_section_data (sec); + elf32_vfp11_erratum_list *errnode = sec_data->erratumlist; + + for (; errnode != NULL; errnode = errnode->next) + { + struct elf_link_hash_entry *myh; + bfd_vma vma; + + switch (errnode->type) + { + case VFP11_ERRATUM_BRANCH_TO_ARM_VENEER: + case VFP11_ERRATUM_BRANCH_TO_THUMB_VENEER: + /* Find veneer symbol. */ + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME, + errnode->u.b.veneer->u.v.id); + + myh = elf_link_hash_lookup + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); + + if (myh == NULL) + (*_bfd_error_handler) (_("%B: unable to find VFP11 veneer " + "`%s'"), abfd, tmp_name); + + vma = myh->root.u.def.section->output_section->vma + + myh->root.u.def.section->output_offset + + myh->root.u.def.value; + + errnode->u.b.veneer->vma = vma; + break; + + case VFP11_ERRATUM_ARM_VENEER: + case VFP11_ERRATUM_THUMB_VENEER: + /* Find return location. */ + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME "_r", + errnode->u.v.id); + + myh = elf_link_hash_lookup + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); + + if (myh == NULL) + (*_bfd_error_handler) (_("%B: unable to find VFP11 veneer " + "`%s'"), abfd, tmp_name); + + vma = myh->root.u.def.section->output_section->vma + + myh->root.u.def.section->output_offset + + myh->root.u.def.value; + + errnode->u.v.branch->vma = vma; + break; + + default: + abort (); + } + } + } + + free (tmp_name); +} + + /* Set target relocation values needed during linking. */ void -bfd_elf32_arm_set_target_relocs (struct bfd_link_info *link_info, +bfd_elf32_arm_set_target_relocs (struct bfd *output_bfd, + struct bfd_link_info *link_info, int target1_is_rel, char * target2_type, int fix_v4bx, - int use_blx) + int use_blx, + bfd_arm_vfp11_fix vfp11_fix, + int no_enum_warn, int pic_veneer) { struct elf32_arm_link_hash_table *globals; @@ -2608,6 +3938,10 @@ bfd_elf32_arm_set_target_relocs (struct bfd_link_info *link_info, } globals->fix_v4bx = fix_v4bx; globals->use_blx |= use_blx; + globals->vfp11_fix = vfp11_fix; + globals->pic_veneer = pic_veneer; + + elf32_arm_tdata (output_bfd)->no_enum_size_warning = no_enum_warn; } /* The thumb form of a long branch is a bit finicky, because the offset @@ -2664,6 +3998,35 @@ insert_thumb_branch (insn32 br_insn, int rel_off) return br_insn; } + +/* Store an Arm insn into an output section not processed by + elf32_arm_write_section. */ + +static void +put_arm_insn (struct elf32_arm_link_hash_table *htab, + bfd * output_bfd, bfd_vma val, void * ptr) +{ + if (htab->byteswap_code != bfd_little_endian (output_bfd)) + bfd_putl32 (val, ptr); + else + bfd_putb32 (val, ptr); +} + + +/* Store a 16-bit Thumb insn into an output section not processed by + elf32_arm_write_section. */ + +static void +put_thumb_insn (struct elf32_arm_link_hash_table *htab, + bfd * output_bfd, bfd_vma val, void * ptr) +{ + if (htab->byteswap_code != bfd_little_endian (output_bfd)) + bfd_putl16 (val, ptr); + else + bfd_putb16 (val, ptr); +} + + /* Thumb code calling an ARM function. */ static int @@ -2676,7 +4039,8 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, asection * sym_sec, bfd_vma offset, bfd_signed_vma addend, - bfd_vma val) + bfd_vma val, + char **error_message) { asection * s = 0; bfd_vma my_offset; @@ -2685,7 +4049,7 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, struct elf_link_hash_entry * myh; struct elf32_arm_link_hash_table * globals; - myh = find_thumb_glue (info, name, input_bfd); + myh = find_thumb_glue (info, name, error_message); if (myh == NULL) return FALSE; @@ -2720,11 +4084,11 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, --my_offset; myh->root.u.def.value = my_offset; - bfd_put_16 (output_bfd, (bfd_vma) t2a1_bx_pc_insn, - s->contents + my_offset); + put_thumb_insn (globals, output_bfd, (bfd_vma) t2a1_bx_pc_insn, + s->contents + my_offset); - bfd_put_16 (output_bfd, (bfd_vma) t2a2_noop_insn, - s->contents + my_offset + 2); + put_thumb_insn (globals, output_bfd, (bfd_vma) t2a2_noop_insn, + s->contents + my_offset + 2); ret_offset = /* Address of destination of the stub. */ @@ -2742,9 +4106,9 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, /* ARM branches work from the pc of the instruction + 8. */ + 8); - bfd_put_32 (output_bfd, - (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), - s->contents + my_offset + 4); + put_arm_insn (globals, output_bfd, + (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), + s->contents + my_offset + 4); } BFD_ASSERT (my_offset <= globals->thumb_glue_size); @@ -2771,30 +4135,26 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, return TRUE; } -/* Arm code calling a Thumb function. */ +/* Populate an Arm to Thumb stub. Returns the stub symbol. */ -static int -elf32_arm_to_thumb_stub (struct bfd_link_info * info, - const char * name, - bfd * input_bfd, - bfd * output_bfd, - asection * input_section, - bfd_byte * hit_data, - asection * sym_sec, - bfd_vma offset, - bfd_signed_vma addend, - bfd_vma val) +static struct elf_link_hash_entry * +elf32_arm_create_thumb_stub (struct bfd_link_info * info, + const char * name, + bfd * input_bfd, + bfd * output_bfd, + asection * sym_sec, + bfd_vma val, + asection *s, + char **error_message) { - unsigned long int tmp; bfd_vma my_offset; - asection * s; long int ret_offset; struct elf_link_hash_entry * myh; struct elf32_arm_link_hash_table * globals; - myh = find_arm_glue (info, name, input_bfd); + myh = find_arm_glue (info, name, error_message); if (myh == NULL) - return FALSE; + return NULL; globals = elf32_arm_hash_table (info); @@ -2802,11 +4162,6 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, BFD_ASSERT (globals->bfd_of_glue_owner != NULL); my_offset = myh->root.u.def.value; - s = bfd_get_section_by_name (globals->bfd_of_glue_owner, - ARM2THUMB_GLUE_SECTION_NAME); - BFD_ASSERT (s != NULL); - BFD_ASSERT (s->contents != NULL); - BFD_ASSERT (s->output_section != NULL); if ((my_offset & 0x01) == 0x01) { @@ -2823,18 +4178,19 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, --my_offset; myh->root.u.def.value = my_offset; - if ((info->shared || globals->root.is_relocatable_executable)) + if (info->shared || globals->root.is_relocatable_executable + || globals->pic_veneer) { /* For relocatable objects we can't use absolute addresses, so construct the address from a relative offset. */ /* TODO: If the offset is small it's probably worth constructing the address with adds. */ - bfd_put_32 (output_bfd, (bfd_vma) a2t1p_ldr_insn, - s->contents + my_offset); - bfd_put_32 (output_bfd, (bfd_vma) a2t2p_add_pc_insn, - s->contents + my_offset + 4); - bfd_put_32 (output_bfd, (bfd_vma) a2t3p_bx_r12_insn, - s->contents + my_offset + 8); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t1p_ldr_insn, + s->contents + my_offset); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t2p_add_pc_insn, + s->contents + my_offset + 4); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t3p_bx_r12_insn, + s->contents + my_offset + 8); /* Adjust the offset by 4 for the position of the add, and 8 for the pipeline offset. */ ret_offset = (val - (s->output_offset @@ -2844,13 +4200,22 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, bfd_put_32 (output_bfd, ret_offset, s->contents + my_offset + 12); } + else if (globals->use_blx) + { + put_arm_insn (globals, output_bfd, (bfd_vma) a2t1v5_ldr_insn, + s->contents + my_offset); + + /* It's a thumb address. Add the low order bit. */ + bfd_put_32 (output_bfd, val | a2t2v5_func_addr_insn, + s->contents + my_offset + 4); + } else { - bfd_put_32 (output_bfd, (bfd_vma) a2t1_ldr_insn, - s->contents + my_offset); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t1_ldr_insn, + s->contents + my_offset); - bfd_put_32 (output_bfd, (bfd_vma) a2t2_bx_r12_insn, - s->contents + my_offset + 4); + put_arm_insn (globals, output_bfd, (bfd_vma) a2t2_bx_r12_insn, + s->contents + my_offset + 4); /* It's a thumb address. Add the low order bit. */ bfd_put_32 (output_bfd, val | a2t3_func_addr_insn, @@ -2860,6 +4225,48 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, BFD_ASSERT (my_offset <= globals->arm_glue_size); + return myh; +} + +/* Arm code calling a Thumb function. */ + +static int +elf32_arm_to_thumb_stub (struct bfd_link_info * info, + const char * name, + bfd * input_bfd, + bfd * output_bfd, + asection * input_section, + bfd_byte * hit_data, + asection * sym_sec, + bfd_vma offset, + bfd_signed_vma addend, + bfd_vma val, + char **error_message) +{ + unsigned long int tmp; + bfd_vma my_offset; + asection * s; + long int ret_offset; + struct elf_link_hash_entry * myh; + struct elf32_arm_link_hash_table * globals; + + globals = elf32_arm_hash_table (info); + + BFD_ASSERT (globals != NULL); + BFD_ASSERT (globals->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); + BFD_ASSERT (s != NULL); + BFD_ASSERT (s->contents != NULL); + BFD_ASSERT (s->output_section != NULL); + + myh = elf32_arm_create_thumb_stub (info, name, input_bfd, output_bfd, + sym_sec, val, s, error_message); + if (!myh) + return FALSE; + + my_offset = myh->root.u.def.value; tmp = bfd_get_32 (input_bfd, hit_data); tmp = tmp & 0xFF000000; @@ -2879,6 +4286,70 @@ elf32_arm_to_thumb_stub (struct bfd_link_info * info, return TRUE; } +/* Populate Arm stub for an exported Thumb function. */ + +static bfd_boolean +elf32_arm_to_thumb_export_stub (struct elf_link_hash_entry *h, void * inf) +{ + struct bfd_link_info * info = (struct bfd_link_info *) inf; + asection * s; + struct elf_link_hash_entry * myh; + struct elf32_arm_link_hash_entry *eh; + struct elf32_arm_link_hash_table * globals; + asection *sec; + bfd_vma val; + char *error_message; + + eh = elf32_arm_hash_entry(h); + /* Allocate stubs for exported Thumb functions on v4t. */ + if (eh->export_glue == NULL) + return TRUE; + + globals = elf32_arm_hash_table (info); + + BFD_ASSERT (globals != NULL); + BFD_ASSERT (globals->bfd_of_glue_owner != NULL); + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); + BFD_ASSERT (s != NULL); + BFD_ASSERT (s->contents != NULL); + BFD_ASSERT (s->output_section != NULL); + + sec = eh->export_glue->root.u.def.section; + + BFD_ASSERT (sec->output_section != NULL); + + val = eh->export_glue->root.u.def.value + sec->output_offset + + sec->output_section->vma; + myh = elf32_arm_create_thumb_stub (info, h->root.root.string, + h->root.u.def.section->owner, + globals->obfd, sec, val, s, + &error_message); + BFD_ASSERT (myh); + return TRUE; +} + +/* Generate Arm stubs for exported Thumb symbols. */ +static void +elf32_arm_begin_write_processing (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info) +{ + struct elf32_arm_link_hash_table * globals; + + if (!link_info) + return; + + globals = elf32_arm_hash_table (link_info); + /* If blx is available then exported Thumb symbols are OK and there is + nothing to do. */ + if (globals->use_blx) + return; + + elf_link_hash_traverse (&globals->root, elf32_arm_to_thumb_export_stub, + link_info); +} + /* Some relocations map to different relocations depending on the target. Return the real relocation. */ static int @@ -2944,6 +4415,83 @@ elf32_arm_abs12_reloc (bfd *abfd, void *data, bfd_vma value) return bfd_reloc_ok; } +/* For a given value of n, calculate the value of G_n as required to + deal with group relocations. We return it in the form of an + encoded constant-and-rotation, together with the final residual. If n is + specified as less than zero, then final_residual is filled with the + input value and no further action is performed. */ + +static bfd_vma +calculate_group_reloc_mask (bfd_vma value, int n, bfd_vma *final_residual) +{ + int current_n; + bfd_vma g_n; + bfd_vma encoded_g_n = 0; + bfd_vma residual = value; /* Also known as Y_n. */ + + for (current_n = 0; current_n <= n; current_n++) + { + int shift; + + /* Calculate which part of the value to mask. */ + if (residual == 0) + shift = 0; + else + { + int msb; + + /* Determine the most significant bit in the residual and + align the resulting value to a 2-bit boundary. */ + for (msb = 30; msb >= 0; msb -= 2) + if (residual & (3 << msb)) + break; + + /* The desired shift is now (msb - 6), or zero, whichever + is the greater. */ + shift = msb - 6; + if (shift < 0) + shift = 0; + } + + /* Calculate g_n in 32-bit as well as encoded constant+rotation form. */ + g_n = residual & (0xff << shift); + encoded_g_n = (g_n >> shift) + | ((g_n <= 0xff ? 0 : (32 - shift) / 2) << 8); + + /* Calculate the residual for the next time around. */ + residual &= ~g_n; + } + + *final_residual = residual; + + return encoded_g_n; +} + +/* Given an ARM instruction, determine whether it is an ADD or a SUB. + Returns 1 if it is an ADD, -1 if it is a SUB, and 0 otherwise. */ +static int +identify_add_or_sub(bfd_vma insn) +{ + int opcode = insn & 0x1e00000; + + if (opcode == 1 << 23) /* ADD */ + return 1; + + if (opcode == 1 << 22) /* SUB */ + return -1; + + return 0; +} + +/* Determine if we're dealing with a Thumb-2 object. */ + +static int using_thumb2 (struct elf32_arm_link_hash_table *globals) +{ + int arch = bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC, + Tag_CPU_arch); + return arch == TAG_CPU_ARCH_V6T2 || arch >= TAG_CPU_ARCH_V7; +} + /* Perform a relocation as part of a final link. */ static bfd_reloc_status_type @@ -2959,7 +4507,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, const char * sym_name, int sym_flags, struct elf_link_hash_entry * h, - bfd_boolean * unresolved_reloc_p) + bfd_boolean * unresolved_reloc_p, + char **error_message) { unsigned long r_type = howto->type; unsigned long r_symndx; @@ -3036,23 +4585,20 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, case R_ARM_PC24: case R_ARM_ABS32: + case R_ARM_ABS32_NOI: case R_ARM_REL32: + case R_ARM_REL32_NOI: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_XPC25: case R_ARM_PREL31: case R_ARM_PLT32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0) - return bfd_reloc_ok; - /* Handle relocations which should use the PLT entry. ABS32/REL32 will use the symbol's value, which may point to a PLT entry, but we don't need to handle that here. If we created a PLT entry, all branches in this object should go to it. */ - if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32) + if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32 + && r_type != R_ARM_ABS32_NOI && r_type != R_ARM_REL32_NOI) && h != NULL && splt != NULL && h->plt.offset != (bfd_vma) -1) @@ -3076,7 +4622,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, run time. */ if ((info->shared || globals->root.is_relocatable_executable) && (input_section->flags & SEC_ALLOC) - && (r_type != R_ARM_REL32 + && ((r_type != R_ARM_REL32 && r_type != R_ARM_REL32_NOI) || !SYMBOL_CALLS_LOCAL (info, h)) && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT @@ -3141,6 +4687,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, value |= 1; if (globals->symbian_p) { + asection *osec; + /* On Symbian OS, the data segment and text segement can be relocated independently. Therefore, we must indicate the segment to which this @@ -3148,11 +4696,27 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, use any symbol in the right segment; we just use the section symbol as it is convenient. (We cannot use the symbol given by "h" directly as it - will not appear in the dynamic symbol table.) */ + will not appear in the dynamic symbol table.) + + Note that the dynamic linker ignores the section + symbol value, so we don't subtract osec->vma + from the emitted reloc addend. */ if (sym_sec) - symbol = elf_section_data (sym_sec->output_section)->dynindx; + osec = sym_sec->output_section; else - symbol = elf_section_data (input_section->output_section)->dynindx; + osec = input_section->output_section; + symbol = elf_section_data (osec)->dynindx; + if (symbol == 0) + { + struct elf_link_hash_table *htab = elf_hash_table (info); + + if ((osec->flags & SEC_READONLY) == 0 + && htab->data_index_section != NULL) + osec = htab->data_index_section; + else + osec = htab->text_index_section; + symbol = elf_section_data (osec)->dynindx; + } BFD_ASSERT (symbol != 0); } else @@ -3207,11 +4771,14 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* Check for Arm calling Thumb function. */ if (sym_flags == STT_ARM_TFUNC) { - elf32_arm_to_thumb_stub (info, sym_name, input_bfd, - output_bfd, input_section, - hit_data, sym_sec, rel->r_offset, - signed_addend, value); - return bfd_reloc_ok; + if (elf32_arm_to_thumb_stub (info, sym_name, input_bfd, + output_bfd, input_section, + hit_data, sym_sec, rel->r_offset, + signed_addend, value, + error_message)) + return bfd_reloc_ok; + else + return bfd_reloc_dangerous; } } @@ -3246,40 +4813,43 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, signed_addend = value; signed_addend >>= howto->rightshift; - /* It is not an error for an undefined weak reference to be - out of range. Any program that branches to such a symbol - is going to crash anyway, so there is no point worrying - about getting the destination exactly right. */ - if (! h || h->root.type != bfd_link_hash_undefweak) + /* A branch to an undefined weak symbol is turned into a jump to + the next instruction. */ + if (h && h->root.type == bfd_link_hash_undefweak) + { + value = (bfd_get_32 (input_bfd, hit_data) & 0xf0000000) + | 0x0affffff; + } + else { /* Perform a signed range check. */ if ( signed_addend > ((bfd_signed_vma) (howto->dst_mask >> 1)) || signed_addend < - ((bfd_signed_vma) ((howto->dst_mask + 1) >> 1))) return bfd_reloc_overflow; - } - addend = (value & 2); + addend = (value & 2); - value = (signed_addend & howto->dst_mask) - | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); + value = (signed_addend & howto->dst_mask) + | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); - /* Set the H bit in the BLX instruction. */ - if (sym_flags == STT_ARM_TFUNC) - { - if (addend) - value |= (1 << 24); - else - value &= ~(bfd_vma)(1 << 24); - } - if (r_type == R_ARM_CALL) - { - /* Select the correct instruction (BL or BLX). */ + /* Set the H bit in the BLX instruction. */ if (sym_flags == STT_ARM_TFUNC) - value |= (1 << 28); - else { - value &= ~(bfd_vma)(1 << 28); - value |= (1 << 24); + if (addend) + value |= (1 << 24); + else + value &= ~(bfd_vma)(1 << 24); + } + if (r_type == R_ARM_CALL) + { + /* Select the correct instruction (BL or BLX). */ + if (sym_flags == STT_ARM_TFUNC) + value |= (1 << 28); + else + { + value &= ~(bfd_vma)(1 << 28); + value |= (1 << 24); + } } } break; @@ -3290,6 +4860,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, value |= 1; break; + case R_ARM_ABS32_NOI: + value += addend; + break; + case R_ARM_REL32: value += addend; if (sym_flags == STT_ARM_TFUNC) @@ -3298,6 +4872,12 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, + input_section->output_offset + rel->r_offset); break; + case R_ARM_REL32_NOI: + value += addend; + value -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + break; + case R_ARM_PREL31: value -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); @@ -3355,27 +4935,122 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_put_16 (input_bfd, value, hit_data); return bfd_reloc_ok; + case R_ARM_THM_ALU_PREL_11_0: + /* Corresponds to: addw.w reg, pc, #offset (and similarly for subw). */ + { + bfd_vma insn; + bfd_signed_vma relocation; + + insn = (bfd_get_16 (input_bfd, hit_data) << 16) + | bfd_get_16 (input_bfd, hit_data + 2); + + if (globals->use_rel) + { + signed_addend = (insn & 0xff) | ((insn & 0x7000) >> 4) + | ((insn & (1 << 26)) >> 15); + if (insn & 0xf00000) + signed_addend = -signed_addend; + } + + relocation = value + signed_addend; + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + value = abs (relocation); + + if (value >= 0x1000) + return bfd_reloc_overflow; + + insn = (insn & 0xfb0f8f00) | (value & 0xff) + | ((value & 0x700) << 4) + | ((value & 0x800) << 15); + if (relocation < 0) + insn |= 0xa00000; + + bfd_put_16 (input_bfd, insn >> 16, hit_data); + bfd_put_16 (input_bfd, insn & 0xffff, hit_data + 2); + + return bfd_reloc_ok; + } + + case R_ARM_THM_PC12: + /* Corresponds to: ldr.w reg, [pc, #offset]. */ + { + bfd_vma insn; + bfd_signed_vma relocation; + + insn = (bfd_get_16 (input_bfd, hit_data) << 16) + | bfd_get_16 (input_bfd, hit_data + 2); + + if (globals->use_rel) + { + signed_addend = insn & 0xfff; + if (!(insn & (1 << 23))) + signed_addend = -signed_addend; + } + + relocation = value + signed_addend; + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + value = abs (relocation); + + if (value >= 0x1000) + return bfd_reloc_overflow; + + insn = (insn & 0xff7ff000) | value; + if (relocation >= 0) + insn |= (1 << 23); + + bfd_put_16 (input_bfd, insn >> 16, hit_data); + bfd_put_16 (input_bfd, insn & 0xffff, hit_data + 2); + + return bfd_reloc_ok; + } + case R_ARM_THM_XPC22: case R_ARM_THM_CALL: /* Thumb BL (branch long instruction). */ { bfd_vma relocation; + bfd_vma reloc_sign; bfd_boolean overflow = FALSE; bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); - bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; - bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; + bfd_signed_vma reloc_signed_max; + bfd_signed_vma reloc_signed_min; bfd_vma check; bfd_signed_vma signed_check; + int bitsize; + int thumb2 = using_thumb2 (globals); - /* Need to refetch the addend and squish the two 11 bit pieces - together. */ + /* A branch to an undefined weak symbol is turned into a jump to + the next instruction. */ + if (h && h->root.type == bfd_link_hash_undefweak) + { + bfd_put_16 (input_bfd, 0xe000, hit_data); + bfd_put_16 (input_bfd, 0xbf00, hit_data + 2); + return bfd_reloc_ok; + } + + /* Fetch the addend. We use the Thumb-2 encoding (backwards compatible + with Thumb-1) involving the J1 and J2 bits. */ if (globals->use_rel) { - bfd_vma upper = upper_insn & 0x7ff; - bfd_vma lower = lower_insn & 0x7ff; - upper = (upper ^ 0x400) - 0x400; /* Sign extend. */ - addend = (upper << 12) | (lower << 1); + bfd_vma s = (upper_insn & (1 << 10)) >> 10; + bfd_vma upper = upper_insn & 0x3ff; + bfd_vma lower = lower_insn & 0x7ff; + bfd_vma j1 = (lower_insn & (1 << 13)) >> 13; + bfd_vma j2 = (lower_insn & (1 << 11)) >> 11; + bfd_vma i1 = j1 ^ s ? 0 : 1; + bfd_vma i2 = j2 ^ s ? 0 : 1; + + addend = (i1 << 23) | (i2 << 22) | (upper << 12) | (lower << 1); + /* Sign extend. */ + addend = (addend | ((s ? 0 : 1) << 24)) - (1 << 24); + signed_addend = addend; } @@ -3407,7 +5082,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, } else if (elf32_thumb_to_arm_stub (info, sym_name, input_bfd, output_bfd, input_section, - hit_data, sym_sec, rel->r_offset, signed_addend, value)) + hit_data, sym_sec, rel->r_offset, signed_addend, value, + error_message)) return bfd_reloc_ok; else return bfd_reloc_dangerous; @@ -3452,6 +5128,15 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, else signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); + /* Calculate the permissable maximum and minimum values for + this relocation according to whether we're relocating for + Thumb-2 or not. */ + bitsize = howto->bitsize; + if (!thumb2) + bitsize -= 2; + reloc_signed_max = ((1 << (bitsize - 1)) - 1) >> howto->rightshift; + reloc_signed_min = ~reloc_signed_max; + /* Assumes two's complement. */ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = TRUE; @@ -3463,9 +5148,17 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, 1 of the base address. */ relocation = (relocation + 2) & ~ 3; - /* Put RELOCATION back into the insn. */ - upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 12) & 0x7ff); - lower_insn = (lower_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 1) & 0x7ff); + /* Put RELOCATION back into the insn. Assumes two's complement. + We use the Thumb-2 encoding, which is safe even if dealing with + a Thumb-1 instruction by virtue of our overflow check above. */ + reloc_sign = (signed_check < 0) ? 1 : 0; + upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) + | ((relocation >> 12) & 0x3ff) + | (reloc_sign << 10); + lower_insn = (lower_insn & ~(bfd_vma) 0x2fff) + | (((!((relocation >> 23) & 1)) ^ reloc_sign) << 13) + | (((!((relocation >> 22) & 1)) ^ reloc_sign) << 11) + | ((relocation >> 1) & 0x7ff); /* Put the relocated value back in the object file: */ bfd_put_16 (input_bfd, upper_insn, hit_data); @@ -3555,9 +5248,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_boolean overflow = FALSE; bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); - bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; - bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; - bfd_vma check; + bfd_signed_vma reloc_signed_max = 0xffffe; + bfd_signed_vma reloc_signed_min = -0x100000; bfd_signed_vma signed_check; /* Need to refetch the addend, reconstruct the top three bits, @@ -3565,14 +5257,14 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, if (globals->use_rel) { bfd_vma S = (upper_insn & 0x0400) >> 10; - bfd_vma upper = (upper_insn & 0x001f); + bfd_vma upper = (upper_insn & 0x003f); bfd_vma J1 = (lower_insn & 0x2000) >> 13; bfd_vma J2 = (lower_insn & 0x0800) >> 11; bfd_vma lower = (lower_insn & 0x07ff); - upper |= J2 << 6; - upper |= J1 << 7; - upper |= ~S << 8; + upper |= J1 << 6; + upper |= J2 << 7; + upper |= (!S) << 8; upper -= 0x0100; /* Sign extend. */ addend = (upper << 12) | (lower << 1); @@ -3586,17 +5278,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, relocation -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); + signed_check = (bfd_signed_vma) relocation; - check = relocation >> howto->rightshift; - - /* If this is a signed value, the rightshift just dropped - leading 1 bits (assuming twos complement). */ - if ((bfd_signed_vma) relocation >= 0) - signed_check = check; - else - signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); - - /* Assumes two's complement. */ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = TRUE; @@ -3608,7 +5291,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_vma hi = (relocation & 0x0003f000) >> 12; bfd_vma lo = (relocation & 0x00000ffe) >> 1; - upper_insn = (upper_insn & 0xfb30) | (S << 10) | hi; + upper_insn = (upper_insn & 0xfbc0) | (S << 10) | hi; lower_insn = (lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | lo; } @@ -4097,199 +5780,499 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, } return bfd_reloc_ok; + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + /* Until we properly support segment-base-relative addressing then + we assume the segment base to be zero, as for the group relocations. + Thus R_ARM_MOVW_BREL_NC has the same semantics as R_ARM_MOVW_ABS_NC + and R_ARM_MOVT_BREL has the same semantics as R_ARM_MOVT_ABS. */ + case R_ARM_MOVW_BREL_NC: + case R_ARM_MOVW_BREL: + case R_ARM_MOVT_BREL: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + + if (globals->use_rel) + { + addend = ((insn >> 4) & 0xf000) | (insn & 0xfff); + signed_addend = (addend ^ 0x10000) - 0x10000; + } + + value += signed_addend; + + if (r_type == R_ARM_MOVW_PREL_NC || r_type == R_ARM_MOVT_PREL) + value -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + + if (r_type == R_ARM_MOVW_BREL && value >= 0x10000) + return bfd_reloc_overflow; + + if (sym_flags == STT_ARM_TFUNC) + value |= 1; + + if (r_type == R_ARM_MOVT_ABS || r_type == R_ARM_MOVT_PREL + || r_type == R_ARM_MOVT_BREL) + value >>= 16; + + insn &= 0xfff0f000; + insn |= value & 0xfff; + insn |= (value & 0xf000) << 4; + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: + /* Until we properly support segment-base-relative addressing then + we assume the segment base to be zero, as for the above relocations. + Thus R_ARM_THM_MOVW_BREL_NC has the same semantics as + R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_BREL has the same semantics + as R_ARM_THM_MOVT_ABS. */ + case R_ARM_THM_MOVW_BREL_NC: + case R_ARM_THM_MOVW_BREL: + case R_ARM_THM_MOVT_BREL: + { + bfd_vma insn; + + insn = bfd_get_16 (input_bfd, hit_data) << 16; + insn |= bfd_get_16 (input_bfd, hit_data + 2); + + if (globals->use_rel) + { + addend = ((insn >> 4) & 0xf000) + | ((insn >> 15) & 0x0800) + | ((insn >> 4) & 0x0700) + | (insn & 0x00ff); + signed_addend = (addend ^ 0x10000) - 0x10000; + } + + value += signed_addend; + + if (r_type == R_ARM_THM_MOVW_PREL_NC || r_type == R_ARM_THM_MOVT_PREL) + value -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + + if (r_type == R_ARM_THM_MOVW_BREL && value >= 0x10000) + return bfd_reloc_overflow; + + if (sym_flags == STT_ARM_TFUNC) + value |= 1; + + if (r_type == R_ARM_THM_MOVT_ABS || r_type == R_ARM_THM_MOVT_PREL + || r_type == R_ARM_THM_MOVT_BREL) + value >>= 16; + + insn &= 0xfbf08f00; + insn |= (value & 0xf000) << 4; + insn |= (value & 0x0800) << 15; + insn |= (value & 0x0700) << 4; + insn |= (value & 0x00ff); + + bfd_put_16 (input_bfd, insn >> 16, hit_data); + bfd_put_16 (input_bfd, insn & 0xffff, hit_data + 2); + } + return bfd_reloc_ok; + + case R_ARM_ALU_PC_G0_NC: + case R_ARM_ALU_PC_G1_NC: + case R_ARM_ALU_PC_G0: + case R_ARM_ALU_PC_G1: + case R_ARM_ALU_PC_G2: + case R_ARM_ALU_SB_G0_NC: + case R_ARM_ALU_SB_G1_NC: + case R_ARM_ALU_SB_G0: + case R_ARM_ALU_SB_G1: + case R_ARM_ALU_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + /* sb should be the origin of the *segment* containing the symbol. + It is not clear how to obtain this OS-dependent value, so we + make an arbitrary choice of zero. */ + bfd_vma sb = 0; + bfd_vma residual; + bfd_vma g_n; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which group of bits to select. */ + switch (r_type) + { + case R_ARM_ALU_PC_G0_NC: + case R_ARM_ALU_PC_G0: + case R_ARM_ALU_SB_G0_NC: + case R_ARM_ALU_SB_G0: + group = 0; + break; + + case R_ARM_ALU_PC_G1_NC: + case R_ARM_ALU_PC_G1: + case R_ARM_ALU_SB_G1_NC: + case R_ARM_ALU_SB_G1: + group = 1; + break; + + case R_ARM_ALU_PC_G2: + case R_ARM_ALU_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative; + bfd_vma constant = insn & 0xff; + bfd_vma rotation = (insn & 0xf00) >> 8; + + if (rotation == 0) + signed_addend = constant; + else + { + /* Compensate for the fact that in the instruction, the + rotation is stored in multiples of 2 bits. */ + rotation *= 2; + + /* Rotate "constant" right by "rotation" bits. */ + signed_addend = (constant >> rotation) | + (constant << (8 * sizeof (bfd_vma) - rotation)); + } + + /* Determine if the instruction is an ADD or a SUB. + (For REL, this determines the sign of the addend.) */ + negative = identify_add_or_sub (insn); + if (negative == 0) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group relocations"), + input_bfd, input_section, + (long) rel->r_offset, howto->name); + return bfd_reloc_overflow; + } + + signed_addend *= negative; + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_ALU_PC_G0_NC + || r_type == R_ARM_ALU_PC_G1_NC + || r_type == R_ARM_ALU_PC_G0 + || r_type == R_ARM_ALU_PC_G1 + || r_type == R_ARM_ALU_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* If the target symbol is a Thumb function, then set the + Thumb bit in the address. */ + if (sym_flags == STT_ARM_TFUNC) + signed_value |= 1; + + /* Calculate the value of the relevant G_n, in encoded + constant-with-rotation format. */ + g_n = calculate_group_reloc_mask (abs (signed_value), group, + &residual); + + /* Check for overflow if required. */ + if ((r_type == R_ARM_ALU_PC_G0 + || r_type == R_ARM_ALU_PC_G1 + || r_type == R_ARM_ALU_PC_G2 + || r_type == R_ARM_ALU_SB_G0 + || r_type == R_ARM_ALU_SB_G1 + || r_type == R_ARM_ALU_SB_G2) && residual != 0) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and the ADD/SUB part of the opcode; take care + not to destroy the S bit. */ + insn &= 0xff1ff000; + + /* Set the opcode according to whether the value to go in the + place is negative. */ + if (signed_value < 0) + insn |= 1 << 22; + else + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= g_n; + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_LDR_PC_G0: + case R_ARM_LDR_PC_G1: + case R_ARM_LDR_PC_G2: + case R_ARM_LDR_SB_G0: + case R_ARM_LDR_SB_G1: + case R_ARM_LDR_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + bfd_vma sb = 0; /* See note above. */ + bfd_vma residual; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which groups of bits to calculate. */ + switch (r_type) + { + case R_ARM_LDR_PC_G0: + case R_ARM_LDR_SB_G0: + group = 0; + break; + + case R_ARM_LDR_PC_G1: + case R_ARM_LDR_SB_G1: + group = 1; + break; + + case R_ARM_LDR_PC_G2: + case R_ARM_LDR_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative = (insn & (1 << 23)) ? 1 : -1; + signed_addend = negative * (insn & 0xfff); + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_LDR_PC_G0 + || r_type == R_ARM_LDR_PC_G1 + || r_type == R_ARM_LDR_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* Calculate the value of the relevant G_{n-1} to obtain + the residual at that stage. */ + calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + + /* Check for overflow. */ + if (residual >= 0x1000) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and U bit. */ + insn &= 0xff7ff000; + + /* Set the U bit if the value to go in the place is non-negative. */ + if (signed_value >= 0) + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= residual; + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_LDRS_PC_G0: + case R_ARM_LDRS_PC_G1: + case R_ARM_LDRS_PC_G2: + case R_ARM_LDRS_SB_G0: + case R_ARM_LDRS_SB_G1: + case R_ARM_LDRS_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + bfd_vma sb = 0; /* See note above. */ + bfd_vma residual; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which groups of bits to calculate. */ + switch (r_type) + { + case R_ARM_LDRS_PC_G0: + case R_ARM_LDRS_SB_G0: + group = 0; + break; + + case R_ARM_LDRS_PC_G1: + case R_ARM_LDRS_SB_G1: + group = 1; + break; + + case R_ARM_LDRS_PC_G2: + case R_ARM_LDRS_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative = (insn & (1 << 23)) ? 1 : -1; + signed_addend = negative * (((insn & 0xf00) >> 4) + (insn & 0xf)); + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_LDRS_PC_G0 + || r_type == R_ARM_LDRS_PC_G1 + || r_type == R_ARM_LDRS_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* Calculate the value of the relevant G_{n-1} to obtain + the residual at that stage. */ + calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + + /* Check for overflow. */ + if (residual >= 0x100) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and U bit. */ + insn &= 0xff7ff0f0; + + /* Set the U bit if the value to go in the place is non-negative. */ + if (signed_value >= 0) + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= ((residual & 0xf0) << 4) | (residual & 0xf); + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + + case R_ARM_LDC_PC_G0: + case R_ARM_LDC_PC_G1: + case R_ARM_LDC_PC_G2: + case R_ARM_LDC_SB_G0: + case R_ARM_LDC_SB_G1: + case R_ARM_LDC_SB_G2: + { + bfd_vma insn = bfd_get_32 (input_bfd, hit_data); + bfd_vma pc = input_section->output_section->vma + + input_section->output_offset + rel->r_offset; + bfd_vma sb = 0; /* See note above. */ + bfd_vma residual; + bfd_signed_vma signed_value; + int group = 0; + + /* Determine which groups of bits to calculate. */ + switch (r_type) + { + case R_ARM_LDC_PC_G0: + case R_ARM_LDC_SB_G0: + group = 0; + break; + + case R_ARM_LDC_PC_G1: + case R_ARM_LDC_SB_G1: + group = 1; + break; + + case R_ARM_LDC_PC_G2: + case R_ARM_LDC_SB_G2: + group = 2; + break; + + default: + abort(); + } + + /* If REL, extract the addend from the insn. If RELA, it will + have already been fetched for us. */ + if (globals->use_rel) + { + int negative = (insn & (1 << 23)) ? 1 : -1; + signed_addend = negative * ((insn & 0xff) << 2); + } + + /* Compute the value (X) to go in the place. */ + if (r_type == R_ARM_LDC_PC_G0 + || r_type == R_ARM_LDC_PC_G1 + || r_type == R_ARM_LDC_PC_G2) + /* PC relative. */ + signed_value = value - pc + signed_addend; + else + /* Section base relative. */ + signed_value = value - sb + signed_addend; + + /* Calculate the value of the relevant G_{n-1} to obtain + the residual at that stage. */ + calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + + /* Check for overflow. (The absolute value to go in the place must be + divisible by four and, after having been divided by four, must + fit in eight bits.) */ + if ((residual & 0x3) != 0 || residual >= 0x400) + { + (*_bfd_error_handler) + (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), + input_bfd, input_section, + (long) rel->r_offset, abs (signed_value), howto->name); + return bfd_reloc_overflow; + } + + /* Mask out the value and U bit. */ + insn &= 0xff7fff00; + + /* Set the U bit if the value to go in the place is non-negative. */ + if (signed_value >= 0) + insn |= 1 << 23; + + /* Encode the offset. */ + insn |= residual >> 2; + + bfd_put_32 (input_bfd, insn, hit_data); + } + return bfd_reloc_ok; + default: return bfd_reloc_notsupported; } } - -static int -uleb128_size (unsigned int i) -{ - int size; - size = 1; - while (i >= 0x80) - { - i >>= 7; - size++; - } - return size; -} - -/* Return TRUE if the attribute has the default value (0/""). */ -static bfd_boolean -is_default_attr (aeabi_attribute *attr) -{ - if ((attr->type & 1) && attr->i != 0) - return FALSE; - if ((attr->type & 2) && attr->s && *attr->s) - return FALSE; - - return TRUE; -} - -/* Return the size of a single attribute. */ -static bfd_vma -eabi_attr_size(int tag, aeabi_attribute *attr) -{ - bfd_vma size; - - if (is_default_attr (attr)) - return 0; - - size = uleb128_size (tag); - if (attr->type & 1) - size += uleb128_size (attr->i); - if (attr->type & 2) - size += strlen ((char *)attr->s) + 1; - return size; -} - -/* Returns the size of the eabi object attributess section. */ -bfd_vma -elf32_arm_eabi_attr_size (bfd *abfd) -{ - bfd_vma size; - aeabi_attribute *attr; - aeabi_attribute_list *list; - int i; - - attr = elf32_arm_tdata (abfd)->known_eabi_attributes; - size = 16; /* 'A' "aeabi" 0x1 . */ - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) - size += eabi_attr_size (i, &attr[i]); - - for (list = elf32_arm_tdata (abfd)->other_eabi_attributes; - list; - list = list->next) - size += eabi_attr_size (list->tag, &list->attr); - - return size; -} - -static bfd_byte * -write_uleb128 (bfd_byte *p, unsigned int val) -{ - bfd_byte c; - do - { - c = val & 0x7f; - val >>= 7; - if (val) - c |= 0x80; - *(p++) = c; - } - while (val); - return p; -} - -/* Write attribute ATTR to butter P, and return a pointer to the following - byte. */ -static bfd_byte * -write_eabi_attribute (bfd_byte *p, int tag, aeabi_attribute *attr) -{ - /* Suppress default entries. */ - if (is_default_attr(attr)) - return p; - - p = write_uleb128 (p, tag); - if (attr->type & 1) - p = write_uleb128 (p, attr->i); - if (attr->type & 2) - { - int len; - - len = strlen (attr->s) + 1; - memcpy (p, attr->s, len); - p += len; - } - - return p; -} - -/* Write the contents of the eabi attributes section to p. */ -void -elf32_arm_set_eabi_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size) -{ - bfd_byte *p; - aeabi_attribute *attr; - aeabi_attribute_list *list; - int i; - - p = contents; - *(p++) = 'A'; - bfd_put_32 (abfd, size - 1, p); - p += 4; - memcpy (p, "aeabi", 6); - p += 6; - *(p++) = Tag_File; - bfd_put_32 (abfd, size - 11, p); - p += 4; - - attr = elf32_arm_tdata (abfd)->known_eabi_attributes; - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) - p = write_eabi_attribute (p, i, &attr[i]); - - for (list = elf32_arm_tdata (abfd)->other_eabi_attributes; - list; - list = list->next) - p = write_eabi_attribute (p, list->tag, &list->attr); -} - -/* Override final_link to handle EABI object attribute sections. */ - -static bfd_boolean -elf32_arm_bfd_final_link (bfd *abfd, struct bfd_link_info *info) -{ - asection *o; - struct bfd_link_order *p; - asection *attr_section = NULL; - bfd_byte *contents; - bfd_vma size = 0; - - /* elf32_arm_merge_private_bfd_data will already have merged the - object attributes. Remove the input sections from the link, and set - the contents of the output secton. */ - for (o = abfd->sections; o != NULL; o = o->next) - { - if (strcmp (o->name, ".ARM.attributes") == 0) - { - for (p = o->map_head.link_order; p != NULL; p = p->next) - { - asection *input_section; - - if (p->type != bfd_indirect_link_order) - continue; - input_section = p->u.indirect.section; - /* Hack: reset the SEC_HAS_CONTENTS flag so that - elf_link_input_bfd ignores this section. */ - input_section->flags &= ~SEC_HAS_CONTENTS; - } - - size = elf32_arm_eabi_attr_size (abfd); - bfd_set_section_size (abfd, o, size); - attr_section = o; - /* Skip this section later on. */ - o->map_head.link_order = NULL; - } - } - /* Invoke the ELF linker to do all the work. */ - if (!bfd_elf_final_link (abfd, info)) - return FALSE; - - if (attr_section) - { - contents = bfd_malloc(size); - if (contents == NULL) - return FALSE; - elf32_arm_set_eabi_attr_contents (abfd, contents, size); - bfd_set_section_contents (abfd, attr_section, contents, 0, size); - free (contents); - } - return TRUE; -} - - /* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. */ static void arm_add_to_rel (bfd * abfd, @@ -4392,8 +6375,6 @@ elf32_arm_relocate_section (bfd * output_bfd, struct elf32_arm_link_hash_table * globals; globals = elf32_arm_hash_table (info); - if (info->relocatable && !globals->use_rel) - return TRUE; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -4413,6 +6394,7 @@ elf32_arm_relocate_section (bfd * output_bfd, arelent bfd_reloc; char sym_type; bfd_boolean unresolved_reloc = FALSE; + char *error_message = NULL; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); @@ -4425,29 +6407,6 @@ elf32_arm_relocate_section (bfd * output_bfd, bfd_reloc.howto = elf32_arm_howto_from_type (r_type); howto = bfd_reloc.howto; - if (info->relocatable && globals->use_rel) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - arm_add_to_rel (input_bfd, contents + rel->r_offset, - howto, - (bfd_signed_vma) (sec->output_offset - + sym->st_value)); - } - } - - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -4462,8 +6421,9 @@ elf32_arm_relocate_section (bfd * output_bfd, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + if (!info->relocatable + && (sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) { asection *msec; bfd_vma addend, value; @@ -4513,6 +6473,34 @@ elf32_arm_relocate_section (bfd * output_bfd, sym_type = h->type; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + if (globals->use_rel) + arm_add_to_rel (input_bfd, contents + rel->r_offset, + howto, (bfd_signed_vma) sec->output_offset); + else + rel->r_addend += sec->output_offset; + } + continue; + } + if (h != NULL) name = h->root.root.string; else @@ -4546,7 +6534,7 @@ elf32_arm_relocate_section (bfd * output_bfd, relocation, info, sec, name, (h ? ELF_ST_TYPE (h->type) : ELF_ST_TYPE (sym->st_info)), h, - &unresolved_reloc); + &unresolved_reloc, &error_message); /* Dynamic relocs are not propagated for SEC_DEBUGGING sections because such sections are not SEC_ALLOC and thus ld.so will @@ -4567,8 +6555,6 @@ elf32_arm_relocate_section (bfd * output_bfd, if (r != bfd_reloc_ok) { - const char * msg = (const char *) 0; - switch (r) { case bfd_reloc_overflow: @@ -4592,24 +6578,25 @@ elf32_arm_relocate_section (bfd * output_bfd, break; case bfd_reloc_outofrange: - msg = _("internal error: out of range error"); + error_message = _("out of range"); goto common_error; case bfd_reloc_notsupported: - msg = _("internal error: unsupported relocation error"); + error_message = _("unsupported relocation"); goto common_error; case bfd_reloc_dangerous: - msg = _("internal error: dangerous error"); + /* error_message should already be set. */ goto common_error; default: - msg = _("internal error: unknown error"); + error_message = _("unknown error"); /* fall through */ common_error: - if (!((*info->callbacks->warning) - (info, msg, name, input_bfd, input_section, + BFD_ASSERT (error_message != NULL); + if (!((*info->callbacks->reloc_dangerous) + (info, error_message, input_bfd, input_section, rel->r_offset))) return FALSE; break; @@ -4620,130 +6607,6 @@ elf32_arm_relocate_section (bfd * output_bfd, return TRUE; } -/* Allocate/find an object attribute. */ -static aeabi_attribute * -elf32_arm_new_eabi_attr (bfd *abfd, int tag) -{ - aeabi_attribute *attr; - aeabi_attribute_list *list; - aeabi_attribute_list *p; - aeabi_attribute_list **lastp; - - - if (tag < NUM_KNOWN_ATTRIBUTES) - { - /* Knwon tags are preallocated. */ - attr = &elf32_arm_tdata (abfd)->known_eabi_attributes[tag]; - } - else - { - /* Create a new tag. */ - list = (aeabi_attribute_list *) - bfd_alloc (abfd, sizeof (aeabi_attribute_list)); - memset (list, 0, sizeof (aeabi_attribute_list)); - list->tag = tag; - /* Keep the tag list in order. */ - lastp = &elf32_arm_tdata (abfd)->other_eabi_attributes; - for (p = *lastp; p; p = p->next) - { - if (tag < p->tag) - break; - lastp = &p->next; - } - list->next = *lastp; - *lastp = list; - attr = &list->attr; - } - - return attr; -} - -int -elf32_arm_get_eabi_attr_int (bfd *abfd, int tag) -{ - aeabi_attribute_list *p; - - if (tag < NUM_KNOWN_ATTRIBUTES) - { - /* Knwon tags are preallocated. */ - return elf32_arm_tdata (abfd)->known_eabi_attributes[tag].i; - } - else - { - for (p = elf32_arm_tdata (abfd)->other_eabi_attributes; - p; - p = p->next) - { - if (tag == p->tag) - return p->attr.i; - if (tag < p->tag) - break; - } - return 0; - } -} - -void -elf32_arm_add_eabi_attr_int (bfd *abfd, int tag, unsigned int i) -{ - aeabi_attribute *attr; - - attr = elf32_arm_new_eabi_attr (abfd, tag); - attr->type = 1; - attr->i = i; -} - -static char * -attr_strdup (bfd *abfd, const char * s) -{ - char * p; - int len; - - len = strlen (s) + 1; - p = (char *)bfd_alloc(abfd, len); - return memcpy (p, s, len); -} - -void -elf32_arm_add_eabi_attr_string (bfd *abfd, int tag, const char *s) -{ - aeabi_attribute *attr; - - attr = elf32_arm_new_eabi_attr (abfd, tag); - attr->type = 2; - attr->s = attr_strdup (abfd, s); -} - -void -elf32_arm_add_eabi_attr_compat (bfd *abfd, unsigned int i, const char *s) -{ - aeabi_attribute_list *list; - aeabi_attribute_list *p; - aeabi_attribute_list **lastp; - - list = (aeabi_attribute_list *) - bfd_alloc (abfd, sizeof (aeabi_attribute_list)); - memset (list, 0, sizeof (aeabi_attribute_list)); - list->tag = Tag_compatibility; - list->attr.type = 3; - list->attr.i = i; - list->attr.s = attr_strdup (abfd, s); - - lastp = &elf32_arm_tdata (abfd)->other_eabi_attributes; - for (p = *lastp; p; p = p->next) - { - int cmp; - if (p->tag != Tag_compatibility) - break; - cmp = strcmp(s, p->attr.s); - if (cmp < 0 || (cmp == 0 && i < p->attr.i)) - break; - lastp = &p->next; - } - list->next = *lastp; - *lastp = list; -} - /* Set the right machine number. */ static bfd_boolean @@ -4794,49 +6657,6 @@ elf32_arm_set_private_flags (bfd *abfd, flagword flags) return TRUE; } -/* Copy the eabi object attribute from IBFD to OBFD. */ -static void -copy_eabi_attributes (bfd *ibfd, bfd *obfd) -{ - aeabi_attribute *in_attr; - aeabi_attribute *out_attr; - aeabi_attribute_list *list; - int i; - - in_attr = elf32_arm_tdata (ibfd)->known_eabi_attributes; - out_attr = elf32_arm_tdata (obfd)->known_eabi_attributes; - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) - { - out_attr->i = in_attr->i; - if (in_attr->s && *in_attr->s) - out_attr->s = attr_strdup (obfd, in_attr->s); - in_attr++; - out_attr++; - } - - for (list = elf32_arm_tdata (ibfd)->other_eabi_attributes; - list; - list = list->next) - { - in_attr = &list->attr; - switch (in_attr->type) - { - case 1: - elf32_arm_add_eabi_attr_int (obfd, list->tag, in_attr->i); - break; - case 2: - elf32_arm_add_eabi_attr_string (obfd, list->tag, in_attr->s); - break; - case 3: - elf32_arm_add_eabi_attr_compat (obfd, in_attr->i, in_attr->s); - break; - default: - abort(); - } - } -} - - /* Copy backend specific data from one object module to another. */ static bfd_boolean @@ -4888,8 +6708,8 @@ elf32_arm_copy_private_bfd_data (bfd *ibfd, bfd *obfd) elf_elfheader (obfd)->e_ident[EI_OSABI] = elf_elfheader (ibfd)->e_ident[EI_OSABI]; - /* Copy EABI object attributes. */ - copy_eabi_attributes (ibfd, obfd); + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); return TRUE; } @@ -4921,33 +6741,48 @@ enum AEABI_enum_forced_wide }; +/* Determine whether an object attribute tag takes an integer, a + string or both. */ +static int +elf32_arm_obj_attrs_arg_type (int tag) +{ + if (tag == Tag_compatibility) + return 3; + else if (tag == 4 || tag == 5) + return 2; + else if (tag < 32) + return 1; + else + return (tag & 1) != 0 ? 2 : 1; +} + /* Merge EABI object attributes from IBFD into OBFD. Raise an error if there are conflicting attributes. */ static bfd_boolean elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) { - aeabi_attribute *in_attr; - aeabi_attribute *out_attr; - aeabi_attribute_list *in_list; - aeabi_attribute_list *out_list; + obj_attribute *in_attr; + obj_attribute *out_attr; + obj_attribute_list *in_list; /* Some tags have 0 = don't care, 1 = strong requirement, 2 = weak requirement. */ static const int order_312[3] = {3, 1, 2}; int i; - if (!elf32_arm_tdata (ibfd)->known_eabi_attributes[0].i) + if (!elf_known_obj_attributes_proc (obfd)[0].i) { /* This is the first object. Copy the attributes. */ - copy_eabi_attributes (ibfd, obfd); + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + return TRUE; } - /* Use the Tag_null value to indicate the attributes have been - initialized. */ - elf32_arm_tdata (ibfd)->known_eabi_attributes[0].i = 1; - - in_attr = elf32_arm_tdata (ibfd)->known_eabi_attributes; - out_attr = elf32_arm_tdata (obfd)->known_eabi_attributes; + in_attr = elf_known_obj_attributes_proc (ibfd); + out_attr = elf_known_obj_attributes_proc (obfd); /* This needs to happen before Tag_ABI_FP_number_model is merged. */ if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i) { @@ -4963,16 +6798,19 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } } - for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++) + for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { /* Merge this attribute with existing attributes. */ switch (i) { case Tag_CPU_raw_name: case Tag_CPU_name: - /* Use whichever has the greatest architecture requirements. */ - if (in_attr[Tag_CPU_arch].i > out_attr[Tag_CPU_arch].i) - out_attr[i].s = attr_strdup(obfd, in_attr[i].s); + /* Use whichever has the greatest architecture requirements. We + won't necessarily have both the above tags, so make sure input + name is non-NULL. */ + if (in_attr[Tag_CPU_arch].i > out_attr[Tag_CPU_arch].i + && in_attr[i].s) + out_attr[i].s = _bfd_elf_attr_strdup (obfd, in_attr[i].s); break; case Tag_ABI_optimization_goals: @@ -5023,7 +6861,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } break; case Tag_ABI_PCS_R9_use: - if (out_attr[i].i != AEABI_R9_unused + if (in_attr[i].i != out_attr[i].i + && out_attr[i].i != AEABI_R9_unused && in_attr[i].i != AEABI_R9_unused) { _bfd_error_handler @@ -5084,10 +6923,15 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) out_attr[i].i = in_attr[i].i; } else if (in_attr[i].i != AEABI_enum_forced_wide - && out_attr[i].i != in_attr[i].i) + && out_attr[i].i != in_attr[i].i + && !elf32_arm_tdata (obfd)->no_enum_size_warning) { + const char *aeabi_enum_names[] = + { "", "variable-size", "32-bit", "" }; _bfd_error_handler - (_("ERROR: %B: Conflicting enum sizes"), ibfd); + (_("warning: %B uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"), + ibfd, aeabi_enum_names[in_attr[i].i], + aeabi_enum_names[out_attr[i].i]); } } break; @@ -5108,60 +6952,13 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) } } - in_list = elf32_arm_tdata (ibfd)->other_eabi_attributes; - out_list = elf32_arm_tdata (ibfd)->other_eabi_attributes; - while (in_list && in_list->tag == Tag_compatibility) - { - in_attr = &in_list->attr; - if (in_attr->i == 0) - continue; - if (in_attr->i == 1) - { - _bfd_error_handler - (_("ERROR: %B: Must be processed by '%s' toolchain"), - ibfd, in_attr->s); - return FALSE; - } - if (!out_list || out_list->tag != Tag_compatibility - || strcmp (in_attr->s, out_list->attr.s) != 0) - { - /* Add this compatibility tag to the output. */ - elf32_arm_add_eabi_attr_compat (obfd, in_attr->i, in_attr->s); - continue; - } - out_attr = &out_list->attr; - /* Check all the input tags with the same identifier. */ - for (;;) - { - if (out_list->tag != Tag_compatibility - || in_attr->i != out_attr->i - || strcmp (in_attr->s, out_attr->s) != 0) - { - _bfd_error_handler - (_("ERROR: %B: Incompatible object tag '%s':%d"), - ibfd, in_attr->s, in_attr->i); - return FALSE; - } - in_list = in_list->next; - if (in_list->tag != Tag_compatibility - || strcmp (in_attr->s, in_list->attr.s) != 0) - break; - in_attr = &in_list->attr; - out_list = out_list->next; - if (out_list) - out_attr = &out_list->attr; - } + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); - /* Check the output doesn't have extra tags with this identifier. */ - if (out_list && out_list->tag == Tag_compatibility - && strcmp (in_attr->s, out_list->attr.s) == 0) - { - _bfd_error_handler - (_("ERROR: %B: Incompatible object tag '%s':%d"), - ibfd, in_attr->s, out_list->attr.i); - return FALSE; - } - } + /* Check for any attributes not known on ARM. */ + in_list = elf_other_obj_attributes_proc (ibfd); + while (in_list && in_list->tag == Tag_compatibility) + in_list = in_list->next; for (; in_list; in_list = in_list->next) { @@ -5563,39 +7360,21 @@ elf32_arm_get_symbol_type (Elf_Internal_Sym * elf_sym, int type) } static asection * -elf32_arm_gc_mark_hook (asection * sec, - struct bfd_link_info * info ATTRIBUTE_UNUSED, - Elf_Internal_Rela * rel, - struct elf_link_hash_entry * h, - Elf_Internal_Sym * sym) +elf32_arm_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF32_R_TYPE (rel->r_info)) { case R_ARM_GNU_VTINHERIT: case R_ARM_GNU_VTENTRY: - break; + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -5661,13 +7440,23 @@ elf32_arm_gc_sweep_hook (bfd * abfd, break; case R_ARM_ABS32: + case R_ARM_ABS32_NOI: case R_ARM_REL32: + case R_ARM_REL32_NOI: case R_ARM_PC24: case R_ARM_PLT32: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PREL31: case R_ARM_THM_CALL: + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: /* Should the interworking branches be here also? */ if (h != NULL) @@ -5686,14 +7475,17 @@ elf32_arm_gc_sweep_hook (bfd * abfd, } if (r_type == R_ARM_ABS32 - || r_type == R_ARM_REL32) + || r_type == R_ARM_REL32 + || r_type == R_ARM_ABS32_NOI + || r_type == R_ARM_REL32_NOI) { for (pp = &eh->relocs_copied; (p = *pp) != NULL; pp = &p->next) if (p->section == sec) { p->count -= 1; - if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32) + if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32 + || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32_NOI) p->pc_count -= 1; if (p->count == 0) *pp = p->next; @@ -5871,13 +7663,23 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, /* Fall through */ case R_ARM_ABS32: + case R_ARM_ABS32_NOI: case R_ARM_REL32: + case R_ARM_REL32_NOI: case R_ARM_PC24: case R_ARM_PLT32: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_PREL31: case R_ARM_THM_CALL: + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: /* Should the interworking branches be listed here? */ if (h != NULL) { @@ -5894,12 +7696,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, refers to is in a different object. We can't tell for sure yet, because something later might force the symbol local. */ - if (r_type == R_ARM_PC24 - || r_type == R_ARM_CALL - || r_type == R_ARM_JUMP24 - || r_type == R_ARM_PREL31 - || r_type == R_ARM_PLT32 - || r_type == R_ARM_THM_CALL) + if (r_type != R_ARM_ABS32 + && r_type != R_ARM_REL32 + && r_type != R_ARM_ABS32_NOI + && r_type != R_ARM_REL32_NOI + && r_type != R_ARM_ABS12) h->needs_plt = 1; /* If we create a PLT entry, this relocation will reference @@ -5924,7 +7725,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, relocs_copied field of the hash table entry. */ if ((info->shared || htab->root.is_relocatable_executable) && (sec->flags & SEC_ALLOC) != 0 - && (r_type == R_ARM_ABS32 + && ((r_type == R_ARM_ABS32 || r_type == R_ARM_ABS32_NOI) || (h != NULL && ! h->needs_plt && (! info->symbolic || ! h->def_regular)))) { @@ -6008,7 +7809,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, p->pc_count = 0; } - if (r_type == R_ARM_REL32) + if (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI) p->pc_count += 1; p->count += 1; } @@ -6033,12 +7834,57 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, return TRUE; } +/* Unwinding tables are not referenced directly. This pass marks them as + required if the corresponding code section is marked. */ + +static bfd_boolean +elf32_arm_gc_mark_extra_sections(struct bfd_link_info *info, + elf_gc_mark_hook_fn gc_mark_hook) +{ + bfd *sub; + Elf_Internal_Shdr **elf_shdrp; + bfd_boolean again; + + /* Marking EH data may cause additional code sections to be marked, + requiring multiple passes. */ + again = TRUE; + while (again) + { + again = FALSE; + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; + + elf_shdrp = elf_elfsections (sub); + for (o = sub->sections; o != NULL; o = o->next) + { + Elf_Internal_Shdr *hdr; + hdr = &elf_section_data (o)->this_hdr; + if (hdr->sh_type == SHT_ARM_EXIDX && hdr->sh_link + && !o->gc_mark + && elf_shdrp[hdr->sh_link]->bfd_section->gc_mark) + { + again = TRUE; + if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) + return FALSE; + } + } + } + } + + return TRUE; +} + /* Treat mapping symbols as special target symbols. */ static bfd_boolean elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym) { - return bfd_is_arm_mapping_symbol_name (sym->name); + return bfd_is_arm_special_symbol_name (sym->name, + BFD_ARM_SPECIAL_SYM_TYPE_ANY); } /* This is a copy of elf_find_function() from elf.c except that @@ -6074,9 +7920,10 @@ arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED, case STT_FUNC: case STT_ARM_TFUNC: case STT_NOTYPE: - /* Skip $a and $t symbols. */ + /* Skip mapping symbols. */ if ((q->symbol.flags & BSF_LOCAL) - && bfd_is_arm_mapping_symbol_name (q->symbol.name)) + && bfd_is_arm_special_symbol_name (q->symbol.name, + BFD_ARM_SPECIAL_SYM_TYPE_ANY)) continue; /* Fall through. */ if (bfd_get_section (&q->symbol) == section @@ -6177,7 +8024,6 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info, { bfd * dynobj; asection * s; - unsigned int power_of_two; struct elf32_arm_link_hash_entry * eh; struct elf32_arm_link_hash_table *globals; @@ -6290,28 +8136,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -6500,6 +8325,37 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) else h->got.offset = (bfd_vma) -1; + /* Allocate stubs for exported Thumb functions on v4t. */ + if (!htab->use_blx && h->dynindx != -1 + && h->def_regular + && ELF_ST_TYPE (h->type) == STT_ARM_TFUNC + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + { + struct elf_link_hash_entry * th; + struct bfd_link_hash_entry * bh; + struct elf_link_hash_entry * myh; + char name[1024]; + asection *s; + bh = NULL; + /* Create a new symbol to regist the real location of the function. */ + s = h->root.u.def.section; + sprintf(name, "__real_%s", h->root.root.string); + _bfd_generic_link_add_one_symbol (info, s->owner, + name, BSF_GLOBAL, s, + h->root.u.def.value, + NULL, TRUE, FALSE, &bh); + + myh = (struct elf_link_hash_entry *) bh; + myh->type = ELF_ST_INFO (STB_LOCAL, STT_ARM_TFUNC); + myh->forced_local = 1; + eh->export_glue = myh; + th = record_arm_to_thumb_glue (info, h); + /* Point the symbol at the stub. */ + h->type = ELF_ST_INFO (ELF_ST_BIND (h->type), STT_FUNC); + h->root.u.def.section = th->root.u.def.section; + h->root.u.def.value = th->root.u.def.value & ~1; + } + if (eh->relocs_copied == NULL) return TRUE; @@ -6511,12 +8367,12 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) if (info->shared || htab->root.is_relocatable_executable) { - /* The only reloc that uses pc_count is R_ARM_REL32, which will - appear on something like ".long foo - .". We want calls to - protected symbols to resolve directly to the function rather - than going via the plt. If people want function pointer - comparisons to work as expected then they should avoid - writing assembly like ".long foo - .". */ + /* The only relocs that use pc_count are R_ARM_REL32 and + R_ARM_REL32_NOI, which will appear on something like + ".long foo - .". We want calls to protected symbols to resolve + directly to the function rather than going via the plt. If people + want function pointer comparisons to work as expected then they + should avoid writing assembly like ".long foo - .". */ if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf32_arm_relocs_copied **pp; @@ -6633,6 +8489,16 @@ elf32_arm_readonly_dynrelocs (struct elf_link_hash_entry *h, PTR inf) return TRUE; } +void +bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *info, + int byteswap_code) +{ + struct elf32_arm_link_hash_table *globals; + + globals = elf32_arm_hash_table (info); + globals->byteswap_code = byteswap_code; +} + /* Set the sizes of the dynamic sections. */ static bfd_boolean @@ -6748,6 +8614,19 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, sym dynamic relocs. */ elf_link_hash_traverse (& htab->root, allocate_dynrelocs, info); + /* Here we rummage through the found bfds to collect glue information. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + /* Initialise mapping tables for code/data. */ + bfd_elf32_arm_init_maps (ibfd); + + if (!bfd_elf32_arm_process_before_allocation (ibfd, info) + || !bfd_elf32_arm_vfp11_erratum_scan (ibfd, info)) + /* xgettext:c-format */ + _bfd_error_handler (_("Errors encountered processing file %s"), + ibfd->filename); + } + /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ @@ -6769,7 +8648,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rel", 4) == 0) + else if (CONST_STRNEQ (name, ".rel")) { if (s->size != 0) { @@ -6783,7 +8662,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -6910,16 +8789,17 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, /* Fill in the entry in the procedure linkage table. */ if (htab->symbian_p) { - unsigned i; - for (i = 0; i < htab->plt_entry_size / 4; ++i) - bfd_put_32 (output_bfd, - elf32_arm_symbian_plt_entry[i], - splt->contents + h->plt.offset + 4 * i); + put_arm_insn (htab, output_bfd, + elf32_arm_symbian_plt_entry[0], + splt->contents + h->plt.offset); + bfd_put_32 (output_bfd, + elf32_arm_symbian_plt_entry[1], + splt->contents + h->plt.offset + 4); /* Fill in the entry in the .rel.plt section. */ rel.r_offset = (splt->output_section->vma + splt->output_offset - + h->plt.offset + 4 * (i - 1)); + + h->plt.offset + 4); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT); /* Get the index in the procedure linkage table which @@ -6934,6 +8814,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, bfd_vma got_offset, got_address, plt_address; bfd_vma got_displacement; asection * sgot; + bfd_byte * ptr; sgot = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (sgot != NULL); @@ -6959,20 +8840,23 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, + splt->output_offset + h->plt.offset); + ptr = htab->splt->contents + h->plt.offset; if (htab->vxworks_p && info->shared) { unsigned int i; bfd_vma val; - for (i = 0; i != htab->plt_entry_size / 4; i++) + for (i = 0; i != htab->plt_entry_size / 4; i++, ptr += 4) { val = elf32_arm_vxworks_shared_plt_entry[i]; if (i == 2) val |= got_address - sgot->output_section->vma; if (i == 5) val |= plt_index * RELOC_SIZE (htab); - bfd_put_32 (output_bfd, val, - htab->splt->contents + h->plt.offset + i * 4); + if (i == 2 || i == 5) + bfd_put_32 (output_bfd, val, ptr); + else + put_arm_insn (htab, output_bfd, val, ptr); } } else if (htab->vxworks_p) @@ -6980,7 +8864,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, unsigned int i; bfd_vma val; - for (i = 0; i != htab->plt_entry_size / 4; i++) + for (i = 0; i != htab->plt_entry_size / 4; i++, ptr += 4) { val = elf32_arm_vxworks_exec_plt_entry[i]; if (i == 2) @@ -6989,8 +8873,10 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, val |= 0xffffff & -((h->plt.offset + i * 4 + 8) >> 2); if (i == 5) val |= plt_index * RELOC_SIZE (htab); - bfd_put_32 (output_bfd, val, - htab->splt->contents + h->plt.offset + i * 4); + if (i == 2 || i == 5) + bfd_put_32 (output_bfd, val, ptr); + else + put_arm_insn (htab, output_bfd, val, ptr); } loc = (htab->srelplt2->contents @@ -7023,27 +8909,26 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info, if (!htab->use_blx && eh->plt_thumb_refcount > 0) { - bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[0], - splt->contents + h->plt.offset - 4); - bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[1], - splt->contents + h->plt.offset - 2); + put_thumb_insn (htab, output_bfd, + elf32_arm_plt_thumb_stub[0], ptr - 4); + put_thumb_insn (htab, output_bfd, + elf32_arm_plt_thumb_stub[1], ptr - 2); } - bfd_put_32 (output_bfd, - elf32_arm_plt_entry[0] - | ((got_displacement & 0x0ff00000) >> 20), - splt->contents + h->plt.offset + 0); - bfd_put_32 (output_bfd, - elf32_arm_plt_entry[1] - | ((got_displacement & 0x000ff000) >> 12), - splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, - elf32_arm_plt_entry[2] - | (got_displacement & 0x00000fff), - splt->contents + h->plt.offset + 8); + put_arm_insn (htab, output_bfd, + elf32_arm_plt_entry[0] + | ((got_displacement & 0x0ff00000) >> 20), + ptr + 0); + put_arm_insn (htab, output_bfd, + elf32_arm_plt_entry[1] + | ((got_displacement & 0x000ff000) >> 12), + ptr+ 4); + put_arm_insn (htab, output_bfd, + elf32_arm_plt_entry[2] + | (got_displacement & 0x00000fff), + ptr + 8); #ifdef FOUR_WORD_PLT - bfd_put_32 (output_bfd, elf32_arm_plt_entry[3], - splt->contents + h->plt.offset + 12); + bfd_put_32 (output_bfd, elf32_arm_plt_entry[3], ptr + 12); #endif } @@ -7353,9 +9238,12 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info Elf_Internal_Rela rel; plt0_entry = elf32_arm_vxworks_exec_plt0_entry; - bfd_put_32 (output_bfd, plt0_entry[0], splt->contents + 0); - bfd_put_32 (output_bfd, plt0_entry[1], splt->contents + 4); - bfd_put_32 (output_bfd, plt0_entry[2], splt->contents + 8); + put_arm_insn (htab, output_bfd, plt0_entry[0], + splt->contents + 0); + put_arm_insn (htab, output_bfd, plt0_entry[1], + splt->contents + 4); + put_arm_insn (htab, output_bfd, plt0_entry[2], + splt->contents + 8); bfd_put_32 (output_bfd, got_address, splt->contents + 12); /* Generate a relocation for _GLOBAL_OFFSET_TABLE_. */ @@ -7370,10 +9258,14 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info got_displacement = got_address - (plt_address + 16); plt0_entry = elf32_arm_plt0_entry; - bfd_put_32 (output_bfd, plt0_entry[0], splt->contents + 0); - bfd_put_32 (output_bfd, plt0_entry[1], splt->contents + 4); - bfd_put_32 (output_bfd, plt0_entry[2], splt->contents + 8); - bfd_put_32 (output_bfd, plt0_entry[3], splt->contents + 12); + put_arm_insn (htab, output_bfd, plt0_entry[0], + splt->contents + 0); + put_arm_insn (htab, output_bfd, plt0_entry[1], + splt->contents + 4); + put_arm_insn (htab, output_bfd, plt0_entry[2], + splt->contents + 8); + put_arm_insn (htab, output_bfd, plt0_entry[3], + splt->contents + 12); #ifdef FOUR_WORD_PLT /* The displacement value goes in the otherwise-unused @@ -7387,7 +9279,8 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info /* UnixWare sets the entsize of .plt to 4, although that doesn't really seem like the right value. */ - elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; + if (splt->output_section->owner == output_bfd) + elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; if (htab->vxworks_p && !info->shared && htab->splt->size > 0) { @@ -7498,12 +9391,8 @@ elf32_arm_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED static bfd_boolean is_arm_elf_unwind_section_name (bfd * abfd ATTRIBUTE_UNUSED, const char * name) { - size_t len1, len2; - - len1 = sizeof (ELF_STRING_ARM_unwind) - 1; - len2 = sizeof (ELF_STRING_ARM_unwind_once) - 1; - return (strncmp (name, ELF_STRING_ARM_unwind, len1) == 0 - || strncmp (name, ELF_STRING_ARM_unwind_once, len2) == 0); + return (CONST_STRNEQ (name, ELF_STRING_ARM_unwind) + || CONST_STRNEQ (name, ELF_STRING_ARM_unwind_once)); } @@ -7522,125 +9411,9 @@ elf32_arm_fake_sections (bfd * abfd, Elf_Internal_Shdr * hdr, asection * sec) hdr->sh_type = SHT_ARM_EXIDX; hdr->sh_flags |= SHF_LINK_ORDER; } - else if (strcmp(name, ".ARM.attributes") == 0) - { - hdr->sh_type = SHT_ARM_ATTRIBUTES; - } return TRUE; } -/* Parse an Arm EABI attributes section. */ -static void -elf32_arm_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) -{ - bfd_byte *contents; - bfd_byte *p; - bfd_vma len; - - contents = bfd_malloc (hdr->sh_size); - if (!contents) - return; - if (!bfd_get_section_contents (abfd, hdr->bfd_section, contents, 0, - hdr->sh_size)) - { - free (contents); - return; - } - p = contents; - if (*(p++) == 'A') - { - len = hdr->sh_size - 1; - while (len > 0) - { - int namelen; - bfd_vma section_len; - - section_len = bfd_get_32 (abfd, p); - p += 4; - if (section_len > len) - section_len = len; - len -= section_len; - namelen = strlen ((char *)p) + 1; - section_len -= namelen + 4; - if (strcmp((char *)p, "aeabi") != 0) - { - /* Vendor section. Ignore it. */ - p += namelen + section_len; - } - else - { - p += namelen; - while (section_len > 0) - { - int tag; - unsigned int n; - unsigned int val; - bfd_vma subsection_len; - bfd_byte *end; - - tag = read_unsigned_leb128 (abfd, p, &n); - p += n; - subsection_len = bfd_get_32 (abfd, p); - p += 4; - if (subsection_len > section_len) - subsection_len = section_len; - section_len -= subsection_len; - subsection_len -= n + 4; - end = p + subsection_len; - switch (tag) - { - case Tag_File: - while (p < end) - { - bfd_boolean is_string; - - tag = read_unsigned_leb128 (abfd, p, &n); - p += n; - if (tag == 4 || tag == 5) - is_string = 1; - else if (tag < 32) - is_string = 0; - else - is_string = (tag & 1) != 0; - if (tag == Tag_compatibility) - { - val = read_unsigned_leb128 (abfd, p, &n); - p += n; - elf32_arm_add_eabi_attr_compat (abfd, val, - (char *)p); - p += strlen ((char *)p) + 1; - } - else if (is_string) - { - elf32_arm_add_eabi_attr_string (abfd, tag, - (char *)p); - p += strlen ((char *)p) + 1; - } - else - { - val = read_unsigned_leb128 (abfd, p, &n); - p += n; - elf32_arm_add_eabi_attr_int (abfd, tag, val); - } - } - break; - case Tag_Section: - case Tag_Symbol: - /* Don't have anywhere convenient to attach these. - Fall through for now. */ - default: - /* Ignore things we don't kow about. */ - p += subsection_len; - subsection_len = 0; - break; - } - } - } - } - } - free (contents); -} - /* Handle an ARM specific section when reading an object file. This is called when bfd_section_from_shdr finds a section with an unknown type. */ @@ -7670,8 +9443,6 @@ elf32_arm_section_from_shdr (bfd *abfd, if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) return FALSE; - if (hdr->sh_type == SHT_ARM_ATTRIBUTES) - elf32_arm_parse_attributes(abfd, hdr); return TRUE; } @@ -7776,76 +9547,236 @@ unrecord_section_with_arm_elf_section_data (asection * sec) } } -/* Called for each symbol. Builds a section map based on mapping symbols. - Does not alter any of the symbols. */ + +typedef struct +{ + void *finfo; + struct bfd_link_info *info; + asection *sec; + int sec_shndx; + bfd_boolean (*func) (void *, const char *, Elf_Internal_Sym *, + asection *, struct elf_link_hash_entry *); +} output_arch_syminfo; + +enum map_symbol_type +{ + ARM_MAP_ARM, + ARM_MAP_THUMB, + ARM_MAP_DATA +}; + + +/* Output a single PLT mapping symbol. */ static bfd_boolean -elf32_arm_output_symbol_hook (struct bfd_link_info *info, - const char *name, - Elf_Internal_Sym *elfsym, - asection *input_sec, - struct elf_link_hash_entry *h) +elf32_arm_ouput_plt_map_sym (output_arch_syminfo *osi, + enum map_symbol_type type, + bfd_vma offset) { - int mapcount; - elf32_arm_section_map *map; - elf32_arm_section_map *newmap; - _arm_elf_section_data *arm_data; - struct elf32_arm_link_hash_table *globals; + static const char *names[3] = {"$a", "$t", "$d"}; + struct elf32_arm_link_hash_table *htab; + Elf_Internal_Sym sym; - globals = elf32_arm_hash_table (info); - if (globals->vxworks_p - && !elf_vxworks_link_output_symbol_hook (info, name, elfsym, - input_sec, h)) + htab = elf32_arm_hash_table (osi->info); + sym.st_value = osi->sec->output_section->vma + + osi->sec->output_offset + + offset; + sym.st_size = 0; + sym.st_other = 0; + sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE); + sym.st_shndx = osi->sec_shndx; + if (!osi->func (osi->finfo, names[type], &sym, osi->sec, NULL)) return FALSE; + return TRUE; +} - /* Only do this on final link. */ - if (info->relocatable) + +/* Output mapping symbols for PLT entries associated with H. */ + +static bfd_boolean +elf32_arm_output_plt_map (struct elf_link_hash_entry *h, void *inf) +{ + output_arch_syminfo *osi = (output_arch_syminfo *) inf; + struct elf32_arm_link_hash_table *htab; + struct elf32_arm_link_hash_entry *eh; + bfd_vma addr; + + htab = elf32_arm_hash_table (osi->info); + + if (h->root.type == bfd_link_hash_indirect) return TRUE; - /* Only build a map if we need to byteswap code. */ - if (!globals->byteswap_code) + if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->plt.offset == (bfd_vma) -1) return TRUE; - /* We only want mapping symbols. */ - if (! bfd_is_arm_mapping_symbol_name (name)) - return TRUE; - - /* If this section has not been allocated an _arm_elf_section_data - structure then we cannot record anything. */ - arm_data = get_arm_elf_section_data (input_sec); - if (arm_data == NULL) - return TRUE; - - mapcount = arm_data->mapcount + 1; - map = arm_data->map; - - /* TODO: This may be inefficient, but we probably don't usually have many - mapping symbols per section. */ - newmap = bfd_realloc (map, mapcount * sizeof (* map)); - if (newmap != NULL) + eh = (struct elf32_arm_link_hash_entry *) h; + addr = h->plt.offset; + if (htab->symbian_p) { - arm_data->map = newmap; - arm_data->mapcount = mapcount; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 4)) + return FALSE; + } + else if (htab->vxworks_p) + { + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 8)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr + 12)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 20)) + return FALSE; + } + else + { + bfd_boolean thumb_stub; - newmap[mapcount - 1].vma = elfsym->st_value; - newmap[mapcount - 1].type = name[1]; + thumb_stub = eh->plt_thumb_refcount > 0 && !htab->use_blx; + if (thumb_stub) + { + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_THUMB, addr - 4)) + return FALSE; + } +#ifdef FOUR_WORD_PLT + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_DATA, addr + 12)) + return FALSE; +#else + /* A three-word PLT with no Thumb thunk contains only Arm code, + so only need to output a mapping symbol for the first PLT entry and + entries with thumb thunks. */ + if (thumb_stub || addr == 20) + { + if (!elf32_arm_ouput_plt_map_sym (osi, ARM_MAP_ARM, addr)) + return FALSE; + } +#endif } return TRUE; } + +/* Output mapping symbols for linker generated sections. */ + +static bfd_boolean +elf32_arm_output_arch_local_syms (bfd *output_bfd, + struct bfd_link_info *info, + void *finfo, bfd_boolean (*func) (void *, const char *, + Elf_Internal_Sym *, + asection *, + struct elf_link_hash_entry *)) +{ + output_arch_syminfo osi; + struct elf32_arm_link_hash_table *htab; + bfd_vma offset; + bfd_size_type size; + + htab = elf32_arm_hash_table (info); + check_use_blx(htab); + + osi.finfo = finfo; + osi.info = info; + osi.func = func; + + /* ARM->Thumb glue. */ + if (htab->arm_glue_size > 0) + { + osi.sec = bfd_get_section_by_name (htab->bfd_of_glue_owner, + ARM2THUMB_GLUE_SECTION_NAME); + + osi.sec_shndx = _bfd_elf_section_from_bfd_section + (output_bfd, osi.sec->output_section); + if (info->shared || htab->root.is_relocatable_executable + || htab->pic_veneer) + size = ARM2THUMB_PIC_GLUE_SIZE; + else if (htab->use_blx) + size = ARM2THUMB_V5_STATIC_GLUE_SIZE; + else + size = ARM2THUMB_STATIC_GLUE_SIZE; + + for (offset = 0; offset < htab->arm_glue_size; offset += size) + { + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, offset); + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, offset + size - 4); + } + } + + /* Thumb->ARM glue. */ + if (htab->thumb_glue_size > 0) + { + osi.sec = bfd_get_section_by_name (htab->bfd_of_glue_owner, + THUMB2ARM_GLUE_SECTION_NAME); + + osi.sec_shndx = _bfd_elf_section_from_bfd_section + (output_bfd, osi.sec->output_section); + size = THUMB2ARM_GLUE_SIZE; + + for (offset = 0; offset < htab->thumb_glue_size; offset += size) + { + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_THUMB, offset); + elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, offset + 4); + } + } + + /* Finally, output mapping symbols for the PLT. */ + if (!htab->splt || htab->splt->size == 0) + return TRUE; + + osi.sec_shndx = _bfd_elf_section_from_bfd_section (output_bfd, + htab->splt->output_section); + osi.sec = htab->splt; + /* Output mapping symbols for the plt header. SymbianOS does not have a + plt header. */ + if (htab->vxworks_p) + { + /* VxWorks shared libraries have no PLT header. */ + if (!info->shared) + { + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, 0)) + return FALSE; + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, 12)) + return FALSE; + } + } + else if (!htab->symbian_p) + { + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_ARM, 0)) + return FALSE; +#ifndef FOUR_WORD_PLT + if (!elf32_arm_ouput_plt_map_sym (&osi, ARM_MAP_DATA, 16)) + return FALSE; +#endif + } + + elf_link_hash_traverse (&htab->root, elf32_arm_output_plt_map, (void *) &osi); + return TRUE; +} + /* Allocate target specific section data. */ static bfd_boolean elf32_arm_new_section_hook (bfd *abfd, asection *sec) { - _arm_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + _arm_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } record_section_with_arm_elf_section_data (sec); @@ -7867,15 +9798,18 @@ elf32_arm_compare_mapping (const void * a, const void * b) written out as normal. */ static bfd_boolean -elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec, +elf32_arm_write_section (bfd *output_bfd, + struct bfd_link_info *link_info, asection *sec, bfd_byte *contents) { - int mapcount; + int mapcount, errcount; _arm_elf_section_data *arm_data; + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info); elf32_arm_section_map *map; + elf32_vfp11_erratum_list *errnode; bfd_vma ptr; bfd_vma end; - bfd_vma offset; + bfd_vma offset = sec->output_section->vma + sec->output_offset; bfd_byte tmp; int i; @@ -7887,57 +9821,136 @@ elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec, mapcount = arm_data->mapcount; map = arm_data->map; + errcount = arm_data->erratumcount; + + if (errcount != 0) + { + unsigned int endianflip = bfd_big_endian (output_bfd) ? 3 : 0; + + for (errnode = arm_data->erratumlist; errnode != 0; + errnode = errnode->next) + { + bfd_vma index = errnode->vma - offset; + + switch (errnode->type) + { + case VFP11_ERRATUM_BRANCH_TO_ARM_VENEER: + { + bfd_vma branch_to_veneer; + /* Original condition code of instruction, plus bit mask for + ARM B instruction. */ + unsigned int insn = (errnode->u.b.vfp_insn & 0xf0000000) + | 0x0a000000; + + /* The instruction is before the label. */ + index -= 4; + + /* Above offset included in -4 below. */ + branch_to_veneer = errnode->u.b.veneer->vma + - errnode->vma - 4; + + if ((signed) branch_to_veneer < -(1 << 25) + || (signed) branch_to_veneer >= (1 << 25)) + (*_bfd_error_handler) (_("%B: error: VFP11 veneer out of " + "range"), output_bfd); + + insn |= (branch_to_veneer >> 2) & 0xffffff; + contents[endianflip ^ index] = insn & 0xff; + contents[endianflip ^ (index + 1)] = (insn >> 8) & 0xff; + contents[endianflip ^ (index + 2)] = (insn >> 16) & 0xff; + contents[endianflip ^ (index + 3)] = (insn >> 24) & 0xff; + } + break; + + case VFP11_ERRATUM_ARM_VENEER: + { + bfd_vma branch_from_veneer; + unsigned int insn; + + /* Take size of veneer into account. */ + branch_from_veneer = errnode->u.v.branch->vma + - errnode->vma - 12; + + if ((signed) branch_from_veneer < -(1 << 25) + || (signed) branch_from_veneer >= (1 << 25)) + (*_bfd_error_handler) (_("%B: error: VFP11 veneer out of " + "range"), output_bfd); + + /* Original instruction. */ + insn = errnode->u.v.branch->u.b.vfp_insn; + contents[endianflip ^ index] = insn & 0xff; + contents[endianflip ^ (index + 1)] = (insn >> 8) & 0xff; + contents[endianflip ^ (index + 2)] = (insn >> 16) & 0xff; + contents[endianflip ^ (index + 3)] = (insn >> 24) & 0xff; + + /* Branch back to insn after original insn. */ + insn = 0xea000000 | ((branch_from_veneer >> 2) & 0xffffff); + contents[endianflip ^ (index + 4)] = insn & 0xff; + contents[endianflip ^ (index + 5)] = (insn >> 8) & 0xff; + contents[endianflip ^ (index + 6)] = (insn >> 16) & 0xff; + contents[endianflip ^ (index + 7)] = (insn >> 24) & 0xff; + } + break; + + default: + abort (); + } + } + } if (mapcount == 0) return FALSE; - qsort (map, mapcount, sizeof (* map), elf32_arm_compare_mapping); - - offset = sec->output_section->vma + sec->output_offset; - ptr = map[0].vma - offset; - for (i = 0; i < mapcount; i++) + if (globals->byteswap_code) { - if (i == mapcount - 1) - end = sec->size; - else - end = map[i + 1].vma - offset; + qsort (map, mapcount, sizeof (* map), elf32_arm_compare_mapping); - switch (map[i].type) - { - case 'a': - /* Byte swap code words. */ - while (ptr + 3 < end) + ptr = map[0].vma; + for (i = 0; i < mapcount; i++) + { + if (i == mapcount - 1) + end = sec->size; + else + end = map[i + 1].vma; + + switch (map[i].type) { - tmp = contents[ptr]; - contents[ptr] = contents[ptr + 3]; - contents[ptr + 3] = tmp; - tmp = contents[ptr + 1]; - contents[ptr + 1] = contents[ptr + 2]; - contents[ptr + 2] = tmp; - ptr += 4; - } - break; + case 'a': + /* Byte swap code words. */ + while (ptr + 3 < end) + { + tmp = contents[ptr]; + contents[ptr] = contents[ptr + 3]; + contents[ptr + 3] = tmp; + tmp = contents[ptr + 1]; + contents[ptr + 1] = contents[ptr + 2]; + contents[ptr + 2] = tmp; + ptr += 4; + } + break; - case 't': - /* Byte swap code halfwords. */ - while (ptr + 1 < end) - { - tmp = contents[ptr]; - contents[ptr] = contents[ptr + 1]; - contents[ptr + 1] = tmp; - ptr += 2; - } - break; + case 't': + /* Byte swap code halfwords. */ + while (ptr + 1 < end) + { + tmp = contents[ptr]; + contents[ptr] = contents[ptr + 1]; + contents[ptr + 1] = tmp; + ptr += 2; + } + break; - case 'd': - /* Leave data alone. */ - break; - } - ptr = end; + case 'd': + /* Leave data alone. */ + break; + } + ptr = end; + } } free (map); arm_data->mapcount = 0; + arm_data->mapsize = 0; arm_data->map = NULL; unrecord_section_with_arm_elf_section_data (sec); @@ -7955,11 +9968,25 @@ unrecord_section_via_map_over_sections (bfd * abfd ATTRIBUTE_UNUSED, static bfd_boolean elf32_arm_close_and_cleanup (bfd * abfd) { - bfd_map_over_sections (abfd, unrecord_section_via_map_over_sections, NULL); + if (abfd->sections) + bfd_map_over_sections (abfd, + unrecord_section_via_map_over_sections, + NULL); return _bfd_elf_close_and_cleanup (abfd); } +static bfd_boolean +elf32_arm_bfd_free_cached_info (bfd * abfd) +{ + if (abfd->sections) + bfd_map_over_sections (abfd, + unrecord_section_via_map_over_sections, + NULL); + + return _bfd_free_cached_info (abfd); +} + /* Display STT_ARM_TFUNC symbols as functions. */ static void @@ -7975,13 +10002,14 @@ elf32_arm_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, /* Mangle thumb function symbols as we read them in. */ -static void +static bfd_boolean elf32_arm_swap_symbol_in (bfd * abfd, const void *psrc, const void *pshn, Elf_Internal_Sym *dst) { - bfd_elf32_swap_symbol_in (abfd, psrc, pshn, dst); + if (!bfd_elf32_swap_symbol_in (abfd, psrc, pshn, dst)) + return FALSE; /* New EABI objects mark thumb function symbols by setting the low bit of the address. Turn these into STT_ARM_TFUNC. */ @@ -7991,6 +10019,7 @@ elf32_arm_swap_symbol_in (bfd * abfd, dst->st_info = ELF_ST_INFO (ELF_ST_BIND (dst->st_info), STT_ARM_TFUNC); dst->st_value &= ~(bfd_vma) 1; } + return TRUE; } @@ -8012,7 +10041,18 @@ elf32_arm_swap_symbol_out (bfd *abfd, { newsym = *src; newsym.st_info = ELF_ST_INFO (ELF_ST_BIND (src->st_info), STT_FUNC); - newsym.st_value |= 1; + if (newsym.st_shndx != SHN_UNDEF) + { + /* Do this only for defined symbols. At link type, the static + linker will simulate the work of dynamic linker of resolving + symbols and will carry over the thumbness of found symbols to + the output symbol table. It's not clear how it happens, but + the thumbness of undefined symbols can well be different at + runtime, and writing '1' for them will be confusing for users + and possibly for dynamic linker itself. + */ + newsym.st_value |= 1; + } src = &newsym; } @@ -8057,7 +10097,8 @@ elf32_arm_modify_segment_map (bfd *abfd, /* We may add a PT_ARM_EXIDX program header. */ static int -elf32_arm_additional_program_headers (bfd *abfd) +elf32_arm_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *sec; @@ -8068,6 +10109,13 @@ elf32_arm_additional_program_headers (bfd *abfd) return 0; } +/* We have two function types: STT_FUNC and STT_ARM_TFUNC. */ +static bfd_boolean +elf32_arm_is_function_type (unsigned int type) +{ + return (type == STT_FUNC) || (type == STT_ARM_TFUNC); +} + /* We use this to override swap_symbol_in and swap_symbol_out. */ const struct elf_size_info elf32_arm_size_info = { sizeof (Elf32_External_Ehdr), @@ -8105,6 +10153,7 @@ const struct elf_size_info elf32_arm_size_info = { #define ELF_MAXPAGESIZE 0x8000 #endif #define ELF_MINPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #define bfd_elf32_mkobject elf32_arm_mkobject @@ -8114,15 +10163,17 @@ const struct elf_size_info elf32_arm_size_info = { #define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data #define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf32_arm_reloc_name_lookup #define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line #define bfd_elf32_find_inliner_info elf32_arm_find_inliner_info #define bfd_elf32_new_section_hook elf32_arm_new_section_hook #define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol #define bfd_elf32_close_and_cleanup elf32_arm_close_and_cleanup -#define bfd_elf32_bfd_final_link elf32_arm_bfd_final_link +#define bfd_elf32_bfd_free_cached_info elf32_arm_bfd_free_cached_info #define elf_backend_get_symbol_type elf32_arm_get_symbol_type #define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook +#define elf_backend_gc_mark_extra_sections elf32_arm_gc_mark_extra_sections #define elf_backend_gc_sweep_hook elf32_arm_gc_sweep_hook #define elf_backend_check_relocs elf32_arm_check_relocs #define elf_backend_relocate_section elf32_arm_relocate_section @@ -8131,8 +10182,8 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections -#define elf_backend_link_output_symbol_hook elf32_arm_output_symbol_hook #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_2_index_sections #define elf_backend_post_process_headers elf32_arm_post_process_headers #define elf_backend_reloc_type_class elf32_arm_reloc_type_class #define elf_backend_object_p elf32_arm_object_p @@ -8146,6 +10197,11 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_modify_segment_map elf32_arm_modify_segment_map #define elf_backend_additional_program_headers \ elf32_arm_additional_program_headers +#define elf_backend_output_arch_local_syms \ + elf32_arm_output_arch_local_syms +#define elf_backend_begin_write_processing \ + elf32_arm_begin_write_processing +#define elf_backend_is_function_type elf32_arm_is_function_type #define elf_backend_can_refcount 1 #define elf_backend_can_gc_sections 1 @@ -8155,10 +10211,18 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_may_use_rel_p 1 #define elf_backend_may_use_rela_p 0 #define elf_backend_default_use_rela_p 0 -#define elf_backend_rela_normal 0 #define elf_backend_got_header_size 12 +#undef elf_backend_obj_attrs_vendor +#define elf_backend_obj_attrs_vendor "aeabi" +#undef elf_backend_obj_attrs_section +#define elf_backend_obj_attrs_section ".ARM.attributes" +#undef elf_backend_obj_attrs_arg_type +#define elf_backend_obj_attrs_arg_type elf32_arm_obj_attrs_arg_type +#undef elf_backend_obj_attrs_section_type +#define elf_backend_obj_attrs_section_type SHT_ARM_ATTRIBUTES + #include "elf32-target.h" /* VxWorks Targets */ @@ -8219,8 +10283,6 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #define elf_backend_may_use_rela_p 1 #undef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p 1 -#undef elf_backend_rela_normal -#define elf_backend_rela_normal 1 #undef elf_backend_want_plt_sym #define elf_backend_want_plt_sym 1 #undef ELF_MAXPAGESIZE @@ -8271,24 +10333,23 @@ elf32_arm_symbian_special_sections[] = the loadable read-only segment. The post-linker may wish to refer to these sections, but they are not part of the final program image. */ - { ".dynamic", 8, 0, SHT_DYNAMIC, 0 }, - { ".dynstr", 7, 0, SHT_STRTAB, 0 }, - { ".dynsym", 7, 0, SHT_DYNSYM, 0 }, - { ".got", 4, 0, SHT_PROGBITS, 0 }, - { ".hash", 5, 0, SHT_HASH, 0 }, + { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, 0 }, + { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, 0 }, + { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, 0 }, + { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, 0 }, + { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, 0 }, /* These sections do not need to be writable as the SymbianOS postlinker will arrange things so that no dynamic relocation is required. */ - { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC }, - { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC }, - { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC }, + { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC }, + { STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; static void elf32_arm_symbian_begin_write_processing (bfd *abfd, - struct bfd_link_info *link_info - ATTRIBUTE_UNUSED) + struct bfd_link_info *link_info) { /* BPABI objects are never loaded directly by an OS kernel; they are processed by a postlinker first, into an OS-specific format. If @@ -8299,6 +10360,7 @@ elf32_arm_symbian_begin_write_processing (bfd *abfd, recognize that the program headers should not be mapped into any loadable segment. */ abfd->flags &= ~D_PAGED; + elf32_arm_begin_write_processing(abfd, link_info); } static bfd_boolean @@ -8315,9 +10377,16 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd, dynsec = bfd_get_section_by_name (abfd, ".dynamic"); if (dynsec) { - m = _bfd_elf_make_dynamic_segment (abfd, dynsec); - m->next = elf_tdata (abfd)->segment_map; - elf_tdata (abfd)->segment_map = m; + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_DYNAMIC) + break; + + if (m == NULL) + { + m = _bfd_elf_make_dynamic_segment (abfd, dynsec); + m->next = elf_tdata (abfd)->segment_map; + elf_tdata (abfd)->segment_map = m; + } } /* Also call the generic arm routine. */ @@ -8366,8 +10435,6 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd, #define elf_backend_may_use_rela_p 0 #undef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p 0 -#undef elf_backend_rela_normal -#define elf_backend_rela_normal 0 #undef elf_backend_want_plt_sym #define elf_backend_want_plt_sym 0 #undef ELF_MAXPAGESIZE diff --git a/contrib/binutils/bfd/elf32-avr.h b/contrib/binutils/bfd/elf32-avr.h new file mode 100644 index 00000000000..4b9035fa475 --- /dev/null +++ b/contrib/binutils/bfd/elf32-avr.h @@ -0,0 +1,38 @@ +/* AVR-specific support for 32-bit ELF. + Copyright 2006 Free Software Foundation, Inc. + + Written by Bjoern Haase + + This file is part of BFD, the Binary File Descriptor library. + + 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. */ + + +/* These four functions will be called from the ld back-end. */ + +extern void +elf32_avr_setup_params (struct bfd_link_info *, bfd *, asection *, + bfd_boolean, bfd_boolean, bfd_boolean, + bfd_vma, bfd_boolean); + +extern int +elf32_avr_setup_section_lists (bfd *, struct bfd_link_info *); + +extern bfd_boolean +elf32_avr_size_stubs (bfd *, struct bfd_link_info *, bfd_boolean); + +extern bfd_boolean +elf32_avr_build_stubs (struct bfd_link_info *); diff --git a/contrib/binutils/bfd/elf32-cr16.c b/contrib/binutils/bfd/elf32-cr16.c new file mode 100644 index 00000000000..197bff72008 --- /dev/null +++ b/contrib/binutils/bfd/elf32-cr16.c @@ -0,0 +1,1433 @@ +/* BFD back-end for National Semiconductor's CR16 ELF + Copyright 2007 Free Software Foundation, Inc. + Written by M R Swami Reddy. + + This file is part of BFD, the Binary File Descriptor library. + + 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 "bfdlink.h" +#include "libbfd.h" +#include "libiberty.h" +#include "elf-bfd.h" +#include "elf/cr16.h" + +/* cr16_reloc_map array maps BFD relocation enum into a CRGAS relocation type. */ + +struct cr16_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_enum; /* BFD relocation enum. */ + unsigned short cr16_reloc_type; /* CR16 relocation type. */ +}; + +static const struct cr16_reloc_map cr16_reloc_map[R_CR16_MAX] = +{ + {BFD_RELOC_NONE, R_CR16_NONE}, + {BFD_RELOC_CR16_NUM8, R_CR16_NUM8}, + {BFD_RELOC_CR16_NUM16, R_CR16_NUM16}, + {BFD_RELOC_CR16_NUM32, R_CR16_NUM32}, + {BFD_RELOC_CR16_NUM32a, R_CR16_NUM32a}, + {BFD_RELOC_CR16_REGREL4, R_CR16_REGREL4}, + {BFD_RELOC_CR16_REGREL4a, R_CR16_REGREL4a}, + {BFD_RELOC_CR16_REGREL14, R_CR16_REGREL14}, + {BFD_RELOC_CR16_REGREL14a, R_CR16_REGREL14a}, + {BFD_RELOC_CR16_REGREL16, R_CR16_REGREL16}, + {BFD_RELOC_CR16_REGREL20, R_CR16_REGREL20}, + {BFD_RELOC_CR16_REGREL20a, R_CR16_REGREL20a}, + {BFD_RELOC_CR16_ABS20, R_CR16_ABS20}, + {BFD_RELOC_CR16_ABS24, R_CR16_ABS24}, + {BFD_RELOC_CR16_IMM4, R_CR16_IMM4}, + {BFD_RELOC_CR16_IMM8, R_CR16_IMM8}, + {BFD_RELOC_CR16_IMM16, R_CR16_IMM16}, + {BFD_RELOC_CR16_IMM20, R_CR16_IMM20}, + {BFD_RELOC_CR16_IMM24, R_CR16_IMM24}, + {BFD_RELOC_CR16_IMM32, R_CR16_IMM32}, + {BFD_RELOC_CR16_IMM32a, R_CR16_IMM32a}, + {BFD_RELOC_CR16_DISP4, R_CR16_DISP4}, + {BFD_RELOC_CR16_DISP8, R_CR16_DISP8}, + {BFD_RELOC_CR16_DISP16, R_CR16_DISP16}, + {BFD_RELOC_CR16_DISP24, R_CR16_DISP24}, + {BFD_RELOC_CR16_DISP24a, R_CR16_DISP24a} +}; + +static reloc_howto_type cr16_elf_howto_table[] = +{ + HOWTO (R_CR16_NONE, /* type */ + 0, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM8", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM16, /* type */ + 0, /* rightshift */ + 1, /* size */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM32, /* type */ + 0, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_NUM32a, /* type */ + 1, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_NUM32a", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL4, /* type */ + 0, /* rightshift */ + 0, /* size */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL4", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL4a, /* type */ + 0, /* rightshift */ + 0, /* size */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL4a", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL14, /* type */ + 0, /* rightshift */ + 1, /* size */ + 14, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL14", /* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL14a, /* type */ + 0, /* rightshift */ + 1, /* size */ + 14, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL14a", /* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL16, /* type */ + 0, /* rightshift */ + 1, /* size */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL20, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_REGREL20a, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_REGREL20a", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_ABS20, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_ABS20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_ABS24, /* type */ + 0, /* rightshift */ + 2, /* size */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_ABS24", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM4, /* type */ + 0, /* rightshift */ + 0, /* size */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM4", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM8", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM16, /* type */ + 0, /* rightshift */ + 1, /* size */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM20, /* type */ + 0, /* rightshift */ + 2, /* size */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM24, /* type */ + 0, /* rightshift */ + 2, /* size */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM24", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM32, /* type */ + 0, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_IMM32a, /* type */ + 1, /* rightshift */ + 2, /* size */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_IMM32a", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP4, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP4", /* name */ + FALSE, /* partial_inplace */ + 0xf, /* src_mask */ + 0xf, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP8, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP8", /* name */ + FALSE, /* partial_inplace */ + 0x1ff, /* src_mask */ + 0x1ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP16, /* type */ + 0, /* rightshift REVIITS: To sync with WinIDEA*/ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP16", /* name */ + FALSE, /* partial_inplace */ + 0x1ffff, /* src_mask */ + 0x1ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* REVISIT: DISP24 should be left-shift by 2 as per ISA doc + but its not done, to sync with WinIDEA and CR16 4.1 tools */ + HOWTO (R_CR16_DISP24, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP24", /* name */ + FALSE, /* partial_inplace */ + 0x1ffffff, /* src_mask */ + 0x1ffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_CR16_DISP24a, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CR16_DISP24a", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE) /* pcrel_offset */ +}; + +/* Retrieve a howto ptr using a BFD reloc_code. */ + +static reloc_howto_type * +elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + unsigned int i; + + for (i = 0; i < R_CR16_MAX; i++) + if (code == cr16_reloc_map[i].bfd_reloc_enum) + return &cr16_elf_howto_table[cr16_reloc_map[i].cr16_reloc_type]; + + _bfd_error_handler ("Unsupported CR16 relocation type: 0x%x\n", code); + return NULL; +} + +static reloc_howto_type * +elf_cr16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; ARRAY_SIZE (cr16_elf_howto_table); i++) + if (cr16_elf_howto_table[i].name != NULL + && strcasecmp (cr16_elf_howto_table[i].name, r_name) == 0) + return cr16_elf_howto_table + i; + + return NULL; +} + +/* Retrieve a howto ptr using an internal relocation entry. */ + +static void +elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + + BFD_ASSERT (r_type < (unsigned int) R_CR16_MAX); + cache_ptr->howto = &cr16_elf_howto_table[r_type]; +} + +/* Perform a relocation as part of a final link. */ + +static bfd_reloc_status_type +cr16_elf_final_link_relocate (reloc_howto_type *howto, + bfd *input_bfd, + bfd *output_bfd ATTRIBUTE_UNUSED, + asection *input_section, + bfd_byte *contents, + bfd_vma offset, + bfd_vma Rvalue, + bfd_vma addend, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + int is_local ATTRIBUTE_UNUSED) +{ + unsigned short r_type = howto->type; + bfd_byte *hit_data = contents + offset; + bfd_vma reloc_bits, check, Rvalue1; + + switch (r_type) + { + case R_CR16_IMM4: + case R_CR16_IMM8: + case R_CR16_IMM16: + case R_CR16_IMM20: + case R_CR16_IMM32: + case R_CR16_IMM32a: + case R_CR16_REGREL4: + case R_CR16_REGREL4a: + case R_CR16_REGREL14: + case R_CR16_REGREL14a: + case R_CR16_REGREL16: + case R_CR16_REGREL20: + case R_CR16_ABS20: + case R_CR16_ABS24: + case R_CR16_DISP16: + case R_CR16_DISP24: + /* 'hit_data' is relative to the start of the instruction, not the + relocation offset. Advance it to account for the exact offset. */ + hit_data += 2; + break; + + case R_CR16_NONE: + return bfd_reloc_ok; + break; + + case R_CR16_DISP4: + case R_CR16_DISP8: + case R_CR16_DISP24a: + /* We only care about the addend, where the difference between + expressions is kept. */ + if (is_local) Rvalue -= -1; + + default: + break; + } + + if (howto->pc_relative) + { + /* Subtract the address of the section containing the location. */ + Rvalue -= (input_section->output_section->vma + + input_section->output_offset); + /* Subtract the position of the location within the section. */ + Rvalue -= offset; + } + + /* Add in supplied addend. */ + Rvalue += addend; + + /* Complain if the bitfield overflows, whether it is considered + as signed or unsigned. */ + check = Rvalue >> howto->rightshift; + + /* Assumes two's complement. This expression avoids + overflow if howto->bitsize is the number of bits in + bfd_vma. */ + reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1; + + if (((bfd_vma) check & ~reloc_bits) != 0 + && (((bfd_vma) check & ~reloc_bits) + != (-(bfd_vma) 1 & ~reloc_bits))) + { + /* The above right shift is incorrect for a signed + value. See if turning on the upper bits fixes the + overflow. */ + if (howto->rightshift && (bfd_signed_vma) Rvalue < 0) + { + check |= ((bfd_vma) - 1 + & ~((bfd_vma) - 1 + >> howto->rightshift)); + + if (((bfd_vma) check & ~reloc_bits) + != (-(bfd_vma) 1 & ~reloc_bits)) + return bfd_reloc_overflow; + } + else + return bfd_reloc_overflow; + } + + /* Drop unwanted bits from the value we are relocating to. */ + Rvalue >>= (bfd_vma) howto->rightshift; + + /* Apply dst_mask to select only relocatable part of the insn. */ + Rvalue &= howto->dst_mask; + + switch (howto->size) + { + case 0: + if ((r_type == R_CR16_IMM4) + || (r_type == R_CR16_DISP4) + || (r_type == R_CR16_DISP8)) + { + Rvalue1 = bfd_get_16 (input_bfd, hit_data); + Rvalue = ((Rvalue1 & 0xf000) | ((Rvalue << 4) & 0xf00) + | (Rvalue1 & 0x00f0) | (Rvalue & 0xf)); + bfd_put_16 (input_bfd, Rvalue, hit_data); + } + break; + + case 1: + if (r_type == R_CR16_DISP16) + { + Rvalue |= (bfd_get_16 (input_bfd, hit_data)); + Rvalue = ((Rvalue & 0xfffe) | ((Rvalue >> 16) & 0x1)); + + bfd_put_16 (input_bfd, Rvalue, hit_data); + } + break; + + case 2: + if (r_type == R_CR16_ABS20) + { + Rvalue |= (((bfd_get_16 (input_bfd, hit_data) << 16) + | (bfd_get_16 (input_bfd, hit_data + 2))) + & ~howto->dst_mask); + Rvalue |= (bfd_get_16 (input_bfd, hit_data + 2) << 16); + + /* Relocation on INSTRUCTIONS is different : Instructions are + word-addressable, that is, each word itself is arranged according + to little-endian convention, whereas the words are arranged with + respect to one another in BIG ENDIAN fashion. + When there is an immediate value that spans a word boundary, + it is split in a big-endian way with respect to the words. */ + bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data); + bfd_put_16 (input_bfd, (Rvalue >> 16)& 0xffff, hit_data + 2); + } + else if (r_type == R_CR16_ABS24) + { + Rvalue = ((((Rvalue >> 20)& 0xf) + | (((Rvalue >> 16) & 0xf) << 8) + | (bfd_get_16 (input_bfd, hit_data))) + | ((Rvalue & 0xffff) << 16)); + + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if (r_type == R_CR16_DISP24) + { + Rvalue = ((((Rvalue >> 20)& 0xf) | (((Rvalue >> 16) & 0xf)<<8) + | (bfd_get_16 (input_bfd, hit_data))) + | (((Rvalue & 0xfffE) | ((Rvalue >> 24) & 0x1)) << 16)); + + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if ((r_type == R_CR16_IMM32) || (r_type == R_CR16_IMM32a)) + { + Rvalue = (((Rvalue >> 16)& 0xffff) + | (bfd_get_16 (input_bfd, hit_data))) + | ((Rvalue & 0xffff) << 16); + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if (r_type == R_CR16_DISP24a) + { + Rvalue = (((Rvalue & 0xfffffe) | (Rvalue >> 23))); + Rvalue = ((Rvalue >> 16) & 0xff) | ((Rvalue & 0xffff) << 16) + | (bfd_get_32 (input_bfd, hit_data)); + + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + else if ((r_type == R_CR16_NUM32) || (r_type == R_CR16_NUM32a)) + { + bfd_put_32 (input_bfd, Rvalue, hit_data); + } + break; + + default: + return bfd_reloc_notsupported; + } + + return bfd_reloc_ok; +} + +/* Delete some bytes from a section while relaxing. */ + +static bfd_boolean +elf32_cr16_relax_delete_bytes (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, bfd_vma addr, int count) +{ + Elf_Internal_Shdr *symtab_hdr; + unsigned int sec_shndx; + bfd_byte *contents; + Elf_Internal_Rela *irel, *irelend; + Elf_Internal_Rela *irelalign; + bfd_vma toaddr; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + struct elf_link_hash_entry **start_hashes; + unsigned int symcount; + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + contents = elf_section_data (sec)->this_hdr.contents; + + /* The deletion must stop at the next ALIGN reloc for an aligment + power larger than the number of bytes we are deleting. */ + irelalign = NULL; + toaddr = sec->size; + + irel = elf_section_data (sec)->relocs; + irelend = irel + sec->reloc_count; + + /* Actually delete the bytes. */ + memmove (contents + addr, contents + addr + count, + (size_t) (toaddr - addr - count)); + sec->size -= count; + + /* Adjust all the relocs. */ + for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) + /* Get the new reloc address. */ + if ((irel->r_offset > addr && irel->r_offset < toaddr)) + irel->r_offset -= count; + + /* Adjust the local symbols defined in this section. */ + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) + { + if (isym->st_shndx == sec_shndx + && isym->st_value > addr + && isym->st_value < toaddr) + { + /* Adjust the addend of SWITCH relocations in this section, + which reference this local symbol. */ + for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) + { + unsigned long r_symndx; + Elf_Internal_Sym *rsym; + bfd_vma addsym, subsym; + + r_symndx = ELF32_R_SYM (irel->r_info); + rsym = (Elf_Internal_Sym *) symtab_hdr->contents + r_symndx; + + /* Skip if not the local adjusted symbol. */ + if (rsym != isym) + continue; + + addsym = isym->st_value; + subsym = addsym - irel->r_addend; + + /* Fix the addend only when -->> (addsym > addr >= subsym). */ + if (subsym <= addr) + irel->r_addend -= count; + else + continue; + } + + isym->st_value -= count; + } + } + + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = start_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + + /* The '--wrap SYMBOL' option is causing a pain when the object file, + containing the definition of __wrap_SYMBOL, includes a direct + call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference + the same symbol (which is __wrap_SYMBOL), but still exist as two + different symbols in 'sym_hashes', we don't want to adjust + the global symbol __wrap_SYMBOL twice. + This check is only relevant when symbols are being wrapped. */ + if (link_info->wrap_hash != NULL) + { + struct elf_link_hash_entry **cur_sym_hashes; + + /* Loop only over the symbols whom been already checked. */ + for (cur_sym_hashes = start_hashes; cur_sym_hashes < sym_hashes; + cur_sym_hashes++) + /* If the current symbol is identical to 'sym_hash', that means + the symbol was already adjusted (or at least checked). */ + if (*cur_sym_hashes == sym_hash) + break; + + /* Don't adjust the symbol again. */ + if (cur_sym_hashes < sym_hashes) + continue; + } + + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec + && sym_hash->root.u.def.value > addr + && sym_hash->root.u.def.value < toaddr) + sym_hash->root.u.def.value -= count; + } + + return TRUE; +} + +/* Relocate a CR16 ELF section. */ + +static bfd_boolean +elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info, + bfd *input_bfd, asection *input_section, + bfd_byte *contents, Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + + if (info->relocatable) + return TRUE; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + bfd_vma relocation; + bfd_reloc_status_type r; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + howto = cr16_elf_howto_table + (r_type); + + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + } + else + { + bfd_boolean unresolved_reloc, warned; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + } + + r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd, + input_section, + contents, rel->r_offset, + relocation, rel->r_addend, + info, sec, h == NULL); + + if (r != bfd_reloc_ok) + { + const char *name; + const char *msg = NULL; + + if (h != NULL) + name = h->root.root.string; + else + { + name = (bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name)); + if (name == NULL || *name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), name, howto->name, + (bfd_vma) 0, input_bfd, input_section, + rel->r_offset))) + return FALSE; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, + rel->r_offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous error"); + goto common_error; + + default: + msg = _("internal error: unknown error"); + /* Fall through. */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, name, input_bfd, input_section, + rel->r_offset))) + return FALSE; + break; + } + } + } + + return TRUE; +} + +/* This is a version of bfd_generic_get_relocated_section_contents + which uses elf32_cr16_relocate_section. */ + +static bfd_byte * +elf32_cr16_get_relocated_section_contents (bfd *output_bfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols) +{ + Elf_Internal_Shdr *symtab_hdr; + asection *input_section = link_order->u.indirect.section; + bfd *input_bfd = input_section->owner; + asection **sections = NULL; + Elf_Internal_Rela *internal_relocs = NULL; + Elf_Internal_Sym *isymbuf = NULL; + + /* We only need to handle the case of relaxing, or of having a + particular set of section contents, specially. */ + if (relocatable + || elf_section_data (input_section)->this_hdr.contents == NULL) + return bfd_generic_get_relocated_section_contents (output_bfd, link_info, + link_order, data, + relocatable, + symbols); + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + + memcpy (data, elf_section_data (input_section)->this_hdr.contents, + (size_t) input_section->size); + + if ((input_section->flags & SEC_RELOC) != 0 + && input_section->reloc_count > 0) + { + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + asection **secpp; + bfd_size_type amt; + + internal_relocs = _bfd_elf_link_read_relocs (input_bfd, input_section, + NULL, NULL, FALSE); + if (internal_relocs == NULL) + goto error_return; + + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } + + amt = symtab_hdr->sh_info; + amt *= sizeof (asection *); + sections = bfd_malloc (amt); + if (sections == NULL && amt != 0) + goto error_return; + + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) + { + asection *isec; + + if (isym->st_shndx == SHN_UNDEF) + isec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + isec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + isec = bfd_com_section_ptr; + else + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); + + *secpp = isec; + } + + if (! elf32_cr16_relocate_section (output_bfd, link_info, input_bfd, + input_section, data, internal_relocs, + isymbuf, sections)) + goto error_return; + + if (sections != NULL) + free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); + } + + return data; + + error_return: + if (sections != NULL) + free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); + return NULL; +} + +/* This function handles relaxing for the CR16. + + There's quite a few relaxing opportunites available on the CR16: + + * bcond:24 -> bcond:16 2 bytes + * bcond:16 -> bcond:8 2 bytes + * arithmetic imm32 -> arithmetic imm16 2 bytes + + Symbol- and reloc-reading infrastructure copied from elf-m10200.c. */ + +static bfd_boolean +elf32_cr16_relax_section (bfd *abfd, asection *sec, + struct bfd_link_info *link_info, bfd_boolean *again) +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents = NULL; + Elf_Internal_Sym *isymbuf = NULL; + + /* Assume nothing changes. */ + *again = FALSE; + + /* We don't have to do anything for a relocatable link, if + this section does not have relocs, or if this is not a + code section. */ + if (link_info->relocatable + || (sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0 + || (sec->flags & SEC_CODE) == 0) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Get a copy of the native relocations. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + link_info->keep_memory); + if (internal_relocs == NULL) + goto error_return; + + /* Walk through them looking for relaxing opportunities. */ + irelend = internal_relocs + sec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma symval; + + /* If this isn't something that can be relaxed, then ignore + this reloc. */ + if (ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP16 + && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP24) + continue; + + /* Get the section contents if we haven't done so already. */ + if (contents == NULL) + { + /* Get cached copy if it exists. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + /* Go get them off disk. */ + else if (!bfd_malloc_and_get_section (abfd, sec, &contents)) + goto error_return; + } + + /* Read this BFD's local symbols if we haven't done so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + asection *sym_sec; + + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = (isym->st_value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + continue; + + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Try to turn a 24 branch/call into a 16bit relative + * branch/call. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_DISP24) + { + bfd_vma value = symval; + + /* Deal with pc-relative gunk. */ + value -= (sec->output_section->vma + sec->output_offset); + value -= irel->r_offset; + value += irel->r_addend; + + /* See if the value will fit in 16 bits, note the high value is + 0xfffe + 2 as the target will be two bytes closer if we are + able to relax. */ + if ((long) value < 0x10000 && (long) value > -0x10002) + { + unsigned int code; + + /* Get the opcode. */ + code = (unsigned int) bfd_get_32 (abfd, contents + irel->r_offset); + + /* Verify it's a 'bcond' and fix the opcode. */ + if ((code & 0xffff) == 0x0010) + { + bfd_put_16 (abfd, 0x1800 | ((0xf & (code >>20))<<4), contents + irel->r_offset); + bfd_put_16 (abfd, value, contents + irel->r_offset+2); + } + else + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_DISP16); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } + + /* Try to turn a 16bit pc-relative branch into an + 8bit pc-relative branch. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_DISP16) + { + bfd_vma value = symval; + + /* Deal with pc-relative gunk. */ + value -= (sec->output_section->vma + sec->output_offset); + value -= irel->r_offset; + value += irel->r_addend; + + /* See if the value will fit in 8 bits, note the high value is + 0xfc + 2 as the target will be two bytes closer if we are + able to relax. */ + if ((long) value < 0xfe && (long) value > -0x100) + { + unsigned short code; + + /* Get the opcode. */ + code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset); + + /* Verify it's a 'bcond' opcode. */ + if ((code & 0xff00) == 0x1800) + { + bfd_put_8 (abfd, 0x1 | ((0xf & (code>>4))<<4), contents + irel->r_offset); + bfd_put_8 (abfd, value, contents + irel->r_offset+2); + } + else + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_DISP8); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } + +#if 0 // REVISIT: To support IMM relaxation in CR16 target + /* Try to turn a 32bit immediate address into + a 20bit immediate address. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM32) + { + bfd_vma value = symval; + + /* See if the value will fit in 20 bits. */ + if ((long) value < 0x7ffff && (long) value > -0x80000) + { + unsigned short code; + + /* Get the opcode. */ + code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset); + + /* Verify it's a 'arithmetic double'. */ + if ((code & 0xfff0) != 0x0070) + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the opcode. */ + bfd_put_8 (abfd, (code & 0xff) - 0x10, contents + irel->r_offset); + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_IMM20); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } + /* Try to turn a 20bit/16bit immediate address into + a 4bit immediate address. */ + if ((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM20) + || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM16)) + { + bfd_vma value = symval; + + /* See if the value will fit in 4 bits. */ + if ((long) value < 0x7 && (long) value > -0x8) + { + unsigned short code; + + /* Get the opcode. */ + code = (unsigned short) bfd_get_8 (abfd, contents + irel->r_offset); + + /* Verify it's a 'arithmetic double'. */ + if (((code & 0xff) != 0x50) || ((code & 0xff) != 0x45)) + continue; + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the opcode. */ + bfd_put_8 (abfd, (code & 0xff) - 0x10, contents + irel->r_offset); + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_CR16_IMM4); + + /* Delete two bytes of data. */ + if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } +#endif + } + + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + { + if (! link_info->keep_memory) + free (isymbuf); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; + } + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + { + if (! link_info->keep_memory) + free (contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + + return TRUE; + + error_return: + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + + return FALSE; +} + +static asection * +elf32_cr16_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + if (h == NULL) + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + return NULL; + } +} + +/* Update the got entry reference counts for the section being removed. */ + +static bfd_boolean +elf32_cr16_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) +{ + /* We don't support garbage collection of GOT and PLT relocs yet. */ + return TRUE; +} + +/* Definitions for setting CR16 target vector. */ +#define TARGET_LITTLE_SYM bfd_elf32_cr16_vec +#define TARGET_LITTLE_NAME "elf32-cr16" +#define ELF_ARCH bfd_arch_cr16 +#define ELF_MACHINE_CODE EM_CR16 +#define ELF_MAXPAGESIZE 0x1 +#define elf_symbol_leading_char '_' + +#define bfd_elf32_bfd_reloc_type_lookup elf_cr16_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_cr16_reloc_name_lookup +#define elf_info_to_howto elf_cr16_info_to_howto +#define elf_info_to_howto_rel 0 +#define elf_backend_relocate_section elf32_cr16_relocate_section +#define bfd_elf32_bfd_relax_section elf32_cr16_relax_section +#define bfd_elf32_bfd_get_relocated_section_contents \ + elf32_cr16_get_relocated_section_contents +#define elf_backend_gc_mark_hook elf32_cr16_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_cr16_gc_sweep_hook +#define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 + +#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-gen.c b/contrib/binutils/bfd/elf32-gen.c index 23c74767799..ef7d4e2308d 100644 --- a/contrib/binutils/bfd/elf32-gen.c +++ b/contrib/binutils/bfd/elf32-gen.c @@ -1,5 +1,5 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005 + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -94,6 +94,7 @@ elf32_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define bfd_elf32_bfd_link_add_symbols elf32_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/contrib/binutils/bfd/elf32-i386.c b/contrib/binutils/bfd/elf32-i386.c index 754aa52254d..0e023df4ad0 100644 --- a/contrib/binutils/bfd/elf32-i386.c +++ b/contrib/binutils/bfd/elf32-i386.c @@ -1,6 +1,6 @@ /* Intel 80386/80486-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -330,6 +330,20 @@ elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return 0; } +static reloc_howto_type * +elf_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + static void elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, @@ -582,10 +596,6 @@ struct elf_i386_link_hash_entry #define GOT_TLS_IE_NEG 6 #define GOT_TLS_IE_BOTH 7 #define GOT_TLS_GDESC 8 -#define GOT_TLS_MASK 0x0f -#define GOT_TLS_IE_IE 0x10 -#define GOT_TLS_IE_GD 0x20 -#define GOT_TLS_IE_MASK 0x30 #define GOT_TLS_GD_BOTH_P(type) \ ((type) == (GOT_TLS_GD | GOT_TLS_GDESC)) #define GOT_TLS_GD_P(type) \ @@ -626,11 +636,14 @@ struct elf_i386_obj_tdata static bfd_boolean elf_i386_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* i386 ELF linker hash table. */ @@ -1011,25 +1024,12 @@ elf_i386_check_relocs (bfd *abfd, case R_386_TLS_IE_32: if (ELF32_R_TYPE (rel->r_info) == r_type) tls_type = GOT_TLS_IE_NEG; - else if (h - && ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD) - /* If this is a GD->IE transition, we may use either - of R_386_TLS_TPOFF and R_386_TLS_TPOFF32. But if - we may have both R_386_TLS_IE and R_386_TLS_GD, - we can't share the same R_386_TLS_TPOFF since - they require different offsets. So we remember - it comes from R_386_TLS_GD. */ - tls_type = GOT_TLS_IE | GOT_TLS_IE_GD; else + /* If this is a GD->IE transition, we may use either of + R_386_TLS_TPOFF and R_386_TLS_TPOFF32. */ tls_type = GOT_TLS_IE; break; case R_386_TLS_IE: - if (h) - { - /* We remember it comes from R_386_TLS_IE. */ - tls_type = GOT_TLS_IE_POS | GOT_TLS_IE_IE; - break; - } case R_386_TLS_GOTIE: tls_type = GOT_TLS_IE_POS; break; } @@ -1069,8 +1069,7 @@ elf_i386_check_relocs (bfd *abfd, tls_type |= old_tls_type; /* If a TLS symbol is accessed using IE at least once, there is no point to use dynamic model for it. */ - else if (old_tls_type != tls_type - && old_tls_type != GOT_UNKNOWN + else if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN && (! GOT_TLS_GD_ANY_P (old_tls_type) || (tls_type & GOT_TLS_IE) == 0)) { @@ -1165,7 +1164,7 @@ elf_i386_check_relocs (bfd *abfd, && (sec->flags & SEC_ALLOC) != 0 && (r_type != R_386_PC32 || (h != NULL - && (! info->symbolic + && (! SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak || !h->def_regular)))) || (ELIMINATE_COPY_RELOCS @@ -1192,7 +1191,7 @@ elf_i386_check_relocs (bfd *abfd, if (name == NULL) return FALSE; - if (strncmp (name, ".rel", 4) != 0 + if (! CONST_STRNEQ (name, ".rel") || strcmp (bfd_get_section_name (abfd, sec), name + 4) != 0) { @@ -1294,38 +1293,20 @@ elf_i386_check_relocs (bfd *abfd, static asection * elf_i386_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_386_GNU_VTINHERIT: - case R_386_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_386_GNU_VTINHERIT: + case R_386_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -1438,7 +1419,6 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, { struct elf_i386_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, @@ -1558,29 +1538,9 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -1700,14 +1660,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) asection *s; bfd_boolean dyn; int tls_type = elf_i386_hash_entry(h)->tls_type; - - /* If we have both R_386_TLS_IE and R_386_TLS_GD, GOT_TLS_IE_BOTH - should be used. */ - if ((tls_type & GOT_TLS_IE_MASK) - == (GOT_TLS_IE_IE | GOT_TLS_IE_GD)) - tls_type = GOT_TLS_IE_BOTH; - else - tls_type &= GOT_TLS_MASK; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -2052,7 +2004,7 @@ elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->elf.hplt != NULL) strip_section = FALSE; } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rel", 4) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rel")) { if (s->size != 0 && s != htab->srelplt && s != htab->srelplt2) relocs = TRUE; @@ -2305,51 +2257,6 @@ elf_i386_relocate_section (bfd *output_bfd, howto = elf_howto_table + indx; r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocatable) - { - bfd_vma val; - bfd_byte *where; - - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx >= symtab_hdr->sh_info) - continue; - - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) - continue; - - sec = local_sections[r_symndx]; - val = sec->output_offset; - if (val == 0) - continue; - - where = contents + rel->r_offset; - switch (howto->size) - { - /* FIXME: overflow checks. */ - case 0: - val += bfd_get_8 (input_bfd, where); - bfd_put_8 (input_bfd, val, where); - break; - case 1: - val += bfd_get_16 (input_bfd, where); - bfd_put_16 (input_bfd, val, where); - break; - case 2: - val += bfd_get_32 (input_bfd, where); - bfd_put_32 (input_bfd, val, where); - break; - default: - abort (); - } - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -2361,10 +2268,12 @@ elf_i386_relocate_section (bfd *output_bfd, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION + && ((sec->flags & SEC_MERGE) != 0 + || (info->relocatable + && sec->output_offset != 0))) { - asection *msec; bfd_vma addend; bfd_byte *where = contents + rel->r_offset; @@ -2398,10 +2307,16 @@ elf_i386_relocate_section (bfd *output_bfd, abort (); } - msec = sec; - addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend); - addend -= relocation; - addend += msec->output_section->vma + msec->output_offset; + if (info->relocatable) + addend += sec->output_offset; + else + { + asection *msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, + addend); + addend -= relocation; + addend += msec->output_section->vma + msec->output_offset; + } switch (howto->size) { @@ -2434,21 +2349,20 @@ elf_i386_relocate_section (bfd *output_bfd, unresolved_reloc, warned); } - if (r_symndx == 0) + if (sec != NULL && elf_discarded_section (sec)) { - /* r_symndx will be zero only for relocs against symbols from - removed linkonce sections, or sections discarded by a linker - script. For these relocs, we just want the section contents - zeroed. Avoid any special processing in the switch below. */ - r_type = R_386_NONE; - - relocation = 0; - if (howto->pc_relative) - relocation = (input_section->output_section->vma - + input_section->output_offset - + rel->r_offset); + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; } + if (info->relocatable) + continue; + switch (r_type) { case R_386_GOT32: @@ -2652,7 +2566,7 @@ elf_i386_relocate_section (bfd *output_bfd, && h->dynindx != -1 && (r_type == R_386_PC32 || !info->shared - || !info->symbolic + || !SYMBOLIC_BIND (info, h) || !h->def_regular)) outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); else @@ -2711,13 +2625,6 @@ elf_i386_relocate_section (bfd *output_bfd, else if (h != NULL) { tls_type = elf_i386_hash_entry(h)->tls_type; - /* If we have both R_386_TLS_IE and R_386_TLS_GD, - GOT_TLS_IE_BOTH should be used. */ - if ((tls_type & GOT_TLS_IE_MASK) - == (GOT_TLS_IE_IE | GOT_TLS_IE_GD)) - tls_type = GOT_TLS_IE_BOTH; - else - tls_type &= GOT_TLS_MASK; if (!info->shared && h->dynindx == -1 && (tls_type & GOT_TLS_IE)) r_type = R_386_TLS_LE_32; } @@ -2851,8 +2758,9 @@ elf_i386_relocate_section (bfd *output_bfd, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; } @@ -3172,12 +3080,8 @@ elf_i386_relocate_section (bfd *output_bfd, subl $foo@gottpoff(%reg), %eax into: addl $foo@gotntpoff(%reg), %eax. */ - if (r_type == R_386_TLS_GOTIE) - { - contents[roff + 6] = 0x03; - if (tls_type == GOT_TLS_IE_BOTH) - off += 4; - } + if (tls_type == GOT_TLS_IE_POS) + contents[roff + 6] = 0x03; bfd_put_32 (output_bfd, htab->sgot->output_section->vma + htab->sgot->output_offset + off @@ -3261,8 +3165,8 @@ elf_i386_relocate_section (bfd *output_bfd, /* Now modify the instruction as appropriate. */ if (tls_type != GOT_TLS_IE_NEG) { - /* nop; nop */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* xchg %ax,%ax */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); } else @@ -3872,6 +3776,18 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, return plt->vma + (i + 1) * PLT_ENTRY_SIZE; } +/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + +static bfd_boolean +elf_i386_hash_symbol (struct elf_link_hash_entry *h) +{ + if (h->plt.offset != (bfd_vma) -1 + && !h->def_regular + && !h->pointer_equality_needed) + return FALSE; + + return _bfd_elf_hash_symbol (h); +} #define TARGET_LITTLE_SYM bfd_elf32_i386_vec #define TARGET_LITTLE_NAME "elf32-i386" @@ -3895,6 +3811,7 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, #define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol #define elf_backend_check_relocs elf_i386_check_relocs @@ -3911,7 +3828,10 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections #define elf_backend_always_size_sections elf_i386_always_size_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_plt_sym_val elf_i386_plt_sym_val +#define elf_backend_hash_symbol elf_i386_hash_symbol #include "elf32-target.h" @@ -3921,6 +3841,8 @@ elf_i386_plt_sym_val (bfd_vma i, const asection *plt, #define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-i386-freebsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD /* The kernel recognizes executables as valid only if they carry a "FreeBSD" label in the ELF header. So we put this label on all @@ -3935,7 +3857,7 @@ elf_i386_post_process_headers (bfd *abfd, i_ehdrp = elf_elfheader (abfd); /* Put an ABI label supported by FreeBSD >= 4.1. */ - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; #ifdef OLD_FREEBSD_ABI_LABEL /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); @@ -3955,7 +3877,7 @@ elf_i386_post_process_headers (bfd *abfd, #define TARGET_LITTLE_SYM bfd_elf32_i386_vxworks_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-i386-vxworks" - +#undef ELF_OSABI /* Like elf_i386_link_hash_table_create but with tweaks for VxWorks. */ diff --git a/contrib/binutils/bfd/elf32-mep.c b/contrib/binutils/bfd/elf32-mep.c new file mode 100644 index 00000000000..169da4454bc --- /dev/null +++ b/contrib/binutils/bfd/elf32-mep.c @@ -0,0 +1,959 @@ +/* MeP-specific support for 32-bit ELF. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libbfd.h" +#include "elf-bfd.h" +#include "elf/mep.h" +#include "libiberty.h" + +/* Forward declarations. */ + +/* Private relocation functions. */ + +#define MEPREL(type, size, bits, right, left, pcrel, overflow, mask) \ + {(unsigned)type, right, size, bits, pcrel, left, overflow, mep_reloc, #type, FALSE, 0, mask, 0 } + +#define N complain_overflow_dont +#define S complain_overflow_signed +#define U complain_overflow_unsigned + +static bfd_reloc_status_type mep_reloc (bfd *, arelent *, struct bfd_symbol *, + void *, asection *, bfd *, char **); + +static reloc_howto_type mep_elf_howto_table [] = +{ + /* type, size, bits, leftshift, rightshift, pcrel, OD/OS/OU, mask. */ + MEPREL (R_MEP_NONE, 0, 0, 0, 0, 0, N, 0), + MEPREL (R_RELC, 0, 0, 0, 0, 0, N, 0), + /* MEPRELOC:HOWTO */ + /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */ + MEPREL (R_MEP_8, 0, 8, 0, 0, 0, U, 0xff), + MEPREL (R_MEP_16, 1, 16, 0, 0, 0, U, 0xffff), + MEPREL (R_MEP_32, 2, 32, 0, 0, 0, U, 0xffffffff), + MEPREL (R_MEP_PCREL8A2, 1, 8, 1, 1, 1, S, 0x00fe), + MEPREL (R_MEP_PCREL12A2,1, 12, 1, 1, 1, S, 0x0ffe), + MEPREL (R_MEP_PCREL17A2,2, 17, 0, 1, 1, S, 0x0000ffff), + MEPREL (R_MEP_PCREL24A2,2, 24, 0, 1, 1, S, 0x07f0ffff), + MEPREL (R_MEP_PCABS24A2,2, 24, 0, 1, 0, U, 0x07f0ffff), + MEPREL (R_MEP_LOW16, 2, 16, 0, 0, 0, N, 0x0000ffff), + MEPREL (R_MEP_HI16U, 2, 32, 0,16, 0, N, 0x0000ffff), + MEPREL (R_MEP_HI16S, 2, 32, 0,16, 0, N, 0x0000ffff), + MEPREL (R_MEP_GPREL, 2, 16, 0, 0, 0, S, 0x0000ffff), + MEPREL (R_MEP_TPREL, 2, 16, 0, 0, 0, S, 0x0000ffff), + MEPREL (R_MEP_TPREL7, 1, 7, 0, 0, 0, U, 0x007f), + MEPREL (R_MEP_TPREL7A2, 1, 7, 1, 1, 0, U, 0x007e), + MEPREL (R_MEP_TPREL7A4, 1, 7, 2, 2, 0, U, 0x007c), + MEPREL (R_MEP_UIMM24, 2, 24, 0, 0, 0, U, 0x00ffffff), + MEPREL (R_MEP_ADDR24A4, 2, 24, 0, 2, 0, U, 0x00fcffff), + MEPREL (R_MEP_GNU_VTINHERIT,1, 0,16,32, 0, N, 0x0000), + MEPREL (R_MEP_GNU_VTENTRY,1, 0,16,32, 0, N, 0x0000), + /* MEPRELOC:END */ +}; + +#define VALID_MEP_RELOC(N) ((N) >= 0 \ + && (N) < ARRAY_SIZE (mep_elf_howto_table) + +#undef N +#undef S +#undef U + +static bfd_reloc_status_type +mep_reloc + (bfd * abfd ATTRIBUTE_UNUSED, + arelent * reloc_entry ATTRIBUTE_UNUSED, + struct bfd_symbol * symbol ATTRIBUTE_UNUSED, + void * data ATTRIBUTE_UNUSED, + asection * input_section ATTRIBUTE_UNUSED, + bfd * output_bfd ATTRIBUTE_UNUSED, + char ** error_message ATTRIBUTE_UNUSED) +{ + return bfd_reloc_ok; +} + + + +#define BFD_RELOC_MEP_NONE BFD_RELOC_NONE +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define MAP(n) case BFD_RELOC_MEP_##n: type = R_MEP_##n; break +#else +#define MAP(n) case BFD_RELOC_MEP_/**/n: type = R_MEP_/**/n; break +#endif + +static reloc_howto_type * +mep_reloc_type_lookup + (bfd * abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + unsigned int type = 0; + + switch (code) + { + MAP(NONE); + case BFD_RELOC_8: + type = R_MEP_8; + break; + case BFD_RELOC_16: + type = R_MEP_16; + break; + case BFD_RELOC_32: + type = R_MEP_32; + break; + case BFD_RELOC_VTABLE_ENTRY: + type = R_MEP_GNU_VTENTRY; + break; + case BFD_RELOC_VTABLE_INHERIT: + type = R_MEP_GNU_VTINHERIT; + break; + case BFD_RELOC_RELC: + type = R_RELC; + break; + + /* MEPRELOC:MAP */ + /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */ + MAP(8); + MAP(16); + MAP(32); + MAP(PCREL8A2); + MAP(PCREL12A2); + MAP(PCREL17A2); + MAP(PCREL24A2); + MAP(PCABS24A2); + MAP(LOW16); + MAP(HI16U); + MAP(HI16S); + MAP(GPREL); + MAP(TPREL); + MAP(TPREL7); + MAP(TPREL7A2); + MAP(TPREL7A4); + MAP(UIMM24); + MAP(ADDR24A4); + MAP(GNU_VTINHERIT); + MAP(GNU_VTENTRY); + /* MEPRELOC:END */ + + default: + /* Pacify gcc -Wall. */ + fprintf (stderr, "mep: no reloc for code %d\n", code); + return NULL; + } + + if (mep_elf_howto_table[type].type != type) + { + fprintf (stderr, "MeP: howto %d has type %d\n", type, mep_elf_howto_table[type].type); + abort (); + } + + return mep_elf_howto_table + type; +} + +#undef MAP + +static reloc_howto_type * +mep_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mep_elf_howto_table) / sizeof (mep_elf_howto_table[0]); + i++) + if (mep_elf_howto_table[i].name != NULL + && strcasecmp (mep_elf_howto_table[i].name, r_name) == 0) + return &mep_elf_howto_table[i]; + + return NULL; +} + +/* Perform a single relocation. */ + +static struct bfd_link_info *mep_info; +static int warn_tp = 0, warn_sda = 0; + +static bfd_vma +mep_lookup_global + (char * name, + bfd_vma ofs, + bfd_vma * cache, + int * warn) +{ + struct bfd_link_hash_entry *h; + + if (*cache || *warn) + return *cache; + + h = bfd_link_hash_lookup (mep_info->hash, name, FALSE, FALSE, TRUE); + if (h == 0 || h->type != bfd_link_hash_defined) + { + *warn = ofs + 1; + return 0; + } + *cache = (h->u.def.value + + h->u.def.section->output_section->vma + + h->u.def.section->output_offset); + return *cache; +} + +static bfd_vma +mep_tpoff_base (bfd_vma ofs) +{ + static bfd_vma cache = 0; + return mep_lookup_global ("__tpbase", ofs, &cache, &warn_tp); +} + +static bfd_vma +mep_sdaoff_base (bfd_vma ofs) +{ + static bfd_vma cache = 0; + return mep_lookup_global ("__sdabase", ofs, &cache, &warn_sda); +} + +static bfd_reloc_status_type +mep_final_link_relocate + (reloc_howto_type * howto, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + bfd_vma relocation) +{ + unsigned long u; + long s; + unsigned char *byte; + bfd_vma pc; + bfd_reloc_status_type r = bfd_reloc_ok; + int e2, e4; + + if (bfd_big_endian (input_bfd)) + { + e2 = 0; + e4 = 0; + } + else + { + e2 = 1; + e4 = 3; + } + + pc = (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + + s = relocation + rel->r_addend; + + byte = (unsigned char *)contents + rel->r_offset; + + if (howto->type == R_MEP_PCREL24A2 + && s == 0 + && pc >= 0x800000) + { + /* This is an unreachable branch to an undefined weak function. + Silently ignore it, since the opcode can't do that but should + never be executed anyway. */ + return bfd_reloc_ok; + } + + if (howto->pc_relative) + s -= pc; + + u = (unsigned long) s; + + switch (howto->type) + { + /* MEPRELOC:APPLY */ + /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */ + case R_MEP_8: /* 76543210 */ + if (u > 255) r = bfd_reloc_overflow; + byte[0] = (u & 0xff); + break; + case R_MEP_16: /* fedcba9876543210 */ + if (u > 65535) r = bfd_reloc_overflow; + byte[0^e2] = ((u >> 8) & 0xff); + byte[1^e2] = (u & 0xff); + break; + case R_MEP_32: /* vutsrqponmlkjihgfedcba9876543210 */ + byte[0^e4] = ((u >> 24) & 0xff); + byte[1^e4] = ((u >> 16) & 0xff); + byte[2^e4] = ((u >> 8) & 0xff); + byte[3^e4] = (u & 0xff); + break; + case R_MEP_PCREL8A2: /* --------7654321- */ + if (-128 > s || s > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x01) | (s & 0xfe); + break; + case R_MEP_PCREL12A2: /* ----ba987654321- */ + if (-2048 > s || s > 2047) r = bfd_reloc_overflow; + byte[0^e2] = (byte[0^e2] & 0xf0) | ((s >> 8) & 0x0f); + byte[1^e2] = (byte[1^e2] & 0x01) | (s & 0xfe); + break; + case R_MEP_PCREL17A2: /* ----------------gfedcba987654321 */ + if (-65536 > s || s > 65535) r = bfd_reloc_overflow; + byte[2^e2] = ((s >> 9) & 0xff); + byte[3^e2] = ((s >> 1) & 0xff); + break; + case R_MEP_PCREL24A2: /* -----7654321----nmlkjihgfedcba98 */ + if (-8388608 > s || s > 8388607) r = bfd_reloc_overflow; + byte[0^e2] = (byte[0^e2] & 0xf8) | ((s >> 5) & 0x07); + byte[1^e2] = (byte[1^e2] & 0x0f) | ((s << 3) & 0xf0); + byte[2^e2] = ((s >> 16) & 0xff); + byte[3^e2] = ((s >> 8) & 0xff); + break; + case R_MEP_PCABS24A2: /* -----7654321----nmlkjihgfedcba98 */ + if (u > 16777215) r = bfd_reloc_overflow; + byte[0^e2] = (byte[0^e2] & 0xf8) | ((u >> 5) & 0x07); + byte[1^e2] = (byte[1^e2] & 0x0f) | ((u << 3) & 0xf0); + byte[2^e2] = ((u >> 16) & 0xff); + byte[3^e2] = ((u >> 8) & 0xff); + break; + case R_MEP_LOW16: /* ----------------fedcba9876543210 */ + byte[2^e2] = ((u >> 8) & 0xff); + byte[3^e2] = (u & 0xff); + break; + case R_MEP_HI16U: /* ----------------vutsrqponmlkjihg */ + byte[2^e2] = ((u >> 24) & 0xff); + byte[3^e2] = ((u >> 16) & 0xff); + break; + case R_MEP_HI16S: /* ----------------vutsrqponmlkjihg */ + byte[2^e2] = ((s >> 24) & 0xff); + byte[3^e2] = ((s >> 16) & 0xff); + break; + case R_MEP_GPREL: /* ----------------fedcba9876543210 */ + s -= mep_sdaoff_base(rel->r_offset); + if (-32768 > s || s > 32767) r = bfd_reloc_overflow; + byte[2^e2] = ((s >> 8) & 0xff); + byte[3^e2] = (s & 0xff); + break; + case R_MEP_TPREL: /* ----------------fedcba9876543210 */ + s -= mep_tpoff_base(rel->r_offset); + if (-32768 > s || s > 32767) r = bfd_reloc_overflow; + byte[2^e2] = ((s >> 8) & 0xff); + byte[3^e2] = (s & 0xff); + break; + case R_MEP_TPREL7: /* ---------6543210 */ + u -= mep_tpoff_base(rel->r_offset); + if (u > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x80) | (u & 0x7f); + break; + case R_MEP_TPREL7A2: /* ---------654321- */ + u -= mep_tpoff_base(rel->r_offset); + if (u > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x81) | (u & 0x7e); + break; + case R_MEP_TPREL7A4: /* ---------65432-- */ + u -= mep_tpoff_base(rel->r_offset); + if (u > 127) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x83) | (u & 0x7c); + break; + case R_MEP_UIMM24: /* --------76543210nmlkjihgfedcba98 */ + if (u > 16777215) r = bfd_reloc_overflow; + byte[1^e2] = (u & 0xff); + byte[2^e2] = ((u >> 16) & 0xff); + byte[3^e2] = ((u >> 8) & 0xff); + break; + case R_MEP_ADDR24A4: /* --------765432--nmlkjihgfedcba98 */ + if (u > 16777215) r = bfd_reloc_overflow; + byte[1^e2] = (byte[1^e2] & 0x03) | (u & 0xfc); + byte[2^e2] = ((u >> 16) & 0xff); + byte[3^e2] = ((u >> 8) & 0xff); + break; + case R_MEP_GNU_VTINHERIT: /* ---------------- */ + break; + case R_MEP_GNU_VTENTRY: /* ---------------- */ + break; + /* MEPRELOC:END */ + default: + abort (); + } + + return r; +} + +/* Set the howto pointer for a MEP ELF reloc. */ + +static void +mep_info_to_howto_rela + (bfd * abfd ATTRIBUTE_UNUSED, + arelent * cache_ptr, + Elf_Internal_Rela * dst) +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = & mep_elf_howto_table [r_type]; +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static bfd_boolean +mep_elf_check_relocs + (bfd * abfd, + struct bfd_link_info * info, + asection * sec, + const Elf_Internal_Rela * relocs) +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry ** sym_hashes_end; + const Elf_Internal_Rela * rel; + const Elf_Internal_Rela * rel_end; + + if (info->relocatable) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry *h; + unsigned long r_symndx; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + } + return TRUE; +} + + +/* Relocate a MEP ELF section. + There is some attempt to make this function usable for many architectures, + both USE_REL and USE_RELA ['twould be nice if such a critter existed], + if only to serve as a learning tool. + + The RELOCATE_SECTION function is called by the new ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjusting the section contents as + necessary, and (if using Rela relocs and generating a relocatable + output file) adjusting the reloc addend as necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocatable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +static bfd_boolean +mep_elf_relocate_section + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * relocs, + Elf_Internal_Sym * local_syms, + asection ** local_sections) +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + Elf_Internal_Rela * rel; + Elf_Internal_Rela * relend; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + mep_info = info; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type * howto; + unsigned long r_symndx; + Elf_Internal_Sym * sym; + asection * sec; + struct elf_link_hash_entry * h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char * name = NULL; + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + + r_symndx = ELF32_R_SYM (rel->r_info); + + /* Is this a complex relocation? */ + if (!info->relocatable && ELF32_R_TYPE (rel->r_info) == R_RELC) + { + bfd_elf_perform_complex_relocation (output_bfd, info, + input_bfd, input_section, contents, + rel, local_syms, local_sections); + continue; + } + + howto = mep_elf_howto_table + ELF32_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; +#if 0 + fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", + sec->name, name, sym->st_name, + sec->output_section->vma, sec->output_offset, + sym->st_value, rel->r_addend); +#endif + } + else + { + relocation = 0; + h = sym_hashes [r_symndx]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); +#if 0 + fprintf (stderr, + "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n", + sec->name, name, h->root.u.def.value, + sec->output_section->vma, sec->output_offset, relocation); +#endif + } + else if (h->root.type == bfd_link_hash_undefweak) + { +#if 0 + fprintf (stderr, "undefined: sec: %s, name: %s\n", + sec->name, name); +#endif + } + else if (!info->relocatable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR)))) + return FALSE; +#if 0 + fprintf (stderr, "unknown: name: %s\n", name); +#endif + } + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; + continue; + } + + switch (r_type) + { + default: + r = mep_final_link_relocate (howto, input_bfd, input_section, + contents, rel, relocation); + break; + } + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + r = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, TRUE); + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + r = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! r) + return FALSE; + } + } + + if (warn_tp) + info->callbacks->undefined_symbol + (info, "__tpbase", input_bfd, input_section, warn_tp-1, TRUE); + if (warn_sda) + info->callbacks->undefined_symbol + (info, "__sdabase", input_bfd, input_section, warn_sda-1, TRUE); + if (warn_sda || warn_tp) + return FALSE; + + return TRUE; +} + + +/* Update the got entry reference counts for the section being + removed. */ + +static bfd_boolean +mep_elf_gc_sweep_hook + (bfd * abfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + asection * sec ATTRIBUTE_UNUSED, + const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +mep_elf_gc_mark_hook + (asection * sec, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + Elf_Internal_Rela * rel, + struct elf_link_hash_entry * h, + Elf_Internal_Sym * sym) +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (!(elf_bad_symtab (sec->owner) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + } + + return NULL; +} + + +/* Function to set the ELF flag bits. */ + +static bfd_boolean +mep_elf_set_private_flags (bfd * abfd, + flagword flags) +{ + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = TRUE; + return TRUE; +} + +static bfd_boolean +mep_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd) +{ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return TRUE; + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = TRUE; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + return TRUE; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +static bfd_boolean +mep_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd) +{ + static bfd *last_ibfd = 0; + flagword old_flags, new_flags; + flagword old_partial, new_partial; + + /* Check if we have the same endianess. */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE) + return FALSE; + + new_flags = elf_elfheader (ibfd)->e_flags; + old_flags = elf_elfheader (obfd)->e_flags; + +#ifdef DEBUG + _bfd_error_handler ("%B: old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s", + ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no"); +#endif + + /* First call, no flags set. */ + if (!elf_flags_init (obfd)) + { + elf_flags_init (obfd) = TRUE; + old_flags = new_flags; + } + else if ((new_flags | old_flags) & EF_MEP_LIBRARY) + { + /* Non-library flags trump library flags. The choice doesn't really + matter if both OLD_FLAGS and NEW_FLAGS have EF_MEP_LIBRARY set. */ + if (old_flags & EF_MEP_LIBRARY) + old_flags = new_flags; + } + else + { + /* Make sure they're for the same mach. Allow upgrade from the "mep" + mach. */ + new_partial = (new_flags & EF_MEP_CPU_MASK); + old_partial = (old_flags & EF_MEP_CPU_MASK); + if (new_partial == old_partial) + ; + else if (new_partial == EF_MEP_CPU_MEP) + ; + else if (old_partial == EF_MEP_CPU_MEP) + old_flags = (old_flags & ~EF_MEP_CPU_MASK) | new_partial; + else + { + _bfd_error_handler (_("%B and %B are for different cores"), last_ibfd, ibfd); + bfd_set_error (bfd_error_invalid_target); + return FALSE; + } + + /* Make sure they're for the same me_module. Allow basic config to + mix with any other. */ + new_partial = (new_flags & EF_MEP_INDEX_MASK); + old_partial = (old_flags & EF_MEP_INDEX_MASK); + if (new_partial == old_partial) + ; + else if (new_partial == 0) + ; + else if (old_partial == 0) + old_flags = (old_flags & ~EF_MEP_INDEX_MASK) | new_partial; + else + { + _bfd_error_handler (_("%B and %B are for different configurations"), last_ibfd, ibfd); + bfd_set_error (bfd_error_invalid_target); + return FALSE; + } + } + + elf_elfheader (obfd)->e_flags = old_flags; + last_ibfd = ibfd; + return TRUE; +} + +/* This will be edited by the MeP configration tool. */ +static const char * config_names[] = +{ + "basic" + /* start-mepcfgtool */ + ,"simple" + ,"fmax" + /* end-mepcfgtool */ +}; + +static const char * core_names[] = +{ + "MeP", "MeP-c2", "MeP-c3", "MeP-h1" +}; + +static bfd_boolean +mep_elf_print_private_bfd_data (bfd * abfd, void * ptr) +{ + FILE * file = (FILE *) ptr; + flagword flags, partial_flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + flags = elf_elfheader (abfd)->e_flags; + fprintf (file, _("private flags = 0x%lx"), (long)flags); + + partial_flags = (flags & EF_MEP_CPU_MASK) >> 24; + if (partial_flags < ARRAY_SIZE (core_names)) + fprintf (file, " core: %s", core_names[(long)partial_flags]); + + partial_flags = flags & EF_MEP_INDEX_MASK; + if (partial_flags < ARRAY_SIZE (config_names)) + fprintf (file, " me_module: %s", config_names[(long)partial_flags]); + + fputc ('\n', file); + + return TRUE; +} + +/* Return the machine subcode from the ELF e_flags header. */ + +static int +elf32_mep_machine (bfd * abfd) +{ + switch (elf_elfheader (abfd)->e_flags & EF_MEP_CPU_MASK) + { + default: break; + case EF_MEP_CPU_C2: return bfd_mach_mep; + case EF_MEP_CPU_C3: return bfd_mach_mep; + case EF_MEP_CPU_C4: return bfd_mach_mep; + case EF_MEP_CPU_H1: return bfd_mach_mep_h1; + } + + return bfd_mach_mep; +} + +static bfd_boolean +mep_elf_object_p (bfd * abfd) +{ + /* Irix 5 and 6 is broken. Object file symbol tables are not always + sorted correctly such that local symbols preceed global symbols, + and the sh_info field in the symbol table is not always right. */ + /* This is needed for the RELC support code. */ + elf_bad_symtab (abfd) = TRUE; + bfd_default_set_arch_mach (abfd, bfd_arch_mep, elf32_mep_machine (abfd)); + return TRUE; +} + +static bfd_boolean +mep_elf_section_flags (flagword * flags, const Elf_Internal_Shdr * hdr) +{ + if (hdr->sh_flags & SHF_MEP_VLIW) + * flags |= SEC_MEP_VLIW; + return TRUE; +} + +static bfd_boolean +mep_elf_fake_sections (bfd * abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr * hdr, + asection * sec) +{ + if (sec->flags & SEC_MEP_VLIW) + hdr->sh_flags |= SHF_MEP_VLIW; + return TRUE; +} + + +#define ELF_ARCH bfd_arch_mep +#define ELF_MACHINE_CODE EM_CYGNUS_MEP +#define ELF_MAXPAGESIZE 0x1000 + +#define TARGET_BIG_SYM bfd_elf32_mep_vec +#define TARGET_BIG_NAME "elf32-mep" + +#define TARGET_LITTLE_SYM bfd_elf32_mep_little_vec +#define TARGET_LITTLE_NAME "elf32-mep-little" + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto mep_info_to_howto_rela +#define elf_backend_relocate_section mep_elf_relocate_section +#define elf_backend_gc_mark_hook mep_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook mep_elf_gc_sweep_hook +#define elf_backend_check_relocs mep_elf_check_relocs +#define elf_backend_object_p mep_elf_object_p +#define elf_backend_section_flags mep_elf_section_flags +#define elf_backend_fake_sections mep_elf_fake_sections + +#define elf_backend_can_gc_sections 1 + +#define bfd_elf32_bfd_reloc_type_lookup mep_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup mep_reloc_name_lookup +#define bfd_elf32_bfd_set_private_flags mep_elf_set_private_flags +#define bfd_elf32_bfd_copy_private_bfd_data mep_elf_copy_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data mep_elf_merge_private_bfd_data +#define bfd_elf32_bfd_print_private_bfd_data mep_elf_print_private_bfd_data + +/* We use only the RELA entries. */ +#define USE_RELA + +#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-mips.c b/contrib/binutils/bfd/elf32-mips.c index 6ed4ad35f62..3843b856e16 100644 --- a/contrib/binutils/bfd/elf32-mips.c +++ b/contrib/binutils/bfd/elf32-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -29,8 +29,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. different MIPS ELF from other targets. This matters when linking. This file supports both, switching at runtime. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -68,8 +68,6 @@ static bfd_boolean mips_elf32_object_p (bfd *); static bfd_boolean mips_elf_is_local_label_name (bfd *, const char *); -static bfd_reloc_status_type mips16_jump_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_final_gp @@ -702,6 +700,21 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This @@ -734,7 +747,7 @@ static reloc_howto_type elf_mips16_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ TRUE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1112,36 +1125,6 @@ mips32_64bit_reloc (bfd *abfd, arelent *reloc_entry, return r; } -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, - asymbol *symbol, void *data ATTRIBUTE_UNUSED, - asection *input_section, bfd *output_bfd, - char **error_message ATTRIBUTE_UNUSED) -{ - if (output_bfd != NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME. */ - { - static bfd_boolean warned; - - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = TRUE; - } - - return bfd_reloc_undefined; -} - /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type @@ -1291,6 +1274,40 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_mips_howto_table_rel) + / sizeof (elf_mips_howto_table_rel[0])); + i++) + if (elf_mips_howto_table_rel[i].name != NULL + && strcasecmp (elf_mips_howto_table_rel[i].name, r_name) == 0) + return &elf_mips_howto_table_rel[i]; + + for (i = 0; + i < (sizeof (elf_mips16_howto_table_rel) + / sizeof (elf_mips16_howto_table_rel[0])); + i++) + if (elf_mips16_howto_table_rel[i].name != NULL + && strcasecmp (elf_mips16_howto_table_rel[i].name, r_name) == 0) + return &elf_mips16_howto_table_rel[i]; + + if (strcasecmp (elf_mips_gnu_pcrel32.name, r_name) == 0) + return &elf_mips_gnu_pcrel32; + if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0) + return &elf_mips_gnu_rel16_s2; + if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0) + return &elf_mips_gnu_vtinherit_howto; + if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0) + return &elf_mips_gnu_vtentry_howto; + + return NULL; +} + /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * @@ -1537,12 +1554,15 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_create_dynamic_sections \ _bfd_mips_elf_create_dynamic_sections #define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_merge_symbol_attribute \ + _bfd_mips_elf_merge_symbol_attribute #define elf_backend_adjust_dynamic_symbol \ _bfd_mips_elf_adjust_dynamic_symbol #define elf_backend_always_size_sections \ _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol @@ -1599,6 +1619,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { /* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses a value of 0x1000, and we are compatible. */ #define ELF_MAXPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #include "elf32-target.h" @@ -1609,15 +1630,20 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #undef TARGET_BIG_NAME #undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE #define TARGET_LITTLE_SYM bfd_elf32_tradlittlemips_vec #define TARGET_LITTLE_NAME "elf32-tradlittlemips" #define TARGET_BIG_SYM bfd_elf32_tradbigmips_vec #define TARGET_BIG_NAME "elf32-tradbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses - page sizes of up to that limit, so we need to respect it. */ +/* The MIPS ABI says at Page 5-1: + Virtual addresses and file offsets for MIPS segments are congruent + modulo 64 KByte (0x10000) or larger powers of 2. Because 64 KBytes + is the maximum page size, the files are suitable for paging + regardless of physical page size. */ #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf32_bed elf32_tradbed /* Include the target file again for this target. */ @@ -1672,6 +1698,17 @@ mips_vxworks_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) } } +static reloc_howto_type * +mips_vxworks_bfd_reloc_name_lookup (bfd *abfd, const char *r_name) +{ + if (strcasecmp (mips_vxworks_copy_howto_rela.name, r_name) == 0) + return &mips_vxworks_copy_howto_rela; + if (strcasecmp (mips_vxworks_jump_slot_howto_rela.name, r_name) == 0) + return &mips_vxworks_jump_slot_howto_rela; + + return bfd_elf32_bfd_reloc_name_lookup (abfd, r_name); +} + /* Implement elf_backend_mips_rtype_to_lookup for VxWorks. */ static reloc_howto_type * @@ -1702,6 +1739,9 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #undef TARGET_BIG_SYM #undef TARGET_BIG_NAME +#undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE + #define TARGET_LITTLE_SYM bfd_elf32_littlemips_vxworks_vec #define TARGET_LITTLE_NAME "elf32-littlemips-vxworks" #define TARGET_BIG_SYM bfd_elf32_bigmips_vxworks_vec @@ -1710,8 +1750,8 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #undef elf32_bed #define elf32_bed elf32_mips_vxworks_bed -#undef ELF_MAXPAGESIZE #define ELF_MAXPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #undef elf_backend_want_got_plt #define elf_backend_want_got_plt 1 @@ -1735,6 +1775,9 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) #undef bfd_elf32_bfd_reloc_type_lookup #define bfd_elf32_bfd_reloc_type_lookup \ mips_vxworks_bfd_reloc_type_lookup +#undef bfd_elf32_bfd_reloc_name_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + mips_vxworks_bfd_reloc_name_lookup #undef elf_backend_mips_rtype_to_howto #define elf_backend_mips_rtype_to_howto \ mips_vxworks_rtype_to_howto diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c index 53d1046bb8c..d67ad866a6f 100644 --- a/contrib/binutils/bfd/elf32-ppc.c +++ b/contrib/binutils/bfd/elf32-ppc.c @@ -1,6 +1,6 @@ /* PowerPC-specific support for 32-bit ELF Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -25,8 +25,9 @@ suggestions from the in-progress Embedded PowerPC ABI, and that information may also not match. */ -#include "bfd.h" #include "sysdep.h" +#include +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -1577,6 +1578,22 @@ ppc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return ppc_elf_howto_table[r]; }; +static reloc_howto_type * +ppc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); + i++) + if (ppc_elf_howto_raw[i].name != NULL + && strcasecmp (ppc_elf_howto_raw[i].name, r_name) == 0) + return &ppc_elf_howto_raw[i]; + + return NULL; +} + /* Set the howto pointer for a PowerPC ELF reloc. */ static void @@ -1590,6 +1607,17 @@ ppc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max); cache_ptr->howto = ppc_elf_howto_table[ELF32_R_TYPE (dst->r_info)]; + + /* Just because the above assert didn't trigger doesn't mean that + ELF32_R_TYPE (dst->r_info) is necessarily a valid relocation. */ + if (!cache_ptr->howto) + { + (*_bfd_error_handler) (_("%B: invalid relocation type %d"), + abfd, ELF32_R_TYPE (dst->r_info)); + bfd_set_error (bfd_error_bad_value); + + cache_ptr->howto = ppc_elf_howto_table[R_PPC_NONE]; + } } /* Handle the R_PPC_ADDR16_HA and R_PPC_REL16_HA relocs. */ @@ -1695,6 +1723,10 @@ struct ppc_elf_obj_tdata /* A mapping from local symbols to offsets into the various linker sections added. This is index by the symbol index. */ elf_linker_section_pointers_t **linker_section_pointers; + + /* Flags used to auto-detect plt type. */ + unsigned int makes_plt_call : 1; + unsigned int has_rel16 : 1; }; #define ppc_elf_tdata(bfd) \ @@ -1708,11 +1740,14 @@ struct ppc_elf_obj_tdata static bfd_boolean ppc_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct ppc_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct ppc_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* Fix bad default arch selected for a 32 bit input bfd when the @@ -1810,6 +1845,52 @@ ppc_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) return TRUE; } +static char * +ppc_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, ...) +{ + switch (note_type) + { + default: + return NULL; + + case NT_PRPSINFO: + { + char data[128]; + va_list ap; + + va_start (ap, note_type); + memset (data, 0, 32); + strncpy (data + 32, va_arg (ap, const char *), 16); + strncpy (data + 48, va_arg (ap, const char *), 80); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + + case NT_PRSTATUS: + { + char data[268]; + va_list ap; + long pid; + int cursig; + const void *greg; + + va_start (ap, note_type); + memset (data, 0, 72); + pid = va_arg (ap, long); + bfd_put_32 (abfd, pid, data + 24); + cursig = va_arg (ap, int); + bfd_put_16 (abfd, cursig, data + 12); + greg = va_arg (ap, const void *); + memcpy (data + 72, greg, 192); + memset (data + 264, 0, 4); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + } +} + /* Return address for Ith PLT stub in section PLT, for relocation REL or (bfd_vma) -1 if it should not be included. */ @@ -1869,7 +1950,8 @@ ppc_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, need to bump up the number of section headers. */ static int -ppc_elf_additional_program_headers (bfd *abfd) +ppc_elf_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int ret = 0; @@ -1892,21 +1974,21 @@ ppc_elf_additional_program_headers (bfd *abfd) static const struct bfd_elf_special_section ppc_elf_special_sections[] = { - { ".plt", 4, 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".sbss2", 6, -2, SHT_PROGBITS, SHF_ALLOC }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".sdata2", 7, -2, SHT_PROGBITS, SHF_ALLOC }, - { ".tags", 5, 0, SHT_ORDERED, SHF_ALLOC }, - { ".PPC.EMB.apuinfo", 16, 0, SHT_NOTE, 0 }, - { ".PPC.EMB.sbss0", 14, 0, SHT_PROGBITS, SHF_ALLOC }, - { ".PPC.EMB.sdata0", 15, 0, SHT_PROGBITS, SHF_ALLOC }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".plt"), 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sbss2"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sdata2"), -2, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".tags"), 0, SHT_ORDERED, SHF_ALLOC }, + { STRING_COMMA_LEN (".PPC.EMB.apuinfo"), 0, SHT_NOTE, 0 }, + { STRING_COMMA_LEN (".PPC.EMB.sbss0"), 0, SHT_PROGBITS, SHF_ALLOC }, + { STRING_COMMA_LEN (".PPC.EMB.sdata0"), 0, SHT_PROGBITS, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } }; /* This is what we want for new plt/got. */ static struct bfd_elf_special_section ppc_alt_plt = - { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC }; + { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC }; static const struct bfd_elf_special_section * ppc_elf_get_sec_type_attr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) @@ -2147,6 +2229,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) static bfd_boolean ppc_elf_write_section (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, asection *asec, bfd_byte *contents ATTRIBUTE_UNUSED) { @@ -2313,13 +2396,6 @@ struct ppc_elf_link_hash_entry #define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent)) -enum ppc_elf_plt_type { - PLT_UNSET, - PLT_OLD, - PLT_NEW, - PLT_VXWORKS -}; - /* PPC ELF linker hash table. */ struct ppc_elf_link_hash_table @@ -2339,9 +2415,18 @@ struct ppc_elf_link_hash_table elf_linker_section_t sdata[2]; asection *sbss; + /* The (unloaded but important) .rela.plt.unloaded on VxWorks. */ + asection *srelplt2; + + /* The .got.plt section (VxWorks only)*/ + asection *sgotplt; + /* Shortcut to .__tls_get_addr. */ struct elf_link_hash_entry *tls_get_addr; + /* The bfd that forced an old-style PLT. */ + bfd *old_bfd; + /* TLS local dynamic got entry handling. */ union { bfd_signed_vma refcount; @@ -2359,23 +2444,11 @@ struct ppc_elf_link_hash_table /* The type of PLT we have chosen to use. */ enum ppc_elf_plt_type plt_type; - /* Whether we can use the new PLT layout. */ - unsigned int can_use_new_plt:1; - /* Set if we should emit symbols for stubs. */ unsigned int emit_stub_syms:1; - /* Small local sym to section mapping cache. */ - struct sym_sec_cache sym_sec; - - /* The (unloaded but important) .rela.plt.unloaded on VxWorks. */ - asection *srelplt2; - - /* The .got.plt section (VxWorks only)*/ - asection *sgotplt; - /* True if the target system is VxWorks. */ - int is_vxworks; + unsigned int is_vxworks:1; /* The size of PLT entries. */ int plt_entry_size; @@ -2383,6 +2456,9 @@ struct ppc_elf_link_hash_table int plt_slot_size; /* The size of the first PLT entry. */ int plt_initial_entry_size; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; }; /* Get the PPC ELF linker hash table from a link_info structure. */ @@ -2454,8 +2530,6 @@ ppc_elf_link_hash_table_create (bfd *abfd) ret->plt_entry_size = 12; ret->plt_slot_size = 8; ret->plt_initial_entry_size = 72; - - ret->is_vxworks = 0; return &ret->elf.root; } @@ -3225,8 +3299,13 @@ ppc_elf_check_relocs (bfd *abfd, } else { - bfd_vma addend = r_type == R_PPC_PLTREL24 ? rel->r_addend : 0; + bfd_vma addend = 0; + if (r_type == R_PPC_PLTREL24) + { + ppc_elf_tdata (abfd)->makes_plt_call = 1; + addend = rel->r_addend; + } h->needs_plt = 1; if (!update_plt_info (abfd, h, got2, addend)) return FALSE; @@ -3251,7 +3330,7 @@ ppc_elf_check_relocs (bfd *abfd, case R_PPC_REL16_LO: case R_PPC_REL16_HI: case R_PPC_REL16_HA: - htab->can_use_new_plt = 1; + ppc_elf_tdata (abfd)->has_rel16 = 1; break; /* These are just markers. */ @@ -3280,7 +3359,10 @@ ppc_elf_check_relocs (bfd *abfd, /* This refers only to functions defined in the shared library. */ case R_PPC_LOCAL24PC: if (h && h == htab->elf.hgot && htab->plt_type == PLT_UNSET) - htab->plt_type = PLT_OLD; + { + htab->plt_type = PLT_OLD; + htab->old_bfd = abfd; + } break; /* This relocation describes the C++ object vtable hierarchy. @@ -3334,7 +3416,10 @@ ppc_elf_check_relocs (bfd *abfd, s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == got2) - htab->plt_type = PLT_OLD; + { + htab->plt_type = PLT_OLD; + htab->old_bfd = abfd; + } } if (h == NULL || h == htab->elf.hgot) break; @@ -3349,7 +3434,10 @@ ppc_elf_check_relocs (bfd *abfd, if (h == htab->elf.hgot) { if (htab->plt_type == PLT_UNSET) - htab->plt_type = PLT_OLD; + { + htab->plt_type = PLT_OLD; + htab->old_bfd = abfd; + } break; } /* fall through */ @@ -3432,7 +3520,7 @@ ppc_elf_check_relocs (bfd *abfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -3506,6 +3594,62 @@ ppc_elf_check_relocs (bfd *abfd, return TRUE; } + +/* Merge object attributes from IBFD into OBFD. Raise an error if + there are conflicting attributes. */ +static bfd_boolean +ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + + if (!elf_known_obj_attributes_proc (obfd)[0].i) + { + /* This is the first object. Copy the attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + + return TRUE; + } + + /* Check for conflicting Tag_GNU_Power_ABI_FP attributes and merge + non-conflicting ones. */ + in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU]; + out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU]; + if (in_attr[Tag_GNU_Power_ABI_FP].i != out_attr[Tag_GNU_Power_ABI_FP].i) + { + out_attr[Tag_GNU_Power_ABI_FP].type = 1; + if (out_attr[Tag_GNU_Power_ABI_FP].i == 0) + out_attr[Tag_GNU_Power_ABI_FP].i = in_attr[Tag_GNU_Power_ABI_FP].i; + else if (in_attr[Tag_GNU_Power_ABI_FP].i == 0) + ; + else if (out_attr[Tag_GNU_Power_ABI_FP].i == 1 + && in_attr[Tag_GNU_Power_ABI_FP].i == 2) + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd); + else if (out_attr[Tag_GNU_Power_ABI_FP].i == 2 + && in_attr[Tag_GNU_Power_ABI_FP].i == 1) + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd); + else if (in_attr[Tag_GNU_Power_ABI_FP].i > 2) + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), ibfd, + in_attr[Tag_GNU_Power_ABI_FP].i); + else + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), obfd, + out_attr[Tag_GNU_Power_ABI_FP].i); + } + + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); + + return TRUE; +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -3524,6 +3668,9 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return FALSE; + if (!ppc_elf_merge_obj_attributes (ibfd, obfd)) + return FALSE; + new_flags = elf_elfheader (ibfd)->e_flags; old_flags = elf_elfheader (obfd)->e_flags; if (!elf_flags_init (obfd)) @@ -3603,7 +3750,7 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) int ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info, - int force_old_plt, + enum ppc_elf_plt_type plt_style, int emit_stub_syms) { struct ppc_elf_link_hash_table *htab; @@ -3612,8 +3759,37 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, htab = ppc_elf_hash_table (info); if (htab->plt_type == PLT_UNSET) - htab->plt_type = (force_old_plt || !htab->can_use_new_plt - ? PLT_OLD : PLT_NEW); + { + if (plt_style == PLT_OLD) + htab->plt_type = PLT_OLD; + else + { + bfd *ibfd; + enum ppc_elf_plt_type plt_type = plt_style; + + /* Look through the reloc flags left by ppc_elf_check_relocs. + Use the old style bss plt if a file makes plt calls + without using the new relocs, and if ld isn't given + --secure-plt and we never see REL16 relocs. */ + if (plt_type == PLT_UNSET) + plt_type = PLT_OLD; + for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next) + if (is_ppc_elf_target (ibfd->xvec)) + { + if (ppc_elf_tdata (ibfd)->has_rel16) + plt_type = PLT_NEW; + else if (ppc_elf_tdata (ibfd)->makes_plt_call) + { + plt_type = PLT_OLD; + htab->old_bfd = ibfd; + break; + } + } + htab->plt_type = plt_type; + } + } + if (htab->plt_type == PLT_OLD && plt_style == PLT_NEW) + info->callbacks->info (_("Using bss-plt due to %B"), htab->old_bfd); htab->emit_stub_syms = emit_stub_syms; @@ -3649,38 +3825,20 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, static asection * ppc_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_PPC_GNU_VTINHERIT: - case R_PPC_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_PPC_GNU_VTINHERIT: + case R_PPC_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got, plt and dynamic reloc reference counts for the @@ -4048,7 +4206,6 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { struct ppc_elf_link_hash_table *htab; asection *s; - unsigned int power_of_two; #ifdef DEBUG fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", @@ -4190,28 +4347,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Generate a symbol to mark plt call stubs. For non-PIC code the sym is @@ -4450,13 +4586,15 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) } else ent->plt.offset = (bfd_vma) -1; - - if (!doneone) - { - h->plt.plist = NULL; - h->needs_plt = 0; - } } + else + ent->plt.offset = (bfd_vma) -1; + + if (!doneone) + { + h->plt.plist = NULL; + h->needs_plt = 0; + } } else { @@ -4860,7 +4998,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { /* Strip these too. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0) { @@ -5518,6 +5656,7 @@ ppc_elf_relocate_section (bfd *output_bfd, asection *got2, *sreloc = NULL; bfd_vma *local_got_offsets; bfd_boolean ret = TRUE; + bfd_vma d_offset = (bfd_big_endian (output_bfd) ? 2 : 0); #ifdef DEBUG _bfd_error_handler ("ppc_elf_relocate_section called for %B section %A, " @@ -5529,29 +5668,6 @@ ppc_elf_relocate_section (bfd *output_bfd, got2 = bfd_get_section_by_name (input_bfd, ".got2"); - if (info->relocatable) - { - if (got2 == NULL) - return TRUE; - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) - { - enum elf_ppc_reloc_type r_type; - - r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == R_PPC_PLTREL24 - && rel->r_addend >= 32768) - { - /* R_PPC_PLTREL24 is rather special. If non-zero, the - addend specifies the GOT pointer offset within .got2. */ - rel->r_addend += got2->output_offset; - } - } - return TRUE; - } - /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) ppc_elf_howto_init (); @@ -5605,6 +5721,33 @@ ppc_elf_relocate_section (bfd *output_bfd, sym_name = h->root.root.string; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + howto = NULL; + if (r_type < R_PPC_max) + howto = ppc_elf_howto_table[r_type]; + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + if (got2 != NULL + && r_type == R_PPC_PLTREL24 + && rel->r_addend >= 32768) + { + /* R_PPC_PLTREL24 is rather special. If non-zero, the + addend specifies the GOT pointer offset within .got2. */ + rel->r_addend += got2->output_offset; + } + continue; + } + /* TLS optimizations. Replace instruction sequences and relocs based on information we collected in tls_optimize. We edit RELOCS so that --emit-relocs will output something sensible @@ -5644,10 +5787,10 @@ ppc_elf_relocate_section (bfd *output_bfd, && (tls_mask & TLS_TPREL) == 0) { bfd_vma insn; - insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - d_offset); insn &= 31 << 21; insn |= 0x3c020000; /* addis 0,2,0 */ - bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - d_offset); r_type = R_PPC_TPREL16_HA; rel->r_info = ELF32_R_INFO (r_symndx, r_type); } @@ -5691,9 +5834,10 @@ ppc_elf_relocate_section (bfd *output_bfd, bfd_put_32 (output_bfd, insn, contents + rel->r_offset); r_type = R_PPC_TPREL16_LO; rel->r_info = ELF32_R_INFO (r_symndx, r_type); + /* Was PPC_TLS which sits on insn boundary, now - PPC_TPREL16_LO which is at insn+2. */ - rel->r_offset += 2; + PPC_TPREL16_LO which is at low-order half-word. */ + rel->r_offset += d_offset; } break; @@ -5715,7 +5859,7 @@ ppc_elf_relocate_section (bfd *output_bfd, else { bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); - rel->r_offset -= 2; + rel->r_offset -= d_offset; r_type = R_PPC_NONE; } rel->r_info = ELF32_R_INFO (r_symndx, r_type); @@ -5764,7 +5908,7 @@ ppc_elf_relocate_section (bfd *output_bfd, /* OK, it checks out. Replace the call. */ offset = rel[1].r_offset; insn1 = bfd_get_32 (output_bfd, - contents + rel->r_offset - 2); + contents + rel->r_offset - d_offset); if ((tls_mask & tls_gd) != 0) { /* IE */ @@ -5792,10 +5936,10 @@ ppc_elf_relocate_section (bfd *output_bfd, rel->r_info = ELF32_R_INFO (r_symndx, r_type); rel[1].r_info = ELF32_R_INFO (r_symndx, R_PPC_TPREL16_LO); - rel[1].r_offset += 2; + rel[1].r_offset += d_offset; rel[1].r_addend = rel->r_addend; } - bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - d_offset); bfd_put_32 (output_bfd, insn2, contents + offset); if (tls_gd == 0) { @@ -6189,14 +6333,7 @@ ppc_elf_relocate_section (bfd *output_bfd, case R_PPC_ADDR14_BRNTAKEN: case R_PPC_UADDR32: case R_PPC_UADDR16: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ dodyn: - if (r_symndx == 0) - break; - /* Fall thru. */ - if ((input_section->flags & SEC_ALLOC) == 0) break; /* Fall thru. */ @@ -6238,7 +6375,7 @@ ppc_elf_relocate_section (bfd *output_bfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); @@ -6294,10 +6431,15 @@ ppc_elf_relocate_section (bfd *output_bfd, but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT (indx > 0); + if (indx == 0) + { + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); #ifdef DEBUG - if (indx <= 0) - printf ("indx=%d section=%s flags=%08x name=%s\n", + if (indx == 0) + printf ("indx=%ld section=%s flags=%08x name=%s\n", indx, osec->name, osec->flags, h->root.root.string); #endif @@ -6441,9 +6583,9 @@ ppc_elf_relocate_section (bfd *output_bfd, BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (! ((strncmp (name, ".sdata", 6) == 0 + if (! ((CONST_STRNEQ (name, ".sdata") && (name[6] == 0 || name[6] == '.')) - || (strncmp (name, ".sbss", 5) == 0 + || (CONST_STRNEQ (name, ".sbss") && (name[5] == 0 || name[5] == '.')))) { (*_bfd_error_handler) @@ -6469,8 +6611,8 @@ ppc_elf_relocate_section (bfd *output_bfd, BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (! (strncmp (name, ".sdata2", 7) == 0 - || strncmp (name, ".sbss2", 6) == 0)) + if (! (CONST_STRNEQ (name, ".sdata2") + || CONST_STRNEQ (name, ".sbss2"))) { (*_bfd_error_handler) (_("%B: the target (%s) of a %s relocation is " @@ -6501,9 +6643,9 @@ ppc_elf_relocate_section (bfd *output_bfd, BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (((strncmp (name, ".sdata", 6) == 0 + if (((CONST_STRNEQ (name, ".sdata") && (name[6] == 0 || name[6] == '.')) - || (strncmp (name, ".sbss", 5) == 0 + || (CONST_STRNEQ (name, ".sbss") && (name[5] == 0 || name[5] == '.')))) { reg = 13; @@ -6513,8 +6655,8 @@ ppc_elf_relocate_section (bfd *output_bfd, + sh->root.u.def.section->output_section->vma); } - else if (strncmp (name, ".sdata2", 7) == 0 - || strncmp (name, ".sbss2", 6) == 0) + else if (CONST_STRNEQ (name, ".sdata2") + || CONST_STRNEQ (name, ".sbss2")) { reg = 2; sh = htab->sdata[1].sym; @@ -6605,25 +6747,28 @@ ppc_elf_relocate_section (bfd *output_bfd, case R_PPC_ADDR16_HA: case R_PPC_REL16_HA: - case R_PPC_GOT16_HA: - case R_PPC_PLT16_HA: case R_PPC_SECTOFF_HA: case R_PPC_TPREL16_HA: case R_PPC_DTPREL16_HA: - case R_PPC_GOT_TLSGD16_HA: - case R_PPC_GOT_TLSLD16_HA: - case R_PPC_GOT_TPREL16_HA: - case R_PPC_GOT_DTPREL16_HA: case R_PPC_EMB_NADDR16_HA: case R_PPC_EMB_RELST_HA: /* It's just possible that this symbol is a weak symbol that's not actually defined anywhere. In that case, 'sec' would be NULL, and we should leave the symbol alone (it will be set to zero elsewhere in the link). */ - if (sec != NULL) - /* Add 0x10000 if sign bit in 0:15 is set. - Bits 0:15 are not used. */ - addend += 0x8000; + if (sec == NULL) + break; + /* Fall thru */ + + case R_PPC_PLT16_HA: + case R_PPC_GOT16_HA: + case R_PPC_GOT_TLSGD16_HA: + case R_PPC_GOT_TLSLD16_HA: + case R_PPC_GOT_TPREL16_HA: + case R_PPC_GOT_DTPREL16_HA: + /* Add 0x10000 if sign bit in 0:15 is set. + Bits 0:15 are not used. */ + addend += 0x8000; break; } @@ -7436,6 +7581,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define ELF_MAXPAGESIZE 0x10000 #endif #define ELF_MINPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf_info_to_howto ppc_elf_info_to_howto #ifdef EM_CYGNUS_POWERPC @@ -7455,6 +7601,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data #define bfd_elf32_bfd_relax_section ppc_elf_relax_section #define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup ppc_elf_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags #define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create @@ -7475,6 +7622,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define elf_backend_additional_program_headers ppc_elf_additional_program_headers #define elf_backend_grok_prstatus ppc_elf_grok_prstatus #define elf_backend_grok_psinfo ppc_elf_grok_psinfo +#define elf_backend_write_core_note ppc_elf_write_core_note #define elf_backend_reloc_type_class ppc_elf_reloc_type_class #define elf_backend_begin_write_processing ppc_elf_begin_write_processing #define elf_backend_final_write_processing ppc_elf_final_write_processing @@ -7482,6 +7630,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define elf_backend_get_sec_type_attr ppc_elf_get_sec_type_attr #define elf_backend_plt_sym_val ppc_elf_plt_sym_val #define elf_backend_action_discarded ppc_elf_action_discarded +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-ppc.h b/contrib/binutils/bfd/elf32-ppc.h index 5f8f63a38a5..f5383a7bb58 100644 --- a/contrib/binutils/bfd/elf32-ppc.h +++ b/contrib/binutils/bfd/elf32-ppc.h @@ -1,5 +1,5 @@ /* PowerPC-specific support for 64-bit ELF. - Copyright 2003, 2005 Free Software Foundation, Inc. + Copyright 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,15 @@ 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. */ -int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, int, int); +enum ppc_elf_plt_type { + PLT_UNSET, + PLT_OLD, + PLT_NEW, + PLT_VXWORKS +}; + +int ppc_elf_select_plt_layout (bfd *, struct bfd_link_info *, + enum ppc_elf_plt_type, int); asection *ppc_elf_tls_setup (bfd *, struct bfd_link_info *); bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *); void ppc_elf_set_sdata_syms (bfd *, struct bfd_link_info *); diff --git a/contrib/binutils/bfd/elf32-s390.c b/contrib/binutils/bfd/elf32-s390.c index eb8e1724fc1..9e36a5d5746 100644 --- a/contrib/binutils/bfd/elf32-s390.c +++ b/contrib/binutils/bfd/elf32-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -46,12 +46,6 @@ static void elf_s390_copy_indirect_symbol static bfd_boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *elf_s390_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_s390_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); struct elf_s390_link_hash_entry; static void elf_s390_adjust_gotplt PARAMS ((struct elf_s390_link_hash_entry *)); @@ -73,8 +67,6 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_s390_mkobject - PARAMS ((bfd *)); static bfd_boolean elf_s390_object_p PARAMS ((bfd *)); static bfd_boolean elf_s390_grok_prstatus @@ -342,6 +334,25 @@ elf_s390_reloc_type_lookup (abfd, code) return 0; } +static reloc_howto_type * +elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + if (strcasecmp (elf32_s390_vtinherit_howto.name, r_name) == 0) + return &elf32_s390_vtinherit_howto; + if (strcasecmp (elf32_s390_vtentry_howto.name, r_name) == 0) + return &elf32_s390_vtentry_howto; + + return NULL; +} + /* We need to use ELF32_R_TYPE so we have our own copy of this function, and elf32-s390.c has its own copy. */ @@ -678,14 +689,16 @@ struct elf_s390_obj_tdata (elf_s390_tdata (abfd)->local_got_tls_type) static bfd_boolean -elf_s390_mkobject (abfd) - bfd *abfd; +elf_s390_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -1273,7 +1286,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -1379,50 +1392,30 @@ elf_s390_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_s390_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_s390_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GNU_VTINHERIT: - case R_390_GNU_VTENTRY: - break; + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_390_GNU_VTINHERIT: + case R_390_GNU_VTENTRY: + return NULL; + } + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_s390_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_s390_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1589,7 +1582,6 @@ elf_s390_adjust_dynamic_symbol (info, h) { struct elf_s390_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later @@ -1710,29 +1702,9 @@ elf_s390_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2126,7 +2098,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0) relocs = TRUE; @@ -2268,6 +2240,7 @@ invalid_tls_insn (input_bfd, input_section, rel) input_section, (long) rel->r_offset, howto->name); + bfd_set_error (bfd_error_bad_value); } /* Relocate a 390 ELF section. */ @@ -2291,9 +2264,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2328,7 +2298,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_howto_table + r_type; r_symndx = ELF32_R_SYM (rel->r_info); - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -2349,6 +2318,20 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_390_GOTPLT12: @@ -2565,11 +2548,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, case R_390_PC16DBL: case R_390_PC32DBL: case R_390_PC32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2655,14 +2634,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + if (sindx == 0) + { + osec = htab->elf.text_index_section; + sindx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (sindx != 0); /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= osec->vma; } outrel.r_info = ELF32_R_INFO (sindx, r_type); @@ -2926,7 +2909,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, continue; case R_390_TLS_LDO32: - if (info->shared || (input_section->flags & SEC_CODE) == 0) + if (info->shared) relocation -= dtpoff_base (info); else /* When converting LDO to LE, we must negate. */ @@ -2982,16 +2965,44 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unsigned int insn; insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - if ((insn & 0xff000fff) != 0x4d000000) + if ((insn & 0xff000fff) != 0x4d000000 && + (insn & 0xffff0000) != 0xc0e50000) invalid_tls_insn (input_bfd, input_section, rel); if (!info->shared && (h == NULL || h->dynindx == -1)) - /* GD->LE transition. - bas %r14,0(%rx,%r13) -> bc 0,0 */ - insn = 0x47000000; + { + if ((insn & 0xff000000) == 0x4d000000) + { + /* GD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + } + else + { + /* GD->LE transition. + brasl %r14,_tls_get_addr@plt -> brcl 0,. */ + insn = 0xc0040000; + bfd_put_16 (output_bfd, 0x0000, + contents + rel->r_offset + 4); + } + } else - /* GD->IE transition. - bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */ - insn = 0x5822c000; + { + if ((insn & 0xff000000) == 0x4d000000) + { + /* GD->IE transition. + bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */ + insn = 0x5822c000; + } + else + { + /* GD->IE transition. + brasl %r14,__tls_get_addr@plt -> + l %r2,0(%r2,%r12) ; bcr 0,0 */ + insn = 0x5822c000; + bfd_put_16 (output_bfd, 0x0700, + contents + rel->r_offset + 4); + } + } bfd_put_32 (output_bfd, insn, contents + rel->r_offset); } else if (r_type == R_390_TLS_LDCALL) @@ -3001,11 +3012,23 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unsigned int insn; insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - if ((insn & 0xff000fff) != 0x4d000000) + if ((insn & 0xff000fff) != 0x4d000000 && + (insn & 0xffff0000) != 0xc0e50000) invalid_tls_insn (input_bfd, input_section, rel); - /* LD->LE transition. - bas %r14,0(%rx,%r13) -> bc 0,0 */ - insn = 0x47000000; + if ((insn & 0xff000000) == 0x4d000000) + { + /* LD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + } + else + { + /* LD->LE transition. + brasl %r14,__tls_get_addr@plt -> brcl 0,. */ + insn = 0xc0040000; + bfd_put_16 (output_bfd, 0x0000, + contents + rel->r_offset + 4); + } bfd_put_32 (output_bfd, insn, contents + rel->r_offset); } } @@ -3515,6 +3538,7 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt, #define bfd_elf32_bfd_is_local_label_name elf_s390_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_s390_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf_s390_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup elf_s390_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol #define elf_backend_check_relocs elf_s390_check_relocs @@ -3527,6 +3551,7 @@ elf_s390_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_grok_prstatus elf_s390_grok_prstatus #define elf_backend_plt_sym_val elf_s390_plt_sym_val diff --git a/contrib/binutils/bfd/elf32-score.c b/contrib/binutils/bfd/elf32-score.c new file mode 100644 index 00000000000..070177b1507 --- /dev/null +++ b/contrib/binutils/bfd/elf32-score.c @@ -0,0 +1,3883 @@ +/* 32-bit ELF support for S+core. + Copyright 2006, 2007 Free Software Foundation, Inc. + Contributed by + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of BFD, the Binary File Descriptor library. + + 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 "libbfd.h" +#include "libiberty.h" +#include "elf-bfd.h" +#include "elf/score.h" +#include "elf/common.h" +#include "elf/internal.h" +#include "hashtab.h" + + +/* Score ELF linker hash table. */ + +struct score_elf_link_hash_table +{ + /* The main hash table. */ + struct elf_link_hash_table root; +}; + +/* The SCORE ELF linker needs additional information for each symbol in + the global hash table. */ + +struct score_elf_link_hash_entry +{ + struct elf_link_hash_entry root; + + /* Number of R_SCORE_ABS32, R_SCORE_REL32 relocs against this symbol. */ + unsigned int possibly_dynamic_relocs; + + /* If the R_SCORE_ABS32, R_SCORE_REL32 reloc is against a readonly section. */ + bfd_boolean readonly_reloc; + + /* We must not create a stub for a symbol that has relocations related to + taking the function's address, i.e. any but R_SCORE_CALL15 ones. */ + bfd_boolean no_fn_stub; + + /* Are we forced local? This will only be set if we have converted + the initial global GOT entry to a local GOT entry. */ + bfd_boolean forced_local; +}; + +/* Traverse a score ELF linker hash table. */ +#define score_elf_link_hash_traverse(table, func, info) \ + (elf_link_hash_traverse \ + (&(table)->root, \ + (bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \ + (info))) + +/* Get the SCORE elf linker hash table from a link_info structure. */ +#define score_elf_hash_table(info) \ + ((struct score_elf_link_hash_table *) ((info)->hash)) + +/* This structure is used to hold .got entries while estimating got sizes. */ +struct score_got_entry +{ + /* The input bfd in which the symbol is defined. */ + bfd *abfd; + /* The index of the symbol, as stored in the relocation r_info, if + we have a local symbol; -1 otherwise. */ + long symndx; + union + { + /* If abfd == NULL, an address that must be stored in the got. */ + bfd_vma address; + /* If abfd != NULL && symndx != -1, the addend of the relocation + that should be added to the symbol value. */ + bfd_vma addend; + /* If abfd != NULL && symndx == -1, the hash table entry + corresponding to a global symbol in the got (or, local, if + h->forced_local). */ + struct score_elf_link_hash_entry *h; + } d; + + /* The offset from the beginning of the .got section to the entry + corresponding to this symbol+addend. If it's a global symbol + whose offset is yet to be decided, it's going to be -1. */ + long gotidx; +}; + +/* This structure is passed to score_elf_sort_hash_table_f when sorting + the dynamic symbols. */ + +struct score_elf_hash_sort_data +{ + /* The symbol in the global GOT with the lowest dynamic symbol table index. */ + struct elf_link_hash_entry *low; + /* The least dynamic symbol table index corresponding to a symbol with a GOT entry. */ + long min_got_dynindx; + /* The greatest dynamic symbol table index corresponding to a symbol + with a GOT entry that is not referenced (e.g., a dynamic symbol + with dynamic relocations pointing to it from non-primary GOTs). */ + long max_unref_got_dynindx; + /* The greatest dynamic symbol table index not corresponding to a + symbol without a GOT entry. */ + long max_non_got_dynindx; +}; + +struct score_got_info +{ + /* The global symbol in the GOT with the lowest index in the dynamic + symbol table. */ + struct elf_link_hash_entry *global_gotsym; + /* The number of global .got entries. */ + unsigned int global_gotno; + /* The number of local .got entries. */ + unsigned int local_gotno; + /* The number of local .got entries we have used. */ + unsigned int assigned_gotno; + /* A hash table holding members of the got. */ + struct htab *got_entries; + /* In multi-got links, a pointer to the next got (err, rather, most + of the time, it points to the previous got). */ + struct score_got_info *next; +}; + +/* A structure used to count GOT entries, for GOT entry or ELF symbol table traversal. */ +struct _score_elf_section_data +{ + struct bfd_elf_section_data elf; + union + { + struct score_got_info *got_info; + bfd_byte *tdata; + } + u; +}; + +#define score_elf_section_data(sec) \ + ((struct _score_elf_section_data *) elf_section_data (sec)) + +/* The size of a symbol-table entry. */ +#define SCORE_ELF_SYM_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->sizeof_sym) + +/* In case we're on a 32-bit machine, construct a 64-bit "-1" value + from smaller values. Start with zero, widen, *then* decrement. */ +#define MINUS_ONE (((bfd_vma)0) - 1) +#define MINUS_TWO (((bfd_vma)0) - 2) + +#define PDR_SIZE 32 + + +/* The number of local .got entries we reserve. */ +#define SCORE_RESERVED_GOTNO (2) +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* The offset of $gp from the beginning of the .got section. */ +#define ELF_SCORE_GP_OFFSET(abfd) (0x3ff0) +/* The maximum size of the GOT for it to be addressable using 15-bit offsets from $gp. */ +#define SCORE_ELF_GOT_MAX_SIZE(abfd) (ELF_SCORE_GP_OFFSET(abfd) + 0x3fff) + +#define SCORE_ELF_STUB_SECTION_NAME (".SCORE.stub") +#define SCORE_FUNCTION_STUB_SIZE (16) + +#define STUB_LW 0xc3bcc010 /* lw r29, [r28, -0x3ff0] */ +#define STUB_MOVE 0x8363bc56 /* mv r27, r3 */ +#define STUB_LI16 0x87548000 /* ori r26, .dynsym_index */ +#define STUB_BRL 0x801dbc09 /* brl r29 */ + +#define SCORE_ELF_GOT_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->arch_size / 8) + +#define SCORE_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \ + (_bfd_elf_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val)) + +/* The size of an external dynamic table entry. */ +#define SCORE_ELF_DYN_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->sizeof_dyn) + +/* The size of an external REL relocation. */ +#define SCORE_ELF_REL_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->sizeof_rel) + +/* The default alignment for sections, as a power of two. */ +#define SCORE_ELF_LOG_FILE_ALIGN(abfd)\ + (get_elf_backend_data (abfd)->s->log_file_align) + +#ifndef NUM_ELEM +#define NUM_ELEM(a) (sizeof (a) / (sizeof (a)[0])) +#endif + +static bfd_byte *hi16_rel_addr; + +/* This will be used when we sort the dynamic relocation records. */ +static bfd *reldyn_sorting_bfd; + +/* SCORE ELF uses two common sections. One is the usual one, and the + other is for small objects. All the small objects are kept + together, and then referenced via the gp pointer, which yields + faster assembler code. This is what we use for the small common + section. This approach is copied from ecoff.c. */ +static asection score_elf_scom_section; +static asymbol score_elf_scom_symbol; +static asymbol *score_elf_scom_symbol_ptr; + +static bfd_reloc_status_type +score_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED, + arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void * data, + asection *input_section ATTRIBUTE_UNUSED, + bfd *output_bfd ATTRIBUTE_UNUSED, + char **error_message ATTRIBUTE_UNUSED) +{ + hi16_rel_addr = (bfd_byte *) data + reloc_entry->address; + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +score_elf_lo16_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void * data, + asection *input_section, + bfd *output_bfd ATTRIBUTE_UNUSED, + char **error_message ATTRIBUTE_UNUSED) +{ + bfd_vma addend = 0, offset = 0; + unsigned long val; + unsigned long hi16_offset, hi16_value, uvalue; + + hi16_value = bfd_get_32 (abfd, hi16_rel_addr); + hi16_offset = ((((hi16_value >> 16) & 0x3) << 15) | (hi16_value & 0x7fff)) >> 1; + addend = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + offset = ((((addend >> 16) & 0x3) << 15) | (addend & 0x7fff)) >> 1; + val = reloc_entry->addend; + if (reloc_entry->address > input_section->size) + return bfd_reloc_outofrange; + uvalue = ((hi16_offset << 16) | (offset & 0xffff)) + val; + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_value & ~0x37fff) | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (abfd, hi16_value, hi16_rel_addr); + offset = (uvalue & 0xffff) << 1; + addend = (addend & ~0x37fff) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (abfd, addend, (bfd_byte *) data + reloc_entry->address); + return bfd_reloc_ok; +} + +/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a + dangerous relocation. */ + +static bfd_boolean +score_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp) +{ + unsigned int count; + asymbol **sym; + unsigned int i; + + /* If we've already figured out what GP will be, just return it. */ + *pgp = _bfd_get_gp_value (output_bfd); + if (*pgp) + return TRUE; + + count = bfd_get_symcount (output_bfd); + sym = bfd_get_outsymbols (output_bfd); + + /* The linker script will have created a symbol named `_gp' with the + appropriate value. */ + if (sym == NULL) + i = count; + else + { + for (i = 0; i < count; i++, sym++) + { + const char *name; + + name = bfd_asymbol_name (*sym); + if (*name == '_' && strcmp (name, "_gp") == 0) + { + *pgp = bfd_asymbol_value (*sym); + _bfd_set_gp_value (output_bfd, *pgp); + break; + } + } + } + + if (i >= count) + { + /* Only get the error once. */ + *pgp = 4; + _bfd_set_gp_value (output_bfd, *pgp); + return FALSE; + } + + return TRUE; +} + +/* We have to figure out the gp value, so that we can adjust the + symbol value correctly. We look up the symbol _gp in the output + BFD. If we can't find it, we're stuck. We cache it in the ELF + target data. We don't need to adjust the symbol value for an + external symbol if we are producing relocatable output. */ + +static bfd_reloc_status_type +score_elf_final_gp (bfd *output_bfd, + asymbol *symbol, + bfd_boolean relocatable, + char **error_message, + bfd_vma *pgp) +{ + if (bfd_is_und_section (symbol->section) + && ! relocatable) + { + *pgp = 0; + return bfd_reloc_undefined; + } + + *pgp = _bfd_get_gp_value (output_bfd); + if (*pgp == 0 + && (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0)) + { + if (relocatable) + { + /* Make up a value. */ + *pgp = symbol->section->output_section->vma + 0x4000; + _bfd_set_gp_value (output_bfd, *pgp); + } + else if (!score_elf_assign_gp (output_bfd, pgp)) + { + *error_message = + (char *) _("GP relative relocation when _gp not defined"); + return bfd_reloc_dangerous; + } + } + + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +score_elf_gprel15_with_gp (bfd *abfd, + asymbol *symbol, + arelent *reloc_entry, + asection *input_section, + bfd_boolean relocateable, + void * data, + bfd_vma gp ATTRIBUTE_UNUSED) +{ + bfd_vma relocation; + unsigned long insn; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + if (reloc_entry->address > input_section->size) + return bfd_reloc_outofrange; + + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + if (((reloc_entry->addend & 0xffffc000) != 0) + && ((reloc_entry->addend & 0xffffc000) != 0xffffc000)) + return bfd_reloc_overflow; + + insn = (insn & ~0x7fff) | (reloc_entry->addend & 0x7fff); + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + if (relocateable) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry, + asection *input_section, bfd_boolean relocatable, + void *data, bfd_vma gp) +{ + bfd_vma relocation; + bfd_vma val; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) + return bfd_reloc_outofrange; + + /* Set val to the offset into the section or symbol. */ + val = reloc_entry->addend; + + if (reloc_entry->howto->partial_inplace) + val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + /* Adjust val for the final section location and GP value. If we + are producing relocatable output, we don't want to do this for + an external symbol. */ + if (! relocatable + || (symbol->flags & BSF_SECTION_SYM) != 0) + val += relocation - gp; + + if (reloc_entry->howto->partial_inplace) + bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); + else + reloc_entry->addend = val; + + if (relocatable) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} + +static bfd_reloc_status_type +score_elf_gprel15_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol, + void * data, + asection *input_section, + bfd *output_bfd, + char **error_message) +{ + bfd_boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 && reloc_entry->addend == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + if (output_bfd != (bfd *) NULL) + relocateable = TRUE; + else + { + relocateable = FALSE; + output_bfd = symbol->section->output_section->owner; + } + + ret = score_elf_final_gp (output_bfd, symbol, relocateable, error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + + return score_elf_gprel15_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, data, gp); +} + +/* Do a R_SCORE_GPREL32 relocation. This is a 32 bit value which must + become the offset from the gp register. */ + +static bfd_reloc_status_type +score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) +{ + bfd_boolean relocatable; + bfd_reloc_status_type ret; + bfd_vma gp; + + /* R_SCORE_GPREL32 relocations are defined for local symbols only. */ + if (output_bfd != NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (symbol->flags & BSF_LOCAL) != 0) + { + *error_message = (char *) + _("32bits gp relative relocation occurs for an external symbol"); + return bfd_reloc_outofrange; + } + + if (output_bfd != NULL) + relocatable = TRUE; + else + { + relocatable = FALSE; + output_bfd = symbol->section->output_section->owner; + } + + ret = score_elf_final_gp (output_bfd, symbol, relocatable, error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + + gp = 0; /* FIXME. */ + return gprel32_with_gp (abfd, symbol, reloc_entry, input_section, + relocatable, data, gp); +} + +/* A howto special_function for R_SCORE_GOT15 relocations. This is just + like any other 16-bit relocation when applied to global symbols, but is + treated in the same as R_SCORE_HI16 when applied to local symbols. */ + +static bfd_reloc_status_type +score_elf_got15_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) +{ + if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0 + || bfd_is_und_section (bfd_get_section (symbol)) + || bfd_is_com_section (bfd_get_section (symbol))) + /* The relocation is against a global symbol. */ + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, + error_message); + + return score_elf_hi16_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); +} + +static bfd_reloc_status_type +score_elf_got_lo16_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol ATTRIBUTE_UNUSED, + void * data, + asection *input_section, + bfd *output_bfd ATTRIBUTE_UNUSED, + char **error_message ATTRIBUTE_UNUSED) +{ + bfd_vma addend = 0, offset = 0; + signed long val; + signed long hi16_offset, hi16_value, uvalue; + + hi16_value = bfd_get_32 (abfd, hi16_rel_addr); + hi16_offset = ((((hi16_value >> 16) & 0x3) << 15) | (hi16_value & 0x7fff)) >> 1; + addend = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + offset = ((((addend >> 16) & 0x3) << 15) | (addend & 0x7fff)) >> 1; + val = reloc_entry->addend; + if (reloc_entry->address > input_section->size) + return bfd_reloc_outofrange; + uvalue = ((hi16_offset << 16) | (offset & 0xffff)) + val; + if ((uvalue > -0x8000) && (uvalue < 0x7fff)) + hi16_offset = 0; + else + hi16_offset = (uvalue >> 16) & 0x7fff; + hi16_value = (hi16_value & ~0x37fff) | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (abfd, hi16_value, hi16_rel_addr); + offset = (uvalue & 0xffff) << 1; + addend = (addend & ~0x37fff) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (abfd, addend, (bfd_byte *) data + reloc_entry->address); + return bfd_reloc_ok; +} + +static reloc_howto_type elf32_score_howto_table[] = +{ + /* No relocation. */ + HOWTO (R_SCORE_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_HI16 */ + HOWTO (R_SCORE_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_hi16_reloc, /* special_function */ + "R_SCORE_HI16", /* name */ + TRUE, /* partial_inplace */ + 0x37fff, /* src_mask */ + 0x37fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_LO16 */ + HOWTO (R_SCORE_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_lo16_reloc, /* special_function */ + "R_SCORE_LO16", /* name */ + TRUE, /* partial_inplace */ + 0x37fff, /* src_mask */ + 0x37fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_DUMMY1 */ + HOWTO (R_SCORE_DUMMY1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_DUMMY1", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /*R_SCORE_24 */ + HOWTO (R_SCORE_24, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_24", /* name */ + FALSE, /* partial_inplace */ + 0x3ff7fff, /* src_mask */ + 0x3ff7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /*R_SCORE_PC19 */ + HOWTO (R_SCORE_PC19, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_PC19", /* name */ + FALSE, /* partial_inplace */ + 0x3ff03fe, /* src_mask */ + 0x3ff03fe, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /*R_SCORE16_11 */ + HOWTO (R_SCORE16_11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE16_11", /* name */ + FALSE, /* partial_inplace */ + 0x000000ffe, /* src_mask */ + 0x000000ffe, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE16_PC8 */ + HOWTO (R_SCORE16_PC8, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE16_PC8", /* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit absolute */ + HOWTO (R_SCORE_ABS32, /* type 8 */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_ABS32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 16 bit absolute */ + HOWTO (R_SCORE_ABS16, /* type 11 */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_ABS16", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_DUMMY2 */ + HOWTO (R_SCORE_DUMMY2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_DUMMY2", /* name */ + TRUE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_GP15 */ + HOWTO (R_SCORE_GP15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_gprel15_reloc,/* special_function */ + "R_SCORE_GP15", /* name */ + TRUE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_SCORE_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + NULL, /* special_function */ + "R_SCORE_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_SCORE_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_SCORE_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Reference to global offset table. */ + HOWTO (R_SCORE_GOT15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + score_elf_got15_reloc, /* special_function */ + "R_SCORE_GOT15", /* name */ + TRUE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Low 16 bits of displacement in global offset table. */ + HOWTO (R_SCORE_GOT_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_got_lo16_reloc, /* special_function */ + "R_SCORE_GOT_LO16", /* name */ + TRUE, /* partial_inplace */ + 0x37ffe, /* src_mask */ + 0x37ffe, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 15 bit call through global offset table. */ + HOWTO (R_SCORE_CALL15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_CALL15", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit GP relative reference. */ + HOWTO (R_SCORE_GPREL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_gprel32_reloc, /* special_function */ + "R_SCORE_GPREL32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit symbol relative relocation. */ + HOWTO (R_SCORE_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SCORE_REL32", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* R_SCORE_DUMMY_HI16 */ + HOWTO (R_SCORE_DUMMY_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 1, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + score_elf_hi16_reloc, /* special_function */ + "R_SCORE_DUMMY_HI16", /* name */ + TRUE, /* partial_inplace */ + 0x37fff, /* src_mask */ + 0x37fff, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; + +struct score_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; +}; + +static const struct score_reloc_map elf32_score_reloc_map[] = +{ + {BFD_RELOC_NONE, R_SCORE_NONE}, + {BFD_RELOC_HI16_S, R_SCORE_HI16}, + {BFD_RELOC_LO16, R_SCORE_LO16}, + {BFD_RELOC_SCORE_DUMMY1, R_SCORE_DUMMY1}, + {BFD_RELOC_SCORE_JMP, R_SCORE_24}, + {BFD_RELOC_SCORE_BRANCH, R_SCORE_PC19}, + {BFD_RELOC_SCORE16_JMP, R_SCORE16_11}, + {BFD_RELOC_SCORE16_BRANCH, R_SCORE16_PC8}, + {BFD_RELOC_32, R_SCORE_ABS32}, + {BFD_RELOC_16, R_SCORE_ABS16}, + {BFD_RELOC_SCORE_DUMMY2, R_SCORE_DUMMY2}, + {BFD_RELOC_SCORE_GPREL15, R_SCORE_GP15}, + {BFD_RELOC_VTABLE_INHERIT, R_SCORE_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_SCORE_GNU_VTENTRY}, + {BFD_RELOC_SCORE_GOT15, R_SCORE_GOT15}, + {BFD_RELOC_SCORE_GOT_LO16, R_SCORE_GOT_LO16}, + {BFD_RELOC_SCORE_CALL15, R_SCORE_CALL15}, + {BFD_RELOC_GPREL32, R_SCORE_GPREL32}, + {BFD_RELOC_32_PCREL, R_SCORE_REL32}, + {BFD_RELOC_SCORE_DUMMY_HI16, R_SCORE_DUMMY_HI16}, +}; + +/* got_entries only match if they're identical, except for gotidx, so + use all fields to compute the hash, and compare the appropriate + union members. */ + +static hashval_t +score_elf_got_entry_hash (const void *entry_) +{ + const struct score_got_entry *entry = (struct score_got_entry *)entry_; + + return entry->symndx + + (!entry->abfd ? entry->d.address : entry->abfd->id); +} + +static int +score_elf_got_entry_eq (const void *entry1, const void *entry2) +{ + const struct score_got_entry *e1 = (struct score_got_entry *)entry1; + const struct score_got_entry *e2 = (struct score_got_entry *)entry2; + + return e1->abfd == e2->abfd && e1->symndx == e2->symndx + && (! e1->abfd ? e1->d.address == e2->d.address + : e1->symndx >= 0 ? e1->d.addend == e2->d.addend + : e1->d.h == e2->d.h); +} + +/* If H needs a GOT entry, assign it the highest available dynamic + index. Otherwise, assign it the lowest available dynamic + index. */ + +static bfd_boolean +score_elf_sort_hash_table_f (struct score_elf_link_hash_entry *h, void *data) +{ + struct score_elf_hash_sort_data *hsd = data; + + if (h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + + /* Symbols without dynamic symbol table entries aren't interesting at all. */ + if (h->root.dynindx == -1) + return TRUE; + + /* Global symbols that need GOT entries that are not explicitly + referenced are marked with got offset 2. Those that are + referenced get a 1, and those that don't need GOT entries get + -1. */ + if (h->root.got.offset == 2) + { + if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx) + hsd->low = (struct elf_link_hash_entry *) h; + h->root.dynindx = hsd->max_unref_got_dynindx++; + } + else if (h->root.got.offset != 1) + h->root.dynindx = hsd->max_non_got_dynindx++; + else + { + h->root.dynindx = --hsd->min_got_dynindx; + hsd->low = (struct elf_link_hash_entry *) h; + } + + return TRUE; +} + +static asection * +score_elf_got_section (bfd *abfd, bfd_boolean maybe_excluded) +{ + asection *sgot = bfd_get_section_by_name (abfd, ".got"); + + if (sgot == NULL || (! maybe_excluded && (sgot->flags & SEC_EXCLUDE) != 0)) + return NULL; + return sgot; +} + +/* Returns the GOT information associated with the link indicated by + INFO. If SGOTP is non-NULL, it is filled in with the GOT section. */ + +static struct score_got_info * +score_elf_got_info (bfd *abfd, asection **sgotp) +{ + asection *sgot; + struct score_got_info *g; + + sgot = score_elf_got_section (abfd, TRUE); + BFD_ASSERT (sgot != NULL); + BFD_ASSERT (elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + + if (sgotp) + *sgotp = sgot; + return g; +} + +/* Sort the dynamic symbol table so that symbols that need GOT entries + appear towards the end. This reduces the amount of GOT space + required. MAX_LOCAL is used to set the number of local symbols + known to be in the dynamic symbol table. During + _bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the + section symbols are added and the count is higher. */ + +static bfd_boolean +score_elf_sort_hash_table (struct bfd_link_info *info, + unsigned long max_local) +{ + struct score_elf_hash_sort_data hsd; + struct score_got_info *g; + bfd *dynobj; + + dynobj = elf_hash_table (info)->dynobj; + + g = score_elf_got_info (dynobj, NULL); + + hsd.low = NULL; + hsd.max_unref_got_dynindx = + hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount + /* In the multi-got case, assigned_gotno of the master got_info + indicate the number of entries that aren't referenced in the + primary GOT, but that must have entries because there are + dynamic relocations that reference it. Since they aren't + referenced, we move them to the end of the GOT, so that they + don't prevent other entries that are referenced from getting + too large offsets. */ + - (g->next ? g->assigned_gotno : 0); + hsd.max_non_got_dynindx = max_local; + score_elf_link_hash_traverse (((struct score_elf_link_hash_table *) + elf_hash_table (info)), + score_elf_sort_hash_table_f, + &hsd); + + /* There should have been enough room in the symbol table to + accommodate both the GOT and non-GOT symbols. */ + BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); + BFD_ASSERT ((unsigned long)hsd.max_unref_got_dynindx + <= elf_hash_table (info)->dynsymcount); + + /* Now we know which dynamic symbol has the lowest dynamic symbol + table index in the GOT. */ + g->global_gotsym = hsd.low; + + return TRUE; +} + +/* Create an entry in an score ELF linker hash table. */ + +static struct bfd_hash_entry * +score_elf_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + struct score_elf_link_hash_entry *ret = (struct score_elf_link_hash_entry *)entry; + + /* Allocate the structure if it has not already been allocated by a subclass. */ + if (ret == NULL) + ret = bfd_hash_allocate (table, sizeof (struct score_elf_link_hash_entry)); + if (ret == NULL) + return (struct bfd_hash_entry *)ret; + + /* Call the allocation method of the superclass. */ + ret = ((struct score_elf_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *)ret, table, string)); + + if (ret != NULL) + { + ret->possibly_dynamic_relocs = 0; + ret->readonly_reloc = FALSE; + ret->no_fn_stub = FALSE; + ret->forced_local = FALSE; + } + + return (struct bfd_hash_entry *)ret; +} + +/* Returns the first relocation of type r_type found, beginning with + RELOCATION. RELEND is one-past-the-end of the relocation table. */ + +static const Elf_Internal_Rela * +score_elf_next_relocation (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type, + const Elf_Internal_Rela *relocation, + const Elf_Internal_Rela *relend) +{ + while (relocation < relend) + { + if (ELF32_R_TYPE (relocation->r_info) == r_type) + return relocation; + + ++relocation; + } + + /* We didn't find it. */ + bfd_set_error (bfd_error_bad_value); + return NULL; +} + +/* This function is called via qsort() to sort the dynamic relocation + entries by increasing r_symndx value. */ + +static int +score_elf_sort_dynamic_relocs (const void *arg1, const void *arg2) +{ + Elf_Internal_Rela int_reloc1; + Elf_Internal_Rela int_reloc2; + + bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg1, &int_reloc1); + bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg2, &int_reloc2); + + return (ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info)); +} + +/* Return whether a relocation is against a local symbol. */ + +static bfd_boolean +score_elf_local_relocation_p (bfd *input_bfd, + const Elf_Internal_Rela *relocation, + asection **local_sections, + bfd_boolean check_forced) +{ + unsigned long r_symndx; + Elf_Internal_Shdr *symtab_hdr; + struct score_elf_link_hash_entry *h; + size_t extsymoff; + + r_symndx = ELF32_R_SYM (relocation->r_info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info; + + if (r_symndx < extsymoff) + return TRUE; + if (elf_bad_symtab (input_bfd) && local_sections[r_symndx] != NULL) + return TRUE; + + if (check_forced) + { + /* Look up the hash table to check whether the symbol was forced local. */ + h = (struct score_elf_link_hash_entry *) + elf_sym_hashes (input_bfd) [r_symndx - extsymoff]; + /* Find the real hash-table entry for this symbol. */ + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + if (h->root.forced_local) + return TRUE; + } + + return FALSE; +} + +/* Returns the dynamic relocation section for DYNOBJ. */ + +static asection * +score_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p) +{ + static const char dname[] = ".rel.dyn"; + asection *sreloc; + + sreloc = bfd_get_section_by_name (dynobj, dname); + if (sreloc == NULL && create_p) + { + sreloc = bfd_make_section_with_flags (dynobj, dname, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)); + if (sreloc == NULL + || ! bfd_set_section_alignment (dynobj, sreloc, + SCORE_ELF_LOG_FILE_ALIGN (dynobj))) + return NULL; + } + return sreloc; +} + +static void +score_elf_allocate_dynamic_relocations (bfd *abfd, unsigned int n) +{ + asection *s; + + s = score_elf_rel_dyn_section (abfd, FALSE); + BFD_ASSERT (s != NULL); + + if (s->size == 0) + { + /* Make room for a null element. */ + s->size += SCORE_ELF_REL_SIZE (abfd); + ++s->reloc_count; + } + s->size += n * SCORE_ELF_REL_SIZE (abfd); +} + +/* Create a rel.dyn relocation for the dynamic linker to resolve. REL + is the original relocation, which is now being transformed into a + dynamic relocation. The ADDENDP is adjusted if necessary; the + caller should store the result in place of the original addend. */ + +static bfd_boolean +score_elf_create_dynamic_relocation (bfd *output_bfd, + struct bfd_link_info *info, + const Elf_Internal_Rela *rel, + struct score_elf_link_hash_entry *h, + bfd_vma symbol, + bfd_vma *addendp, asection *input_section) +{ + Elf_Internal_Rela outrel[3]; + asection *sreloc; + bfd *dynobj; + int r_type; + long indx; + bfd_boolean defined_p; + + r_type = ELF32_R_TYPE (rel->r_info); + dynobj = elf_hash_table (info)->dynobj; + sreloc = score_elf_rel_dyn_section (dynobj, FALSE); + BFD_ASSERT (sreloc != NULL); + BFD_ASSERT (sreloc->contents != NULL); + BFD_ASSERT (sreloc->reloc_count * SCORE_ELF_REL_SIZE (output_bfd) < sreloc->size); + + outrel[0].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[0].r_offset); + outrel[1].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); + outrel[2].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + + if (outrel[0].r_offset == MINUS_ONE) + /* The relocation field has been deleted. */ + return TRUE; + + if (outrel[0].r_offset == MINUS_TWO) + { + /* The relocation field has been converted into a relative value of + some sort. Functions like _bfd_elf_write_section_eh_frame expect + the field to be fully relocated, so add in the symbol's value. */ + *addendp += symbol; + return TRUE; + } + + /* We must now calculate the dynamic symbol table index to use + in the relocation. */ + if (h != NULL + && (! info->symbolic || !h->root.def_regular) + /* h->root.dynindx may be -1 if this symbol was marked to + become local. */ + && h->root.dynindx != -1) + { + indx = h->root.dynindx; + /* ??? glibc's ld.so just adds the final GOT entry to the + relocation field. It therefore treats relocs against + defined symbols in the same way as relocs against + undefined symbols. */ + defined_p = FALSE; + } + else + { + indx = 0; + defined_p = TRUE; + } + + /* If the relocation was previously an absolute relocation and + this symbol will not be referred to by the relocation, we must + adjust it by the value we give it in the dynamic symbol table. + Otherwise leave the job up to the dynamic linker. */ + if (defined_p && r_type != R_SCORE_REL32) + *addendp += symbol; + + /* The relocation is always an REL32 relocation because we don't + know where the shared library will wind up at load-time. */ + outrel[0].r_info = ELF32_R_INFO ((unsigned long) indx, R_SCORE_REL32); + + /* For strict adherence to the ABI specification, we should + generate a R_SCORE_64 relocation record by itself before the + _REL32/_64 record as well, such that the addend is read in as + a 64-bit value (REL32 is a 32-bit relocation, after all). + However, since none of the existing ELF64 SCORE dynamic + loaders seems to care, we don't waste space with these + artificial relocations. If this turns out to not be true, + score_elf_allocate_dynamic_relocations() should be tweaked so + as to make room for a pair of dynamic relocations per + invocation if ABI_64_P, and here we should generate an + additional relocation record with R_SCORE_64 by itself for a + NULL symbol before this relocation record. */ + outrel[1].r_info = ELF32_R_INFO (0, R_SCORE_NONE); + outrel[2].r_info = ELF32_R_INFO (0, R_SCORE_NONE); + + /* Adjust the output offset of the relocation to reference the + correct location in the output file. */ + outrel[0].r_offset += (input_section->output_section->vma + + input_section->output_offset); + outrel[1].r_offset += (input_section->output_section->vma + + input_section->output_offset); + outrel[2].r_offset += (input_section->output_section->vma + + input_section->output_offset); + + /* Put the relocation back out. We have to use the special + relocation outputter in the 64-bit case since the 64-bit + relocation format is non-standard. */ + bfd_elf32_swap_reloc_out + (output_bfd, &outrel[0], + (sreloc->contents + sreloc->reloc_count * sizeof (Elf32_External_Rel))); + + /* We've now added another relocation. */ + ++sreloc->reloc_count; + + /* Make sure the output section is writable. The dynamic linker + will be writing to it. */ + elf_section_data (input_section->output_section)->this_hdr.sh_flags |= SHF_WRITE; + + return TRUE; +} + +static bfd_boolean +score_elf_create_got_section (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean maybe_exclude) +{ + flagword flags; + asection *s; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + struct score_got_info *g; + bfd_size_type amt; + + /* This function may be called more than once. */ + s = score_elf_got_section (abfd, TRUE); + if (s) + { + if (! maybe_exclude) + s->flags &= ~SEC_EXCLUDE; + return TRUE; + } + + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + + if (maybe_exclude) + flags |= SEC_EXCLUDE; + + /* We have to use an alignment of 2**4 here because this is hardcoded + in the function stub generation and in the linker script. */ + s = bfd_make_section_with_flags (abfd, ".got", flags); + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, 4)) + return FALSE; + + /* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the + linker script because we don't want to define the symbol if we + are not creating a global offset table. */ + bh = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, + 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + + h = (struct elf_link_hash_entry *) bh; + h->non_elf = 0; + h->def_regular = 1; + h->type = STT_OBJECT; + + if (info->shared && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + amt = sizeof (struct score_got_info); + g = bfd_alloc (abfd, amt); + if (g == NULL) + return FALSE; + + g->global_gotsym = NULL; + g->global_gotno = 0; + + g->local_gotno = SCORE_RESERVED_GOTNO; + g->assigned_gotno = SCORE_RESERVED_GOTNO; + g->next = NULL; + + g->got_entries = htab_try_create (1, score_elf_got_entry_hash, + score_elf_got_entry_eq, NULL); + if (g->got_entries == NULL) + return FALSE; + score_elf_section_data (s)->u.got_info = g; + score_elf_section_data (s)->elf.this_hdr.sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL; + + return TRUE; +} + +/* Calculate the %high function. */ + +static bfd_vma +score_elf_high (bfd_vma value) +{ + return ((value + (bfd_vma) 0x8000) >> 16) & 0xffff; +} + +/* Create a local GOT entry for VALUE. Return the index of the entry, + or -1 if it could not be created. */ + +static struct score_got_entry * +score_elf_create_local_got_entry (bfd *abfd, + bfd *ibfd ATTRIBUTE_UNUSED, + struct score_got_info *gg, + asection *sgot, bfd_vma value, + unsigned long r_symndx ATTRIBUTE_UNUSED, + struct score_elf_link_hash_entry *h ATTRIBUTE_UNUSED, + int r_type ATTRIBUTE_UNUSED) +{ + struct score_got_entry entry, **loc; + struct score_got_info *g; + + entry.abfd = NULL; + entry.symndx = -1; + entry.d.address = value; + + g = gg; + loc = (struct score_got_entry **) htab_find_slot (g->got_entries, &entry, INSERT); + if (*loc) + return *loc; + + entry.gotidx = SCORE_ELF_GOT_SIZE (abfd) * g->assigned_gotno++; + + *loc = bfd_alloc (abfd, sizeof entry); + + if (! *loc) + return NULL; + + memcpy (*loc, &entry, sizeof entry); + + if (g->assigned_gotno >= g->local_gotno) + { + (*loc)->gotidx = -1; + /* We didn't allocate enough space in the GOT. */ + (*_bfd_error_handler) + (_("not enough GOT space for local GOT entries")); + bfd_set_error (bfd_error_bad_value); + return NULL; + } + + bfd_put_32 (abfd, value, (sgot->contents + entry.gotidx)); + + return *loc; +} + +/* Find a GOT entry whose higher-order 16 bits are the same as those + for value. Return the index into the GOT for this entry. */ + +static bfd_vma +score_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, + bfd_vma value, bfd_boolean external) +{ + asection *sgot; + struct score_got_info *g; + struct score_got_entry *entry; + + if (!external) + { + /* Although the ABI says that it is "the high-order 16 bits" that we + want, it is really the %high value. The complete value is + calculated with a `addiu' of a LO16 relocation, just as with a + HI16/LO16 pair. */ + value = score_elf_high (value) << 16; + } + + g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot); + + entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, 0, NULL, + R_SCORE_GOT15); + if (entry) + return entry->gotidx; + else + return MINUS_ONE; +} + +static void +_bfd_score_elf_hide_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *entry, + bfd_boolean force_local) +{ + bfd *dynobj; + asection *got; + struct score_got_info *g; + struct score_elf_link_hash_entry *h; + + h = (struct score_elf_link_hash_entry *) entry; + if (h->forced_local) + return; + h->forced_local = TRUE; + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj != NULL && force_local) + { + got = score_elf_got_section (dynobj, FALSE); + if (got == NULL) + return; + g = score_elf_section_data (got)->u.got_info; + + if (g->next) + { + struct score_got_entry e; + struct score_got_info *gg = g; + + /* Since we're turning what used to be a global symbol into a + local one, bump up the number of local entries of each GOT + that had an entry for it. This will automatically decrease + the number of global entries, since global_gotno is actually + the upper limit of global entries. */ + e.abfd = dynobj; + e.symndx = -1; + e.d.h = h; + + for (g = g->next; g != gg; g = g->next) + if (htab_find (g->got_entries, &e)) + { + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } + + /* If this was a global symbol forced into the primary GOT, we + no longer need an entry for it. We can't release the entry + at this point, but we must at least stop counting it as one + of the symbols that required a forced got entry. */ + if (h->root.got.offset == 2) + { + BFD_ASSERT (gg->assigned_gotno > 0); + gg->assigned_gotno--; + } + } + else if (g->global_gotno == 0 && g->global_gotsym == NULL) + /* If we haven't got through GOT allocation yet, just bump up the + number of local entries, as this symbol won't be counted as + global. */ + g->local_gotno++; + else if (h->root.got.offset == 1) + { + /* If we're past non-multi-GOT allocation and this symbol had + been marked for a global got entry, give it a local entry + instead. */ + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } + } + + _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); +} + +/* If H is a symbol that needs a global GOT entry, but has a dynamic + symbol table index lower than any we've seen to date, record it for + posterity. */ + +static bfd_boolean +score_elf_record_global_got_symbol (struct elf_link_hash_entry *h, + bfd *abfd, + struct bfd_link_info *info, + struct score_got_info *g) +{ + struct score_got_entry entry, **loc; + + /* A global symbol in the GOT must also be in the dynamic symbol table. */ + if (h->dynindx == -1) + { + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + _bfd_score_elf_hide_symbol (info, h, TRUE); + break; + } + if (!bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + entry.abfd = abfd; + entry.symndx = -1; + entry.d.h = (struct score_elf_link_hash_entry *)h; + + loc = (struct score_got_entry **)htab_find_slot (g->got_entries, &entry, INSERT); + + /* If we've already marked this entry as needing GOT space, we don't + need to do it again. */ + if (*loc) + return TRUE; + + *loc = bfd_alloc (abfd, sizeof entry); + if (! *loc) + return FALSE; + + entry.gotidx = -1; + + memcpy (*loc, &entry, sizeof (entry)); + + if (h->got.offset != MINUS_ONE) + return TRUE; + + /* By setting this to a value other than -1, we are indicating that + there needs to be a GOT entry for H. Avoid using zero, as the + generic ELF copy_indirect_symbol tests for <= 0. */ + h->got.offset = 1; + + return TRUE; +} + +/* Reserve space in G for a GOT entry containing the value of symbol + SYMNDX in input bfd ABDF, plus ADDEND. */ + +static bfd_boolean +score_elf_record_local_got_symbol (bfd *abfd, + long symndx, + bfd_vma addend, + struct score_got_info *g) +{ + struct score_got_entry entry, **loc; + + entry.abfd = abfd; + entry.symndx = symndx; + entry.d.addend = addend; + loc = (struct score_got_entry **)htab_find_slot (g->got_entries, &entry, INSERT); + + if (*loc) + return TRUE; + + entry.gotidx = g->local_gotno++; + + *loc = bfd_alloc (abfd, sizeof(entry)); + if (! *loc) + return FALSE; + + memcpy (*loc, &entry, sizeof (entry)); + + return TRUE; +} + +/* Returns the GOT offset at which the indicated address can be found. + If there is not yet a GOT entry for this value, create one. + Returns -1 if no satisfactory GOT offset can be found. */ + +static bfd_vma +score_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, + bfd_vma value, unsigned long r_symndx, + struct score_elf_link_hash_entry *h, int r_type) +{ + asection *sgot; + struct score_got_info *g; + struct score_got_entry *entry; + + g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot); + + entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, + r_symndx, h, r_type); + if (!entry) + return MINUS_ONE; + + else + return entry->gotidx; +} + +/* Returns the GOT index for the global symbol indicated by H. */ + +static bfd_vma +score_elf_global_got_index (bfd *abfd, struct elf_link_hash_entry *h) +{ + bfd_vma index; + asection *sgot; + struct score_got_info *g; + long global_got_dynindx = 0; + + g = score_elf_got_info (abfd, &sgot); + if (g->global_gotsym != NULL) + global_got_dynindx = g->global_gotsym->dynindx; + + /* Once we determine the global GOT entry with the lowest dynamic + symbol table index, we must put all dynamic symbols with greater + indices into the GOT. That makes it easy to calculate the GOT + offset. */ + BFD_ASSERT (h->dynindx >= global_got_dynindx); + index = ((h->dynindx - global_got_dynindx + g->local_gotno) * SCORE_ELF_GOT_SIZE (abfd)); + BFD_ASSERT (index < sgot->size); + + return index; +} + +/* Returns the offset for the entry at the INDEXth position in the GOT. */ + +static bfd_vma +score_elf_got_offset_from_index (bfd *dynobj, bfd *output_bfd, + bfd *input_bfd ATTRIBUTE_UNUSED, bfd_vma index) +{ + asection *sgot; + bfd_vma gp; + struct score_got_info *g; + + g = score_elf_got_info (dynobj, &sgot); + gp = _bfd_get_gp_value (output_bfd); + + return sgot->output_section->vma + sgot->output_offset + index - gp; +} + +/* Follow indirect and warning hash entries so that each got entry + points to the final symbol definition. P must point to a pointer + to the hash table we're traversing. Since this traversal may + modify the hash table, we set this pointer to NULL to indicate + we've made a potentially-destructive change to the hash table, so + the traversal must be restarted. */ +static int +score_elf_resolve_final_got_entry (void **entryp, void *p) +{ + struct score_got_entry *entry = (struct score_got_entry *)*entryp; + htab_t got_entries = *(htab_t *)p; + + if (entry->abfd != NULL && entry->symndx == -1) + { + struct score_elf_link_hash_entry *h = entry->d.h; + + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + + if (entry->d.h == h) + return 1; + + entry->d.h = h; + + /* If we can't find this entry with the new bfd hash, re-insert + it, and get the traversal restarted. */ + if (! htab_find (got_entries, entry)) + { + htab_clear_slot (got_entries, entryp); + entryp = htab_find_slot (got_entries, entry, INSERT); + if (! *entryp) + *entryp = entry; + /* Abort the traversal, since the whole table may have + moved, and leave it up to the parent to restart the + process. */ + *(htab_t *)p = NULL; + return 0; + } + /* We might want to decrement the global_gotno count, but it's + either too early or too late for that at this point. */ + } + + return 1; +} + +/* Turn indirect got entries in a got_entries table into their final locations. */ +static void +score_elf_resolve_final_got_entries (struct score_got_info *g) +{ + htab_t got_entries; + + do + { + got_entries = g->got_entries; + + htab_traverse (got_entries, + score_elf_resolve_final_got_entry, + &got_entries); + } + while (got_entries == NULL); +} + +/* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. for -r */ + +static void +score_elf_add_to_rel (bfd *abfd, + bfd_byte *address, + reloc_howto_type *howto, + bfd_signed_vma increment) +{ + bfd_signed_vma addend; + bfd_vma contents; + unsigned long offset; + unsigned long r_type = howto->type; + unsigned long hi16_addend, hi16_offset, hi16_value, uvalue; + + contents = bfd_get_32 (abfd, address); + /* Get the (signed) value from the instruction. */ + addend = contents & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~howto->src_mask; + addend |= mask; + } + /* Add in the increment, (which is a byte value). */ + switch (r_type) + { + case R_SCORE_PC19: + offset = + (((contents & howto->src_mask) & 0x3ff0000) >> 6) | ((contents & howto->src_mask) & 0x3ff); + offset += increment; + contents = + (contents & ~howto-> + src_mask) | (((offset << 6) & howto->src_mask) & 0x3ff0000) | (offset & 0x3ff); + bfd_put_32 (abfd, contents, address); + break; + case R_SCORE_HI16: + break; + case R_SCORE_LO16: + hi16_addend = bfd_get_32 (abfd, address - 4); + hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1; + offset = ((((contents >> 16) & 0x3) << 15) | (contents & 0x7fff)) >> 1; + offset = (hi16_offset << 16) | (offset & 0xffff); + uvalue = increment + offset; + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_addend & (~(howto->dst_mask))) + | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (abfd, hi16_value, address - 4); + offset = (uvalue & 0xffff) << 1; + contents = (contents & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (abfd, contents, address); + break; + case R_SCORE_24: + offset = + (((contents & howto->src_mask) >> 1) & 0x1ff8000) | ((contents & howto->src_mask) & 0x7fff); + offset += increment; + contents = + (contents & ~howto-> + src_mask) | (((offset << 1) & howto->src_mask) & 0x3ff0000) | (offset & 0x7fff); + bfd_put_32 (abfd, contents, address); + break; + case R_SCORE16_11: + + contents = bfd_get_16 (abfd, address); + offset = contents & howto->src_mask; + offset += increment; + contents = (contents & ~howto->src_mask) | (offset & howto->src_mask); + bfd_put_16 (abfd, contents, address); + + break; + case R_SCORE16_PC8: + + contents = bfd_get_16 (abfd, address); + offset = (contents & howto->src_mask) + ((increment >> 1) & 0xff); + contents = (contents & (~howto->src_mask)) | (offset & howto->src_mask); + bfd_put_16 (abfd, contents, address); + + break; + default: + addend += increment; + contents = (contents & ~howto->dst_mask) | (addend & howto->dst_mask); + bfd_put_32 (abfd, contents, address); + break; + } +} + +/* Perform a relocation as part of a final link. */ + +static bfd_reloc_status_type +score_elf_final_link_relocate (reloc_howto_type *howto, + bfd *input_bfd, + bfd *output_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *rel, + Elf_Internal_Rela *relocs, + bfd_vma symbol, + struct bfd_link_info *info, + const char *sym_name ATTRIBUTE_UNUSED, + int sym_flags ATTRIBUTE_UNUSED, + struct score_elf_link_hash_entry *h, + asection **local_sections, + bfd_boolean gp_disp_p) +{ + unsigned long r_type; + unsigned long r_symndx; + bfd_byte *hit_data = contents + rel->r_offset; + bfd_vma addend; + /* The final GP value to be used for the relocatable, executable, or + shared object file being produced. */ + bfd_vma gp = MINUS_ONE; + /* The place (section offset or address) of the storage unit being relocated. */ + bfd_vma rel_addr; + /* The value of GP used to create the relocatable object. */ + bfd_vma gp0 = MINUS_ONE; + /* The offset into the global offset table at which the address of the relocation entry + symbol, adjusted by the addend, resides during execution. */ + bfd_vma g = MINUS_ONE; + /* TRUE if the symbol referred to by this relocation is a local symbol. */ + bfd_boolean local_p; + /* The eventual value we will relocate. */ + bfd_vma value = symbol; + unsigned long hi16_addend, hi16_offset, hi16_value, uvalue, offset, abs_value = 0; + + if (elf_gp (output_bfd) == 0) + { + struct bfd_link_hash_entry *bh; + asection *o; + + bh = bfd_link_hash_lookup (info->hash, "_gp", 0, 0, 1); + if (bh != (struct bfd_link_hash_entry *)NULL && bh->type == bfd_link_hash_defined) + elf_gp (output_bfd) = (bh->u.def.value + + bh->u.def.section->output_section->vma + + bh->u.def.section->output_offset); + else if (info->relocatable) + { + bfd_vma lo = -1; + + /* Find the GP-relative section with the lowest offset. */ + for (o = output_bfd->sections; o != (asection *) NULL; o = o->next) + if (o->vma < lo) + lo = o->vma; + /* And calculate GP relative to that. */ + elf_gp (output_bfd) = lo + ELF_SCORE_GP_OFFSET (input_bfd); + } + else + { + /* If the relocate_section function needs to do a reloc + involving the GP value, it should make a reloc_dangerous + callback to warn that GP is not defined. */ + } + } + + /* Parse the relocation. */ + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + rel_addr = (input_section->output_section->vma + input_section->output_offset + rel->r_offset); + local_p = score_elf_local_relocation_p (input_bfd, rel, local_sections, TRUE); + + if (r_type == R_SCORE_GOT15) + { + const Elf_Internal_Rela *relend; + const Elf_Internal_Rela *lo16_rel; + const struct elf_backend_data *bed; + bfd_vma lo_value = 0; + + bed = get_elf_backend_data (output_bfd); + relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel; + lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend); + if ((local_p) && (lo16_rel != NULL)) + { + bfd_vma tmp = 0; + tmp = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset); + lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1); + } + addend = lo_value; + } + else + { + addend = (bfd_get_32 (input_bfd, hit_data) >> howto->bitpos) & howto->src_mask; + } + + /* If we haven't already determined the GOT offset, or the GP value, + and we're going to need it, get it now. */ + switch (r_type) + { + case R_SCORE_CALL15: + case R_SCORE_GOT15: + if (!local_p) + { + g = score_elf_global_got_index (elf_hash_table (info)->dynobj, + (struct elf_link_hash_entry *) h); + if ((! elf_hash_table(info)->dynamic_sections_created + || (info->shared + && (info->symbolic || h->root.dynindx == -1) + && h->root.def_regular))) + { + /* This is a static link or a -Bsymbolic link. The + symbol is defined locally, or was forced to be local. + We must initialize this entry in the GOT. */ + bfd *tmpbfd = elf_hash_table (info)->dynobj; + asection *sgot = score_elf_got_section (tmpbfd, FALSE); + bfd_put_32 (tmpbfd, value, sgot->contents + g); + } + } + else if (r_type == R_SCORE_GOT15 || r_type == R_SCORE_CALL15) + { + /* There's no need to create a local GOT entry here; the + calculation for a local GOT15 entry does not involve G. */ + ; + } + else + { + g = score_elf_local_got_index (output_bfd, input_bfd, info, + symbol + addend, r_symndx, h, r_type); + if (g == MINUS_ONE) + return bfd_reloc_outofrange; + } + + /* Convert GOT indices to actual offsets. */ + g = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj, + output_bfd, input_bfd, g); + break; + + case R_SCORE_HI16: + case R_SCORE_LO16: + case R_SCORE_GPREL32: + gp0 = _bfd_get_gp_value (input_bfd); + gp = _bfd_get_gp_value (output_bfd); + break; + + case R_SCORE_GP15: + gp = _bfd_get_gp_value (output_bfd); + + default: + break; + } + + switch (r_type) + { + case R_SCORE_NONE: + return bfd_reloc_ok; + + case R_SCORE_ABS32: + case R_SCORE_REL32: + if ((info->shared + || (elf_hash_table (info)->dynamic_sections_created + && h != NULL + && h->root.def_dynamic + && !h->root.def_regular)) + && r_symndx != 0 + && (input_section->flags & SEC_ALLOC) != 0) + { + /* If we're creating a shared library, or this relocation is against a symbol + in a shared library, then we can't know where the symbol will end up. + So, we create a relocation record in the output, and leave the job up + to the dynamic linker. */ + value = addend; + if (!score_elf_create_dynamic_relocation (output_bfd, info, rel, h, + symbol, &value, + input_section)) + return bfd_reloc_undefined; + } + else + { + if (r_type != R_SCORE_REL32) + value = symbol + addend; + else + value = addend; + } + value &= howto->dst_mask; + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_ABS16: + value += addend; + if ((long)value > 0x7fff || (long)value < -0x8000) + return bfd_reloc_overflow; + bfd_put_16 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_24: + addend = bfd_get_32 (input_bfd, hit_data); + offset = (((addend & howto->src_mask) >> 1) & 0x1ff8000) | ((addend & howto->src_mask) & 0x7fff); + if ((offset & 0x1000000) != 0) + offset |= 0xfe000000; + value += offset; + addend = (addend & ~howto->src_mask) + | (((value << 1) & howto->src_mask) & 0x3ff0000) | (value & 0x7fff); + bfd_put_32 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE_PC19: + addend = bfd_get_32 (input_bfd, hit_data); + offset = (((addend & howto->src_mask) & 0x3ff0000) >> 6) | ((addend & howto->src_mask) & 0x3ff); + if ((offset & 0x80000) != 0) + offset |= 0xfff00000; + abs_value = value = value - rel_addr + offset; + /* exceed 20 bit : overflow. */ + if ((abs_value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xfff80000) != 0) + return bfd_reloc_overflow; + addend = (addend & ~howto->src_mask) + | (((value << 6) & howto->src_mask) & 0x3ff0000) | (value & 0x3ff); + bfd_put_32 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE16_11: + addend = bfd_get_16 (input_bfd, hit_data); + offset = addend & howto->src_mask; + if ((offset & 0x800) != 0) /* Offset is negative. */ + offset |= 0xfffff000; + value += offset; + addend = (addend & ~howto->src_mask) | (value & howto->src_mask); + bfd_put_16 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE16_PC8: + addend = bfd_get_16 (input_bfd, hit_data); + offset = (addend & howto->src_mask) << 1; + if ((offset & 0x100) != 0) /* Offset is negative. */ + offset |= 0xfffffe00; + abs_value = value = value - rel_addr + offset; + /* Sign bit + exceed 9 bit. */ + if (((value & 0xffffff00) != 0) && ((value & 0xffffff00) != 0xffffff00)) + return bfd_reloc_overflow; + value >>= 1; + addend = (addend & ~howto->src_mask) | (value & howto->src_mask); + bfd_put_16 (input_bfd, addend, hit_data); + return bfd_reloc_ok; + + case R_SCORE_HI16: + return bfd_reloc_ok; + + case R_SCORE_LO16: + hi16_addend = bfd_get_32 (input_bfd, hit_data - 4); + hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1; + addend = bfd_get_32 (input_bfd, hit_data); + offset = ((((addend >> 16) & 0x3) << 15) | (addend & 0x7fff)) >> 1; + offset = (hi16_offset << 16) | (offset & 0xffff); + + if (!gp_disp_p) + uvalue = value + offset; + else + uvalue = offset + gp - rel_addr + 4; + + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_addend & (~(howto->dst_mask))) + | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (input_bfd, hi16_value, hit_data - 4); + offset = (uvalue & 0xffff) << 1; + value = (addend & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GP15: + addend = bfd_get_32 (input_bfd, hit_data); + offset = addend & 0x7fff; + if ((offset & 0x4000) == 0x4000) + offset |= 0xffffc000; + value = value + offset - gp; + if (((value & 0xffffc000) != 0) && ((value & 0xffffc000) != 0xffffc000)) + return bfd_reloc_overflow; + value = (addend & ~howto->src_mask) | (value & howto->src_mask); + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GOT15: + case R_SCORE_CALL15: + if (local_p) + { + bfd_boolean forced; + + /* The special case is when the symbol is forced to be local. We need the + full address in the GOT since no R_SCORE_GOT_LO16 relocation follows. */ + forced = ! score_elf_local_relocation_p (input_bfd, rel, + local_sections, FALSE); + value = score_elf_got16_entry (output_bfd, input_bfd, info, + symbol + addend, forced); + if (value == MINUS_ONE) + return bfd_reloc_outofrange; + value = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj, + output_bfd, input_bfd, value); + } + else + { + value = g; + } + + if ((long) value > 0x3fff || (long) value < -0x4000) + return bfd_reloc_overflow; + + addend = bfd_get_32 (input_bfd, hit_data); + value = (addend & ~howto->dst_mask) | (value & howto->dst_mask); + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GPREL32: + value = (addend + symbol - gp); + value &= howto->dst_mask; + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_GOT_LO16: + addend = bfd_get_32 (input_bfd, hit_data); + value = (((addend >> 16) & 0x3) << 14) | ((addend & 0x7fff) >> 1); + value += symbol; + value = (addend & (~(howto->dst_mask))) | ((value & 0x3fff) << 1) + | (((value >> 14) & 0x3) << 16); + + bfd_put_32 (input_bfd, value, hit_data); + return bfd_reloc_ok; + + case R_SCORE_DUMMY_HI16: + return bfd_reloc_ok; + + case R_SCORE_GNU_VTINHERIT: + case R_SCORE_GNU_VTENTRY: + /* We don't do anything with these at present. */ + return bfd_reloc_continue; + + default: + return bfd_reloc_notsupported; + } +} + +/* Score backend functions. */ + +static void +_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *bfd_reloc, + Elf_Internal_Rela *elf_reloc) +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (elf_reloc->r_info); + if (r_type >= NUM_ELEM (elf32_score_howto_table)) + bfd_reloc->howto = NULL; + else + bfd_reloc->howto = &elf32_score_howto_table[r_type]; +} + +/* Relocate an score ELF section. */ + +static bfd_boolean +_bfd_score_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + const char *name; + unsigned long offset; + unsigned long hi16_addend, hi16_offset, hi16_value, uvalue; + size_t extsymoff; + bfd_boolean gp_disp_p = FALSE; + + /* Sort dynsym. */ + if (elf_hash_table (info)->dynamic_sections_created) + { + bfd_size_type dynsecsymcount = 0; + if (info->shared) + { + asection * p; + const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + + for (p = output_bfd->sections; p ; p = p->next) + if ((p->flags & SEC_EXCLUDE) == 0 + && (p->flags & SEC_ALLOC) != 0 + && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p)) + ++ dynsecsymcount; + } + + if (!score_elf_sort_hash_table (info, dynsecsymcount + 1)) + return FALSE; + } + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info; + sym_hashes = elf_sym_hashes (input_bfd); + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct score_elf_link_hash_entry *h; + bfd_vma relocation = 0; + bfd_reloc_status_type r; + arelent bfd_reloc; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + _bfd_score_info_to_howto (input_bfd, &bfd_reloc, (Elf_Internal_Rela *) rel); + howto = bfd_reloc.howto; + + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < extsymoff) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec); + + if (!info->relocatable + && (sec->flags & SEC_MERGE) != 0 + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + asection *msec; + bfd_vma addend, value; + + switch (r_type) + { + case R_SCORE_HI16: + break; + case R_SCORE_LO16: + hi16_addend = bfd_get_32 (input_bfd, contents + rel->r_offset - 4); + hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1; + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + offset = ((((value >> 16) & 0x3) << 15) | (value & 0x7fff)) >> 1; + addend = (hi16_offset << 16) | (offset & 0xffff); + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend); + addend -= relocation; + addend += msec->output_section->vma + msec->output_offset; + uvalue = addend; + hi16_offset = (uvalue >> 16) << 1; + hi16_value = (hi16_addend & (~(howto->dst_mask))) + | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000); + bfd_put_32 (input_bfd, hi16_value, contents + rel->r_offset - 4); + offset = (uvalue & 0xffff) << 1; + value = (value & (~(howto->dst_mask))) + | (offset & 0x7fff) | ((offset << 1) & 0x30000); + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + break; + case R_SCORE_GOT_LO16: + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + addend = (((value >> 16) & 0x3) << 14) | ((value & 0x7fff) >> 1); + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation; + addend += msec->output_section->vma + msec->output_offset; + value = (value & (~(howto->dst_mask))) | ((addend & 0x3fff) << 1) + | (((addend >> 14) & 0x3) << 16); + + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + break; + default: + value = bfd_get_32 (input_bfd, contents + rel->r_offset); + /* Get the (signed) value from the instruction. */ + addend = value & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~howto->src_mask; + addend |= mask; + } + msec = sec; + addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation; + addend += msec->output_section->vma + msec->output_offset; + value = (value & ~howto->dst_mask) | (addend & howto->dst_mask); + bfd_put_32 (input_bfd, value, contents + rel->r_offset); + break; + } + } + } + else + { + /* For global symbols we look up the symbol in the hash-table. */ + h = ((struct score_elf_link_hash_entry *) + elf_sym_hashes (input_bfd) [r_symndx - extsymoff]); + /* Find the real hash-table entry for this symbol. */ + while (h->root.root.type == bfd_link_hash_indirect + || h->root.root.type == bfd_link_hash_warning) + h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link; + + /* Record the name of this symbol, for our caller. */ + name = h->root.root.root.string; + + /* See if this is the special GP_DISP_LABEL symbol. Note that such a + symbol must always be a global symbol. */ + if (strcmp (name, GP_DISP_LABEL) == 0) + { + /* Relocations against GP_DISP_LABEL are permitted only with + R_SCORE_HI16 and R_SCORE_LO16 relocations. */ + if (r_type != R_SCORE_HI16 && r_type != R_SCORE_LO16) + return bfd_reloc_notsupported; + + gp_disp_p = TRUE; + } + + /* If this symbol is defined, calculate its address. Note that + GP_DISP_LABEL is a magic symbol, always implicitly defined by the + linker, so it's inappropriate to check to see whether or not + its defined. */ + else if ((h->root.root.type == bfd_link_hash_defined + || h->root.root.type == bfd_link_hash_defweak) + && h->root.root.u.def.section) + { + sec = h->root.root.u.def.section; + if (sec->output_section) + relocation = (h->root.root.u.def.value + + sec->output_section->vma + + sec->output_offset); + else + { + relocation = h->root.root.u.def.value; + } + } + else if (h->root.root.type == bfd_link_hash_undefweak) + /* We allow relocations against undefined weak symbols, giving + it the value zero, so that you can undefined weak functions + and check to see if they exist by looking at their addresses. */ + relocation = 0; + else if (info->unresolved_syms_in_objects == RM_IGNORE + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) + relocation = 0; + else if (strcmp (name, "_DYNAMIC_LINK") == 0) + { + /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol + in _bfd_score_elf_create_dynamic_sections. Otherwise, we should define + the symbol with a value of 0. */ + BFD_ASSERT (! info->shared); + BFD_ASSERT (bfd_get_section_by_name (output_bfd, ".dynamic") == NULL); + relocation = 0; + } + else if (!info->relocatable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.root.string, input_bfd, + input_section, rel->r_offset, + (info->unresolved_syms_in_objects == RM_GENERATE_ERROR) + || ELF_ST_VISIBILITY (h->root.other)))) + return bfd_reloc_undefined; + relocation = 0; + } + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + score_elf_add_to_rel (input_bfd, contents + rel->r_offset, + howto, (bfd_signed_vma) sec->output_offset); + continue; + } + + r = score_elf_final_link_relocate (howto, input_bfd, output_bfd, + input_section, contents, rel, relocs, + relocation, info, name, + (h ? ELF_ST_TYPE ((unsigned int)h->root.root.type) : + ELF_ST_TYPE ((unsigned int)sym->st_info)), h, local_sections, + gp_disp_p); + + if (r != bfd_reloc_ok) + { + const char *msg = (const char *)0; + + switch (r) + { + case bfd_reloc_overflow: + /* If the overflowing reloc was to an undefined symbol, + we have already printed one error message and there + is no point complaining again. */ + if (((!h) || (h->root.root.type != bfd_link_hash_undefined)) + && (!((*info->callbacks->reloc_overflow) + (info, NULL, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset)))) + return FALSE; + break; + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, rel->r_offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous error"); + goto common_error; + + default: + msg = _("internal error: unknown error"); + /* fall through */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, name, input_bfd, input_section, rel->r_offset))) + return FALSE; + break; + } + } + } + + return TRUE; +} + +/* Look through the relocs for a section during the first phase, and + allocate space in the global offset table. */ + +static bfd_boolean +_bfd_score_elf_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) +{ + const char *name; + bfd *dynobj; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + struct score_got_info *g; + size_t extsymoff; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + asection *sgot; + asection *sreloc; + const struct elf_backend_data *bed; + + if (info->relocatable) + return TRUE; + + dynobj = elf_hash_table (info)->dynobj; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info; + + name = bfd_get_section_name (abfd, sec); + + if (dynobj == NULL) + { + sgot = NULL; + g = NULL; + } + else + { + sgot = score_elf_got_section (dynobj, FALSE); + if (sgot == NULL) + g = NULL; + else + { + BFD_ASSERT (score_elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + } + } + + sreloc = NULL; + bed = get_elf_backend_data (abfd); + rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel; + for (rel = relocs; rel < rel_end; ++rel) + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_symndx < extsymoff) + { + h = NULL; + } + else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) + { + (*_bfd_error_handler) (_("%s: Malformed reloc detected for section %s"), abfd, name); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + else + { + h = sym_hashes[r_symndx - extsymoff]; + + /* This may be an indirect symbol created because of a version. */ + if (h != NULL) + { + while (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *)h->root.u.i.link; + } + } + + /* Some relocs require a global offset table. */ + if (dynobj == NULL || sgot == NULL) + { + switch (r_type) + { + case R_SCORE_GOT15: + case R_SCORE_CALL15: + if (dynobj == NULL) + elf_hash_table (info)->dynobj = dynobj = abfd; + if (!score_elf_create_got_section (dynobj, info, FALSE)) + return FALSE; + g = score_elf_got_info (dynobj, &sgot); + break; + case R_SCORE_ABS32: + case R_SCORE_REL32: + if (dynobj == NULL && (info->shared || h != NULL) && (sec->flags & SEC_ALLOC) != 0) + elf_hash_table (info)->dynobj = dynobj = abfd; + break; + default: + break; + } + } + + if (!h && (r_type == R_SCORE_GOT_LO16)) + { + if (! score_elf_record_local_got_symbol (abfd, r_symndx, rel->r_addend, g)) + return FALSE; + } + + switch (r_type) + { + case R_SCORE_CALL15: + if (h == NULL) + { + (*_bfd_error_handler) + (_("%B: CALL15 reloc at 0x%lx not against global symbol"), + abfd, (unsigned long) rel->r_offset); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + else + { + /* This symbol requires a global offset table entry. */ + if (! score_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + + /* We need a stub, not a plt entry for the undefined function. But we record + it as if it needs plt. See _bfd_elf_adjust_dynamic_symbol. */ + h->needs_plt = 1; + h->type = STT_FUNC; + } + break; + case R_SCORE_GOT15: + if (h && ! score_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + break; + case R_SCORE_ABS32: + case R_SCORE_REL32: + if ((info->shared || h != NULL) && (sec->flags & SEC_ALLOC) != 0) + { + if (sreloc == NULL) + { + sreloc = score_elf_rel_dyn_section (dynobj, TRUE); + if (sreloc == NULL) + return FALSE; + } +#define SCORE_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY) + if (info->shared) + { + /* When creating a shared object, we must copy these reloc types into + the output file as R_SCORE_REL32 relocs. We make room for this reloc + in the .rel.dyn reloc section. */ + score_elf_allocate_dynamic_relocations (dynobj, 1); + if ((sec->flags & SCORE_READONLY_SECTION) + == SCORE_READONLY_SECTION) + /* We tell the dynamic linker that there are + relocations against the text segment. */ + info->flags |= DF_TEXTREL; + } + else + { + struct score_elf_link_hash_entry *hscore; + + /* We only need to copy this reloc if the symbol is + defined in a dynamic object. */ + hscore = (struct score_elf_link_hash_entry *)h; + ++hscore->possibly_dynamic_relocs; + if ((sec->flags & SCORE_READONLY_SECTION) + == SCORE_READONLY_SECTION) + /* We need it to tell the dynamic linker if there + are relocations against the text segment. */ + hscore->readonly_reloc = TRUE; + } + + /* Even though we don't directly need a GOT entry for this symbol, + a symbol must have a dynamic symbol table index greater that + DT_SCORE_GOTSYM if there are dynamic relocations against it. */ + if (h != NULL) + { + if (dynobj == NULL) + elf_hash_table (info)->dynobj = dynobj = abfd; + if (! score_elf_create_got_section (dynobj, info, TRUE)) + return FALSE; + g = score_elf_got_info (dynobj, &sgot); + if (! score_elf_record_global_got_symbol (h, abfd, info, g)) + return FALSE; + } + } + break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_SCORE_GNU_VTINHERIT: + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return FALSE; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_SCORE_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) + return FALSE; + break; + default: + break; + } + + /* We must not create a stub for a symbol that has relocations + related to taking the function's address. */ + switch (r_type) + { + default: + if (h != NULL) + { + struct score_elf_link_hash_entry *sh; + + sh = (struct score_elf_link_hash_entry *) h; + sh->no_fn_stub = TRUE; + } + break; + case R_SCORE_CALL15: + break; + } + } + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_add_symbol_hook (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + const char **namep ATTRIBUTE_UNUSED, + flagword *flagsp ATTRIBUTE_UNUSED, + asection **secp, + bfd_vma *valp) +{ + switch (sym->st_shndx) + { + case SHN_COMMON: + if (sym->st_size > elf_gp_size (abfd)) + break; + /* Fall through. */ + case SHN_SCORE_SCOMMON: + *secp = bfd_make_section_old_way (abfd, ".scommon"); + (*secp)->flags |= SEC_IS_COMMON; + *valp = sym->st_size; + break; + } + + return TRUE; +} + +static void +_bfd_score_elf_symbol_processing (bfd *abfd, asymbol *asym) +{ + elf_symbol_type *elfsym; + + elfsym = (elf_symbol_type *) asym; + switch (elfsym->internal_elf_sym.st_shndx) + { + case SHN_COMMON: + if (asym->value > elf_gp_size (abfd)) + break; + /* Fall through. */ + case SHN_SCORE_SCOMMON: + if (score_elf_scom_section.name == NULL) + { + /* Initialize the small common section. */ + score_elf_scom_section.name = ".scommon"; + score_elf_scom_section.flags = SEC_IS_COMMON; + score_elf_scom_section.output_section = &score_elf_scom_section; + score_elf_scom_section.symbol = &score_elf_scom_symbol; + score_elf_scom_section.symbol_ptr_ptr = &score_elf_scom_symbol_ptr; + score_elf_scom_symbol.name = ".scommon"; + score_elf_scom_symbol.flags = BSF_SECTION_SYM; + score_elf_scom_symbol.section = &score_elf_scom_section; + score_elf_scom_symbol_ptr = &score_elf_scom_symbol; + } + asym->section = &score_elf_scom_section; + asym->value = elfsym->internal_elf_sym.st_size; + break; + } +} + +static bfd_boolean +_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + asection *input_sec, + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED) +{ + /* If we see a common symbol, which implies a relocatable link, then + if a symbol was small common in an input file, mark it as small + common in the output file. */ + if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0) + sym->st_shndx = SHN_SCORE_SCOMMON; + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec, + int *retval) +{ + if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0) + { + *retval = SHN_SCORE_SCOMMON; + return TRUE; + } + + return FALSE; +} + +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. The current definition is in some section of the + dynamic object, but we're not including those sections. We have to + change the definition to something the rest of the link can understand. */ + +static bfd_boolean +_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) +{ + bfd *dynobj; + struct score_elf_link_hash_entry *hscore; + asection *s; + + dynobj = elf_hash_table (info)->dynobj; + + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && (h->needs_plt + || h->u.weakdef != NULL + || (h->def_dynamic && h->ref_regular && !h->def_regular))); + + /* If this symbol is defined in a dynamic object, we need to copy + any R_SCORE_ABS32 or R_SCORE_REL32 relocs against it into the output + file. */ + hscore = (struct score_elf_link_hash_entry *)h; + if (!info->relocatable + && hscore->possibly_dynamic_relocs != 0 + && (h->root.type == bfd_link_hash_defweak || !h->def_regular)) + { + score_elf_allocate_dynamic_relocations (dynobj, hscore->possibly_dynamic_relocs); + if (hscore->readonly_reloc) + /* We tell the dynamic linker that there are relocations + against the text segment. */ + info->flags |= DF_TEXTREL; + } + + /* For a function, create a stub, if allowed. */ + if (!hscore->no_fn_stub && h->needs_plt) + { + if (!elf_hash_table (info)->dynamic_sections_created) + return TRUE; + + /* If this symbol is not defined in a regular file, then set + the symbol to the stub location. This is required to make + function pointers compare as equal between the normal + executable and the shared library. */ + if (!h->def_regular) + { + /* We need .stub section. */ + s = bfd_get_section_by_name (dynobj, SCORE_ELF_STUB_SECTION_NAME); + BFD_ASSERT (s != NULL); + + h->root.u.def.section = s; + h->root.u.def.value = s->size; + + /* XXX Write this stub address somewhere. */ + h->plt.offset = s->size; + + /* Make room for this stub code. */ + s->size += SCORE_FUNCTION_STUB_SIZE; + + /* The last half word of the stub will be filled with the index + of this symbol in .dynsym section. */ + return TRUE; + } + } + else if ((h->type == STT_FUNC) && !h->needs_plt) + { + /* This will set the entry for this symbol in the GOT to 0, and + the dynamic linker will take care of this. */ + h->root.u.def.value = 0; + return TRUE; + } + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->u.weakdef != NULL) + { + BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined + || h->u.weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->u.weakdef->root.u.def.section; + h->root.u.def.value = h->u.weakdef->root.u.def.value; + return TRUE; + } + + /* This is a reference to a symbol defined by a dynamic object which + is not a function. */ + return TRUE; +} + +/* This function is called after all the input files have been read, + and the input sections have been assigned to output sections. */ + +static bfd_boolean +_bfd_score_elf_always_size_sections (bfd *output_bfd, + struct bfd_link_info *info) +{ + bfd *dynobj; + asection *s; + struct score_got_info *g; + int i; + bfd_size_type loadable_size = 0; + bfd_size_type local_gotno; + bfd *sub; + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj == NULL) + /* Relocatable links don't have it. */ + return TRUE; + + g = score_elf_got_info (dynobj, &s); + if (s == NULL) + return TRUE; + + /* Calculate the total loadable size of the output. That will give us the + maximum number of GOT_PAGE entries required. */ + for (sub = info->input_bfds; sub; sub = sub->link_next) + { + asection *subsection; + + for (subsection = sub->sections; + subsection; + subsection = subsection->next) + { + if ((subsection->flags & SEC_ALLOC) == 0) + continue; + loadable_size += ((subsection->size + 0xf) + &~ (bfd_size_type) 0xf); + } + } + + /* There has to be a global GOT entry for every symbol with + a dynamic symbol table index of DT_SCORE_GOTSYM or + higher. Therefore, it make sense to put those symbols + that need GOT entries at the end of the symbol table. We + do that here. */ + if (! score_elf_sort_hash_table (info, 1)) + return FALSE; + + if (g->global_gotsym != NULL) + i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx; + else + /* If there are no global symbols, or none requiring + relocations, then GLOBAL_GOTSYM will be NULL. */ + i = 0; + + /* In the worst case, we'll get one stub per dynamic symbol. */ + loadable_size += SCORE_FUNCTION_STUB_SIZE * i; + + /* Assume there are two loadable segments consisting of + contiguous sections. Is 5 enough? */ + local_gotno = (loadable_size >> 16) + 5; + + g->local_gotno += local_gotno; + s->size += g->local_gotno * SCORE_ELF_GOT_SIZE (output_bfd); + + g->global_gotno = i; + s->size += i * SCORE_ELF_GOT_SIZE (output_bfd); + + score_elf_resolve_final_got_entries (g); + + if (s->size > SCORE_ELF_GOT_MAX_SIZE (output_bfd)) + { + /* Fixme. Error message or Warning message should be issued here. */ + } + + return TRUE; +} + +/* Set the sizes of the dynamic sections. */ + +static bfd_boolean +_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + bfd *dynobj; + asection *s; + bfd_boolean reltext; + + dynobj = elf_hash_table (info)->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (!info->shared) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (s != NULL); + s->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1; + s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER; + } + } + + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + reltext = FALSE; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); + + if (CONST_STRNEQ (name, ".rel")) + { + if (s->size == 0) + { + /* We only strip the section if the output section name + has the same name. Otherwise, there might be several + input sections for this output section. FIXME: This + code is probably not needed these days anyhow, since + the linker now does not create empty output sections. */ + if (s->output_section != NULL + && strcmp (name, + bfd_get_section_name (s->output_section->owner, + s->output_section)) == 0) + s->flags |= SEC_EXCLUDE; + } + else + { + const char *outname; + asection *target; + + /* If this relocation section applies to a read only + section, then we probably need a DT_TEXTREL entry. + If the relocation section is .rel.dyn, we always + assert a DT_TEXTREL entry rather than testing whether + there exists a relocation to a read only section or + not. */ + outname = bfd_get_section_name (output_bfd, s->output_section); + target = bfd_get_section_by_name (output_bfd, outname + 4); + if ((target != NULL + && (target->flags & SEC_READONLY) != 0 + && (target->flags & SEC_ALLOC) != 0) || strcmp (outname, ".rel.dyn") == 0) + reltext = TRUE; + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + if (strcmp (name, ".rel.dyn") != 0) + s->reloc_count = 0; + } + } + else if (CONST_STRNEQ (name, ".got")) + { + /* _bfd_score_elf_always_size_sections() has already done + most of the work, but some symbols may have been mapped + to versions that we must now resolve in the got_entries + hash tables. */ + } + else if (strcmp (name, SCORE_ELF_STUB_SECTION_NAME) == 0) + { + /* IRIX rld assumes that the function stub isn't at the end + of .text section. So put a dummy. XXX */ + s->size += SCORE_FUNCTION_STUB_SIZE; + } + else if (! CONST_STRNEQ (name, ".init")) + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + /* Allocate memory for the section contents. */ + s->contents = bfd_zalloc (dynobj, s->size); + if (s->contents == NULL && s->size != 0) + { + bfd_set_error (bfd_error_no_memory); + return FALSE; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in _bfd_score_elf_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) + return FALSE; + + if (reltext) + info->flags |= DF_TEXTREL; + + if ((info->flags & DF_TEXTREL) != 0) + { + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0)) + return FALSE; + } + + if (! SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0)) + return FALSE; + + if (score_elf_rel_dyn_section (dynobj, FALSE)) + { + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0)) + return FALSE; + } + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_BASE_ADDRESS, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_LOCAL_GOTNO, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_SYMTABNO, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_UNREFEXTNO, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_GOTSYM, 0)) + return FALSE; + + if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_HIPAGENO, 0)) + return FALSE; + } + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) +{ + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + flagword flags; + asection *s; + + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED | SEC_READONLY); + + /* ABI requests the .dynamic section to be read only. */ + s = bfd_get_section_by_name (abfd, ".dynamic"); + if (s != NULL) + { + if (!bfd_set_section_flags (abfd, s, flags)) + return FALSE; + } + + /* We need to create .got section. */ + if (!score_elf_create_got_section (abfd, info, FALSE)) + return FALSE; + + if (!score_elf_rel_dyn_section (elf_hash_table (info)->dynobj, TRUE)) + return FALSE; + + /* Create .stub section. */ + if (bfd_get_section_by_name (abfd, SCORE_ELF_STUB_SECTION_NAME) == NULL) + { + s = bfd_make_section_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME, + flags | SEC_CODE); + if (s == NULL + || !bfd_set_section_alignment (abfd, s, 2)) + + return FALSE; + } + + if (!info->shared) + { + const char *name; + + name = "_DYNAMIC_LINK"; + bh = NULL; + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, + (bfd_vma) 0, (const char *)NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + + h = (struct elf_link_hash_entry *)bh; + h->non_elf = 0; + h->def_regular = 1; + h->type = STT_SECTION; + + if (!bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + return TRUE; +} + + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static bfd_boolean +_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + bfd *dynobj; + asection *sgot; + struct score_got_info *g; + const char *name; + + dynobj = elf_hash_table (info)->dynobj; + + if (h->plt.offset != MINUS_ONE) + { + asection *s; + bfd_byte stub[SCORE_FUNCTION_STUB_SIZE]; + + /* This symbol has a stub. Set it up. */ + BFD_ASSERT (h->dynindx != -1); + + s = bfd_get_section_by_name (dynobj, SCORE_ELF_STUB_SECTION_NAME); + BFD_ASSERT (s != NULL); + + /* FIXME: Can h->dynindex be more than 64K? */ + if (h->dynindx & 0xffff0000) + return FALSE; + + /* Fill the stub. */ + bfd_put_32 (output_bfd, STUB_LW, stub); + bfd_put_32 (output_bfd, STUB_MOVE, stub + 4); + bfd_put_32 (output_bfd, STUB_LI16 | (h->dynindx << 1), stub + 8); + bfd_put_32 (output_bfd, STUB_BRL, stub + 12); + + BFD_ASSERT (h->plt.offset <= s->size); + memcpy (s->contents + h->plt.offset, stub, SCORE_FUNCTION_STUB_SIZE); + + /* Mark the symbol as undefined. plt.offset != -1 occurs + only for the referenced symbol. */ + sym->st_shndx = SHN_UNDEF; + + /* The run-time linker uses the st_value field of the symbol + to reset the global offset table entry for this external + to its stub address when unlinking a shared object. */ + sym->st_value = (s->output_section->vma + s->output_offset + h->plt.offset); + } + + BFD_ASSERT (h->dynindx != -1 || h->forced_local); + + sgot = score_elf_got_section (dynobj, FALSE); + BFD_ASSERT (sgot != NULL); + BFD_ASSERT (score_elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + + /* Run through the global symbol table, creating GOT entries for all + the symbols that need them. */ + if (g->global_gotsym != NULL && h->dynindx >= g->global_gotsym->dynindx) + { + bfd_vma offset; + bfd_vma value; + + value = sym->st_value; + offset = score_elf_global_got_index (dynobj, h); + bfd_put_32 (output_bfd, value, sgot->contents + offset); + } + + /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ + name = h->root.root.string; + if (strcmp (name, "_DYNAMIC") == 0 || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + else if (strcmp (name, "_DYNAMIC_LINK") == 0) + { + sym->st_shndx = SHN_ABS; + sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); + sym->st_value = 1; + } + else if (strcmp (name, GP_DISP_LABEL) == 0) + { + sym->st_shndx = SHN_ABS; + sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); + sym->st_value = elf_gp (output_bfd); + } + + return TRUE; +} + +/* Finish up the dynamic sections. */ + +static bfd_boolean +_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) +{ + bfd *dynobj; + asection *sdyn; + asection *sgot; + asection *s; + struct score_got_info *g; + + dynobj = elf_hash_table (info)->dynobj; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + sgot = score_elf_got_section (dynobj, FALSE); + if (sgot == NULL) + g = NULL; + else + { + BFD_ASSERT (score_elf_section_data (sgot) != NULL); + g = score_elf_section_data (sgot)->u.got_info; + BFD_ASSERT (g != NULL); + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + bfd_byte *b; + + BFD_ASSERT (sdyn != NULL); + BFD_ASSERT (g != NULL); + + for (b = sdyn->contents; + b < sdyn->contents + sdyn->size; + b += SCORE_ELF_DYN_SIZE (dynobj)) + { + Elf_Internal_Dyn dyn; + const char *name; + size_t elemsize; + bfd_boolean swap_out_p; + + /* Read in the current dynamic entry. */ + (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn); + + /* Assume that we're going to modify it and write it out. */ + swap_out_p = TRUE; + + switch (dyn.d_tag) + { + case DT_RELENT: + s = score_elf_rel_dyn_section (dynobj, FALSE); + BFD_ASSERT (s != NULL); + dyn.d_un.d_val = SCORE_ELF_REL_SIZE (dynobj); + break; + + case DT_STRSZ: + /* Rewrite DT_STRSZ. */ + dyn.d_un.d_val = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); + break; + + case DT_PLTGOT: + name = ".got"; + s = bfd_get_section_by_name (output_bfd, name); + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma; + break; + + case DT_SCORE_BASE_ADDRESS: + s = output_bfd->sections; + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff; + break; + + case DT_SCORE_LOCAL_GOTNO: + dyn.d_un.d_val = g->local_gotno; + break; + + case DT_SCORE_UNREFEXTNO: + /* The index into the dynamic symbol table which is the + entry of the first external symbol that is not + referenced within the same object. */ + dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1; + break; + + case DT_SCORE_GOTSYM: + if (g->global_gotsym) + { + dyn.d_un.d_val = g->global_gotsym->dynindx; + break; + } + /* In case if we don't have global got symbols we default + to setting DT_SCORE_GOTSYM to the same value as + DT_SCORE_SYMTABNO, so we just fall through. */ + + case DT_SCORE_SYMTABNO: + name = ".dynsym"; + elemsize = SCORE_ELF_SYM_SIZE (output_bfd); + s = bfd_get_section_by_name (output_bfd, name); + BFD_ASSERT (s != NULL); + + dyn.d_un.d_val = s->size / elemsize; + break; + + case DT_SCORE_HIPAGENO: + dyn.d_un.d_val = g->local_gotno - SCORE_RESERVED_GOTNO; + break; + + default: + swap_out_p = FALSE; + break; + } + + if (swap_out_p) + (*get_elf_backend_data (dynobj)->s->swap_dyn_out) (dynobj, &dyn, b); + } + } + + /* The first entry of the global offset table will be filled at + runtime. The second entry will be used by some runtime loaders. + This isn't the case of IRIX rld. */ + if (sgot != NULL && sgot->size > 0) + { + bfd_put_32 (output_bfd, 0, sgot->contents); + bfd_put_32 (output_bfd, 0x80000000, sgot->contents + SCORE_ELF_GOT_SIZE (output_bfd)); + } + + if (sgot != NULL) + elf_section_data (sgot->output_section)->this_hdr.sh_entsize + = SCORE_ELF_GOT_SIZE (output_bfd); + + + /* We need to sort the entries of the dynamic relocation section. */ + s = score_elf_rel_dyn_section (dynobj, FALSE); + + if (s != NULL && s->size > (bfd_vma)2 * SCORE_ELF_REL_SIZE (output_bfd)) + { + reldyn_sorting_bfd = output_bfd; + qsort ((Elf32_External_Rel *) s->contents + 1, s->reloc_count - 1, + sizeof (Elf32_External_Rel), score_elf_sort_dynamic_relocs); + } + + return TRUE; +} + +/* This function set up the ELF section header for a BFD section in preparation for writing + it out. This is where the flags and type fields are set for unusual sections. */ + +static bfd_boolean +_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *hdr, + asection *sec) +{ + const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".got") == 0 + || strcmp (name, ".srdata") == 0 + || strcmp (name, ".sdata") == 0 + || strcmp (name, ".sbss") == 0) + hdr->sh_flags |= SHF_SCORE_GPREL; + + return TRUE; +} + +/* This function do additional processing on the ELF section header before writing + it out. This is used to set the flags and type fields for some sections. */ + +/* assign_file_positions_except_relocs() check section flag and if it is allocatable, + warning message will be issued. backend_fake_section is called before + assign_file_positions_except_relocs(); backend_section_processing after it. so, we + modify section flag there, but not backend_fake_section. */ + +static bfd_boolean +_bfd_score_elf_section_processing (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Shdr *hdr) +{ + if (hdr->bfd_section != NULL) + { + const char *name = bfd_get_section_name (abfd, hdr->bfd_section); + + if (strcmp (name, ".sdata") == 0) + { + hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL; + hdr->sh_type = SHT_PROGBITS; + } + else if (strcmp (name, ".sbss") == 0) + { + hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL; + hdr->sh_type = SHT_NOBITS; + } + else if (strcmp (name, ".srdata") == 0) + { + hdr->sh_flags |= SHF_ALLOC | SHF_SCORE_GPREL; + hdr->sh_type = SHT_PROGBITS; + } + } + + return TRUE; +} + +static bfd_boolean +_bfd_score_elf_write_section (bfd *output_bfd, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + asection *sec, bfd_byte *contents) +{ + bfd_byte *to, *from, *end; + int i; + + if (strcmp (sec->name, ".pdr") != 0) + return FALSE; + + if (score_elf_section_data (sec)->u.tdata == NULL) + return FALSE; + + to = contents; + end = contents + sec->size; + for (from = contents, i = 0; from < end; from += PDR_SIZE, i++) + { + if ((score_elf_section_data (sec)->u.tdata)[i] == 1) + continue; + + if (to != from) + memcpy (to, from, PDR_SIZE); + + to += PDR_SIZE; + } + bfd_set_section_contents (output_bfd, sec->output_section, contents, + (file_ptr) sec->output_offset, sec->size); + + return TRUE; +} + +/* Copy data from a SCORE ELF indirect symbol to its direct symbol, hiding the old + indirect symbol. Process additional relocation information. */ + +static void +_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) +{ + struct score_elf_link_hash_entry *dirscore, *indscore; + + _bfd_elf_link_hash_copy_indirect (info, dir, ind); + + if (ind->root.type != bfd_link_hash_indirect) + return; + + dirscore = (struct score_elf_link_hash_entry *) dir; + indscore = (struct score_elf_link_hash_entry *) ind; + dirscore->possibly_dynamic_relocs += indscore->possibly_dynamic_relocs; + + if (indscore->readonly_reloc) + dirscore->readonly_reloc = TRUE; + + if (indscore->no_fn_stub) + dirscore->no_fn_stub = TRUE; +} + +/* Remove information about discarded functions from other sections which mention them. */ + +static bfd_boolean +_bfd_score_elf_discard_info (bfd *abfd, struct elf_reloc_cookie *cookie, + struct bfd_link_info *info) +{ + asection *o; + bfd_boolean ret = FALSE; + unsigned char *tdata; + size_t i, skip; + + o = bfd_get_section_by_name (abfd, ".pdr"); + if ((!o) || (o->size == 0) || (o->size % PDR_SIZE != 0) + || (o->output_section != NULL && bfd_is_abs_section (o->output_section))) + return FALSE; + + tdata = bfd_zmalloc (o->size / PDR_SIZE); + if (!tdata) + return FALSE; + + cookie->rels = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, info->keep_memory); + if (!cookie->rels) + { + free (tdata); + return FALSE; + } + + cookie->rel = cookie->rels; + cookie->relend = cookie->rels + o->reloc_count; + + for (i = 0, skip = 0; i < o->size; i++) + { + if (bfd_elf_reloc_symbol_deleted_p (i * PDR_SIZE, cookie)) + { + tdata[i] = 1; + skip++; + } + } + + if (skip != 0) + { + score_elf_section_data (o)->u.tdata = tdata; + o->size -= skip * PDR_SIZE; + ret = TRUE; + } + else + free (tdata); + + if (!info->keep_memory) + free (cookie->rels); + + return ret; +} + +/* Signal that discard_info() has removed the discarded relocations for this section. */ + +static bfd_boolean +_bfd_score_elf_ignore_discarded_relocs (asection *sec) +{ + if (strcmp (sec->name, ".pdr") == 0) + return TRUE; + return FALSE; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +_bfd_score_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + if (h != NULL) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_SCORE_GNU_VTINHERIT: + case R_SCORE_GNU_VTENTRY: + return NULL; + } + + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); +} + +/* Support for core dump NOTE sections. */ + +static bfd_boolean +_bfd_score_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) +{ + int offset; + unsigned int raw_size; + + switch (note->descsz) + { + default: + return FALSE; + + case 148: /* Linux/Score 32-bit. */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 72; + + break; + } + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size, note->descpos + offset); +} + +static bfd_boolean +_bfd_score_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) +{ + switch (note->descsz) + { + default: + return FALSE; + + case 124: /* Linux/Score elf_prpsinfo. */ + elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + elf_tdata (abfd)->core_command = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + } + + /* Note that for some reason, a spurious space is tacked + onto the end of the args in some (at least one anyway) + implementations, so strip it off if it exists. */ + + { + char *command = elf_tdata (abfd)->core_command; + int n = strlen (command); + + if (0 < n && command[n - 1] == ' ') + command[n - 1] = '\0'; + } + + return TRUE; +} + + +/* Score BFD functions. */ + +static reloc_howto_type * +elf32_score_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +{ + unsigned int i; + + for (i = 0; i < NUM_ELEM (elf32_score_reloc_map); i++) + if (elf32_score_reloc_map[i].bfd_reloc_val == code) + return &elf32_score_howto_table[elf32_score_reloc_map[i].elf_reloc_val]; + + return NULL; +} + +static reloc_howto_type * +elf32_score_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf32_score_howto_table) + / sizeof (elf32_score_howto_table[0])); + i++) + if (elf32_score_howto_table[i].name != NULL + && strcasecmp (elf32_score_howto_table[i].name, r_name) == 0) + return &elf32_score_howto_table[i]; + + return NULL; +} + +/* Create a score elf linker hash table. */ + +static struct bfd_link_hash_table * +elf32_score_link_hash_table_create (bfd *abfd) +{ + struct score_elf_link_hash_table *ret; + bfd_size_type amt = sizeof (struct score_elf_link_hash_table); + + ret = bfd_malloc (amt); + if (ret == NULL) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, score_elf_link_hash_newfunc, + sizeof (struct score_elf_link_hash_entry))) + { + free (ret); + return NULL; + } + + return &ret->root.root; +} + +static bfd_boolean +elf32_score_print_private_bfd_data (bfd *abfd, void * ptr) +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + /* xgettext:c-format */ + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + if (elf_elfheader (abfd)->e_flags & EF_SCORE_PIC) + { + fprintf (file, _(" [pic]")); + } + if (elf_elfheader (abfd)->e_flags & EF_SCORE_FIXDEP) + { + fprintf (file, _(" [fix dep]")); + } + fputc ('\n', file); + + return TRUE; +} + +static bfd_boolean +elf32_score_merge_private_bfd_data (bfd *ibfd, bfd *obfd) +{ + flagword in_flags; + flagword out_flags; + + if (!_bfd_generic_verify_endian_match (ibfd, obfd)) + return FALSE; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return TRUE; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = TRUE; + elf_elfheader (obfd)->e_flags = in_flags; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); + } + + return TRUE; + } + + if (((in_flags & EF_SCORE_PIC) != 0) != ((out_flags & EF_SCORE_PIC) != 0)) + { + (*_bfd_error_handler) (_("%B: warning: linking PIC files with non-PIC files"), ibfd); + } + + /* FIXME: Maybe dependency fix compatibility should be checked here. */ + + return TRUE; +} + +static bfd_boolean +elf32_score_new_section_hook (bfd *abfd, asection *sec) +{ + struct _score_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + + return _bfd_elf_new_section_hook (abfd, sec); +} + + +#define USE_REL 1 +#define TARGET_LITTLE_SYM bfd_elf32_littlescore_vec +#define TARGET_LITTLE_NAME "elf32-littlescore" +#define TARGET_BIG_SYM bfd_elf32_bigscore_vec +#define TARGET_BIG_NAME "elf32-bigscore" +#define ELF_ARCH bfd_arch_score +#define ELF_MACHINE_CODE EM_SCORE +#define ELF_MAXPAGESIZE 0x8000 + +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel _bfd_score_info_to_howto +#define elf_backend_relocate_section _bfd_score_elf_relocate_section +#define elf_backend_check_relocs _bfd_score_elf_check_relocs +#define elf_backend_add_symbol_hook _bfd_score_elf_add_symbol_hook +#define elf_backend_symbol_processing _bfd_score_elf_symbol_processing +#define elf_backend_link_output_symbol_hook \ + _bfd_score_elf_link_output_symbol_hook +#define elf_backend_section_from_bfd_section \ + _bfd_score_elf_section_from_bfd_section +#define elf_backend_adjust_dynamic_symbol \ + _bfd_score_elf_adjust_dynamic_symbol +#define elf_backend_always_size_sections \ + _bfd_score_elf_always_size_sections +#define elf_backend_size_dynamic_sections \ + _bfd_score_elf_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_create_dynamic_sections \ + _bfd_score_elf_create_dynamic_sections +#define elf_backend_finish_dynamic_symbol \ + _bfd_score_elf_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + _bfd_score_elf_finish_dynamic_sections +#define elf_backend_fake_sections _bfd_score_elf_fake_sections +#define elf_backend_section_processing _bfd_score_elf_section_processing +#define elf_backend_write_section _bfd_score_elf_write_section +#define elf_backend_copy_indirect_symbol _bfd_score_elf_copy_indirect_symbol +#define elf_backend_hide_symbol _bfd_score_elf_hide_symbol +#define elf_backend_discard_info _bfd_score_elf_discard_info +#define elf_backend_ignore_discarded_relocs \ + _bfd_score_elf_ignore_discarded_relocs +#define elf_backend_gc_mark_hook _bfd_score_elf_gc_mark_hook +#define elf_backend_grok_prstatus _bfd_score_elf_grok_prstatus +#define elf_backend_grok_psinfo _bfd_score_elf_grok_psinfo +#define elf_backend_can_gc_sections 1 +#define elf_backend_want_plt_sym 0 +#define elf_backend_got_header_size (4 * SCORE_RESERVED_GOTNO) +#define elf_backend_plt_header_size 0 +#define elf_backend_collect TRUE +#define elf_backend_type_change_ok TRUE + +#define bfd_elf32_bfd_reloc_type_lookup elf32_score_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + elf32_score_reloc_name_lookup +#define bfd_elf32_bfd_link_hash_table_create elf32_score_link_hash_table_create +#define bfd_elf32_bfd_print_private_bfd_data elf32_score_print_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data elf32_score_merge_private_bfd_data +#define bfd_elf32_new_section_hook elf32_score_new_section_hook + +#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-sh-relocs.h b/contrib/binutils/bfd/elf32-sh-relocs.h new file mode 100644 index 00000000000..3488ef4edbe --- /dev/null +++ b/contrib/binutils/bfd/elf32-sh-relocs.h @@ -0,0 +1,1716 @@ + /* No relocation. */ + HOWTO (R_SH_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit absolute relocation. Setting partial_inplace to TRUE and + src_mask to a non-zero value is similar to the COFF toolchain. */ + HOWTO (R_SH_DIR32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + SH_ELF_RELOC, /* special_function */ + "R_SH_DIR32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 32 bit PC relative relocation. */ + HOWTO (R_SH_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_REL32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit PC relative branch divided by 2. */ + HOWTO (R_SH_DIR8WPN, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8WPN", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 12 bit PC relative branch divided by 2. */ + /* This cannot be partial_inplace because relaxation can't know the + eventual value of a symbol. */ + HOWTO (R_SH_IND12W, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + NULL, /* special_function */ + "R_SH_IND12W", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xfff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit unsigned PC relative divided by 4. */ + HOWTO (R_SH_DIR8WPL, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8WPL", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit unsigned PC relative divided by 2. */ + HOWTO (R_SH_DIR8WPZ, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8WPZ", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit GBR relative. FIXME: This only makes sense if we have some + special symbol for the GBR relative area, and that is not + implemented. */ + HOWTO (R_SH_DIR8BP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8BP", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit GBR relative divided by 2. FIXME: This only makes sense if + we have some special symbol for the GBR relative area, and that + is not implemented. */ + HOWTO (R_SH_DIR8W, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8W", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit GBR relative divided by 4. FIXME: This only makes sense if + we have some special symbol for the GBR relative area, and that + is not implemented. */ + HOWTO (R_SH_DIR8L, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DIR8L", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ + HOWTO (R_SH_LOOP_START, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_LOOP_START", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* 8 bit PC relative divided by 2 - but specified in a very odd way. */ + HOWTO (R_SH_LOOP_END, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_LOOP_END", /* name */ + TRUE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + EMPTY_HOWTO (12), + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + EMPTY_HOWTO (20), + EMPTY_HOWTO (21), + + /* The remaining relocs are a GNU extension used for relaxing. The + final pass of the linker never needs to do anything with any of + these relocs. Any required operations are handled by the + relaxation code. */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_SH_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_SH_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_SH_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_SH_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* An 8 bit switch table entry. This is generated for an expression + such as ``.word L1 - L2''. The offset holds the difference + between the reloc address and L2. */ + HOWTO (R_SH_SWITCH8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SWITCH8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16 bit switch table entry. This is generated for an expression + such as ``.word L1 - L2''. The offset holds the difference + between the reloc address and L2. */ + HOWTO (R_SH_SWITCH16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SWITCH16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 32 bit switch table entry. This is generated for an expression + such as ``.long L1 - L2''. The offset holds the difference + between the reloc address and L2. */ + HOWTO (R_SH_SWITCH32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SWITCH32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Indicates a .uses pseudo-op. The compiler will generate .uses + pseudo-ops when it finds a function call which can be relaxed. + The offset field holds the PC relative offset to the instruction + which loads the register used in the function call. */ + HOWTO (R_SH_USES, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_USES", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler will generate this reloc for addresses referred to + by the register loads associated with USES relocs. The offset + field holds the number of times the address is referenced in the + object file. */ + HOWTO (R_SH_COUNT, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_COUNT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Indicates an alignment statement. The offset field is the power + of 2 to which subsequent portions of the object file must be + aligned. */ + HOWTO (R_SH_ALIGN, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_ALIGN", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler will generate this reloc before a block of + instructions. A section should be processed as assuming it + contains data, unless this reloc is seen. */ + HOWTO (R_SH_CODE, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_CODE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler will generate this reloc after a block of + instructions when it sees data that is not instructions. */ + HOWTO (R_SH_DATA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_DATA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The assembler generates this reloc for each label within a block + of instructions. This permits the linker to avoid swapping + instructions which are the targets of branches. */ + HOWTO (R_SH_LABEL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_LABEL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The next 12 are only supported via linking in SHC-generated objects. */ + HOWTO (R_SH_DIR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8UL, /* type */ + 2, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8UL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8UW, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8UW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8U, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8SW, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8SW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR8S, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR8S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR4UL, /* type */ + 2, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR4UL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR4UW, /* type */ + 1, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR4UW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_DIR4U, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 4, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR4U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_PSHA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 4, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PSHA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_PSHL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 4, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PSHL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0f, /* dst_mask */ + FALSE), /* pcrel_offset */ + +#ifdef INCLUDE_SHMEDIA + /* Used in SHLLI.L and SHLRI.L. */ + HOWTO (R_SH_DIR5U, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR5U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in SHARI, SHLLI et al. */ + HOWTO (R_SH_DIR6U, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR6U", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in BxxI, LDHI.L et al. */ + HOWTO (R_SH_DIR6S, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR6S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in ADDI, ANDI et al. */ + HOWTO (R_SH_DIR10S, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in LD.UW, ST.W et al. */ + HOWTO (R_SH_DIR10SW, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10SW", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in LD.L, FLD.S et al. */ + HOWTO (R_SH_DIR10SL, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10SL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in FLD.D, FST.P et al. */ + HOWTO (R_SH_DIR10SQ, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR10SQ", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + +#else + EMPTY_HOWTO (45), + EMPTY_HOWTO (46), + EMPTY_HOWTO (47), + EMPTY_HOWTO (48), + EMPTY_HOWTO (49), + EMPTY_HOWTO (50), + EMPTY_HOWTO (51), +#endif + + EMPTY_HOWTO (52), + + HOWTO (R_SH_DIR16S, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_DIR16S", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + EMPTY_HOWTO (60), + EMPTY_HOWTO (61), + EMPTY_HOWTO (62), + EMPTY_HOWTO (63), + EMPTY_HOWTO (64), + EMPTY_HOWTO (65), + EMPTY_HOWTO (66), + EMPTY_HOWTO (67), + EMPTY_HOWTO (68), + EMPTY_HOWTO (69), + EMPTY_HOWTO (70), + EMPTY_HOWTO (71), + EMPTY_HOWTO (72), + EMPTY_HOWTO (73), + EMPTY_HOWTO (74), + EMPTY_HOWTO (75), + EMPTY_HOWTO (76), + EMPTY_HOWTO (77), + EMPTY_HOWTO (78), + EMPTY_HOWTO (79), + EMPTY_HOWTO (80), + EMPTY_HOWTO (81), + EMPTY_HOWTO (82), + EMPTY_HOWTO (83), + EMPTY_HOWTO (84), + EMPTY_HOWTO (85), + EMPTY_HOWTO (86), + EMPTY_HOWTO (87), + EMPTY_HOWTO (88), + EMPTY_HOWTO (89), + EMPTY_HOWTO (90), + EMPTY_HOWTO (91), + EMPTY_HOWTO (92), + EMPTY_HOWTO (93), + EMPTY_HOWTO (94), + EMPTY_HOWTO (95), + EMPTY_HOWTO (96), + EMPTY_HOWTO (97), + EMPTY_HOWTO (98), + EMPTY_HOWTO (99), + EMPTY_HOWTO (100), + EMPTY_HOWTO (101), + EMPTY_HOWTO (102), + EMPTY_HOWTO (103), + EMPTY_HOWTO (104), + EMPTY_HOWTO (105), + EMPTY_HOWTO (106), + EMPTY_HOWTO (107), + EMPTY_HOWTO (108), + EMPTY_HOWTO (109), + EMPTY_HOWTO (110), + EMPTY_HOWTO (111), + EMPTY_HOWTO (112), + EMPTY_HOWTO (113), + EMPTY_HOWTO (114), + EMPTY_HOWTO (115), + EMPTY_HOWTO (116), + EMPTY_HOWTO (117), + EMPTY_HOWTO (118), + EMPTY_HOWTO (119), + EMPTY_HOWTO (120), + EMPTY_HOWTO (121), + EMPTY_HOWTO (122), + EMPTY_HOWTO (123), + EMPTY_HOWTO (124), + EMPTY_HOWTO (125), + EMPTY_HOWTO (126), + EMPTY_HOWTO (127), + EMPTY_HOWTO (128), + EMPTY_HOWTO (129), + EMPTY_HOWTO (130), + EMPTY_HOWTO (131), + EMPTY_HOWTO (132), + EMPTY_HOWTO (133), + EMPTY_HOWTO (134), + EMPTY_HOWTO (135), + EMPTY_HOWTO (136), + EMPTY_HOWTO (137), + EMPTY_HOWTO (138), + EMPTY_HOWTO (139), + EMPTY_HOWTO (140), + EMPTY_HOWTO (141), + EMPTY_HOWTO (142), + EMPTY_HOWTO (143), + + HOWTO (R_SH_TLS_GD_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_GD_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_LD_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_LD_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_LDO_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_LDO_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_IE_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_IE_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_LE_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_LE_32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_DTPMOD32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_DTPMOD32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_DTPOFF32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_DTPOFF32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_TLS_TPOFF32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_TLS_TPOFF32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (152), + EMPTY_HOWTO (153), + EMPTY_HOWTO (154), + EMPTY_HOWTO (155), + EMPTY_HOWTO (156), + EMPTY_HOWTO (157), + EMPTY_HOWTO (158), + EMPTY_HOWTO (159), + + HOWTO (R_SH_GOT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOT32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_PLT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_PLT32", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_SH_COPY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_COPY", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GLOB_DAT", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_JMP_SLOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_JMP_SLOT", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_RELATIVE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_RELATIVE", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GOTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOTOFF", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GOTPC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOTPC", /* name */ + SH_PARTIAL32, /* partial_inplace */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_SH_GOTPLT32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* */ + "R_SH_GOTPLT32", /* name */ + FALSE, /* partial_inplace */ + /* ??? Why not 0? */ + SH_SRC_MASK32, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + +#ifdef INCLUDE_SHMEDIA + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOT_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOT_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOT_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOT_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOTPLT_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOTPLT_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOTPLT_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOTPLT_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_PLT_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_PLT_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_PLT_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_PLT_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PLT_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOTOFF_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOTOFF_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOTOFF_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOTOFF_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTOFF_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_GOTPC_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_GOTPC_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_GOTPC_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_GOTPC_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPC_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in LD.L, FLD.S et al. */ + HOWTO (R_SH_GOT10BY4, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT10BY4", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in LD.L, FLD.S et al. */ + HOWTO (R_SH_GOTPLT10BY4, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT10BY4", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in FLD.D, FST.P et al. */ + HOWTO (R_SH_GOT10BY8, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOT10BY8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in FLD.D, FST.P et al. */ + HOWTO (R_SH_GOTPLT10BY8, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 13, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GOTPLT10BY8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_COPY64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_COPY64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_GLOB_DAT64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_GLOB_DAT64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_JMP_SLOT64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_JMP_SLOT64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_SH_RELATIVE64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_RELATIVE64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (197), + EMPTY_HOWTO (198), + EMPTY_HOWTO (199), + EMPTY_HOWTO (200), + EMPTY_HOWTO (201), + EMPTY_HOWTO (202), + EMPTY_HOWTO (203), + EMPTY_HOWTO (204), + EMPTY_HOWTO (205), + EMPTY_HOWTO (206), + EMPTY_HOWTO (207), + EMPTY_HOWTO (208), + EMPTY_HOWTO (209), + EMPTY_HOWTO (210), + EMPTY_HOWTO (211), + EMPTY_HOWTO (212), + EMPTY_HOWTO (213), + EMPTY_HOWTO (214), + EMPTY_HOWTO (215), + EMPTY_HOWTO (216), + EMPTY_HOWTO (217), + EMPTY_HOWTO (218), + EMPTY_HOWTO (219), + EMPTY_HOWTO (220), + EMPTY_HOWTO (221), + EMPTY_HOWTO (222), + EMPTY_HOWTO (223), + EMPTY_HOWTO (224), + EMPTY_HOWTO (225), + EMPTY_HOWTO (226), + EMPTY_HOWTO (227), + EMPTY_HOWTO (228), + EMPTY_HOWTO (229), + EMPTY_HOWTO (230), + EMPTY_HOWTO (231), + EMPTY_HOWTO (232), + EMPTY_HOWTO (233), + EMPTY_HOWTO (234), + EMPTY_HOWTO (235), + EMPTY_HOWTO (236), + EMPTY_HOWTO (237), + EMPTY_HOWTO (238), + EMPTY_HOWTO (239), + EMPTY_HOWTO (240), + EMPTY_HOWTO (241), + + /* Relocations for SHmedia code. None of these are partial_inplace or + use the field being relocated (except R_SH_PT_16). */ + + /* The assembler will generate this reloc before a block of SHmedia + instructions. A section should be processed as assuming it contains + data, unless this reloc is seen. Note that a block of SHcompact + instructions are instead preceded by R_SH_CODE. + This is currently not implemented, but should be used for SHmedia + linker relaxation. */ + HOWTO (R_SH_SHMEDIA_CODE, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + sh_elf_ignore_reloc, /* special_function */ + "R_SH_SHMEDIA_CODE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The assembler will generate this reloc at a PTA or PTB instruction, + and the linker checks the right type of target, or changes a PTA to a + PTB, if the original insn was PT. */ + HOWTO (R_SH_PT_16, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_PT_16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in unexpanded MOVI. */ + HOWTO (R_SH_IMMS16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMMS16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in SHORI. */ + HOWTO (R_SH_IMMU16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMMU16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (x & 65536). */ + HOWTO (R_SH_IMM_LOW16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_LOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x - $) & 65536). */ + HOWTO (R_SH_IMM_LOW16_PCREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_LOW16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 16) & 65536). */ + HOWTO (R_SH_IMM_MEDLOW16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDLOW16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (((x - $) >> 16) & 65536). */ + HOWTO (R_SH_IMM_MEDLOW16_PCREL, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDLOW16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 32) & 65536). */ + HOWTO (R_SH_IMM_MEDHI16, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (((x - $) >> 32) & 65536). */ + HOWTO (R_SH_IMM_MEDHI16_PCREL, /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_MEDHI16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* Used in MOVI and SHORI ((x >> 48) & 65536). */ + HOWTO (R_SH_IMM_HI16, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_HI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Used in MOVI and SHORI (((x - $) >> 48) & 65536). */ + HOWTO (R_SH_IMM_HI16_PCREL, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_IMM_HI16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x3fffc00, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* For the .uaquad pseudo. */ + HOWTO (R_SH_64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* For the .uaquad pseudo, (x - $). */ + HOWTO (R_SH_64_PCREL, /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + TRUE, /* pc_relative */ + 10, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_SH_64_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ((bfd_vma) 0) - 1, /* dst_mask */ + TRUE), /* pcrel_offset */ + +#endif +#undef SH_PARTIAL32 +#undef SH_SRC_MASK32 +#undef SH_ELF_RELOC diff --git a/contrib/binutils/bfd/elf32-sparc.c b/contrib/binutils/bfd/elf32-sparc.c index 3bfb38a3d44..f8a3bff196d 100644 --- a/contrib/binutils/bfd/elf32-sparc.c +++ b/contrib/binutils/bfd/elf32-sparc.c @@ -1,6 +1,6 @@ /* SPARC-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -172,6 +172,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define ELF_MACHINE_CODE EM_SPARC #define ELF_MACHINE_ALT1 EM_SPARC32PLUS #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x2000 #define bfd_elf32_bfd_merge_private_bfd_data \ elf32_sparc_merge_private_bfd_data @@ -182,6 +183,8 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_info_to_howto _bfd_sparc_elf_info_to_howto #define bfd_elf32_bfd_reloc_type_lookup _bfd_sparc_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup \ + _bfd_sparc_elf_reloc_name_lookup #define bfd_elf32_bfd_link_hash_table_create \ _bfd_sparc_elf_link_hash_table_create #define bfd_elf32_bfd_relax_section _bfd_sparc_elf_relax_section @@ -206,6 +209,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela) #define elf_backend_gc_mark_hook _bfd_sparc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook _bfd_sparc_elf_gc_sweep_hook #define elf_backend_plt_sym_val _bfd_sparc_elf_plt_sym_val +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 diff --git a/contrib/binutils/bfd/elf32-spu.c b/contrib/binutils/bfd/elf32-spu.c new file mode 100644 index 00000000000..d652117e299 --- /dev/null +++ b/contrib/binutils/bfd/elf32-spu.c @@ -0,0 +1,3154 @@ +/* SPU specific support for 32-bit ELF + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 "bfdlink.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/spu.h" +#include "elf32-spu.h" + +/* We use RELA style relocs. Don't define USE_REL. */ + +static bfd_reloc_status_type spu_elf_rel9 (bfd *, arelent *, asymbol *, + void *, asection *, + bfd *, char **); + +/* Values of type 'enum elf_spu_reloc_type' are used to index this + array, so it must be declared in the order of that type. */ + +static reloc_howto_type elf_howto_table[] = { + HOWTO (R_SPU_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_NONE", + FALSE, 0, 0x00000000, FALSE), + HOWTO (R_SPU_ADDR10, 4, 2, 10, FALSE, 14, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR10", + FALSE, 0, 0x00ffc000, FALSE), + HOWTO (R_SPU_ADDR16, 2, 2, 16, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR16", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_ADDR16_HI, 16, 2, 16, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR16_HI", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_ADDR16_LO, 0, 2, 16, FALSE, 7, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_ADDR16_LO", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_ADDR18, 0, 2, 18, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR18", + FALSE, 0, 0x01ffff80, FALSE), + HOWTO (R_SPU_ADDR32, 0, 2, 32, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_ADDR32", + FALSE, 0, 0xffffffff, FALSE), + HOWTO (R_SPU_REL16, 2, 2, 16, TRUE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_REL16", + FALSE, 0, 0x007fff80, TRUE), + HOWTO (R_SPU_ADDR7, 0, 2, 7, FALSE, 14, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_ADDR7", + FALSE, 0, 0x001fc000, FALSE), + HOWTO (R_SPU_REL9, 2, 2, 9, TRUE, 0, complain_overflow_signed, + spu_elf_rel9, "SPU_REL9", + FALSE, 0, 0x0180007f, TRUE), + HOWTO (R_SPU_REL9I, 2, 2, 9, TRUE, 0, complain_overflow_signed, + spu_elf_rel9, "SPU_REL9I", + FALSE, 0, 0x0000c07f, TRUE), + HOWTO (R_SPU_ADDR10I, 0, 2, 10, FALSE, 14, complain_overflow_signed, + bfd_elf_generic_reloc, "SPU_ADDR10I", + FALSE, 0, 0x00ffc000, FALSE), + HOWTO (R_SPU_ADDR16I, 0, 2, 16, FALSE, 7, complain_overflow_signed, + bfd_elf_generic_reloc, "SPU_ADDR16I", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_REL32, 0, 2, 32, TRUE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_REL32", + FALSE, 0, 0xffffffff, TRUE), + HOWTO (R_SPU_ADDR16X, 0, 2, 16, FALSE, 7, complain_overflow_bitfield, + bfd_elf_generic_reloc, "SPU_ADDR16X", + FALSE, 0, 0x007fff80, FALSE), + HOWTO (R_SPU_PPU32, 0, 2, 32, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_PPU32", + FALSE, 0, 0xffffffff, FALSE), + HOWTO (R_SPU_PPU64, 0, 4, 64, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "SPU_PPU64", + FALSE, 0, -1, FALSE), +}; + +static struct bfd_elf_special_section const spu_elf_special_sections[] = { + { ".toe", 4, 0, SHT_NOBITS, SHF_ALLOC }, + { NULL, 0, 0, 0, 0 } +}; + +static enum elf_spu_reloc_type +spu_elf_bfd_to_reloc_type (bfd_reloc_code_real_type code) +{ + switch (code) + { + default: + return R_SPU_NONE; + case BFD_RELOC_SPU_IMM10W: + return R_SPU_ADDR10; + case BFD_RELOC_SPU_IMM16W: + return R_SPU_ADDR16; + case BFD_RELOC_SPU_LO16: + return R_SPU_ADDR16_LO; + case BFD_RELOC_SPU_HI16: + return R_SPU_ADDR16_HI; + case BFD_RELOC_SPU_IMM18: + return R_SPU_ADDR18; + case BFD_RELOC_SPU_PCREL16: + return R_SPU_REL16; + case BFD_RELOC_SPU_IMM7: + return R_SPU_ADDR7; + case BFD_RELOC_SPU_IMM8: + return R_SPU_NONE; + case BFD_RELOC_SPU_PCREL9a: + return R_SPU_REL9; + case BFD_RELOC_SPU_PCREL9b: + return R_SPU_REL9I; + case BFD_RELOC_SPU_IMM10: + return R_SPU_ADDR10I; + case BFD_RELOC_SPU_IMM16: + return R_SPU_ADDR16I; + case BFD_RELOC_32: + return R_SPU_ADDR32; + case BFD_RELOC_32_PCREL: + return R_SPU_REL32; + case BFD_RELOC_SPU_PPU32: + return R_SPU_PPU32; + case BFD_RELOC_SPU_PPU64: + return R_SPU_PPU64; + } +} + +static void +spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + enum elf_spu_reloc_type r_type; + + r_type = (enum elf_spu_reloc_type) ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < R_SPU_max); + cache_ptr->howto = &elf_howto_table[(int) r_type]; +} + +static reloc_howto_type * +spu_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + enum elf_spu_reloc_type r_type = spu_elf_bfd_to_reloc_type (code); + + if (r_type == R_SPU_NONE) + return NULL; + + return elf_howto_table + r_type; +} + +static reloc_howto_type * +spu_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + return NULL; +} + +/* Apply R_SPU_REL9 and R_SPU_REL9I relocs. */ + +static bfd_reloc_status_type +spu_elf_rel9 (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) +{ + bfd_size_type octets; + bfd_vma val; + long insn; + + /* If this is a relocatable link (output_bfd test tells us), just + call the generic function. Any adjustment will be done at final + link time. */ + if (output_bfd != NULL) + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); + + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) + return bfd_reloc_outofrange; + octets = reloc_entry->address * bfd_octets_per_byte (abfd); + + /* Get symbol value. */ + val = 0; + if (!bfd_is_com_section (symbol->section)) + val = symbol->value; + if (symbol->section->output_section) + val += symbol->section->output_section->vma; + + val += reloc_entry->addend; + + /* Make it pc-relative. */ + val -= input_section->output_section->vma + input_section->output_offset; + + val >>= 2; + if (val + 256 >= 512) + return bfd_reloc_overflow; + + insn = bfd_get_32 (abfd, (bfd_byte *) data + octets); + + /* Move two high bits of value to REL9I and REL9 position. + The mask will take care of selecting the right field. */ + val = (val & 0x7f) | ((val & 0x180) << 7) | ((val & 0x180) << 16); + insn &= ~reloc_entry->howto->dst_mask; + insn |= val & reloc_entry->howto->dst_mask; + bfd_put_32 (abfd, insn, (bfd_byte *) data + octets); + return bfd_reloc_ok; +} + +static bfd_boolean +spu_elf_new_section_hook (bfd *abfd, asection *sec) +{ + if (!sec->used_by_bfd) + { + struct _spu_elf_section_data *sdata; + + sdata = bfd_zalloc (abfd, sizeof (*sdata)); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } + + return _bfd_elf_new_section_hook (abfd, sec); +} + +/* Specially mark defined symbols named _EAR_* with BSF_KEEP so that + strip --strip-unneeded will not remove them. */ + +static void +spu_elf_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) +{ + if (sym->name != NULL + && sym->section != bfd_abs_section_ptr + && strncmp (sym->name, "_EAR_", 5) == 0) + sym->flags |= BSF_KEEP; +} + +/* SPU ELF linker hash table. */ + +struct spu_link_hash_table +{ + struct elf_link_hash_table elf; + + /* The stub hash table. */ + struct bfd_hash_table stub_hash_table; + + /* Shortcuts to overlay sections. */ + asection *stub; + asection *ovtab; + + struct elf_link_hash_entry *ovly_load; + + /* An array of two output sections per overlay region, chosen such that + the first section vma is the overlay buffer vma (ie. the section has + the lowest vma in the group that occupy the region), and the second + section vma+size specifies the end of the region. We keep pointers + to sections like this because section vmas may change when laying + them out. */ + asection **ovl_region; + + /* Number of overlay buffers. */ + unsigned int num_buf; + + /* Total number of overlays. */ + unsigned int num_overlays; + + /* Set if we should emit symbols for stubs. */ + unsigned int emit_stub_syms:1; + + /* Set if we want stubs on calls out of overlay regions to + non-overlay regions. */ + unsigned int non_overlay_stubs : 1; + + /* Set on error. */ + unsigned int stub_overflow : 1; + + /* Set if stack size analysis should be done. */ + unsigned int stack_analysis : 1; + + /* Set if __stack_* syms will be emitted. */ + unsigned int emit_stack_syms : 1; +}; + +#define spu_hash_table(p) \ + ((struct spu_link_hash_table *) ((p)->hash)) + +struct spu_stub_hash_entry +{ + struct bfd_hash_entry root; + + /* Destination of this stub. */ + asection *target_section; + bfd_vma target_off; + + /* Offset of entry in stub section. */ + bfd_vma off; + + /* Offset from this stub to stub that loads the overlay index. */ + bfd_vma delta; +}; + +/* Create an entry in a spu stub hash table. */ + +static struct bfd_hash_entry * +stub_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, sizeof (struct spu_stub_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = bfd_hash_newfunc (entry, table, string); + if (entry != NULL) + { + struct spu_stub_hash_entry *sh = (struct spu_stub_hash_entry *) entry; + + sh->target_section = NULL; + sh->target_off = 0; + sh->off = 0; + sh->delta = 0; + } + + return entry; +} + +/* Create a spu ELF linker hash table. */ + +static struct bfd_link_hash_table * +spu_elf_link_hash_table_create (bfd *abfd) +{ + struct spu_link_hash_table *htab; + + htab = bfd_malloc (sizeof (*htab)); + if (htab == NULL) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&htab->elf, abfd, + _bfd_elf_link_hash_newfunc, + sizeof (struct elf_link_hash_entry))) + { + free (htab); + return NULL; + } + + /* Init the stub hash table too. */ + if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc, + sizeof (struct spu_stub_hash_entry))) + return NULL; + + memset (&htab->stub, 0, + sizeof (*htab) - offsetof (struct spu_link_hash_table, stub)); + + return &htab->elf.root; +} + +/* Free the derived linker hash table. */ + +static void +spu_elf_link_hash_table_free (struct bfd_link_hash_table *hash) +{ + struct spu_link_hash_table *ret = (struct spu_link_hash_table *) hash; + + bfd_hash_table_free (&ret->stub_hash_table); + _bfd_generic_link_hash_table_free (hash); +} + +/* Find the symbol for the given R_SYMNDX in IBFD and set *HP and *SYMP + to (hash, NULL) for global symbols, and (NULL, sym) for locals. Set + *SYMSECP to the symbol's section. *LOCSYMSP caches local syms. */ + +static bfd_boolean +get_sym_h (struct elf_link_hash_entry **hp, + Elf_Internal_Sym **symp, + asection **symsecp, + Elf_Internal_Sym **locsymsp, + unsigned long r_symndx, + bfd *ibfd) +{ + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (ibfd); + struct elf_link_hash_entry *h; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (hp != NULL) + *hp = h; + + if (symp != NULL) + *symp = NULL; + + if (symsecp != NULL) + { + asection *symsec = NULL; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + symsec = h->root.u.def.section; + *symsecp = symsec; + } + } + else + { + Elf_Internal_Sym *sym; + Elf_Internal_Sym *locsyms = *locsymsp; + + if (locsyms == NULL) + { + locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (locsyms == NULL) + { + size_t symcount = symtab_hdr->sh_info; + + /* If we are reading symbols into the contents, then + read the global syms too. This is done to cache + syms for later stack analysis. */ + if ((unsigned char **) locsymsp == &symtab_hdr->contents) + symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize; + locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, 0, + NULL, NULL, NULL); + } + if (locsyms == NULL) + return FALSE; + *locsymsp = locsyms; + } + sym = locsyms + r_symndx; + + if (hp != NULL) + *hp = NULL; + + if (symp != NULL) + *symp = sym; + + if (symsecp != NULL) + { + asection *symsec = NULL; + if ((sym->st_shndx != SHN_UNDEF + && sym->st_shndx < SHN_LORESERVE) + || sym->st_shndx > SHN_HIRESERVE) + symsec = bfd_section_from_elf_index (ibfd, sym->st_shndx); + *symsecp = symsec; + } + } + + return TRUE; +} + +/* Build a name for an entry in the stub hash table. We can't use a + local symbol name because ld -r might generate duplicate local symbols. */ + +static char * +spu_stub_name (const asection *sym_sec, + const struct elf_link_hash_entry *h, + const Elf_Internal_Rela *rel) +{ + char *stub_name; + bfd_size_type len; + + if (h) + { + len = strlen (h->root.root.string) + 1 + 8 + 1; + stub_name = bfd_malloc (len); + if (stub_name == NULL) + return stub_name; + + sprintf (stub_name, "%s+%x", + h->root.root.string, + (int) rel->r_addend & 0xffffffff); + len -= 8; + } + else + { + len = 8 + 1 + 8 + 1 + 8 + 1; + stub_name = bfd_malloc (len); + if (stub_name == NULL) + return stub_name; + + sprintf (stub_name, "%x:%x+%x", + sym_sec->id & 0xffffffff, + (int) ELF32_R_SYM (rel->r_info) & 0xffffffff, + (int) rel->r_addend & 0xffffffff); + len = strlen (stub_name); + } + + if (stub_name[len - 2] == '+' + && stub_name[len - 1] == '0' + && stub_name[len] == 0) + stub_name[len - 2] = 0; + + return stub_name; +} + +/* Create the note section if not already present. This is done early so + that the linker maps the sections to the right place in the output. */ + +bfd_boolean +spu_elf_create_sections (bfd *output_bfd, + struct bfd_link_info *info, + int stack_analysis, + int emit_stack_syms) +{ + bfd *ibfd; + struct spu_link_hash_table *htab = spu_hash_table (info); + + /* Stash some options away where we can get at them later. */ + htab->stack_analysis = stack_analysis; + htab->emit_stack_syms = emit_stack_syms; + + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + if (bfd_get_section_by_name (ibfd, SPU_PTNOTE_SPUNAME) != NULL) + break; + + if (ibfd == NULL) + { + /* Make SPU_PTNOTE_SPUNAME section. */ + asection *s; + size_t name_len; + size_t size; + bfd_byte *data; + flagword flags; + + ibfd = info->input_bfds; + flags = SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY; + s = bfd_make_section_anyway_with_flags (ibfd, SPU_PTNOTE_SPUNAME, flags); + if (s == NULL + || !bfd_set_section_alignment (ibfd, s, 4)) + return FALSE; + + name_len = strlen (bfd_get_filename (output_bfd)) + 1; + size = 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4); + size += (name_len + 3) & -4; + + if (!bfd_set_section_size (ibfd, s, size)) + return FALSE; + + data = bfd_zalloc (ibfd, size); + if (data == NULL) + return FALSE; + + bfd_put_32 (ibfd, sizeof (SPU_PLUGIN_NAME), data + 0); + bfd_put_32 (ibfd, name_len, data + 4); + bfd_put_32 (ibfd, 1, data + 8); + memcpy (data + 12, SPU_PLUGIN_NAME, sizeof (SPU_PLUGIN_NAME)); + memcpy (data + 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4), + bfd_get_filename (output_bfd), name_len); + s->contents = data; + } + + return TRUE; +} + +/* qsort predicate to sort sections by vma. */ + +static int +sort_sections (const void *a, const void *b) +{ + const asection *const *s1 = a; + const asection *const *s2 = b; + bfd_signed_vma delta = (*s1)->vma - (*s2)->vma; + + if (delta != 0) + return delta < 0 ? -1 : 1; + + return (*s1)->index - (*s2)->index; +} + +/* Identify overlays in the output bfd, and number them. */ + +bfd_boolean +spu_elf_find_overlays (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + asection **alloc_sec; + unsigned int i, n, ovl_index, num_buf; + asection *s; + bfd_vma ovl_end; + + if (output_bfd->section_count < 2) + return FALSE; + + alloc_sec = bfd_malloc (output_bfd->section_count * sizeof (*alloc_sec)); + if (alloc_sec == NULL) + return FALSE; + + /* Pick out all the alloced sections. */ + for (n = 0, s = output_bfd->sections; s != NULL; s = s->next) + if ((s->flags & SEC_ALLOC) != 0 + && (s->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != SEC_THREAD_LOCAL + && s->size != 0) + alloc_sec[n++] = s; + + if (n == 0) + { + free (alloc_sec); + return FALSE; + } + + /* Sort them by vma. */ + qsort (alloc_sec, n, sizeof (*alloc_sec), sort_sections); + + /* Look for overlapping vmas. Any with overlap must be overlays. + Count them. Also count the number of overlay regions and for + each region save a section from that region with the lowest vma + and another section with the highest end vma. */ + ovl_end = alloc_sec[0]->vma + alloc_sec[0]->size; + for (ovl_index = 0, num_buf = 0, i = 1; i < n; i++) + { + s = alloc_sec[i]; + if (s->vma < ovl_end) + { + asection *s0 = alloc_sec[i - 1]; + + if (spu_elf_section_data (s0)->ovl_index == 0) + { + spu_elf_section_data (s0)->ovl_index = ++ovl_index; + alloc_sec[num_buf * 2] = s0; + alloc_sec[num_buf * 2 + 1] = s0; + num_buf++; + } + spu_elf_section_data (s)->ovl_index = ++ovl_index; + if (ovl_end < s->vma + s->size) + { + ovl_end = s->vma + s->size; + alloc_sec[num_buf * 2 - 1] = s; + } + } + else + ovl_end = s->vma + s->size; + } + + htab->num_overlays = ovl_index; + htab->num_buf = num_buf; + if (ovl_index == 0) + { + free (alloc_sec); + return FALSE; + } + + alloc_sec = bfd_realloc (alloc_sec, num_buf * 2 * sizeof (*alloc_sec)); + if (alloc_sec == NULL) + return FALSE; + + htab->ovl_region = alloc_sec; + return TRUE; +} + +/* One of these per stub. */ +#define SIZEOF_STUB1 8 +#define ILA_79 0x4200004f /* ila $79,function_address */ +#define BR 0x32000000 /* br stub2 */ + +/* One of these per overlay. */ +#define SIZEOF_STUB2 8 +#define ILA_78 0x4200004e /* ila $78,overlay_number */ + /* br __ovly_load */ +#define NOP 0x40200000 + +/* Return true for all relative and absolute branch instructions. + bra 00110000 0.. + brasl 00110001 0.. + br 00110010 0.. + brsl 00110011 0.. + brz 00100000 0.. + brnz 00100001 0.. + brhz 00100010 0.. + brhnz 00100011 0.. */ + +static bfd_boolean +is_branch (const unsigned char *insn) +{ + return (insn[0] & 0xec) == 0x20 && (insn[1] & 0x80) == 0; +} + +/* Return true for branch hint instructions. + hbra 0001000.. + hbrr 0001001.. */ + +static bfd_boolean +is_hint (const unsigned char *insn) +{ + return (insn[0] & 0xfc) == 0x10; +} + +/* Return TRUE if this reloc symbol should possibly go via an overlay stub. */ + +static bfd_boolean +needs_ovl_stub (const char *sym_name, + asection *sym_sec, + asection *input_section, + struct spu_link_hash_table *htab, + bfd_boolean is_branch) +{ + if (htab->num_overlays == 0) + return FALSE; + + if (sym_sec == NULL + || sym_sec->output_section == NULL + || spu_elf_section_data (sym_sec->output_section) == NULL) + return FALSE; + + /* setjmp always goes via an overlay stub, because then the return + and hence the longjmp goes via __ovly_return. That magically + makes setjmp/longjmp between overlays work. */ + if (strncmp (sym_name, "setjmp", 6) == 0 + && (sym_name[6] == '\0' || sym_name[6] == '@')) + return TRUE; + + /* Usually, symbols in non-overlay sections don't need stubs. */ + if (spu_elf_section_data (sym_sec->output_section)->ovl_index == 0 + && !htab->non_overlay_stubs) + return FALSE; + + /* A reference from some other section to a symbol in an overlay + section needs a stub. */ + if (spu_elf_section_data (sym_sec->output_section)->ovl_index + != spu_elf_section_data (input_section->output_section)->ovl_index) + return TRUE; + + /* If this insn isn't a branch then we are possibly taking the + address of a function and passing it out somehow. */ + return !is_branch; +} + +struct stubarr { + struct bfd_hash_table *stub_hash_table; + struct spu_stub_hash_entry **sh; + unsigned int count; + int err; +}; + +/* Called via elf_link_hash_traverse to allocate stubs for any _SPUEAR_ + symbols. */ + +static bfd_boolean +allocate_spuear_stubs (struct elf_link_hash_entry *h, void *inf) +{ + /* Symbols starting with _SPUEAR_ need a stub because they may be + invoked by the PPU. */ + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->def_regular + && strncmp (h->root.root.string, "_SPUEAR_", 8) == 0) + { + struct stubarr *stubs = inf; + static Elf_Internal_Rela zero_rel; + char *stub_name = spu_stub_name (h->root.u.def.section, h, &zero_rel); + struct spu_stub_hash_entry *sh; + + if (stub_name == NULL) + { + stubs->err = 1; + return FALSE; + } + + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (stubs->stub_hash_table, stub_name, TRUE, FALSE); + if (sh == NULL) + { + free (stub_name); + return FALSE; + } + + /* If this entry isn't new, we already have a stub. */ + if (sh->target_section != NULL) + { + free (stub_name); + return TRUE; + } + + sh->target_section = h->root.u.def.section; + sh->target_off = h->root.u.def.value; + stubs->count += 1; + } + + return TRUE; +} + +/* Called via bfd_hash_traverse to set up pointers to all symbols + in the stub hash table. */ + +static bfd_boolean +populate_stubs (struct bfd_hash_entry *bh, void *inf) +{ + struct stubarr *stubs = inf; + + stubs->sh[--stubs->count] = (struct spu_stub_hash_entry *) bh; + return TRUE; +} + +/* qsort predicate to sort stubs by overlay number. */ + +static int +sort_stubs (const void *a, const void *b) +{ + const struct spu_stub_hash_entry *const *sa = a; + const struct spu_stub_hash_entry *const *sb = b; + int i; + bfd_signed_vma d; + + i = spu_elf_section_data ((*sa)->target_section->output_section)->ovl_index; + i -= spu_elf_section_data ((*sb)->target_section->output_section)->ovl_index; + if (i != 0) + return i; + + d = ((*sa)->target_section->output_section->vma + + (*sa)->target_section->output_offset + + (*sa)->target_off + - (*sb)->target_section->output_section->vma + - (*sb)->target_section->output_offset + - (*sb)->target_off); + if (d != 0) + return d < 0 ? -1 : 1; + + /* Two functions at the same address. Aliases perhaps. */ + i = strcmp ((*sb)->root.string, (*sa)->root.string); + BFD_ASSERT (i != 0); + return i; +} + +/* Allocate space for overlay call and return stubs. */ + +bfd_boolean +spu_elf_size_stubs (bfd *output_bfd, + struct bfd_link_info *info, + int non_overlay_stubs, + int stack_analysis, + asection **stub, + asection **ovtab, + asection **toe) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + bfd *ibfd; + struct stubarr stubs; + unsigned i, group; + flagword flags; + + htab->non_overlay_stubs = non_overlay_stubs; + stubs.stub_hash_table = &htab->stub_hash_table; + stubs.count = 0; + stubs.err = 0; + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + Elf_Internal_Shdr *symtab_hdr; + asection *section; + Elf_Internal_Sym *local_syms = NULL; + void *psyms; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + /* We'll need the symbol table in a second. */ + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + if (symtab_hdr->sh_info == 0) + continue; + + /* Arrange to read and keep global syms for later stack analysis. */ + psyms = &local_syms; + if (stack_analysis) + psyms = &symtab_hdr->contents; + + /* Walk over each section attached to the input bfd. */ + for (section = ibfd->sections; section != NULL; section = section->next) + { + Elf_Internal_Rela *internal_relocs, *irelaend, *irela; + + /* If there aren't any relocs, then there's nothing more to do. */ + if ((section->flags & SEC_RELOC) == 0 + || (section->flags & SEC_ALLOC) == 0 + || (section->flags & SEC_LOAD) == 0 + || section->reloc_count == 0) + continue; + + /* If this section is a link-once section that will be + discarded, then don't create any stubs. */ + if (section->output_section == NULL + || section->output_section->owner != output_bfd) + continue; + + /* Get the relocs. */ + internal_relocs + = _bfd_elf_link_read_relocs (ibfd, section, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + goto error_ret_free_local; + + /* Now examine each relocation. */ + irela = internal_relocs; + irelaend = irela + section->reloc_count; + for (; irela < irelaend; irela++) + { + enum elf_spu_reloc_type r_type; + unsigned int r_indx; + asection *sym_sec; + Elf_Internal_Sym *sym; + struct elf_link_hash_entry *h; + const char *sym_name; + char *stub_name; + struct spu_stub_hash_entry *sh; + unsigned int sym_type; + enum _insn_type { non_branch, branch, call } insn_type; + + r_type = ELF32_R_TYPE (irela->r_info); + r_indx = ELF32_R_SYM (irela->r_info); + + if (r_type >= R_SPU_max) + { + bfd_set_error (bfd_error_bad_value); + goto error_ret_free_internal; + } + + /* Determine the reloc target section. */ + if (!get_sym_h (&h, &sym, &sym_sec, psyms, r_indx, ibfd)) + goto error_ret_free_internal; + + if (sym_sec == NULL + || sym_sec->output_section == NULL + || sym_sec->output_section->owner != output_bfd) + continue; + + /* Ensure no stubs for user supplied overlay manager syms. */ + if (h != NULL + && (strcmp (h->root.root.string, "__ovly_load") == 0 + || strcmp (h->root.root.string, "__ovly_return") == 0)) + continue; + + insn_type = non_branch; + if (r_type == R_SPU_REL16 + || r_type == R_SPU_ADDR16) + { + unsigned char insn[4]; + + if (!bfd_get_section_contents (ibfd, section, insn, + irela->r_offset, 4)) + goto error_ret_free_internal; + + if (is_branch (insn) || is_hint (insn)) + { + insn_type = branch; + if ((insn[0] & 0xfd) == 0x31) + insn_type = call; + } + } + + /* We are only interested in function symbols. */ + if (h != NULL) + { + sym_type = h->type; + sym_name = h->root.root.string; + } + else + { + sym_type = ELF_ST_TYPE (sym->st_info); + sym_name = bfd_elf_sym_name (sym_sec->owner, + symtab_hdr, + sym, + sym_sec); + } + if (sym_type != STT_FUNC) + { + /* It's common for people to write assembly and forget + to give function symbols the right type. Handle + calls to such symbols, but warn so that (hopefully) + people will fix their code. We need the symbol + type to be correct to distinguish function pointer + initialisation from other pointer initialisation. */ + if (insn_type == call) + (*_bfd_error_handler) (_("warning: call to non-function" + " symbol %s defined in %B"), + sym_sec->owner, sym_name); + else + continue; + } + + if (!needs_ovl_stub (sym_name, sym_sec, section, htab, + insn_type != non_branch)) + continue; + + stub_name = spu_stub_name (sym_sec, h, irela); + if (stub_name == NULL) + goto error_ret_free_internal; + + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (&htab->stub_hash_table, stub_name, + TRUE, FALSE); + if (sh == NULL) + { + free (stub_name); + error_ret_free_internal: + if (elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + error_ret_free_local: + if (local_syms != NULL + && (symtab_hdr->contents + != (unsigned char *) local_syms)) + free (local_syms); + return FALSE; + } + + /* If this entry isn't new, we already have a stub. */ + if (sh->target_section != NULL) + { + free (stub_name); + continue; + } + + sh->target_section = sym_sec; + if (h != NULL) + sh->target_off = h->root.u.def.value; + else + sh->target_off = sym->st_value; + sh->target_off += irela->r_addend; + + stubs.count += 1; + } + + /* We're done with the internal relocs, free them. */ + if (elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + } + + if (local_syms != NULL + && symtab_hdr->contents != (unsigned char *) local_syms) + { + if (!info->keep_memory) + free (local_syms); + else + symtab_hdr->contents = (unsigned char *) local_syms; + } + } + + elf_link_hash_traverse (&htab->elf, allocate_spuear_stubs, &stubs); + if (stubs.err) + return FALSE; + + *stub = NULL; + if (stubs.count == 0) + return TRUE; + + ibfd = info->input_bfds; + flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY + | SEC_HAS_CONTENTS | SEC_IN_MEMORY); + htab->stub = bfd_make_section_anyway_with_flags (ibfd, ".stub", flags); + *stub = htab->stub; + if (htab->stub == NULL + || !bfd_set_section_alignment (ibfd, htab->stub, 2)) + return FALSE; + + flags = (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_IN_MEMORY); + htab->ovtab = bfd_make_section_anyway_with_flags (ibfd, ".ovtab", flags); + *ovtab = htab->ovtab; + if (htab->ovtab == NULL + || !bfd_set_section_alignment (ibfd, htab->stub, 4)) + return FALSE; + + *toe = bfd_make_section_anyway_with_flags (ibfd, ".toe", SEC_ALLOC); + if (*toe == NULL + || !bfd_set_section_alignment (ibfd, *toe, 4)) + return FALSE; + (*toe)->size = 16; + + /* Retrieve all the stubs and sort. */ + stubs.sh = bfd_malloc (stubs.count * sizeof (*stubs.sh)); + if (stubs.sh == NULL) + return FALSE; + i = stubs.count; + bfd_hash_traverse (&htab->stub_hash_table, populate_stubs, &stubs); + BFD_ASSERT (stubs.count == 0); + + stubs.count = i; + qsort (stubs.sh, stubs.count, sizeof (*stubs.sh), sort_stubs); + + /* Now that the stubs are sorted, place them in the stub section. + Stubs are grouped per overlay + . ila $79,func1 + . br 1f + . ila $79,func2 + . br 1f + . + . + . ila $79,funcn + . nop + . 1: + . ila $78,ovl_index + . br __ovly_load */ + + group = 0; + for (i = 0; i < stubs.count; i++) + { + if (spu_elf_section_data (stubs.sh[group]->target_section + ->output_section)->ovl_index + != spu_elf_section_data (stubs.sh[i]->target_section + ->output_section)->ovl_index) + { + htab->stub->size += SIZEOF_STUB2; + for (; group != i; group++) + stubs.sh[group]->delta + = stubs.sh[i - 1]->off - stubs.sh[group]->off; + } + if (group == i + || ((stubs.sh[i - 1]->target_section->output_section->vma + + stubs.sh[i - 1]->target_section->output_offset + + stubs.sh[i - 1]->target_off) + != (stubs.sh[i]->target_section->output_section->vma + + stubs.sh[i]->target_section->output_offset + + stubs.sh[i]->target_off))) + { + stubs.sh[i]->off = htab->stub->size; + htab->stub->size += SIZEOF_STUB1; + } + else + stubs.sh[i]->off = stubs.sh[i - 1]->off; + } + if (group != i) + htab->stub->size += SIZEOF_STUB2; + for (; group != i; group++) + stubs.sh[group]->delta = stubs.sh[i - 1]->off - stubs.sh[group]->off; + + /* htab->ovtab consists of two arrays. + . struct { + . u32 vma; + . u32 size; + . u32 file_off; + . u32 buf; + . } _ovly_table[]; + . + . struct { + . u32 mapped; + . } _ovly_buf_table[]; */ + + htab->ovtab->alignment_power = 4; + htab->ovtab->size = htab->num_overlays * 16 + htab->num_buf * 4; + + return TRUE; +} + +/* Functions to handle embedded spu_ovl.o object. */ + +static void * +ovl_mgr_open (struct bfd *nbfd ATTRIBUTE_UNUSED, void *stream) +{ + return stream; +} + +static file_ptr +ovl_mgr_pread (struct bfd *abfd ATTRIBUTE_UNUSED, + void *stream, + void *buf, + file_ptr nbytes, + file_ptr offset) +{ + struct _ovl_stream *os; + size_t count; + size_t max; + + os = (struct _ovl_stream *) stream; + max = (const char *) os->end - (const char *) os->start; + + if ((ufile_ptr) offset >= max) + return 0; + + count = nbytes; + if (count > max - offset) + count = max - offset; + + memcpy (buf, (const char *) os->start + offset, count); + return count; +} + +bfd_boolean +spu_elf_open_builtin_lib (bfd **ovl_bfd, const struct _ovl_stream *stream) +{ + *ovl_bfd = bfd_openr_iovec ("builtin ovl_mgr", + "elf32-spu", + ovl_mgr_open, + (void *) stream, + ovl_mgr_pread, + NULL, + NULL); + return *ovl_bfd != NULL; +} + +/* Fill in the ila and br for a stub. On the last stub for a group, + write the stub that sets the overlay number too. */ + +static bfd_boolean +write_one_stub (struct bfd_hash_entry *bh, void *inf) +{ + struct spu_stub_hash_entry *ent = (struct spu_stub_hash_entry *) bh; + struct spu_link_hash_table *htab = inf; + asection *sec = htab->stub; + asection *s = ent->target_section; + unsigned int ovl; + bfd_vma val; + + val = ent->target_off + s->output_offset + s->output_section->vma; + bfd_put_32 (sec->owner, ILA_79 + ((val << 7) & 0x01ffff80), + sec->contents + ent->off); + val = ent->delta + 4; + bfd_put_32 (sec->owner, BR + ((val << 5) & 0x007fff80), + sec->contents + ent->off + 4); + + /* If this is the last stub of this group, write stub2. */ + if (ent->delta == 0) + { + bfd_put_32 (sec->owner, NOP, + sec->contents + ent->off + 4); + + ovl = spu_elf_section_data (s->output_section)->ovl_index; + bfd_put_32 (sec->owner, ILA_78 + ((ovl << 7) & 0x01ffff80), + sec->contents + ent->off + 8); + + val = (htab->ovly_load->root.u.def.section->output_section->vma + + htab->ovly_load->root.u.def.section->output_offset + + htab->ovly_load->root.u.def.value + - (sec->output_section->vma + + sec->output_offset + + ent->off + 12)); + + if (val + 0x20000 >= 0x40000) + htab->stub_overflow = TRUE; + + bfd_put_32 (sec->owner, BR + ((val << 5) & 0x007fff80), + sec->contents + ent->off + 12); + } + + if (htab->emit_stub_syms) + { + struct elf_link_hash_entry *h; + size_t len1, len2; + char *name; + + len1 = sizeof ("00000000.ovl_call.") - 1; + len2 = strlen (ent->root.string); + name = bfd_malloc (len1 + len2 + 1); + if (name == NULL) + return FALSE; + memcpy (name, "00000000.ovl_call.", len1); + memcpy (name + len1, ent->root.string, len2 + 1); + h = elf_link_hash_lookup (&htab->elf, name, TRUE, TRUE, FALSE); + free (name); + if (h == NULL) + return FALSE; + if (h->root.type == bfd_link_hash_new) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = sec; + h->root.u.def.value = ent->off; + h->size = (ent->delta == 0 + ? SIZEOF_STUB1 + SIZEOF_STUB2 : SIZEOF_STUB1); + h->type = STT_FUNC; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->forced_local = 1; + h->non_elf = 0; + } + } + + return TRUE; +} + +/* Define an STT_OBJECT symbol. */ + +static struct elf_link_hash_entry * +define_ovtab_symbol (struct spu_link_hash_table *htab, const char *name) +{ + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (&htab->elf, name, TRUE, FALSE, FALSE); + if (h == NULL) + return NULL; + + if (h->root.type != bfd_link_hash_defined + || !h->def_regular) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = htab->ovtab; + h->type = STT_OBJECT; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->non_elf = 0; + } + else + { + (*_bfd_error_handler) (_("%B is not allowed to define %s"), + h->root.u.def.section->owner, + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return NULL; + } + + return h; +} + +/* Fill in all stubs and the overlay tables. */ + +bfd_boolean +spu_elf_build_stubs (struct bfd_link_info *info, int emit_syms, asection *toe) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + struct elf_link_hash_entry *h; + bfd_byte *p; + asection *s; + bfd *obfd; + unsigned int i; + + htab->emit_stub_syms = emit_syms; + htab->stub->contents = bfd_zalloc (htab->stub->owner, htab->stub->size); + if (htab->stub->contents == NULL) + return FALSE; + + h = elf_link_hash_lookup (&htab->elf, "__ovly_load", FALSE, FALSE, FALSE); + htab->ovly_load = h; + BFD_ASSERT (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->def_regular); + + s = h->root.u.def.section->output_section; + if (spu_elf_section_data (s)->ovl_index) + { + (*_bfd_error_handler) (_("%s in overlay section"), + h->root.u.def.section->owner); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + /* Write out all the stubs. */ + bfd_hash_traverse (&htab->stub_hash_table, write_one_stub, htab); + + if (htab->stub_overflow) + { + (*_bfd_error_handler) (_("overlay stub relocation overflow")); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + htab->ovtab->contents = bfd_zalloc (htab->ovtab->owner, htab->ovtab->size); + if (htab->ovtab->contents == NULL) + return FALSE; + + /* Write out _ovly_table. */ + p = htab->ovtab->contents; + obfd = htab->ovtab->output_section->owner; + for (s = obfd->sections; s != NULL; s = s->next) + { + unsigned int ovl_index = spu_elf_section_data (s)->ovl_index; + + if (ovl_index != 0) + { + unsigned int lo, hi, mid; + unsigned long off = (ovl_index - 1) * 16; + bfd_put_32 (htab->ovtab->owner, s->vma, p + off); + bfd_put_32 (htab->ovtab->owner, (s->size + 15) & -16, p + off + 4); + /* file_off written later in spu_elf_modify_program_headers. */ + + lo = 0; + hi = htab->num_buf; + while (lo < hi) + { + mid = (lo + hi) >> 1; + if (htab->ovl_region[2 * mid + 1]->vma + + htab->ovl_region[2 * mid + 1]->size <= s->vma) + lo = mid + 1; + else if (htab->ovl_region[2 * mid]->vma > s->vma) + hi = mid; + else + { + bfd_put_32 (htab->ovtab->owner, mid + 1, p + off + 12); + break; + } + } + BFD_ASSERT (lo < hi); + } + } + + /* Write out _ovly_buf_table. */ + p = htab->ovtab->contents + htab->num_overlays * 16; + for (i = 0; i < htab->num_buf; i++) + { + bfd_put_32 (htab->ovtab->owner, 0, p); + p += 4; + } + + h = define_ovtab_symbol (htab, "_ovly_table"); + if (h == NULL) + return FALSE; + h->root.u.def.value = 0; + h->size = htab->num_overlays * 16; + + h = define_ovtab_symbol (htab, "_ovly_table_end"); + if (h == NULL) + return FALSE; + h->root.u.def.value = htab->num_overlays * 16; + h->size = 0; + + h = define_ovtab_symbol (htab, "_ovly_buf_table"); + if (h == NULL) + return FALSE; + h->root.u.def.value = htab->num_overlays * 16; + h->size = htab->num_buf * 4; + + h = define_ovtab_symbol (htab, "_ovly_buf_table_end"); + if (h == NULL) + return FALSE; + h->root.u.def.value = htab->num_overlays * 16 + htab->num_buf * 4; + h->size = 0; + + h = define_ovtab_symbol (htab, "_EAR_"); + if (h == NULL) + return FALSE; + h->root.u.def.section = toe; + h->root.u.def.value = 0; + h->size = 16; + + return TRUE; +} + +/* OFFSET in SEC (presumably) is the beginning of a function prologue. + Search for stack adjusting insns, and return the sp delta. */ + +static int +find_function_stack_adjust (asection *sec, bfd_vma offset) +{ + int unrecog; + int reg[128]; + + memset (reg, 0, sizeof (reg)); + for (unrecog = 0; offset + 4 <= sec->size && unrecog < 32; offset += 4) + { + unsigned char buf[4]; + int rt, ra; + int imm; + + /* Assume no relocs on stack adjusing insns. */ + if (!bfd_get_section_contents (sec->owner, sec, buf, offset, 4)) + break; + + if (buf[0] == 0x24 /* stqd */) + continue; + + rt = buf[3] & 0x7f; + ra = ((buf[2] & 0x3f) << 1) | (buf[3] >> 7); + /* Partly decoded immediate field. */ + imm = (buf[1] << 9) | (buf[2] << 1) | (buf[3] >> 7); + + if (buf[0] == 0x1c /* ai */) + { + imm >>= 7; + imm = (imm ^ 0x200) - 0x200; + reg[rt] = reg[ra] + imm; + + if (rt == 1 /* sp */) + { + if (imm > 0) + break; + return reg[rt]; + } + } + else if (buf[0] == 0x18 && (buf[1] & 0xe0) == 0 /* a */) + { + int rb = ((buf[1] & 0x1f) << 2) | ((buf[2] & 0xc0) >> 6); + + reg[rt] = reg[ra] + reg[rb]; + if (rt == 1) + return reg[rt]; + } + else if ((buf[0] & 0xfc) == 0x40 /* il, ilh, ilhu, ila */) + { + if (buf[0] >= 0x42 /* ila */) + imm |= (buf[0] & 1) << 17; + else + { + imm &= 0xffff; + + if (buf[0] == 0x40 /* il */) + { + if ((buf[1] & 0x80) == 0) + goto unknown_insn; + imm = (imm ^ 0x8000) - 0x8000; + } + else if ((buf[1] & 0x80) == 0 /* ilhu */) + imm <<= 16; + } + reg[rt] = imm; + continue; + } + else if (buf[0] == 0x60 && (buf[1] & 0x80) != 0 /* iohl */) + { + reg[rt] |= imm & 0xffff; + continue; + } + else if (buf[0] == 0x04 /* ori */) + { + imm >>= 7; + imm = (imm ^ 0x200) - 0x200; + reg[rt] = reg[ra] | imm; + continue; + } + else if ((buf[0] == 0x33 && imm == 1 /* brsl .+4 */) + || (buf[0] == 0x08 && (buf[1] & 0xe0) == 0 /* sf */)) + { + /* Used in pic reg load. Say rt is trashed. */ + reg[rt] = 0; + continue; + } + else if (is_branch (buf)) + /* If we hit a branch then we must be out of the prologue. */ + break; + unknown_insn: + ++unrecog; + } + + return 0; +} + +/* qsort predicate to sort symbols by section and value. */ + +static Elf_Internal_Sym *sort_syms_syms; +static asection **sort_syms_psecs; + +static int +sort_syms (const void *a, const void *b) +{ + Elf_Internal_Sym *const *s1 = a; + Elf_Internal_Sym *const *s2 = b; + asection *sec1,*sec2; + bfd_signed_vma delta; + + sec1 = sort_syms_psecs[*s1 - sort_syms_syms]; + sec2 = sort_syms_psecs[*s2 - sort_syms_syms]; + + if (sec1 != sec2) + return sec1->index - sec2->index; + + delta = (*s1)->st_value - (*s2)->st_value; + if (delta != 0) + return delta < 0 ? -1 : 1; + + delta = (*s2)->st_size - (*s1)->st_size; + if (delta != 0) + return delta < 0 ? -1 : 1; + + return *s1 < *s2 ? -1 : 1; +} + +struct call_info +{ + struct function_info *fun; + struct call_info *next; + int is_tail; +}; + +struct function_info +{ + /* List of functions called. Also branches to hot/cold part of + function. */ + struct call_info *call_list; + /* For hot/cold part of function, point to owner. */ + struct function_info *start; + /* Symbol at start of function. */ + union { + Elf_Internal_Sym *sym; + struct elf_link_hash_entry *h; + } u; + /* Function section. */ + asection *sec; + /* Address range of (this part of) function. */ + bfd_vma lo, hi; + /* Stack usage. */ + int stack; + /* Set if global symbol. */ + unsigned int global : 1; + /* Set if known to be start of function (as distinct from a hunk + in hot/cold section. */ + unsigned int is_func : 1; + /* Flags used during call tree traversal. */ + unsigned int visit1 : 1; + unsigned int non_root : 1; + unsigned int visit2 : 1; + unsigned int marking : 1; + unsigned int visit3 : 1; +}; + +struct spu_elf_stack_info +{ + int num_fun; + int max_fun; + /* Variable size array describing functions, one per contiguous + address range belonging to a function. */ + struct function_info fun[1]; +}; + +/* Allocate a struct spu_elf_stack_info with MAX_FUN struct function_info + entries for section SEC. */ + +static struct spu_elf_stack_info * +alloc_stack_info (asection *sec, int max_fun) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + bfd_size_type amt; + + amt = sizeof (struct spu_elf_stack_info); + amt += (max_fun - 1) * sizeof (struct function_info); + sec_data->stack_info = bfd_zmalloc (amt); + if (sec_data->stack_info != NULL) + sec_data->stack_info->max_fun = max_fun; + return sec_data->stack_info; +} + +/* Add a new struct function_info describing a (part of a) function + starting at SYM_H. Keep the array sorted by address. */ + +static struct function_info * +maybe_insert_function (asection *sec, + void *sym_h, + bfd_boolean global, + bfd_boolean is_func) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + struct spu_elf_stack_info *sinfo = sec_data->stack_info; + int i; + bfd_vma off, size; + + if (sinfo == NULL) + { + sinfo = alloc_stack_info (sec, 20); + if (sinfo == NULL) + return NULL; + } + + if (!global) + { + Elf_Internal_Sym *sym = sym_h; + off = sym->st_value; + size = sym->st_size; + } + else + { + struct elf_link_hash_entry *h = sym_h; + off = h->root.u.def.value; + size = h->size; + } + + for (i = sinfo->num_fun; --i >= 0; ) + if (sinfo->fun[i].lo <= off) + break; + + if (i >= 0) + { + /* Don't add another entry for an alias, but do update some + info. */ + if (sinfo->fun[i].lo == off) + { + /* Prefer globals over local syms. */ + if (global && !sinfo->fun[i].global) + { + sinfo->fun[i].global = TRUE; + sinfo->fun[i].u.h = sym_h; + } + if (is_func) + sinfo->fun[i].is_func = TRUE; + return &sinfo->fun[i]; + } + /* Ignore a zero-size symbol inside an existing function. */ + else if (sinfo->fun[i].hi > off && size == 0) + return &sinfo->fun[i]; + } + + if (++i < sinfo->num_fun) + memmove (&sinfo->fun[i + 1], &sinfo->fun[i], + (sinfo->num_fun - i) * sizeof (sinfo->fun[i])); + else if (i >= sinfo->max_fun) + { + bfd_size_type amt = sizeof (struct spu_elf_stack_info); + bfd_size_type old = amt; + + old += (sinfo->max_fun - 1) * sizeof (struct function_info); + sinfo->max_fun += 20 + (sinfo->max_fun >> 1); + amt += (sinfo->max_fun - 1) * sizeof (struct function_info); + sinfo = bfd_realloc (sinfo, amt); + if (sinfo == NULL) + return NULL; + memset ((char *) sinfo + old, 0, amt - old); + sec_data->stack_info = sinfo; + } + sinfo->fun[i].is_func = is_func; + sinfo->fun[i].global = global; + sinfo->fun[i].sec = sec; + if (global) + sinfo->fun[i].u.h = sym_h; + else + sinfo->fun[i].u.sym = sym_h; + sinfo->fun[i].lo = off; + sinfo->fun[i].hi = off + size; + sinfo->fun[i].stack = -find_function_stack_adjust (sec, off); + sinfo->num_fun += 1; + return &sinfo->fun[i]; +} + +/* Return the name of FUN. */ + +static const char * +func_name (struct function_info *fun) +{ + asection *sec; + bfd *ibfd; + Elf_Internal_Shdr *symtab_hdr; + + while (fun->start != NULL) + fun = fun->start; + + if (fun->global) + return fun->u.h->root.root.string; + + sec = fun->sec; + if (fun->u.sym->st_name == 0) + { + size_t len = strlen (sec->name); + char *name = bfd_malloc (len + 10); + if (name == NULL) + return "(null)"; + sprintf (name, "%s+%lx", sec->name, + (unsigned long) fun->u.sym->st_value & 0xffffffff); + return name; + } + ibfd = sec->owner; + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + return bfd_elf_sym_name (ibfd, symtab_hdr, fun->u.sym, sec); +} + +/* Read the instruction at OFF in SEC. Return true iff the instruction + is a nop, lnop, or stop 0 (all zero insn). */ + +static bfd_boolean +is_nop (asection *sec, bfd_vma off) +{ + unsigned char insn[4]; + + if (off + 4 > sec->size + || !bfd_get_section_contents (sec->owner, sec, insn, off, 4)) + return FALSE; + if ((insn[0] & 0xbf) == 0 && (insn[1] & 0xe0) == 0x20) + return TRUE; + if (insn[0] == 0 && insn[1] == 0 && insn[2] == 0 && insn[3] == 0) + return TRUE; + return FALSE; +} + +/* Extend the range of FUN to cover nop padding up to LIMIT. + Return TRUE iff some instruction other than a NOP was found. */ + +static bfd_boolean +insns_at_end (struct function_info *fun, bfd_vma limit) +{ + bfd_vma off = (fun->hi + 3) & -4; + + while (off < limit && is_nop (fun->sec, off)) + off += 4; + if (off < limit) + { + fun->hi = off; + return TRUE; + } + fun->hi = limit; + return FALSE; +} + +/* Check and fix overlapping function ranges. Return TRUE iff there + are gaps in the current info we have about functions in SEC. */ + +static bfd_boolean +check_function_ranges (asection *sec, struct bfd_link_info *info) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + struct spu_elf_stack_info *sinfo = sec_data->stack_info; + int i; + bfd_boolean gaps = FALSE; + + if (sinfo == NULL) + return FALSE; + + for (i = 1; i < sinfo->num_fun; i++) + if (sinfo->fun[i - 1].hi > sinfo->fun[i].lo) + { + /* Fix overlapping symbols. */ + const char *f1 = func_name (&sinfo->fun[i - 1]); + const char *f2 = func_name (&sinfo->fun[i]); + + info->callbacks->einfo (_("warning: %s overlaps %s\n"), f1, f2); + sinfo->fun[i - 1].hi = sinfo->fun[i].lo; + } + else if (insns_at_end (&sinfo->fun[i - 1], sinfo->fun[i].lo)) + gaps = TRUE; + + if (sinfo->num_fun == 0) + gaps = TRUE; + else + { + if (sinfo->fun[0].lo != 0) + gaps = TRUE; + if (sinfo->fun[sinfo->num_fun - 1].hi > sec->size) + { + const char *f1 = func_name (&sinfo->fun[sinfo->num_fun - 1]); + + info->callbacks->einfo (_("warning: %s exceeds section size\n"), f1); + sinfo->fun[sinfo->num_fun - 1].hi = sec->size; + } + else if (insns_at_end (&sinfo->fun[sinfo->num_fun - 1], sec->size)) + gaps = TRUE; + } + return gaps; +} + +/* Search current function info for a function that contains address + OFFSET in section SEC. */ + +static struct function_info * +find_function (asection *sec, bfd_vma offset, struct bfd_link_info *info) +{ + struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); + struct spu_elf_stack_info *sinfo = sec_data->stack_info; + int lo, hi, mid; + + lo = 0; + hi = sinfo->num_fun; + while (lo < hi) + { + mid = (lo + hi) / 2; + if (offset < sinfo->fun[mid].lo) + hi = mid; + else if (offset >= sinfo->fun[mid].hi) + lo = mid + 1; + else + return &sinfo->fun[mid]; + } + info->callbacks->einfo (_("%A:0x%v not found in function table\n"), + sec, offset); + return NULL; +} + +/* Add CALLEE to CALLER call list if not already present. */ + +static bfd_boolean +insert_callee (struct function_info *caller, struct call_info *callee) +{ + struct call_info *p; + for (p = caller->call_list; p != NULL; p = p->next) + if (p->fun == callee->fun) + { + /* Tail calls use less stack than normal calls. Retain entry + for normal call over one for tail call. */ + if (p->is_tail > callee->is_tail) + p->is_tail = callee->is_tail; + return FALSE; + } + callee->next = caller->call_list; + caller->call_list = callee; + return TRUE; +} + +/* Rummage through the relocs for SEC, looking for function calls. + If CALL_TREE is true, fill in call graph. If CALL_TREE is false, + mark destination symbols on calls as being functions. Also + look at branches, which may be tail calls or go to hot/cold + section part of same function. */ + +static bfd_boolean +mark_functions_via_relocs (asection *sec, + struct bfd_link_info *info, + int call_tree) +{ + Elf_Internal_Rela *internal_relocs, *irelaend, *irela; + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (sec->owner)->symtab_hdr; + Elf_Internal_Sym *syms; + void *psyms; + static bfd_boolean warned; + + internal_relocs = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + return FALSE; + + symtab_hdr = &elf_tdata (sec->owner)->symtab_hdr; + psyms = &symtab_hdr->contents; + syms = *(Elf_Internal_Sym **) psyms; + irela = internal_relocs; + irelaend = irela + sec->reloc_count; + for (; irela < irelaend; irela++) + { + enum elf_spu_reloc_type r_type; + unsigned int r_indx; + asection *sym_sec; + Elf_Internal_Sym *sym; + struct elf_link_hash_entry *h; + bfd_vma val; + unsigned char insn[4]; + bfd_boolean is_call; + struct function_info *caller; + struct call_info *callee; + + r_type = ELF32_R_TYPE (irela->r_info); + if (r_type != R_SPU_REL16 + && r_type != R_SPU_ADDR16) + continue; + + r_indx = ELF32_R_SYM (irela->r_info); + if (!get_sym_h (&h, &sym, &sym_sec, psyms, r_indx, sec->owner)) + return FALSE; + + if (sym_sec == NULL + || sym_sec->output_section == NULL + || sym_sec->output_section->owner != sec->output_section->owner) + continue; + + if (!bfd_get_section_contents (sec->owner, sec, insn, + irela->r_offset, 4)) + return FALSE; + if (!is_branch (insn)) + continue; + + if ((sym_sec->flags & (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + != (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + { + if (!call_tree) + warned = TRUE; + if (!call_tree || !warned) + info->callbacks->einfo (_("%B(%A+0x%v): call to non-code section" + " %B(%A), stack analysis incomplete\n"), + sec->owner, sec, irela->r_offset, + sym_sec->owner, sym_sec); + continue; + } + + is_call = (insn[0] & 0xfd) == 0x31; + + if (h) + val = h->root.u.def.value; + else + val = sym->st_value; + val += irela->r_addend; + + if (!call_tree) + { + struct function_info *fun; + + if (irela->r_addend != 0) + { + Elf_Internal_Sym *fake = bfd_zmalloc (sizeof (*fake)); + if (fake == NULL) + return FALSE; + fake->st_value = val; + fake->st_shndx + = _bfd_elf_section_from_bfd_section (sym_sec->owner, sym_sec); + sym = fake; + } + if (sym) + fun = maybe_insert_function (sym_sec, sym, FALSE, is_call); + else + fun = maybe_insert_function (sym_sec, h, TRUE, is_call); + if (fun == NULL) + return FALSE; + if (irela->r_addend != 0 + && fun->u.sym != sym) + free (sym); + continue; + } + + caller = find_function (sec, irela->r_offset, info); + if (caller == NULL) + return FALSE; + callee = bfd_malloc (sizeof *callee); + if (callee == NULL) + return FALSE; + + callee->fun = find_function (sym_sec, val, info); + if (callee->fun == NULL) + return FALSE; + callee->is_tail = !is_call; + if (!insert_callee (caller, callee)) + free (callee); + else if (!is_call + && !callee->fun->is_func + && callee->fun->stack == 0) + { + /* This is either a tail call or a branch from one part of + the function to another, ie. hot/cold section. If the + destination has been called by some other function then + it is a separate function. We also assume that functions + are not split across input files. */ + if (callee->fun->start != NULL + || sec->owner != sym_sec->owner) + { + callee->fun->start = NULL; + callee->fun->is_func = TRUE; + } + else + callee->fun->start = caller; + } + } + + return TRUE; +} + +/* Handle something like .init or .fini, which has a piece of a function. + These sections are pasted together to form a single function. */ + +static bfd_boolean +pasted_function (asection *sec, struct bfd_link_info *info) +{ + struct bfd_link_order *l; + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + Elf_Internal_Sym *fake; + struct function_info *fun, *fun_start; + + fake = bfd_zmalloc (sizeof (*fake)); + if (fake == NULL) + return FALSE; + fake->st_value = 0; + fake->st_size = sec->size; + fake->st_shndx + = _bfd_elf_section_from_bfd_section (sec->owner, sec); + fun = maybe_insert_function (sec, fake, FALSE, FALSE); + if (!fun) + return FALSE; + + /* Find a function immediately preceding this section. */ + fun_start = NULL; + for (l = sec->output_section->map_head.link_order; l != NULL; l = l->next) + { + if (l->u.indirect.section == sec) + { + if (fun_start != NULL) + { + if (fun_start->start) + fun_start = fun_start->start; + fun->start = fun_start; + } + return TRUE; + } + if (l->type == bfd_indirect_link_order + && (sec_data = spu_elf_section_data (l->u.indirect.section)) != NULL + && (sinfo = sec_data->stack_info) != NULL + && sinfo->num_fun != 0) + fun_start = &sinfo->fun[sinfo->num_fun - 1]; + } + + info->callbacks->einfo (_("%A link_order not found\n"), sec); + return FALSE; +} + +/* We're only interested in code sections. */ + +static bfd_boolean +interesting_section (asection *s, bfd *obfd, struct spu_link_hash_table *htab) +{ + return (s != htab->stub + && s->output_section != NULL + && s->output_section->owner == obfd + && ((s->flags & (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + == (SEC_ALLOC | SEC_LOAD | SEC_CODE)) + && s->size != 0); +} + +/* Map address ranges in code sections to functions. */ + +static bfd_boolean +discover_functions (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + bfd *ibfd; + int bfd_idx; + Elf_Internal_Sym ***psym_arr; + asection ***sec_arr; + bfd_boolean gaps = FALSE; + + bfd_idx = 0; + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + bfd_idx++; + + psym_arr = bfd_zmalloc (bfd_idx * sizeof (*psym_arr)); + if (psym_arr == NULL) + return FALSE; + sec_arr = bfd_zmalloc (bfd_idx * sizeof (*sec_arr)); + if (sec_arr == NULL) + return FALSE; + + + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + extern const bfd_target bfd_elf32_spu_vec; + Elf_Internal_Shdr *symtab_hdr; + asection *sec; + size_t symcount; + Elf_Internal_Sym *syms, *sy, **psyms, **psy; + asection **psecs, **p; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + /* Read all the symbols. */ + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize; + if (symcount == 0) + continue; + + syms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (syms == NULL) + { + syms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, 0, + NULL, NULL, NULL); + symtab_hdr->contents = (void *) syms; + if (syms == NULL) + return FALSE; + } + + /* Select defined function symbols that are going to be output. */ + psyms = bfd_malloc ((symcount + 1) * sizeof (*psyms)); + if (psyms == NULL) + return FALSE; + psym_arr[bfd_idx] = psyms; + psecs = bfd_malloc (symcount * sizeof (*psecs)); + if (psecs == NULL) + return FALSE; + sec_arr[bfd_idx] = psecs; + for (psy = psyms, p = psecs, sy = syms; sy < syms + symcount; ++p, ++sy) + if (ELF_ST_TYPE (sy->st_info) == STT_NOTYPE + || ELF_ST_TYPE (sy->st_info) == STT_FUNC) + { + asection *s; + + *p = s = bfd_section_from_elf_index (ibfd, sy->st_shndx); + if (s != NULL && interesting_section (s, output_bfd, htab)) + *psy++ = sy; + } + symcount = psy - psyms; + *psy = NULL; + + /* Sort them by section and offset within section. */ + sort_syms_syms = syms; + sort_syms_psecs = psecs; + qsort (psyms, symcount, sizeof (*psyms), sort_syms); + + /* Now inspect the function symbols. */ + for (psy = psyms; psy < psyms + symcount; ) + { + asection *s = psecs[*psy - syms]; + Elf_Internal_Sym **psy2; + + for (psy2 = psy; ++psy2 < psyms + symcount; ) + if (psecs[*psy2 - syms] != s) + break; + + if (!alloc_stack_info (s, psy2 - psy)) + return FALSE; + psy = psy2; + } + + /* First install info about properly typed and sized functions. + In an ideal world this will cover all code sections, except + when partitioning functions into hot and cold sections, + and the horrible pasted together .init and .fini functions. */ + for (psy = psyms; psy < psyms + symcount; ++psy) + { + sy = *psy; + if (ELF_ST_TYPE (sy->st_info) == STT_FUNC) + { + asection *s = psecs[sy - syms]; + if (!maybe_insert_function (s, sy, FALSE, TRUE)) + return FALSE; + } + } + + for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) + if (interesting_section (sec, output_bfd, htab)) + gaps |= check_function_ranges (sec, info); + } + + if (gaps) + { + /* See if we can discover more function symbols by looking at + relocations. */ + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + asection *sec; + + if (psym_arr[bfd_idx] == NULL) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (interesting_section (sec, output_bfd, htab) + && sec->reloc_count != 0) + { + if (!mark_functions_via_relocs (sec, info, FALSE)) + return FALSE; + } + } + + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + Elf_Internal_Shdr *symtab_hdr; + asection *sec; + Elf_Internal_Sym *syms, *sy, **psyms, **psy; + asection **psecs; + + if ((psyms = psym_arr[bfd_idx]) == NULL) + continue; + + psecs = sec_arr[bfd_idx]; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + syms = (Elf_Internal_Sym *) symtab_hdr->contents; + + gaps = FALSE; + for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) + if (interesting_section (sec, output_bfd, htab)) + gaps |= check_function_ranges (sec, info); + if (!gaps) + continue; + + /* Finally, install all globals. */ + for (psy = psyms; (sy = *psy) != NULL; ++psy) + { + asection *s; + + s = psecs[sy - syms]; + + /* Global syms might be improperly typed functions. */ + if (ELF_ST_TYPE (sy->st_info) != STT_FUNC + && ELF_ST_BIND (sy->st_info) == STB_GLOBAL) + { + if (!maybe_insert_function (s, sy, FALSE, FALSE)) + return FALSE; + } + } + + /* Some of the symbols we've installed as marking the + beginning of functions may have a size of zero. Extend + the range of such functions to the beginning of the + next symbol of interest. */ + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (interesting_section (sec, output_bfd, htab)) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + sec_data = spu_elf_section_data (sec); + sinfo = sec_data->stack_info; + if (sinfo != NULL) + { + int fun_idx; + bfd_vma hi = sec->size; + + for (fun_idx = sinfo->num_fun; --fun_idx >= 0; ) + { + sinfo->fun[fun_idx].hi = hi; + hi = sinfo->fun[fun_idx].lo; + } + } + /* No symbols in this section. Must be .init or .fini + or something similar. */ + else if (!pasted_function (sec, info)) + return FALSE; + } + } + } + + for (ibfd = info->input_bfds, bfd_idx = 0; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_idx++) + { + if (psym_arr[bfd_idx] == NULL) + continue; + + free (psym_arr[bfd_idx]); + free (sec_arr[bfd_idx]); + } + + free (psym_arr); + free (sec_arr); + + return TRUE; +} + +/* Mark nodes in the call graph that are called by some other node. */ + +static void +mark_non_root (struct function_info *fun) +{ + struct call_info *call; + + fun->visit1 = TRUE; + for (call = fun->call_list; call; call = call->next) + { + call->fun->non_root = TRUE; + if (!call->fun->visit1) + mark_non_root (call->fun); + } +} + +/* Remove cycles from the call graph. */ + +static void +call_graph_traverse (struct function_info *fun, struct bfd_link_info *info) +{ + struct call_info **callp, *call; + + fun->visit2 = TRUE; + fun->marking = TRUE; + + callp = &fun->call_list; + while ((call = *callp) != NULL) + { + if (!call->fun->visit2) + call_graph_traverse (call->fun, info); + else if (call->fun->marking) + { + const char *f1 = func_name (fun); + const char *f2 = func_name (call->fun); + + info->callbacks->info (_("Stack analysis will ignore the call " + "from %s to %s\n"), + f1, f2); + *callp = call->next; + continue; + } + callp = &call->next; + } + fun->marking = FALSE; +} + +/* Populate call_list for each function. */ + +static bfd_boolean +build_call_tree (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + bfd *ibfd; + + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + if (!interesting_section (sec, output_bfd, htab) + || sec->reloc_count == 0) + continue; + + if (!mark_functions_via_relocs (sec, info, TRUE)) + return FALSE; + } + + /* Transfer call info from hot/cold section part of function + to main entry. */ + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + { + if (sinfo->fun[i].start != NULL) + { + struct call_info *call = sinfo->fun[i].call_list; + + while (call != NULL) + { + struct call_info *call_next = call->next; + if (!insert_callee (sinfo->fun[i].start, call)) + free (call); + call = call_next; + } + sinfo->fun[i].call_list = NULL; + sinfo->fun[i].non_root = TRUE; + } + } + } + } + } + + /* Find the call graph root(s). */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + if (!sinfo->fun[i].visit1) + mark_non_root (&sinfo->fun[i]); + } + } + } + + /* Remove cycles from the call graph. We start from the root node(s) + so that we break cycles in a reasonable place. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + if (!sinfo->fun[i].non_root) + call_graph_traverse (&sinfo->fun[i], info); + } + } + } + + return TRUE; +} + +/* Descend the call graph for FUN, accumulating total stack required. */ + +static bfd_vma +sum_stack (struct function_info *fun, + struct bfd_link_info *info, + int emit_stack_syms) +{ + struct call_info *call; + struct function_info *max = NULL; + bfd_vma max_stack = fun->stack; + bfd_vma stack; + const char *f1; + + if (fun->visit3) + return max_stack; + + for (call = fun->call_list; call; call = call->next) + { + stack = sum_stack (call->fun, info, emit_stack_syms); + /* Include caller stack for normal calls, don't do so for + tail calls. fun->stack here is local stack usage for + this function. */ + if (!call->is_tail) + stack += fun->stack; + if (max_stack < stack) + { + max_stack = stack; + max = call->fun; + } + } + + f1 = func_name (fun); + info->callbacks->minfo (_("%s: 0x%v 0x%v\n"), f1, fun->stack, max_stack); + + if (fun->call_list) + { + info->callbacks->minfo (_(" calls:\n")); + for (call = fun->call_list; call; call = call->next) + { + const char *f2 = func_name (call->fun); + const char *ann1 = call->fun == max ? "*" : " "; + const char *ann2 = call->is_tail ? "t" : " "; + + info->callbacks->minfo (_(" %s%s %s\n"), ann1, ann2, f2); + } + } + + /* Now fun->stack holds cumulative stack. */ + fun->stack = max_stack; + fun->visit3 = TRUE; + + if (emit_stack_syms) + { + struct spu_link_hash_table *htab = spu_hash_table (info); + char *name = bfd_malloc (18 + strlen (f1)); + struct elf_link_hash_entry *h; + + if (name != NULL) + { + if (fun->global || ELF_ST_BIND (fun->u.sym->st_info) == STB_GLOBAL) + sprintf (name, "__stack_%s", f1); + else + sprintf (name, "__stack_%x_%s", fun->sec->id & 0xffffffff, f1); + + h = elf_link_hash_lookup (&htab->elf, name, TRUE, TRUE, FALSE); + free (name); + if (h != NULL + && (h->root.type == bfd_link_hash_new + || h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak)) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = bfd_abs_section_ptr; + h->root.u.def.value = max_stack; + h->size = 0; + h->type = 0; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->forced_local = 1; + h->non_elf = 0; + } + } + } + + return max_stack; +} + +/* Provide an estimate of total stack required. */ + +static bfd_boolean +spu_elf_stack_analysis (bfd *output_bfd, + struct bfd_link_info *info, + int emit_stack_syms) +{ + bfd *ibfd; + bfd_vma max_stack = 0; + + if (!discover_functions (output_bfd, info)) + return FALSE; + + if (!build_call_tree (output_bfd, info)) + return FALSE; + + info->callbacks->info (_("Stack size for call graph root nodes.\n")); + info->callbacks->minfo (_("\nStack size for functions. " + "Annotations: '*' max stack, 't' tail call\n")); + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + extern const bfd_target bfd_elf32_spu_vec; + asection *sec; + + if (ibfd->xvec != &bfd_elf32_spu_vec) + continue; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + struct _spu_elf_section_data *sec_data; + struct spu_elf_stack_info *sinfo; + + if ((sec_data = spu_elf_section_data (sec)) != NULL + && (sinfo = sec_data->stack_info) != NULL) + { + int i; + for (i = 0; i < sinfo->num_fun; ++i) + { + if (!sinfo->fun[i].non_root) + { + bfd_vma stack; + const char *f1; + + stack = sum_stack (&sinfo->fun[i], info, + emit_stack_syms); + f1 = func_name (&sinfo->fun[i]); + info->callbacks->info (_(" %s: 0x%v\n"), + f1, stack); + if (max_stack < stack) + max_stack = stack; + } + } + } + } + } + + info->callbacks->info (_("Maximum stack required is 0x%v\n"), max_stack); + return TRUE; +} + +/* Perform a final link. */ + +static bfd_boolean +spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + + if (htab->stack_analysis + && !spu_elf_stack_analysis (output_bfd, info, htab->emit_stack_syms)) + info->callbacks->einfo ("%X%P: stack analysis error: %E\n"); + + return bfd_elf_final_link (output_bfd, info); +} + +/* Called when not normally emitting relocs, ie. !info->relocatable + and !info->emitrelocations. Returns a count of special relocs + that need to be emitted. */ + +static unsigned int +spu_elf_count_relocs (asection *sec, Elf_Internal_Rela *relocs) +{ + unsigned int count = 0; + Elf_Internal_Rela *relend = relocs + sec->reloc_count; + + for (; relocs < relend; relocs++) + { + int r_type = ELF32_R_TYPE (relocs->r_info); + if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64) + ++count; + } + + return count; +} + +/* Apply RELOCS to CONTENTS of INPUT_SECTION from INPUT_BFD. */ + +static bfd_boolean +spu_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + struct spu_link_hash_table *htab; + bfd_boolean ret = TRUE; + bfd_boolean emit_these_relocs = FALSE; + + htab = spu_hash_table (info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = (struct elf_link_hash_entry **) (elf_sym_hashes (input_bfd)); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + const char *sym_name; + bfd_vma relocation; + bfd_vma addend; + bfd_reloc_status_type r; + bfd_boolean unresolved_reloc; + bfd_boolean warned; + bfd_boolean branch; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64) + { + emit_these_relocs = TRUE; + continue; + } + + howto = elf_howto_table + r_type; + unresolved_reloc = FALSE; + warned = FALSE; + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + } + else + { + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + sym_name = h->root.root.string; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + + if (unresolved_reloc) + { + (*_bfd_error_handler) + (_("%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"), + input_bfd, + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name, + sym_name); + ret = FALSE; + } + + /* If this symbol is in an overlay area, we may need to relocate + to the overlay stub. */ + addend = rel->r_addend; + branch = (is_branch (contents + rel->r_offset) + || is_hint (contents + rel->r_offset)); + if (needs_ovl_stub (sym_name, sec, input_section, htab, branch)) + { + char *stub_name; + struct spu_stub_hash_entry *sh; + + stub_name = spu_stub_name (sec, h, rel); + if (stub_name == NULL) + return FALSE; + + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); + if (sh != NULL) + { + relocation = (htab->stub->output_section->vma + + htab->stub->output_offset + + sh->off); + addend = 0; + } + free (stub_name); + } + + r = _bfd_final_link_relocate (howto, + input_bfd, + input_section, + contents, + rel->r_offset, relocation, addend); + + if (r != bfd_reloc_ok) + { + const char *msg = (const char *) 0; + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), sym_name, howto->name, + (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) + return FALSE; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, sym_name, input_bfd, input_section, + rel->r_offset, TRUE))) + return FALSE; + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous error"); + goto common_error; + + default: + msg = _("internal error: unknown error"); + /* fall through */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, sym_name, input_bfd, input_section, + rel->r_offset))) + return FALSE; + break; + } + } + } + + if (ret + && emit_these_relocs + && !info->relocatable + && !info->emitrelocations) + { + Elf_Internal_Rela *wrel; + Elf_Internal_Shdr *rel_hdr; + + wrel = rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64) + *wrel++ = *rel; + } + input_section->reloc_count = wrel - relocs; + /* Backflips for _bfd_elf_link_output_relocs. */ + rel_hdr = &elf_section_data (input_section)->rel_hdr; + rel_hdr->sh_size = input_section->reloc_count * rel_hdr->sh_entsize; + ret = 2; + } + + return ret; +} + +/* Adjust _SPUEAR_ syms to point at their overlay stubs. */ + +static bfd_boolean +spu_elf_output_symbol_hook (struct bfd_link_info *info, + const char *sym_name ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym, + asection *sym_sec ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + + if (!info->relocatable + && htab->num_overlays != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->def_regular + && strncmp (h->root.root.string, "_SPUEAR_", 8) == 0) + { + static Elf_Internal_Rela zero_rel; + char *stub_name = spu_stub_name (h->root.u.def.section, h, &zero_rel); + struct spu_stub_hash_entry *sh; + + if (stub_name == NULL) + return FALSE; + sh = (struct spu_stub_hash_entry *) + bfd_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); + free (stub_name); + if (sh == NULL) + return TRUE; + sym->st_shndx + = _bfd_elf_section_from_bfd_section (htab->stub->output_section->owner, + htab->stub->output_section); + sym->st_value = (htab->stub->output_section->vma + + htab->stub->output_offset + + sh->off); + } + + return TRUE; +} + +static int spu_plugin = 0; + +void +spu_elf_plugin (int val) +{ + spu_plugin = val; +} + +/* Set ELF header e_type for plugins. */ + +static void +spu_elf_post_process_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + if (spu_plugin) + { + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); + + i_ehdrp->e_type = ET_DYN; + } +} + +/* We may add an extra PT_LOAD segment for .toe. We also need extra + segments for overlays. */ + +static int +spu_elf_additional_program_headers (bfd *abfd, struct bfd_link_info *info) +{ + struct spu_link_hash_table *htab = spu_hash_table (info); + int extra = htab->num_overlays; + asection *sec; + + if (extra) + ++extra; + + sec = bfd_get_section_by_name (abfd, ".toe"); + if (sec != NULL && (sec->flags & SEC_LOAD) != 0) + ++extra; + + return extra; +} + +/* Remove .toe section from other PT_LOAD segments and put it in + a segment of its own. Put overlays in separate segments too. */ + +static bfd_boolean +spu_elf_modify_segment_map (bfd *abfd, struct bfd_link_info *info) +{ + asection *toe, *s; + struct elf_segment_map *m; + unsigned int i; + + if (info == NULL) + return TRUE; + + toe = bfd_get_section_by_name (abfd, ".toe"); + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD && m->count > 1) + for (i = 0; i < m->count; i++) + if ((s = m->sections[i]) == toe + || spu_elf_section_data (s)->ovl_index != 0) + { + struct elf_segment_map *m2; + bfd_vma amt; + + if (i + 1 < m->count) + { + amt = sizeof (struct elf_segment_map); + amt += (m->count - (i + 2)) * sizeof (m->sections[0]); + m2 = bfd_zalloc (abfd, amt); + if (m2 == NULL) + return FALSE; + m2->count = m->count - (i + 1); + memcpy (m2->sections, m->sections + i + 1, + m2->count * sizeof (m->sections[0])); + m2->p_type = PT_LOAD; + m2->next = m->next; + m->next = m2; + } + m->count = 1; + if (i != 0) + { + m->count = i; + amt = sizeof (struct elf_segment_map); + m2 = bfd_zalloc (abfd, amt); + if (m2 == NULL) + return FALSE; + m2->p_type = PT_LOAD; + m2->count = 1; + m2->sections[0] = s; + m2->next = m->next; + m->next = m2; + } + break; + } + + return TRUE; +} + +/* Check that all loadable section VMAs lie in the range + LO .. HI inclusive. */ + +asection * +spu_elf_check_vma (bfd *abfd, bfd_vma lo, bfd_vma hi) +{ + struct elf_segment_map *m; + unsigned int i; + + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + for (i = 0; i < m->count; i++) + if (m->sections[i]->size != 0 + && (m->sections[i]->vma < lo + || m->sections[i]->vma > hi + || m->sections[i]->vma + m->sections[i]->size - 1 > hi)) + return m->sections[i]; + + return NULL; +} + +/* Tweak the section type of .note.spu_name. */ + +static bfd_boolean +spu_elf_fake_sections (bfd *obfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *hdr, + asection *sec) +{ + if (strcmp (sec->name, SPU_PTNOTE_SPUNAME) == 0) + hdr->sh_type = SHT_NOTE; + return TRUE; +} + +/* Tweak phdrs before writing them out. */ + +static int +spu_elf_modify_program_headers (bfd *abfd, struct bfd_link_info *info) +{ + const struct elf_backend_data *bed; + struct elf_obj_tdata *tdata; + Elf_Internal_Phdr *phdr, *last; + struct spu_link_hash_table *htab; + unsigned int count; + unsigned int i; + + if (info == NULL) + return TRUE; + + bed = get_elf_backend_data (abfd); + tdata = elf_tdata (abfd); + phdr = tdata->phdr; + count = tdata->program_header_size / bed->s->sizeof_phdr; + htab = spu_hash_table (info); + if (htab->num_overlays != 0) + { + struct elf_segment_map *m; + unsigned int o; + + for (i = 0, m = elf_tdata (abfd)->segment_map; m; ++i, m = m->next) + if (m->count != 0 + && (o = spu_elf_section_data (m->sections[0])->ovl_index) != 0) + { + /* Mark this as an overlay header. */ + phdr[i].p_flags |= PF_OVERLAY; + + if (htab->ovtab != NULL && htab->ovtab->size != 0) + { + bfd_byte *p = htab->ovtab->contents; + unsigned int off = (o - 1) * 16 + 8; + + /* Write file_off into _ovly_table. */ + bfd_put_32 (htab->ovtab->owner, phdr[i].p_offset, p + off); + } + } + } + + /* Round up p_filesz and p_memsz of PT_LOAD segments to multiples + of 16. This should always be possible when using the standard + linker scripts, but don't create overlapping segments if + someone is playing games with linker scripts. */ + last = NULL; + for (i = count; i-- != 0; ) + if (phdr[i].p_type == PT_LOAD) + { + unsigned adjust; + + adjust = -phdr[i].p_filesz & 15; + if (adjust != 0 + && last != NULL + && phdr[i].p_offset + phdr[i].p_filesz > last->p_offset - adjust) + break; + + adjust = -phdr[i].p_memsz & 15; + if (adjust != 0 + && last != NULL + && phdr[i].p_filesz != 0 + && phdr[i].p_vaddr + phdr[i].p_memsz > last->p_vaddr - adjust + && phdr[i].p_vaddr + phdr[i].p_memsz <= last->p_vaddr) + break; + + if (phdr[i].p_filesz != 0) + last = &phdr[i]; + } + + if (i == (unsigned int) -1) + for (i = count; i-- != 0; ) + if (phdr[i].p_type == PT_LOAD) + { + unsigned adjust; + + adjust = -phdr[i].p_filesz & 15; + phdr[i].p_filesz += adjust; + + adjust = -phdr[i].p_memsz & 15; + phdr[i].p_memsz += adjust; + } + + return TRUE; +} + +#define TARGET_BIG_SYM bfd_elf32_spu_vec +#define TARGET_BIG_NAME "elf32-spu" +#define ELF_ARCH bfd_arch_spu +#define ELF_MACHINE_CODE EM_SPU +/* This matches the alignment need for DMA. */ +#define ELF_MAXPAGESIZE 0x80 +#define elf_backend_rela_normal 1 +#define elf_backend_can_gc_sections 1 + +#define bfd_elf32_bfd_reloc_type_lookup spu_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup spu_elf_reloc_name_lookup +#define elf_info_to_howto spu_elf_info_to_howto +#define elf_backend_count_relocs spu_elf_count_relocs +#define elf_backend_relocate_section spu_elf_relocate_section +#define elf_backend_symbol_processing spu_elf_backend_symbol_processing +#define elf_backend_link_output_symbol_hook spu_elf_output_symbol_hook +#define bfd_elf32_new_section_hook spu_elf_new_section_hook +#define bfd_elf32_bfd_link_hash_table_create spu_elf_link_hash_table_create +#define bfd_elf32_bfd_link_hash_table_free spu_elf_link_hash_table_free + +#define elf_backend_additional_program_headers spu_elf_additional_program_headers +#define elf_backend_modify_segment_map spu_elf_modify_segment_map +#define elf_backend_modify_program_headers spu_elf_modify_program_headers +#define elf_backend_post_process_headers spu_elf_post_process_headers +#define elf_backend_fake_sections spu_elf_fake_sections +#define elf_backend_special_sections spu_elf_special_sections +#define bfd_elf32_bfd_final_link spu_elf_final_link + +#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-spu.h b/contrib/binutils/bfd/elf32-spu.h new file mode 100644 index 00000000000..b74c3102b8b --- /dev/null +++ b/contrib/binutils/bfd/elf32-spu.h @@ -0,0 +1,57 @@ +/* SPU specific support for 32-bit ELF. + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Extra info kept for SPU sections. */ + +struct spu_elf_stack_info; + +struct _spu_elf_section_data +{ + struct bfd_elf_section_data elf; + + /* Stack analysis info kept for this section. */ + + struct spu_elf_stack_info *stack_info; + + /* Non-zero for overlay output sections. */ + unsigned int ovl_index; +}; + +#define spu_elf_section_data(sec) \ + ((struct _spu_elf_section_data *) elf_section_data (sec)) + +struct _ovl_stream +{ + const void *start; + const void *end; +}; + +extern void spu_elf_plugin (int); +extern bfd_boolean spu_elf_open_builtin_lib (bfd **, + const struct _ovl_stream *); +extern bfd_boolean spu_elf_create_sections (bfd *, + struct bfd_link_info *, int, int); +extern bfd_boolean spu_elf_find_overlays (bfd *, struct bfd_link_info *); +extern bfd_boolean spu_elf_size_stubs (bfd *, struct bfd_link_info *, int, int, + asection **, asection **, + asection **); +extern bfd_boolean spu_elf_build_stubs (struct bfd_link_info *, int, + asection *); +extern asection *spu_elf_check_vma (bfd *, bfd_vma, bfd_vma); diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c index 76d0661a116..3d4350d0082 100644 --- a/contrib/binutils/bfd/elf64-alpha.c +++ b/contrib/binutils/bfd/elf64-alpha.c @@ -1,6 +1,6 @@ /* Alpha specific support for 64-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ /* We need a published ABI spec for this. Until one comes out, don't assume this'll remain unchanged forever. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -184,6 +184,10 @@ struct alpha_elf_link_hash_table /* The head of a list of .got subsections linked through alpha_elf_tdata(abfd)->got_link_next. */ bfd *got_list; + + /* The most recent relax pass that we've seen. The GOTs + should be regenerated if this doesn't match. */ + int relax_trip; }; /* Look up an entry in a Alpha ELF linker hash table. */ @@ -321,11 +325,14 @@ struct alpha_elf_obj_tdata static bfd_boolean elf64_alpha_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -1052,6 +1059,23 @@ elf64_alpha_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return 0; } +static reloc_howto_type * +elf64_alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf64_alpha_howto_table) + / sizeof (elf64_alpha_howto_table[0])); + i++) + if (elf64_alpha_howto_table[i].name != NULL + && strcasecmp (elf64_alpha_howto_table[i].name, r_name) == 0) + return &elf64_alpha_howto_table[i]; + + return NULL; +} + /* Given an Alpha ELF reloc type, fill in an arelent structure. */ static void @@ -1898,7 +1922,7 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info, if (rel_sec_name == NULL) return FALSE; - BFD_ASSERT (strncmp (rel_sec_name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (rel_sec_name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), rel_sec_name+5) == 0); } @@ -2032,6 +2056,19 @@ elf64_alpha_adjust_dynamic_symbol (struct bfd_link_info *info, return TRUE; } +/* Record STO_ALPHA_NOPV and STO_ALPHA_STD_GPLOAD. */ + +static void +elf64_alpha_merge_symbol_attribute (struct elf_link_hash_entry *h, + const Elf_Internal_Sym *isym, + bfd_boolean definition, + bfd_boolean dynamic) +{ + if (!dynamic && definition) + h->other = ((h->other & ELF_ST_VISIBILITY (-1)) + | (isym->st_other & ~ELF_ST_VISIBILITY (-1))); +} + /* Symbol versioning can create new symbols, and make our old symbols indirect to the new ones. Consolidate the got and reloc information in these situations. */ @@ -2342,7 +2379,6 @@ static bfd_boolean elf64_alpha_size_got_sections (struct bfd_link_info *info) { bfd *i, *got_list, *cur_got_obj = NULL; - int something_changed = 0; got_list = alpha_elf_hash_table (info)->got_list; @@ -2380,9 +2416,6 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info) return TRUE; alpha_elf_hash_table (info)->got_list = got_list; - - /* Force got offsets to be recalculated. */ - something_changed = 1; } cur_got_obj = got_list; @@ -2396,8 +2429,6 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info) alpha_elf_tdata(i)->got->size = 0; i = alpha_elf_tdata(i)->got_link_next; alpha_elf_tdata(cur_got_obj)->got_link_next = i; - - something_changed = 1; } else { @@ -2408,8 +2439,7 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info) /* Once the gots have been merged, fill in the got offsets for everything therein. */ - if (1 || something_changed) - elf64_alpha_calc_got_offsets (info); + elf64_alpha_calc_got_offsets (info); return TRUE; } @@ -2444,10 +2474,10 @@ elf64_alpha_size_plt_section_1 (struct alpha_elf_link_hash_entry *h, PTR data) return TRUE; } -/* Called from relax_section to rebuild the PLT in light of - potential changes in the function's status. */ +/* Called from relax_section to rebuild the PLT in light of potential changes + in the function's status. */ -static bfd_boolean +static void elf64_alpha_size_plt_section (struct bfd_link_info *info) { asection *splt, *spltrel, *sgotplt; @@ -2457,7 +2487,7 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) dynobj = elf_hash_table(info)->dynobj; splt = bfd_get_section_by_name (dynobj, ".plt"); if (splt == NULL) - return TRUE; + return; splt->size = 0; @@ -2466,6 +2496,7 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) /* Every plt entry requires a JMP_SLOT relocation. */ spltrel = bfd_get_section_by_name (dynobj, ".rela.plt"); + entries = 0; if (splt->size) { if (elf64_alpha_use_secureplt) @@ -2473,8 +2504,6 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) else entries = (splt->size - OLD_PLT_HEADER_SIZE) / OLD_PLT_ENTRY_SIZE; } - else - entries = 0; spltrel->size = entries * sizeof (Elf64_External_Rela); /* When using the secureplt, we need two words somewhere in the data @@ -2485,8 +2514,6 @@ elf64_alpha_size_plt_section (struct bfd_link_info *info) sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); sgotplt->size = entries ? 16 : 0; } - - return TRUE; } static bfd_boolean @@ -2657,7 +2684,7 @@ elf64_alpha_size_rela_got_1 (struct alpha_elf_link_hash_entry *h, /* Set the sizes of the dynamic relocation sections. */ -static bfd_boolean +static void elf64_alpha_size_rela_got_section (struct bfd_link_info *info) { unsigned long entries; @@ -2696,15 +2723,13 @@ elf64_alpha_size_rela_got_section (struct bfd_link_info *info) if (!srel) { BFD_ASSERT (entries == 0); - return TRUE; + return; } srel->size = sizeof (Elf64_External_Rela) * entries; /* Now do the non-local symbols. */ alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), elf64_alpha_size_rela_got_1, info); - - return TRUE; } /* Set the sizes of the dynamic sections. */ @@ -2758,7 +2783,7 @@ elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - if (strncmp (name, ".rela", 5) == 0) + if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -2770,7 +2795,7 @@ elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".plt") != 0 && strcmp (name, ".dynbss") != 0) { @@ -3576,7 +3601,7 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec, struct alpha_elf_got_entry **local_got_entries; struct alpha_relax_info info; - /* We are not currently changing any sizes, so only one pass. */ + /* There's nothing to change, yet. */ *again = FALSE; if (link_info->relocatable @@ -3585,6 +3610,22 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec, || sec->reloc_count == 0) return TRUE; + /* Make sure our GOT and PLT tables are up-to-date. */ + if (alpha_elf_hash_table(link_info)->relax_trip != link_info->relax_trip) + { + alpha_elf_hash_table(link_info)->relax_trip = link_info->relax_trip; + + /* This should never fail after the initial round, since the only + error is GOT overflow, and relaxation only shrinks the table. */ + if (!elf64_alpha_size_got_sections (link_info)) + abort (); + if (elf_hash_table (link_info)->dynamic_sections_created) + { + elf64_alpha_size_plt_section (link_info); + elf64_alpha_size_rela_got_section (link_info); + } + } + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; @@ -3794,13 +3835,6 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec, } } - if (!elf64_alpha_size_plt_section (link_info)) - return FALSE; - if (!elf64_alpha_size_got_sections (link_info)) - return FALSE; - if (!elf64_alpha_size_rela_got_section (link_info)) - return FALSE; - if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) { @@ -3896,9 +3930,11 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, unsigned long symtab_hdr_sh_info; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + struct elf_link_hash_entry **sym_hashes; bfd_boolean ret_val = TRUE; symtab_hdr_sh_info = elf_tdata (input_bfd)->symtab_hdr.sh_info; + sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; for (rel = relocs; rel < relend; rel++) @@ -3908,7 +3944,7 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec; unsigned long r_type; - r_type = ELF64_R_TYPE(rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); if (r_type >= R_ALPHA_max) { (*_bfd_error_handler) @@ -3919,22 +3955,49 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, continue; } - r_symndx = ELF64_R_SYM(rel->r_info); - /* The symbol associated with GPDISP and LITUSE is immaterial. Only the addend is significant. */ if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE) continue; + r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr_sh_info) { sym = local_syms + r_symndx; - if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } + sec = local_sections[r_symndx]; } + else + { + struct elf_link_hash_entry *h; + + h = sym_hashes[r_symndx - symtab_hdr_sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + continue; + + sym = NULL; + sec = h->root.u.def.section; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. */ + _bfd_clear_contents (elf64_alpha_howto_table + r_type, + input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset; } return ret_val; @@ -4134,6 +4197,17 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, gotent = h->got_entries; } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + addend = rel->r_addend; value += addend; @@ -4193,18 +4267,6 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, goto default_reloc; case R_ALPHA_GPREL32: - /* If the target section was a removed linkonce section, - r_symndx will be zero. In this case, assume that the - switch will not be used, so don't fill it in. If we - do nothing here, we'll get relocation truncated messages, - due to the placement of the application above 4GB. */ - if (r_symndx == 0) - { - r = bfd_reloc_ok; - break; - } - /* FALLTHRU */ - case R_ALPHA_GPREL16: case R_ALPHA_GPRELLOW: if (dynamic_symbol_p) @@ -5145,9 +5207,9 @@ elf64_alpha_reloc_type_class (const Elf_Internal_Rela *rela) static const struct bfd_elf_special_section elf64_alpha_special_sections[] = { - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { NULL, 0, 0, 0, 0 } }; /* ECOFF swapping routines. These are used when dealing with the @@ -5231,12 +5293,15 @@ static const struct elf_size_info alpha_elf_size_info = #define ELF_ARCH bfd_arch_alpha #define ELF_MACHINE_CODE EM_ALPHA #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x2000 #define bfd_elf64_bfd_link_hash_table_create \ elf64_alpha_bfd_link_hash_table_create #define bfd_elf64_bfd_reloc_type_lookup \ elf64_alpha_bfd_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + elf64_alpha_bfd_reloc_name_lookup #define elf_info_to_howto \ elf64_alpha_info_to_howto @@ -5267,10 +5332,14 @@ static const struct elf_size_info alpha_elf_size_info = elf64_alpha_create_dynamic_sections #define elf_backend_adjust_dynamic_symbol \ elf64_alpha_adjust_dynamic_symbol +#define elf_backend_merge_symbol_attribute \ + elf64_alpha_merge_symbol_attribute #define elf_backend_always_size_sections \ elf64_alpha_always_size_sections #define elf_backend_size_dynamic_sections \ elf64_alpha_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_relocate_section \ elf64_alpha_relocate_section #define elf_backend_finish_dynamic_symbol \ @@ -5305,6 +5374,8 @@ static const struct elf_size_info alpha_elf_size_info = #define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf64-alpha-freebsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD /* The kernel recognizes executables as valid only if they carry a "FreeBSD" label in the ELF header. So we put this label on all @@ -5319,7 +5390,7 @@ elf64_alpha_fbsd_post_process_headers (bfd * abfd, i_ehdrp = elf_elfheader (abfd); /* Put an ABI label supported by FreeBSD >= 4.1. */ - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; #ifdef OLD_FREEBSD_ABI_LABEL /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); diff --git a/contrib/binutils/bfd/elf64-gen.c b/contrib/binutils/bfd/elf64-gen.c index 49b8d9c5528..05a94f0650a 100644 --- a/contrib/binutils/bfd/elf64-gen.c +++ b/contrib/binutils/bfd/elf64-gen.c @@ -1,5 +1,5 @@ /* Generic support for 64-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005 + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" @@ -94,6 +94,7 @@ elf64_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/contrib/binutils/bfd/elf64-mips.c b/contrib/binutils/bfd/elf64-mips.c index c8f3127e3c9..e64b50caed0 100644 --- a/contrib/binutils/bfd/elf64-mips.c +++ b/contrib/binutils/bfd/elf64-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -40,8 +40,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. . the OldABI version is still lying around and should be removed. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/ar.h" #include "bfdlink.h" @@ -112,8 +112,6 @@ static bfd_reloc_status_type mips_elf64_gprel32_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_shift6_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); -static bfd_reloc_status_type mips16_jump_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_boolean mips_elf64_assign_gp @@ -791,6 +789,21 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* The relocation table used for SHT_RELA sections. */ @@ -1314,7 +1327,20 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = EMPTY_HOWTO (R_MIPS_TLS_DTPMOD32), EMPTY_HOWTO (R_MIPS_TLS_DTPREL32), EMPTY_HOWTO (R_MIPS_TLS_DTPMOD64), - EMPTY_HOWTO (R_MIPS_TLS_DTPREL64), + + HOWTO (R_MIPS_TLS_DTPREL64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_TLS_DTPREL64", /* name */ + TRUE, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + FALSE), /* pcrel_offset */ /* TLS general dynamic variable reference. */ HOWTO (R_MIPS_TLS_GD, /* type */ @@ -1423,6 +1449,21 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; static reloc_howto_type mips16_elf64_howto_table_rel[] = @@ -1438,7 +1479,7 @@ static reloc_howto_type mips16_elf64_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ TRUE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1510,7 +1551,7 @@ static reloc_howto_type mips16_elf64_howto_table_rela[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ FALSE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -2044,37 +2085,6 @@ mips_elf64_shift6_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, error_message); } -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, - asymbol *symbol, void *data ATTRIBUTE_UNUSED, - asection *input_section, bfd *output_bfd, - char **error_message ATTRIBUTE_UNUSED) -{ - if (output_bfd != NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME. */ - { - static bfd_boolean warned; - - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = TRUE; - } - - return bfd_reloc_undefined; -} - /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type @@ -2227,6 +2237,39 @@ bfd_elf64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (mips_elf64_howto_table_rela) + / sizeof (mips_elf64_howto_table_rela[0])); i++) + if (mips_elf64_howto_table_rela[i].name != NULL + && strcasecmp (mips_elf64_howto_table_rela[i].name, r_name) == 0) + return &mips_elf64_howto_table_rela[i]; + + for (i = 0; + i < (sizeof (mips16_elf64_howto_table_rela) + / sizeof (mips16_elf64_howto_table_rela[0])); + i++) + if (mips16_elf64_howto_table_rela[i].name != NULL + && strcasecmp (mips16_elf64_howto_table_rela[i].name, r_name) == 0) + return &mips16_elf64_howto_table_rela[i]; + + if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0) + return &elf_mips_gnu_vtinherit_howto; + if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0) + return &elf_mips_gnu_vtentry_howto; + if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0) + return &elf_mips_gnu_rel16_s2; + if (strcasecmp (elf_mips_gnu_rela16_s2.name, r_name) == 0) + return &elf_mips_gnu_rela16_s2; + + return NULL; +} + /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * @@ -3059,12 +3102,15 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_create_dynamic_sections \ _bfd_mips_elf_create_dynamic_sections #define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_merge_symbol_attribute \ + _bfd_mips_elf_merge_symbol_attribute #define elf_backend_adjust_dynamic_symbol \ _bfd_mips_elf_adjust_dynamic_symbol #define elf_backend_always_size_sections \ _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol @@ -3152,10 +3198,8 @@ extern bfd_boolean bfd_elf64_archive_write_armap #define TARGET_BIG_SYM bfd_elf64_bigmips_vec #define TARGET_BIG_NAME "elf64-bigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses - a value of 0x1000, and we are compatible. - FIXME: How does this affect NewABI? */ -#define ELF_MAXPAGESIZE 0x1000 +#define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #include "elf64-target.h" @@ -3166,15 +3210,15 @@ extern bfd_boolean bfd_elf64_archive_write_armap #undef TARGET_BIG_NAME #undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE #define TARGET_LITTLE_SYM bfd_elf64_tradlittlemips_vec #define TARGET_LITTLE_NAME "elf64-tradlittlemips" #define TARGET_BIG_SYM bfd_elf64_tradbigmips_vec #define TARGET_BIG_NAME "elf64-tradbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses - page sizes of up to that limit, so we need to respect it. */ #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf64_bed elf64_tradbed /* Include the target file again for this target. */ diff --git a/contrib/binutils/bfd/elf64-ppc.c b/contrib/binutils/bfd/elf64-ppc.c index 698f8e422c8..d7decd85e9d 100644 --- a/contrib/binutils/bfd/elf64-ppc.c +++ b/contrib/binutils/bfd/elf64-ppc.c @@ -1,5 +1,5 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Linus Nordberg, Swox AB , based on elf32-ppc.c by Ian Lance Taylor. @@ -25,8 +25,9 @@ http://www.linuxbase.org/spec/ELF/ppc64/PPC-elf64abi.txt, and http://www.linuxbase.org/spec/ELF/ppc64/spec/book1.html */ -#include "bfd.h" #include "sysdep.h" +#include +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -61,6 +62,7 @@ static bfd_vma opd_entry_value #define ELF_ARCH bfd_arch_powerpc #define ELF_MACHINE_CODE EM_PPC64 #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf_info_to_howto ppc64_elf_info_to_howto #define elf_backend_want_got_sym 0 @@ -71,9 +73,11 @@ static bfd_vma opd_entry_value #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 #define elf_backend_rela_normal 1 +#define elf_backend_default_execstack 0 #define bfd_elf64_mkobject ppc64_elf_mkobject #define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup ppc64_elf_reloc_name_lookup #define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data #define bfd_elf64_new_section_hook ppc64_elf_new_section_hook #define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create @@ -83,10 +87,12 @@ static bfd_vma opd_entry_value #define elf_backend_object_p ppc64_elf_object_p #define elf_backend_grok_prstatus ppc64_elf_grok_prstatus #define elf_backend_grok_psinfo ppc64_elf_grok_psinfo +#define elf_backend_write_core_note ppc64_elf_write_core_note #define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections #define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol #define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook #define elf_backend_check_directives ppc64_elf_check_directives +#define elf_backend_as_needed_cleanup ppc64_elf_as_needed_cleanup #define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup #define elf_backend_check_relocs ppc64_elf_check_relocs #define elf_backend_gc_mark_dynamic_ref ppc64_elf_gc_mark_dynamic_ref @@ -96,6 +102,7 @@ static bfd_vma opd_entry_value #define elf_backend_hide_symbol ppc64_elf_hide_symbol #define elf_backend_always_size_sections ppc64_elf_func_desc_adjust #define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_2_index_sections #define elf_backend_action_discarded ppc64_elf_action_discarded #define elf_backend_relocate_section ppc64_elf_relocate_section #define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol @@ -134,30 +141,29 @@ static bfd_vma opd_entry_value #define BCTR 0x4e800420 /* bctr */ +#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,off@ha */ #define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */ #define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */ #define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ -/* glink call stub instructions. We enter with the index in R0, and the - address of glink entry in CTR. From that, we can calculate PLT0. */ +/* glink call stub instructions. We enter with the index in R0. */ #define GLINK_CALL_STUB_SIZE (16*4) -#define MFCTR_R12 0x7d8902a6 /* mfctr %r12 */ -#define SLDI_R11_R0_3 0x780b1f24 /* sldi %r11,%r0,3 */ -#define ADDIC_R2_R0_32K 0x34408000 /* addic. %r2,%r0,-32768 */ -#define SUB_R12_R12_R11 0x7d8b6050 /* sub %r12,%r12,%r11 */ -#define SRADI_R2_R2_63 0x7c42fe76 /* sradi %r2,%r2,63 */ -#define SLDI_R11_R0_2 0x780b1764 /* sldi %r11,%r0,2 */ -#define AND_R2_R2_R11 0x7c425838 /* and %r2,%r2,%r11 */ - /* sub %r12,%r12,%r11 */ -#define ADD_R12_R12_R2 0x7d8c1214 /* add %r12,%r12,%r2 */ -#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */ - /* ld %r11,xxx@l(%r12) */ -#define ADDI_R12_R12 0x398c0000 /* addi %r12,%r12,xxx@l */ - /* ld %r2,8(%r12) */ - /* mtctr %r11 */ - /* ld %r11,16(%r12) */ - /* bctr */ + /* 0: */ + /* .quad plt0-1f */ + /* __glink: */ +#define MFLR_R12 0x7d8802a6 /* mflr %12 */ +#define BCL_20_31 0x429f0005 /* bcl 20,31,1f */ + /* 1: */ +#define MFLR_R11 0x7d6802a6 /* mflr %11 */ +#define LD_R2_M16R11 0xe84bfff0 /* ld %2,(0b-1b)(%11) */ +#define MTLR_R12 0x7d8803a6 /* mtlr %12 */ +#define ADD_R12_R2_R11 0x7d825a14 /* add %12,%2,%11 */ + /* ld %11,0(%12) */ + /* ld %2,8(%12) */ + /* mtctr %11 */ + /* ld %11,16(%12) */ + /* bctr */ /* Pad with this. */ #define NOP 0x60000000 @@ -1193,7 +1199,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { /* Like R_PPC64_PLTGOT16, but for instructions with a DS field. */ /* FIXME: R_PPC64_PLTGOT16_DS not implemented. */ - HOWTO (R_PPC64_PLTGOT16_DS, /* type */ + HOWTO (R_PPC64_PLTGOT16_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -2106,6 +2112,22 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return ppc64_elf_howto_table[r]; }; +static reloc_howto_type * +ppc64_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]); + i++) + if (ppc64_elf_howto_raw[i].name != NULL + && strcasecmp (ppc64_elf_howto_raw[i].name, r_name) == 0) + return &ppc64_elf_howto_raw[i]; + + return NULL; +} + /* Set the howto pointer for a PowerPC ELF reloc. */ static void @@ -2376,14 +2398,9 @@ struct ppc64_elf_obj_tdata asection *got; asection *relgot; - union { - /* Used during garbage collection. We attach global symbols defined - on removed .opd entries to this section so that the sym is removed. */ - asection *deleted_section; - - /* Used when adding symbols. */ - bfd_boolean has_dotsym; - } u; + /* Used during garbage collection. We attach global symbols defined + on removed .opd entries to this section so that the sym is removed. */ + asection *deleted_section; /* TLS local dynamic got entry handling. Suppose for multiple GOT sections means we potentially need one of these for each input bfd. */ @@ -2407,11 +2424,14 @@ struct ppc64_elf_obj_tdata static bfd_boolean ppc64_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct ppc64_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct ppc64_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } /* Return 1 if target is one of ours. */ @@ -2484,6 +2504,53 @@ ppc64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) return TRUE; } +static char * +ppc64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, + ...) +{ + switch (note_type) + { + default: + return NULL; + + case NT_PRPSINFO: + { + char data[136]; + va_list ap; + + va_start (ap, note_type); + memset (data, 0, 40); + strncpy (data + 40, va_arg (ap, const char *), 16); + strncpy (data + 56, va_arg (ap, const char *), 80); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + + case NT_PRSTATUS: + { + char data[504]; + va_list ap; + long pid; + int cursig; + const void *greg; + + va_start (ap, note_type); + memset (data, 0, 112); + pid = va_arg (ap, long); + bfd_put_32 (abfd, pid, data + 32); + cursig = va_arg (ap, int); + bfd_put_16 (abfd, cursig, data + 12); + greg = va_arg (ap, const void *); + memcpy (data + 112, greg, 384); + memset (data + 496, 0, 8); + va_end (ap); + return elfcore_write_note (abfd, buf, bufsiz, + "CORE", note_type, data, sizeof (data)); + } + } +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -2517,13 +2584,19 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) static const struct bfd_elf_special_section ppc64_elf_special_sections[]= { - { ".plt", 4, 0, SHT_NOBITS, 0 }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".toc", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".toc1", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".tocbss", 7, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".plt"), 0, SHT_NOBITS, 0 }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".toc"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".toc1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".tocbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } +}; + +enum _ppc64_sec_type { + sec_normal = 0, + sec_opd = 1, + sec_toc = 2 }; struct _ppc64_elf_section_data @@ -2534,14 +2607,20 @@ struct _ppc64_elf_section_data union { /* Points to the function code section for local opd entries. */ - asection **func_sec; + asection **opd_func_sec; /* After editing .opd, adjust references to opd local syms. */ - long *adjust; - } opd; + long *opd_adjust; - /* An array for toc sections, indexed by offset/8. - Specifies the relocation symbol index used at a given toc offset. */ - unsigned *t_symndx; + /* An array for toc sections, indexed by offset/8. + Specifies the relocation symbol index used at a given toc offset. */ + unsigned *t_symndx; + } u; + + enum _ppc64_sec_type sec_type:2; + + /* Flag set when small branches are detected. Used to + select suitable defaults for the stub group size. */ + unsigned int has_14bit_branch:1; }; #define ppc64_elf_section_data(sec) \ @@ -2550,13 +2629,16 @@ struct _ppc64_elf_section_data static bfd_boolean ppc64_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _ppc64_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _ppc64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -2566,8 +2648,8 @@ get_opd_info (asection * sec) { if (sec != NULL && ppc64_elf_section_data (sec) != NULL - && ppc64_elf_section_data (sec)->opd.adjust != NULL) - return ppc64_elf_section_data (sec)->opd.adjust; + && ppc64_elf_section_data (sec)->sec_type == sec_opd) + return ppc64_elf_section_data (sec)->u.opd_adjust; return NULL; } @@ -3234,9 +3316,14 @@ struct ppc_link_hash_entry { struct elf_link_hash_entry elf; - /* A pointer to the most recently used stub hash entry against this - symbol. */ - struct ppc_stub_hash_entry *stub_cache; + union { + /* A pointer to the most recently used stub hash entry against this + symbol. */ + struct ppc_stub_hash_entry *stub_cache; + + /* A pointer to the next symbol starting with a '.' */ + struct ppc_link_hash_entry *next_dot_sym; + } u; /* Track dynamic relocs copied for this symbol. */ struct ppc_dyn_relocs *dyn_relocs; @@ -3314,6 +3401,9 @@ struct ppc_link_hash_table /* Highest output section index. */ int top_index; + /* Used when adding symbols. */ + struct ppc_link_hash_entry *dot_syms; + /* List of input sections for each output section. */ asection **input_list; @@ -3348,10 +3438,6 @@ struct ppc_link_hash_table /* Set on error. */ unsigned int stub_error:1; - /* Flag set when small branches are detected. Used to - select suitable defaults for the stub group size. */ - unsigned int has_14bit_branch:1; - /* Temp used by ppc64_elf_check_directives. */ unsigned int twiddled_syms:1; @@ -3470,9 +3556,34 @@ link_hash_newfunc (struct bfd_hash_entry *entry, { struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) entry; - memset (&eh->stub_cache, 0, + memset (&eh->u.stub_cache, 0, (sizeof (struct ppc_link_hash_entry) - - offsetof (struct ppc_link_hash_entry, stub_cache))); + - offsetof (struct ppc_link_hash_entry, u.stub_cache))); + + /* When making function calls, old ABI code references function entry + points (dot symbols), while new ABI code references the function + descriptor symbol. We need to make any combination of reference and + definition work together, without breaking archive linking. + + For a defined function "foo" and an undefined call to "bar": + An old object defines "foo" and ".foo", references ".bar" (possibly + "bar" too). + A new object defines "foo" and references "bar". + + A new object thus has no problem with its undefined symbols being + satisfied by definitions in an old object. On the other hand, the + old object won't have ".bar" satisfied by a new object. + + Keep a list of newly added dot-symbols. */ + + if (string[0] == '.') + { + struct ppc_link_hash_table *htab; + + htab = (struct ppc_link_hash_table *) table; + eh->u.next_dot_sym = htab->dot_syms; + htab->dot_syms = eh; + } } return entry; @@ -3618,11 +3729,11 @@ ppc_get_stub_entry (const asection *input_section, distinguish between them. */ id_sec = htab->stub_group[input_section->id].link_sec; - if (h != NULL && h->stub_cache != NULL - && h->stub_cache->h == h - && h->stub_cache->id_sec == id_sec) + if (h != NULL && h->u.stub_cache != NULL + && h->u.stub_cache->h == h + && h->u.stub_cache->id_sec == id_sec) { - stub_entry = h->stub_cache; + stub_entry = h->u.stub_cache; } else { @@ -3635,7 +3746,7 @@ ppc_get_stub_entry (const asection *input_section, stub_entry = ppc_stub_hash_lookup (&htab->stub_hash_table, stub_name, FALSE, FALSE); if (h != NULL) - h->stub_cache = stub_entry; + h->u.stub_cache = stub_entry; free (stub_name); } @@ -3721,49 +3832,26 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info) htab->glink = bfd_make_section_anyway_with_flags (dynobj, ".glink", flags); if (htab->glink == NULL - || ! bfd_set_section_alignment (dynobj, htab->glink, 2)) + || ! bfd_set_section_alignment (dynobj, htab->glink, 3)) return FALSE; /* Create branch lookup table for plt_branch stubs. */ - if (info->shared) - { - flags = (SEC_ALLOC | SEC_LOAD - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->brlt - = bfd_make_section_anyway_with_flags (dynobj, ".data.rel.ro.brlt", - flags); - } - else - { - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->brlt - = bfd_make_section_anyway_with_flags (dynobj, ".rodata.brlt", flags); - } - + flags = (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + htab->brlt = bfd_make_section_anyway_with_flags (dynobj, ".branch_lt", + flags); if (htab->brlt == NULL || ! bfd_set_section_alignment (dynobj, htab->brlt, 3)) return FALSE; - if (info->shared) - { - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->relbrlt - = bfd_make_section_anyway_with_flags (dynobj, ".rela.data.rel.ro.brlt", - flags); - } - else if (info->emitrelocations) - { - flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY - | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->relbrlt - = bfd_make_section_anyway_with_flags (dynobj, ".rela.rodata.brlt", - flags); - } - else + if (!info->shared) return TRUE; + flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY + | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); + htab->relbrlt = bfd_make_section_anyway_with_flags (dynobj, + ".rela.branch_lt", + flags); if (!htab->relbrlt || ! bfd_set_section_alignment (dynobj, htab->relbrlt, 3)) return FALSE; @@ -4044,29 +4132,14 @@ make_fdh (struct bfd_link_info *info, return fdh; } -/* Hacks to support old ABI code. - When making function calls, old ABI code references function entry - points (dot symbols), while new ABI code references the function - descriptor symbol. We need to make any combination of reference and - definition work together, without breaking archive linking. - - For a defined function "foo" and an undefined call to "bar": - An old object defines "foo" and ".foo", references ".bar" (possibly - "bar" too). - A new object defines "foo" and references "bar". - - A new object thus has no problem with its undefined symbols being - satisfied by definitions in an old object. On the other hand, the - old object won't have ".bar" satisfied by a new object. */ - /* Fix function descriptor symbols defined in .opd sections to be function type. */ static bfd_boolean -ppc64_elf_add_symbol_hook (bfd *ibfd, +ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED, struct bfd_link_info *info ATTRIBUTE_UNUSED, Elf_Internal_Sym *isym, - const char **name, + const char **name ATTRIBUTE_UNUSED, flagword *flags ATTRIBUTE_UNUSED, asection **sec, bfd_vma *value ATTRIBUTE_UNUSED) @@ -4075,12 +4148,6 @@ ppc64_elf_add_symbol_hook (bfd *ibfd, && strcmp (bfd_get_section_name (ibfd, *sec), ".opd") == 0) isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC); - if ((*name)[0] == '.' - && ELF_ST_BIND (isym->st_info) == STB_GLOBAL - && ELF_ST_TYPE (isym->st_info) < STT_SECTION - && is_ppc64_elf_target (ibfd->xvec)) - ppc64_elf_tdata (ibfd)->u.has_dotsym = 1; - return TRUE; } @@ -4129,35 +4196,25 @@ ppc64_elf_archive_symbol_lookup (bfd *abfd, most restrictive visibility of the function descriptor and the function entry symbol is used. */ -struct add_symbol_adjust_data -{ - struct bfd_link_info *info; - bfd_boolean ok; -}; - static bfd_boolean -add_symbol_adjust (struct elf_link_hash_entry *h, void *inf) +add_symbol_adjust (struct ppc_link_hash_entry *eh, struct bfd_link_info *info) { - struct add_symbol_adjust_data *data; struct ppc_link_hash_table *htab; - struct ppc_link_hash_entry *eh; struct ppc_link_hash_entry *fdh; - if (h->root.type == bfd_link_hash_indirect) + if (eh->elf.root.type == bfd_link_hash_indirect) return TRUE; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (eh->elf.root.type == bfd_link_hash_warning) + eh = (struct ppc_link_hash_entry *) eh->elf.root.u.i.link; - if (h->root.root.string[0] != '.') - return TRUE; + if (eh->elf.root.root.string[0] != '.') + abort (); - data = inf; - htab = ppc_hash_table (data->info); - eh = (struct ppc_link_hash_entry *) h; + htab = ppc_hash_table (info); fdh = get_fdh (eh, htab); if (fdh == NULL - && !data->info->relocatable + && !info->relocatable && (eh->elf.root.type == bfd_link_hash_undefined || eh->elf.root.type == bfd_link_hash_undefweak) && eh->elf.ref_regular) @@ -4165,9 +4222,9 @@ add_symbol_adjust (struct elf_link_hash_entry *h, void *inf) /* Make an undefweak function descriptor sym, which is enough to pull in an --as-needed shared lib, but won't cause link errors. Archives are handled elsewhere. */ - fdh = make_fdh (data->info, eh); + fdh = make_fdh (info, eh); if (fdh == NULL) - data->ok = FALSE; + return FALSE; else fdh->elf.ref_regular = 1; } @@ -4193,26 +4250,37 @@ add_symbol_adjust (struct elf_link_hash_entry *h, void *inf) return TRUE; } +/* Process list of dot-symbols we made in link_hash_newfunc. */ + static bfd_boolean -ppc64_elf_check_directives (bfd *abfd, struct bfd_link_info *info) +ppc64_elf_check_directives (bfd *ibfd, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; - struct add_symbol_adjust_data data; - - if (!is_ppc64_elf_target (abfd->xvec)) - return TRUE; - - if (!ppc64_elf_tdata (abfd)->u.has_dotsym) - return TRUE; - ppc64_elf_tdata (abfd)->u.deleted_section = NULL; + struct ppc_link_hash_entry **p, *eh; htab = ppc_hash_table (info); if (!is_ppc64_elf_target (htab->elf.root.creator)) return TRUE; - data.info = info; - data.ok = TRUE; - elf_link_hash_traverse (&htab->elf, add_symbol_adjust, &data); + if (is_ppc64_elf_target (ibfd->xvec)) + { + p = &htab->dot_syms; + while ((eh = *p) != NULL) + { + *p = NULL; + if (!add_symbol_adjust (eh, info)) + return FALSE; + p = &eh->u.next_dot_sym; + } + } + + /* Clear the list for non-ppc64 input files. */ + p = &htab->dot_syms; + while ((eh = *p) != NULL) + { + *p = NULL; + p = &eh->u.next_dot_sym; + } /* We need to fix the undefs list for any syms we have twiddled to undef_weak. */ @@ -4221,7 +4289,18 @@ ppc64_elf_check_directives (bfd *abfd, struct bfd_link_info *info) bfd_link_repair_undef_list (&htab->elf.root); htab->twiddled_syms = 0; } - return data.ok; + return TRUE; +} + +/* Undo hash table changes when an --as-needed input file is determined + not to be needed. */ + +static bfd_boolean +ppc64_elf_as_needed_cleanup (bfd *ibfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + ppc_hash_table (info)->dot_syms = NULL; + return TRUE; } static bfd_boolean @@ -4358,7 +4437,9 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, opd_sym_map = bfd_zalloc (abfd, amt); if (opd_sym_map == NULL) return FALSE; - ppc64_elf_section_data (sec)->opd.func_sec = opd_sym_map; + ppc64_elf_section_data (sec)->u.opd_func_sec = opd_sym_map; + BFD_ASSERT (ppc64_elf_section_data (sec)->sec_type == sec_normal); + ppc64_elf_section_data (sec)->sec_type = sec_opd; } if (htab->sfpr == NULL @@ -4372,6 +4453,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, struct elf_link_hash_entry *h; enum elf_ppc64_reloc_type r_type; int tls_type = 0; + struct _ppc64_elf_section_data *ppc64_sec; r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -4553,7 +4635,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, dest = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (dest != sec) - htab->has_14bit_branch = 1; + ppc64_elf_section_data (sec)->has_14bit_branch = 1; } /* Fall through. */ @@ -4569,7 +4651,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, || h == &htab->tls_get_addr_fd->elf) sec->has_tls_reloc = 1; else if (htab->tls_get_addr == NULL - && !strncmp (h->root.root.string, ".__tls_get_addr", 15) + && CONST_STRNEQ (h->root.root.string, ".__tls_get_addr") && (h->root.root.string[15] == 0 || h->root.root.string[15] == '@')) { @@ -4577,7 +4659,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, sec->has_tls_reloc = 1; } else if (htab->tls_get_addr_fd == NULL - && !strncmp (h->root.root.string, "__tls_get_addr", 14) + && CONST_STRNEQ (h->root.root.string, "__tls_get_addr") && (h->root.root.string[14] == 0 || h->root.root.string[14] == '@')) { @@ -4624,23 +4706,26 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, rel->r_addend, tls_type)) return FALSE; - if (ppc64_elf_section_data (sec)->t_symndx == NULL) + ppc64_sec = ppc64_elf_section_data (sec); + if (ppc64_sec->sec_type != sec_toc) { /* One extra to simplify get_tls_mask. */ bfd_size_type amt = sec->size * sizeof (unsigned) / 8 + 1; - ppc64_elf_section_data (sec)->t_symndx = bfd_zalloc (abfd, amt); - if (ppc64_elf_section_data (sec)->t_symndx == NULL) + ppc64_sec->u.t_symndx = bfd_zalloc (abfd, amt); + if (ppc64_sec->u.t_symndx == NULL) return FALSE; + BFD_ASSERT (ppc64_sec->sec_type == sec_normal); + ppc64_sec->sec_type = sec_toc; } BFD_ASSERT (rel->r_offset % 8 == 0); - ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8] = r_symndx; + ppc64_sec->u.t_symndx[rel->r_offset / 8] = r_symndx; /* Mark the second slot of a GD or LD entry. -1 to indicate GD and -2 to indicate LD. */ if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_GD)) - ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -1; + ppc64_sec->u.t_symndx[rel->r_offset / 8 + 1] = -1; else if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_LD)) - ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -2; + ppc64_sec->u.t_symndx[rel->r_offset / 8 + 1] = -2; goto dodyn; case R_PPC64_TPREL16: @@ -4770,7 +4855,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -5714,7 +5799,6 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { struct ppc_link_hash_table *htab; asection *s; - unsigned int power_of_two; htab = ppc_hash_table (info); @@ -5766,6 +5850,10 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, if (!h->non_got_ref) return TRUE; + /* Don't generate a copy reloc for symbols defined in the executable. */ + if (!h->def_dynamic || !h->ref_regular || h->def_regular) + return TRUE; + if (ELIMINATE_COPY_RELOCS) { struct ppc_link_hash_entry * eh; @@ -5831,29 +5919,9 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ s = htab->dynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* If given a function descriptor symbol, hide both the function code @@ -6036,7 +6104,7 @@ get_tls_mask (char **tls_maskp, unsigned long *toc_symndx, if ((*tls_maskp != NULL && **tls_maskp != 0) || sec == NULL - || ppc64_elf_section_data (sec)->t_symndx == NULL) + || ppc64_elf_section_data (sec)->sec_type != sec_toc) return 1; /* Look inside a TOC section too. */ @@ -6049,8 +6117,8 @@ get_tls_mask (char **tls_maskp, unsigned long *toc_symndx, off = sym->st_value; off += rel->r_addend; BFD_ASSERT (off % 8 == 0); - r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8]; - next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1]; + r_symndx = ppc64_elf_section_data (sec)->u.t_symndx[off / 8]; + next_r = ppc64_elf_section_data (sec)->u.t_symndx[off / 8 + 1]; if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd)) return 0; if (toc_symndx != NULL) @@ -6096,13 +6164,13 @@ adjust_opd_syms (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) if (adjust == -1) { /* This entry has been deleted. */ - asection *dsec = ppc64_elf_tdata (sym_sec->owner)->u.deleted_section; + asection *dsec = ppc64_elf_tdata (sym_sec->owner)->deleted_section; if (dsec == NULL) { for (dsec = sym_sec->owner->sections; dsec; dsec = dsec->next) if (elf_discarded_section (dsec)) { - ppc64_elf_tdata (sym_sec->owner)->u.deleted_section = dsec; + ppc64_elf_tdata (sym_sec->owner)->deleted_section = dsec; break; } } @@ -6291,7 +6359,9 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info, opd_adjust = bfd_alloc (obfd, amt); if (opd_adjust == NULL) return FALSE; - ppc64_elf_section_data (sec)->opd.adjust = opd_adjust; + ppc64_elf_section_data (sec)->u.opd_adjust = opd_adjust; + BFD_ASSERT (ppc64_elf_section_data (sec)->sec_type == sec_normal); + ppc64_elf_section_data (sec)->sec_type = sec_opd; } memset (opd_adjust, 0, amt); @@ -6601,7 +6671,7 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info, sec->contents = new_contents; } - /* Fudge the size too, as this is used later in + /* Fudge the header size too, as this is used later in elf_bfd_final_link if we are emitting relocs. */ elf_section_data (sec)->rel_hdr.sh_size = sec->reloc_count * elf_section_data (sec)->rel_hdr.sh_entsize; @@ -7907,7 +7977,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0) { @@ -8302,6 +8372,33 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) rl += htab->relbrlt->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (htab->relbrlt->owner, &rela, rl); } + else if (info->emitrelocations) + { + Elf_Internal_Rela *relocs, *r; + struct bfd_elf_section_data *elfsec_data; + + elfsec_data = elf_section_data (htab->brlt); + relocs = elfsec_data->relocs; + if (relocs == NULL) + { + bfd_size_type relsize; + relsize = htab->brlt->reloc_count * sizeof (*relocs); + relocs = bfd_alloc (htab->brlt->owner, relsize); + if (relocs == NULL) + return FALSE; + elfsec_data->relocs = relocs; + elfsec_data->rel_hdr.sh_size = relsize; + elfsec_data->rel_hdr.sh_entsize = 24; + htab->brlt->reloc_count = 0; + } + r = relocs + htab->brlt->reloc_count; + htab->brlt->reloc_count += 1; + r->r_offset = (br_entry->offset + + htab->brlt->output_offset + + htab->brlt->output_section->vma); + r->r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + r->r_addend = off; + } off = (br_entry->offset + htab->brlt->output_offset @@ -8531,6 +8628,11 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (htab->relbrlt != NULL) htab->relbrlt->size += sizeof (Elf64_External_Rela); + else if (info->emitrelocations) + { + htab->brlt->reloc_count += 1; + htab->brlt->flags |= SEC_RELOC; + } } stub_entry->stub_type += ppc_stub_plt_branch - ppc_stub_long_branch; @@ -8538,11 +8640,11 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (stub_entry->stub_type != ppc_stub_plt_branch) size = 28; } - - if (info->emitrelocations - && (stub_entry->stub_type == ppc_stub_long_branch - || stub_entry->stub_type == ppc_stub_long_branch_r2off)) - stub_entry->stub_sec->reloc_count += 1; + else if (info->emitrelocations) + { + stub_entry->stub_sec->reloc_count += 1; + stub_entry->stub_sec->flags |= SEC_RELOC; + } } stub_entry->stub_sec->size += size; @@ -8925,7 +9027,29 @@ group_sections (struct ppc_link_hash_table *htab, bfd_size_type stub_group_size, bfd_boolean stubs_always_before_branch) { - asection **list = htab->input_list + htab->top_index; + asection **list; + bfd_size_type stub14_group_size; + bfd_boolean suppress_size_errors; + + suppress_size_errors = FALSE; + stub14_group_size = stub_group_size; + if (stub_group_size == 1) + { + /* Default values. */ + if (stubs_always_before_branch) + { + stub_group_size = 0x1e00000; + stub14_group_size = 0x7800; + } + else + { + stub_group_size = 0x1c00000; + stub14_group_size = 0x7000; + } + suppress_size_errors = TRUE; + } + + list = htab->input_list + htab->top_index; do { asection *tail = *list; @@ -8939,15 +9063,17 @@ group_sections (struct ppc_link_hash_table *htab, curr = tail; total = tail->size; - big_sec = total > stub_group_size; - if (big_sec) + big_sec = total > (ppc64_elf_section_data (tail)->has_14bit_branch + ? stub14_group_size : stub_group_size); + if (big_sec && !suppress_size_errors) (*_bfd_error_handler) (_("%B section %A exceeds stub group size"), tail->owner, tail); curr_toc = htab->stub_group[tail->id].toc_off; while ((prev = PREV_SEC (curr)) != NULL && ((total += curr->output_offset - prev->output_offset) - < stub_group_size) + < (ppc64_elf_section_data (prev)->has_14bit_branch + ? stub14_group_size : stub_group_size)) && htab->stub_group[prev->id].toc_off == curr_toc) curr = prev; @@ -8979,7 +9105,8 @@ group_sections (struct ppc_link_hash_table *htab, total = 0; while (prev != NULL && ((total += tail->output_offset - prev->output_offset) - < stub_group_size) + < (ppc64_elf_section_data (prev)->has_14bit_branch + ? stub14_group_size : stub_group_size)) && htab->stub_group[prev->id].toc_off == curr_toc) { tail = prev; @@ -9020,22 +9147,6 @@ ppc64_elf_size_stubs (bfd *output_bfd, stub_group_size = -group_size; else stub_group_size = group_size; - if (stub_group_size == 1) - { - /* Default values. */ - if (stubs_always_before_branch) - { - stub_group_size = 0x1e00000; - if (htab->has_14bit_branch) - stub_group_size = 0x7800; - } - else - { - stub_group_size = 0x1c00000; - if (htab->has_14bit_branch) - stub_group_size = 0x7000; - } - } group_sections (htab, stub_group_size, stubs_always_before_branch); @@ -9073,6 +9184,9 @@ ppc64_elf_size_stubs (bfd *output_bfd, /* If there aren't any relocs, then there's nothing more to do. */ if ((section->flags & SEC_RELOC) == 0 + || (section->flags & SEC_ALLOC) == 0 + || (section->flags & SEC_LOAD) == 0 + || (section->flags & SEC_CODE) == 0 || section->reloc_count == 0) continue; @@ -9322,9 +9436,12 @@ ppc64_elf_size_stubs (bfd *output_bfd, stub_sec->rawsize = stub_sec->size; stub_sec->size = 0; stub_sec->reloc_count = 0; + stub_sec->flags &= ~SEC_RELOC; } htab->brlt->size = 0; + htab->brlt->reloc_count = 0; + htab->brlt->flags &= ~SEC_RELOC; if (htab->relbrlt != NULL) htab->relbrlt->size = 0; @@ -9442,24 +9559,12 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, stub_sec->size = 0; } - if (htab->glink != NULL && htab->glink->contents != NULL) + if (htab->glink != NULL && htab->glink->size != 0) { unsigned int indx; bfd_vma plt0; /* Build the .glink plt call stub. */ - plt0 = (htab->plt->output_section->vma - + htab->plt->output_offset - - (htab->glink->output_section->vma - + htab->glink->output_offset - + GLINK_CALL_STUB_SIZE)); - if (plt0 + 0x80008000 > 0xffffffff) - { - (*_bfd_error_handler) (_(".glink and .plt too far apart")); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - if (htab->emit_stub_syms) { struct elf_link_hash_entry *h; @@ -9470,7 +9575,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, { h->root.type = bfd_link_hash_defined; h->root.u.def.section = htab->glink; - h->root.u.def.value = 0; + h->root.u.def.value = 8; h->ref_regular = 1; h->def_regular = 1; h->ref_regular_nonweak = 1; @@ -9479,29 +9584,26 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, } } p = htab->glink->contents; - bfd_put_32 (htab->glink->owner, MFCTR_R12, p); + plt0 = (htab->plt->output_section->vma + + htab->plt->output_offset + - (htab->glink->output_section->vma + + htab->glink->output_offset + + 16)); + bfd_put_64 (htab->glink->owner, plt0, p); + p += 8; + bfd_put_32 (htab->glink->owner, MFLR_R12, p); p += 4; - bfd_put_32 (htab->glink->owner, SLDI_R11_R0_3, p); + bfd_put_32 (htab->glink->owner, BCL_20_31, p); p += 4; - bfd_put_32 (htab->glink->owner, ADDIC_R2_R0_32K, p); + bfd_put_32 (htab->glink->owner, MFLR_R11, p); p += 4; - bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + bfd_put_32 (htab->glink->owner, LD_R2_M16R11, p); p += 4; - bfd_put_32 (htab->glink->owner, SRADI_R2_R2_63, p); + bfd_put_32 (htab->glink->owner, MTLR_R12, p); p += 4; - bfd_put_32 (htab->glink->owner, SLDI_R11_R0_2, p); + bfd_put_32 (htab->glink->owner, ADD_R12_R2_R11, p); p += 4; - bfd_put_32 (htab->glink->owner, AND_R2_R2_R11, p); - p += 4; - bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); - p += 4; - bfd_put_32 (htab->glink->owner, ADD_R12_R12_R2, p); - p += 4; - bfd_put_32 (htab->glink->owner, ADDIS_R12_R12 | PPC_HA (plt0), p); - p += 4; - bfd_put_32 (htab->glink->owner, LD_R11_0R12 | PPC_LO (plt0), p); - p += 4; - bfd_put_32 (htab->glink->owner, ADDI_R12_R12 | PPC_LO (plt0), p); + bfd_put_32 (htab->glink->owner, LD_R11_0R12, p); p += 4; bfd_put_32 (htab->glink->owner, LD_R2_0R12 | 8, p); p += 4; @@ -9511,6 +9613,11 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, p += 4; bfd_put_32 (htab->glink->owner, BCTR, p); p += 4; + while (p - htab->glink->contents < GLINK_CALL_STUB_SIZE) + { + bfd_put_32 (htab->glink->owner, NOP, p); + p += 4; + } /* Build the .glink lazy link call stubs. */ indx = 0; @@ -9529,7 +9636,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, p += 4; } bfd_put_32 (htab->glink->owner, - B_DOT | ((htab->glink->contents - p) & 0x3fffffc), p); + B_DOT | ((htab->glink->contents - p + 8) & 0x3fffffc), p); indx++; p += 4; } @@ -9554,6 +9661,9 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, /* Build the stubs as directed by the stub hash table. */ bfd_hash_traverse (&htab->stub_hash_table, ppc_build_one_stub, info); + if (htab->relbrlt != NULL) + htab->relbrlt->reloc_count = 0; + for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; stub_sec = stub_sec->next) @@ -9698,6 +9808,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, bfd_boolean is_opd; /* Disabled until we sort out how ld should choose 'y' vs 'at'. */ bfd_boolean is_power4 = FALSE; + bfd_vma d_offset = (bfd_big_endian (output_bfd) ? 2 : 0); /* Initialize howto table if needed. */ if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) @@ -9713,7 +9824,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, TOCstart = elf_gp (output_bfd); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL; + is_opd = ppc64_elf_section_data (input_section)->sec_type == sec_opd; rel = relocs; relend = relocs + input_section->reloc_count; @@ -9788,13 +9899,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, relocation += adjust; } } - if (info->relocatable) - continue; } else { - if (info->relocatable) - continue; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h_elf, sec, relocation, @@ -9804,6 +9911,21 @@ ppc64_elf_relocate_section (bfd *output_bfd, } h = (struct ppc_link_hash_entry *) h_elf; + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (ppc64_elf_howto_table[r_type], input_bfd, + contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* TLS optimizations. Replace instruction sequences and relocs based on information we collected in tls_optimize. We edit RELOCS so that --emit-relocs will output something sensible @@ -9927,10 +10049,10 @@ ppc64_elf_relocate_section (bfd *output_bfd, && (tls_mask & TLS_TPREL) == 0) { toctprel: - insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - d_offset); insn &= 31 << 21; insn |= 0x3c0d0000; /* addis 0,13,0 */ - bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - d_offset); r_type = R_PPC64_TPREL16_HA; if (toc_symndx != 0) { @@ -9982,8 +10104,8 @@ ppc64_elf_relocate_section (bfd *output_bfd, insn |= rtra; bfd_put_32 (output_bfd, insn, contents + rel->r_offset); /* Was PPC64_TLS which sits on insn boundary, now - PPC64_TPREL16_LO which is at insn+2. */ - rel->r_offset += 2; + PPC64_TPREL16_LO which is at low-order half-word. */ + rel->r_offset += d_offset; r_type = R_PPC64_TPREL16_LO; if (toc_symndx != 0) { @@ -10016,7 +10138,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, else { bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); - rel->r_offset -= 2; + rel->r_offset -= d_offset; r_type = R_PPC64_NONE; } rel->r_info = ELF64_R_INFO (r_symndx, r_type); @@ -10065,7 +10187,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, /* OK, it checks out. Replace the call. */ offset = rel[1].r_offset; insn1 = bfd_get_32 (output_bfd, - contents + rel->r_offset - 2); + contents + rel->r_offset - d_offset); insn3 = bfd_get_32 (output_bfd, contents + offset + 4); if ((tls_mask & tls_gd) != 0) @@ -10100,7 +10222,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, rel->r_info = ELF64_R_INFO (r_symndx, r_type); rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_LO); - rel[1].r_offset += 2; + rel[1].r_offset += d_offset; } if (insn3 == NOP || insn3 == CROR_151515 || insn3 == CROR_313131) @@ -10109,7 +10231,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, insn2 = NOP; rel[1].r_offset += 4; } - bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - d_offset); bfd_put_32 (output_bfd, insn2, contents + offset); bfd_put_32 (output_bfd, insn3, contents + offset + 4); if (tls_gd == 0 || toc_symndx != 0) @@ -10623,7 +10745,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, relocation += htab->stub_group[sec->id].toc_off; else unresolved_reloc = TRUE; - goto dodyn2; + goto dodyn; /* TOC16 relocs. We want the offset relative to the TOC base, which is the address of the start of the TOC plus 0x8000. @@ -10723,15 +10845,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, case R_PPC64_UADDR16: case R_PPC64_UADDR32: case R_PPC64_UADDR64: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ dodyn: - if (r_symndx == 0) - break; - /* Fall thru. */ - - dodyn2: if ((input_section->flags & SEC_ALLOC) == 0) break; @@ -10841,6 +10955,17 @@ ppc64_elf_relocate_section (bfd *output_bfd, osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + if ((osec->flags & SEC_READONLY) == 0 + && htab->elf.data_index_section != NULL) + osec = htab->elf.data_index_section; + else + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (indx != 0); + /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the @@ -10929,17 +11054,10 @@ ppc64_elf_relocate_section (bfd *output_bfd, case R_PPC64_ADDR16_HA: case R_PPC64_ADDR16_HIGHERA: case R_PPC64_ADDR16_HIGHESTA: - case R_PPC64_GOT16_HA: - case R_PPC64_PLTGOT16_HA: - case R_PPC64_PLT16_HA: case R_PPC64_TOC16_HA: case R_PPC64_SECTOFF_HA: case R_PPC64_TPREL16_HA: case R_PPC64_DTPREL16_HA: - case R_PPC64_GOT_TLSGD16_HA: - case R_PPC64_GOT_TLSLD16_HA: - case R_PPC64_GOT_TPREL16_HA: - case R_PPC64_GOT_DTPREL16_HA: case R_PPC64_TPREL16_HIGHER: case R_PPC64_TPREL16_HIGHERA: case R_PPC64_TPREL16_HIGHEST: @@ -10952,10 +11070,20 @@ ppc64_elf_relocate_section (bfd *output_bfd, that's not actually defined anywhere. In that case, 'sec' would be NULL, and we should leave the symbol alone (it will be set to zero elsewhere in the link). */ - if (sec != NULL) - /* Add 0x10000 if sign bit in 0:15 is set. - Bits 0:15 are not used. */ - addend += 0x8000; + if (sec == NULL) + break; + /* Fall thru */ + + case R_PPC64_GOT16_HA: + case R_PPC64_PLTGOT16_HA: + case R_PPC64_PLT16_HA: + case R_PPC64_GOT_TLSGD16_HA: + case R_PPC64_GOT_TLSLD16_HA: + case R_PPC64_GOT_TPREL16_HA: + case R_PPC64_GOT_DTPREL16_HA: + /* Add 0x10000 if sign bit in 0:15 is set. + Bits 0:15 are not used. */ + addend += 0x8000; break; case R_PPC64_ADDR16_DS: @@ -11128,13 +11256,11 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, Elf_Internal_Sym *sym) { struct ppc_link_hash_table *htab; - bfd *dynobj; struct plt_entry *ent; Elf_Internal_Rela rela; bfd_byte *loc; htab = ppc_hash_table (info); - dynobj = htab->elf.dynobj; for (ent = h->plt.plist; ent != NULL; ent = ent->next) if (ent->plt.offset != (bfd_vma) -1) @@ -11331,6 +11457,17 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, = PLT_ENTRY_SIZE; } + /* brlt is SEC_LINKER_CREATED, so we need to write out relocs for + brlt ourselves if emitrelocations. */ + if (htab->brlt != NULL + && htab->brlt->reloc_count != 0 + && !_bfd_elf_link_output_relocs (output_bfd, + htab->brlt, + &elf_section_data (htab->brlt)->rel_hdr, + elf_section_data (htab->brlt)->relocs, + NULL)) + return FALSE; + /* We need to handle writing out multiple GOT sections ourselves, since we didn't add them to DYNOBJ. We know dynobj is the first bfd. */ diff --git a/contrib/binutils/bfd/elf64-s390.c b/contrib/binutils/bfd/elf64-s390.c index 1fe0c6ca915..47fbff6bed9 100644 --- a/contrib/binutils/bfd/elf64-s390.c +++ b/contrib/binutils/bfd/elf64-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 64-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -46,12 +46,6 @@ static void elf_s390_copy_indirect_symbol static bfd_boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *elf_s390_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static bfd_boolean elf_s390_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); struct elf_s390_link_hash_entry; static void elf_s390_adjust_gotplt PARAMS ((struct elf_s390_link_hash_entry *)); @@ -73,8 +67,6 @@ static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_boolean elf_s390_mkobject - PARAMS ((bfd *)); static bfd_boolean elf_s390_object_p PARAMS ((bfd *)); static int elf_s390_tls_transition @@ -364,6 +356,27 @@ elf_s390_reloc_type_lookup (abfd, code) return 0; } +static reloc_howto_type * +elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); + i++) + if (elf_howto_table[i].name != NULL + && strcasecmp (elf_howto_table[i].name, r_name) == 0) + return &elf_howto_table[i]; + + if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0) + return &elf64_s390_vtinherit_howto; + if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0) + return &elf64_s390_vtentry_howto; + + return NULL; +} + /* We need to use ELF64_R_TYPE so we have our own copy of this function, and elf64-s390.c has its own copy. */ @@ -631,14 +644,16 @@ struct elf_s390_obj_tdata (elf_s390_tdata (abfd)->local_got_tls_type) static bfd_boolean -elf_s390_mkobject (abfd) - bfd *abfd; +elf_s390_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -1238,7 +1253,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -1345,50 +1360,30 @@ elf_s390_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_s390_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_s390_gc_mark_hook (asection *sec, + struct bfd_link_info *info, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_390_GNU_VTINHERIT: - case R_390_GNU_VTENTRY: - break; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_390_GNU_VTINHERIT: + case R_390_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean -elf_s390_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf_s390_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1562,7 +1557,6 @@ elf_s390_adjust_dynamic_symbol (info, h) { struct elf_s390_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later @@ -1683,29 +1677,9 @@ elf_s390_adjust_dynamic_symbol (info, h) h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 3) - power_of_two = 3; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2098,7 +2072,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0 && s != htab->srelplt) relocs = TRUE; @@ -2240,6 +2214,7 @@ invalid_tls_insn (input_bfd, input_section, rel) input_section, (long) rel->r_offset, howto->name); + bfd_set_error (bfd_error_bad_value); } /* Relocate a 390 ELF section. */ @@ -2263,9 +2238,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2300,7 +2272,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, howto = elf_howto_table + r_type; r_symndx = ELF64_R_SYM (rel->r_info); - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -2321,6 +2292,20 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, unresolved_reloc, warned); } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_390_GOTPLT12: @@ -2544,11 +2529,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2636,14 +2617,19 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + + if (sindx == 0) + { + osec = htab->elf.text_index_section; + sindx = elf_section_data (osec)->dynindx; + } + BFD_ASSERT (sindx != 0); /* We are turning this relocation into one against a section symbol, so subtract out the output section's address but not the offset of the input section in the output section. */ - outrel.r_addend -= osec->vma; } outrel.r_info = ELF64_R_INFO (sindx, r_type); @@ -2908,7 +2894,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, continue; case R_390_TLS_LDO64: - if (info->shared || (input_section->flags & SEC_CODE) == 0) + if (info->shared) relocation -= dtpoff_base (info); else /* When converting LDO to LE, we must negate. */ @@ -3462,6 +3448,7 @@ const struct elf_size_info s390_elf64_size_info = #define bfd_elf64_bfd_is_local_label_name elf_s390_is_local_label_name #define bfd_elf64_bfd_link_hash_table_create elf_s390_link_hash_table_create #define bfd_elf64_bfd_reloc_type_lookup elf_s390_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup elf_s390_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol #define elf_backend_check_relocs elf_s390_check_relocs @@ -3474,6 +3461,7 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_plt_sym_val elf_s390_plt_sym_val diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c index dd1c302174a..2adddd99446 100644 --- a/contrib/binutils/bfd/elf64-sparc.c +++ b/contrib/binutils/bfd/elf64-sparc.c @@ -1,6 +1,6 @@ /* SPARC-specific support for 64-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/sparc.h" @@ -814,6 +814,7 @@ const struct elf_size_info elf64_sparc_size_info = #define TARGET_BIG_NAME "elf64-sparc" #define ELF_ARCH bfd_arch_sparc #define ELF_MAXPAGESIZE 0x100000 +#define ELF_COMMONPAGESIZE 0x2000 /* This is the official ABI value. */ #define ELF_MACHINE_CODE EM_SPARCV9 @@ -858,6 +859,8 @@ const struct elf_size_info elf64_sparc_size_info = _bfd_sparc_elf_copy_indirect_symbol #define bfd_elf64_bfd_reloc_type_lookup \ _bfd_sparc_elf_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + _bfd_sparc_elf_reloc_name_lookup #define bfd_elf64_bfd_relax_section \ _bfd_sparc_elf_relax_section #define bfd_elf64_new_section_hook \ @@ -888,6 +891,8 @@ const struct elf_size_info elf64_sparc_size_info = _bfd_sparc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook \ _bfd_sparc_elf_gc_sweep_hook +#define elf_backend_init_index_section \ + _bfd_elf_init_1_index_section #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 @@ -901,3 +906,19 @@ const struct elf_size_info elf64_sparc_size_info = #define elf_backend_plt_alignment 8 #include "elf64-target.h" + +/* FreeBSD support */ +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf64_sparc_freebsd_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf64-sparc-freebsd" +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi +#undef elf64_bed +#define elf64_bed elf64_sparc_fbsd_bed + +#include "elf64-target.h" + diff --git a/contrib/binutils/bfd/elf64-x86-64.c b/contrib/binutils/bfd/elf64-x86-64.c index 9befd69c5df..0ee75ce9947 100644 --- a/contrib/binutils/bfd/elf64-x86-64.c +++ b/contrib/binutils/bfd/elf64-x86-64.c @@ -1,5 +1,5 @@ /* X86-64 specific support for 64-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Jan Hubicka . @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -246,6 +246,23 @@ elf64_x86_64_reloc_type_lookup (bfd *abfd, return 0; } +static reloc_howto_type * +elf64_x86_64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (x86_64_elf_howto_table) + / sizeof (x86_64_elf_howto_table[0])); + i++) + if (x86_64_elf_howto_table[i].name != NULL + && strcasecmp (x86_64_elf_howto_table[i].name, r_name) == 0) + return &x86_64_elf_howto_table[i]; + + return NULL; +} + /* Given an x86_64 ELF reloc type, fill in an arelent structure. */ static void @@ -350,7 +367,7 @@ static const bfd_byte elf64_x86_64_plt0_entry[PLT_ENTRY_SIZE] = { 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */ 0xff, 0x25, 16, 0, 0, 0, /* jmpq *GOT+16(%rip) */ - 0x90, 0x90, 0x90, 0x90 /* pad out to 16 bytes with nops. */ + 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */ }; /* Subsequent entries in a procedure linkage table look like this. */ @@ -676,11 +693,14 @@ elf64_x86_64_copy_indirect_symbol (struct bfd_link_info *info, static bfd_boolean elf64_x86_64_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct elf64_x86_64_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct elf64_x86_64_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static bfd_boolean @@ -994,7 +1014,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, && (r_type != R_X86_64_PC32) && (r_type != R_X86_64_PC64)) || (h != NULL - && (! info->symbolic + && (! SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak || !h->def_regular)))) || (ELIMINATE_COPY_RELOCS @@ -1022,7 +1042,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (name == NULL) return FALSE; - if (strncmp (name, ".rela", 5) != 0 + if (! CONST_STRNEQ (name, ".rela") || strcmp (bfd_get_section_name (abfd, sec), name + 5) != 0) { @@ -1131,38 +1151,20 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, static asection * elf64_x86_64_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { if (h != NULL) - { - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_X86_64_GNU_VTINHERIT: - case R_X86_64_GNU_VTENTRY: - break; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_GNU_VTINHERIT: + case R_X86_64_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -1285,7 +1287,6 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, { struct elf64_x86_64_link_hash_table *htab; asection *s; - unsigned int power_of_two; /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, @@ -1403,32 +1404,9 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. 16-bytes is the size - of the largest type that requires hard alignment -- long double. */ - /* FIXME: This is VERY ugly. Should be fixed for all architectures using - this construct. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) - { - if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -1880,7 +1858,7 @@ elf64_x86_64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) + else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0 && s != htab->srelplt) relocs = TRUE; @@ -2077,9 +2055,6 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocatable) - return TRUE; - htab = elf64_x86_64_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2135,6 +2110,21 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, h, sec, relocation, unresolved_reloc, warned); } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + /* When generating a shared object, the relocations handled here are copied into the output file to be resolved at run time. */ switch (r_type) @@ -2382,11 +2372,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, /* FIXME: The ABI says the linker should make sure the value is the same when it's zeroextended to 64 bit. */ - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2442,7 +2428,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, || r_type == R_X86_64_PC32 || r_type == R_X86_64_PC64 || !info->shared - || !info->symbolic + || !SYMBOLIC_BIND (info, h) || !h->def_regular)) { outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); @@ -2472,9 +2458,19 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; sindx = elf_section_data (osec)->dynindx; - BFD_ASSERT (sindx > 0); + if (sindx == 0) + { + asection *oi = htab->elf.text_index_section; + sindx = elf_section_data (oi)->dynindx; + } + BFD_ASSERT (sindx != 0); } outrel.r_info = ELF64_R_INFO (sindx, r_type); @@ -2614,8 +2610,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; } @@ -2907,8 +2904,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; @@ -3030,12 +3028,6 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (r == bfd_reloc_overflow) { - if (h != NULL - && h->root.type == bfd_link_hash_undefweak - && howto->pc_relative) - /* Ignore reloc overflow on branches to undefweak syms. */ - continue; - if (! ((*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, @@ -3594,7 +3586,8 @@ elf64_x86_64_merge_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED, } static int -elf64_x86_64_additional_program_headers (bfd *abfd) +elf64_x86_64_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int count = 0; @@ -3614,23 +3607,38 @@ elf64_x86_64_additional_program_headers (bfd *abfd) return count; } +/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + +static bfd_boolean +elf64_x86_64_hash_symbol (struct elf_link_hash_entry *h) +{ + if (h->plt.offset != (bfd_vma) -1 + && !h->def_regular + && !h->pointer_equality_needed) + return FALSE; + + return _bfd_elf_hash_symbol (h); +} + static const struct bfd_elf_special_section elf64_x86_64_special_sections[]= { - { ".gnu.linkonce.lb", 16, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, - { ".gnu.linkonce.lr", 16, -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, - { ".gnu.linkonce.lt", 16, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR + SHF_X86_64_LARGE}, - { ".lbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, - { ".ldata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, - { ".lrodata", 8, -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".gnu.linkonce.lb"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".gnu.linkonce.lr"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".gnu.linkonce.lt"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".lbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".ldata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE}, + { STRING_COMMA_LEN (".lrodata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE}, + { NULL, 0, 0, 0, 0 } }; #define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec #define TARGET_LITTLE_NAME "elf64-x86-64" #define ELF_ARCH bfd_arch_i386 #define ELF_MACHINE_CODE EM_X86_64 -#define ELF_MAXPAGESIZE 0x100000 +#define ELF_MAXPAGESIZE 0x200000 +#define ELF_MINPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 @@ -3645,6 +3653,8 @@ static const struct bfd_elf_special_section #define bfd_elf64_bfd_link_hash_table_create \ elf64_x86_64_link_hash_table_create #define bfd_elf64_bfd_reloc_type_lookup elf64_x86_64_reloc_type_lookup +#define bfd_elf64_bfd_reloc_name_lookup \ + elf64_x86_64_reloc_name_lookup #define elf_backend_adjust_dynamic_symbol elf64_x86_64_adjust_dynamic_symbol #define elf_backend_check_relocs elf64_x86_64_check_relocs @@ -3660,6 +3670,7 @@ static const struct bfd_elf_special_section #define elf_backend_relocate_section elf64_x86_64_relocate_section #define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections #define elf_backend_always_size_sections elf64_x86_64_always_size_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_plt_sym_val elf64_x86_64_plt_sym_val #define elf_backend_object_p elf64_x86_64_elf_object_p #define bfd_elf64_mkobject elf64_x86_64_mkobject @@ -3685,5 +3696,25 @@ static const struct bfd_elf_special_section elf64_x86_64_special_sections #define elf_backend_additional_program_headers \ elf64_x86_64_additional_program_headers +#define elf_backend_hash_symbol \ + elf64_x86_64_hash_symbol + +#include "elf64-target.h" + +/* FreeBSD support. */ + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf64_x86_64_freebsd_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf64-x86-64-freebsd" + +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_FREEBSD + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi + +#undef elf64_bed +#define elf64_bed elf64_x86_64_fbsd_bed #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h index 1f8ec2b2b2c..191e124d770 100644 --- a/contrib/binutils/bfd/elfcode.h +++ b/contrib/binutils/bfd/elfcode.h @@ -1,6 +1,7 @@ /* ELF executable support for BFD. 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. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -64,8 +65,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. it's cast in stone. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libiberty.h" #include "bfdlink.h" #include "libbfd.h" @@ -139,10 +140,11 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define LOG_FILE_ALIGN 2 #endif -#ifdef DEBUG +#if DEBUG & 2 static void elf_debug_section (int, Elf_Internal_Shdr *); +#endif +#if DEBUG & 1 static void elf_debug_file (Elf_Internal_Ehdr *); -static char *elf_symbol_flags (flagword); #endif /* Structure swapping routines */ @@ -165,7 +167,7 @@ static char *elf_symbol_flags (flagword); /* Translate an ELF symbol in external format into an ELF symbol in internal format. */ -void +bfd_boolean elf_swap_symbol_in (bfd *abfd, const void *psrc, const void *pshn, @@ -187,9 +189,10 @@ elf_swap_symbol_in (bfd *abfd, if (dst->st_shndx == SHN_XINDEX) { if (shndx == NULL) - abort (); + return FALSE; dst->st_shndx = H_GET_32 (abfd, shndx->est_shndx); } + return TRUE; } /* Translate an ELF symbol in internal format into an ELF symbol in external @@ -498,6 +501,8 @@ elf_object_p (bfd *abfd) struct bfd_preserve preserve; asection *s; bfd_size_type amt; + const bfd_target *target; + const bfd_target * const *target_ptr; preserve.marker = NULL; @@ -541,10 +546,12 @@ elf_object_p (bfd *abfd) if (!bfd_preserve_save (abfd, &preserve)) goto got_no_match; + target = abfd->xvec; + /* Allocate an instance of the elf_obj_tdata structure and hook it up to the tdata pointer in the bfd. */ - if (! (*abfd->xvec->_bfd_set_format[bfd_object]) (abfd)) + if (! (*target->_bfd_set_format[bfd_object]) (abfd)) goto got_no_match; preserve.marker = elf_tdata (abfd); @@ -584,8 +591,6 @@ elf_object_p (bfd *abfd) && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2)) { - const bfd_target * const *target_ptr; - if (ebd->elf_machine_code != EM_NONE) goto got_wrong_format_error; @@ -626,6 +631,45 @@ elf_object_p (bfd *abfd) goto got_no_match; } + if (ebd->elf_machine_code != EM_NONE + && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi) + { + if (ebd->elf_osabi != ELFOSABI_NONE) + goto got_wrong_format_error; + + /* This is an ELFOSABI_NONE ELF target. Let it match any ELF + target of the compatible machine for which we do not have a + backend with matching ELFOSABI. */ + for (target_ptr = bfd_target_vector; + *target_ptr != NULL; + target_ptr++) + { + const struct elf_backend_data *back; + + /* Skip this target and targets with incompatible byte + order. */ + if (*target_ptr == target + || (*target_ptr)->flavour != bfd_target_elf_flavour + || (*target_ptr)->byteorder != target->byteorder + || ((*target_ptr)->header_byteorder + != target->header_byteorder)) + continue; + + back = (const struct elf_backend_data *) (*target_ptr)->backend_data; + if (back->elf_osabi == i_ehdrp->e_ident[EI_OSABI] + && (back->elf_machine_code == i_ehdrp->e_machine + || (back->elf_machine_alt1 != 0 + && back->elf_machine_alt1 == i_ehdrp->e_machine) + || (back->elf_machine_alt2 != 0 + && back->elf_machine_alt2 == i_ehdrp->e_machine))) + { + /* target_ptr is an ELF backend which matches this + object file, so reject the ELFOSABI_NONE ELF target. */ + goto got_wrong_format_error; + } + } + } + if (i_ehdrp->e_shoff != 0) { bfd_signed_vma where = i_ehdrp->e_shoff; @@ -846,7 +890,7 @@ elf_object_p (bfd *abfd) } bfd_preserve_finish (abfd, &preserve); - return abfd->xvec; + return target; got_wrong_format_error: /* There is way too much undoing of half-known state here. The caller, @@ -1235,6 +1279,12 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic) case STT_TLS: sym->symbol.flags |= BSF_THREAD_LOCAL; break; + case STT_RELC: + sym->symbol.flags |= BSF_RELC; + break; + case STT_SRELC: + sym->symbol.flags |= BSF_SRELC; + break; } if (dynamic) @@ -1462,7 +1512,7 @@ elf_slurp_reloc_table (bfd *abfd, return TRUE; } -#ifdef DEBUG +#if DEBUG & 2 static void elf_debug_section (int num, Elf_Internal_Shdr *hdr) { @@ -1488,7 +1538,9 @@ elf_debug_section (int num, Elf_Internal_Shdr *hdr) (long) hdr->sh_entsize); fflush (stderr); } +#endif +#if DEBUG & 1 static void elf_debug_file (Elf_Internal_Ehdr *ehdrp) { @@ -1500,77 +1552,6 @@ elf_debug_file (Elf_Internal_Ehdr *ehdrp) fprintf (stderr, "e_shnum = %ld\n", (long) ehdrp->e_shnum); fprintf (stderr, "e_shentsize = %ld\n", (long) ehdrp->e_shentsize); } - -static char * -elf_symbol_flags (flagword flags) -{ - static char buffer[1024]; - - buffer[0] = '\0'; - if (flags & BSF_LOCAL) - strcat (buffer, " local"); - - if (flags & BSF_GLOBAL) - strcat (buffer, " global"); - - if (flags & BSF_DEBUGGING) - strcat (buffer, " debug"); - - if (flags & BSF_FUNCTION) - strcat (buffer, " function"); - - if (flags & BSF_KEEP) - strcat (buffer, " keep"); - - if (flags & BSF_KEEP_G) - strcat (buffer, " keep_g"); - - if (flags & BSF_WEAK) - strcat (buffer, " weak"); - - if (flags & BSF_SECTION_SYM) - strcat (buffer, " section-sym"); - - if (flags & BSF_OLD_COMMON) - strcat (buffer, " old-common"); - - if (flags & BSF_NOT_AT_END) - strcat (buffer, " not-at-end"); - - if (flags & BSF_CONSTRUCTOR) - strcat (buffer, " constructor"); - - if (flags & BSF_WARNING) - strcat (buffer, " warning"); - - if (flags & BSF_INDIRECT) - strcat (buffer, " indirect"); - - if (flags & BSF_FILE) - strcat (buffer, " file"); - - if (flags & DYNAMIC) - strcat (buffer, " dynamic"); - - if (flags & ~(BSF_LOCAL - | BSF_GLOBAL - | BSF_DEBUGGING - | BSF_FUNCTION - | BSF_KEEP - | BSF_KEEP_G - | BSF_WEAK - | BSF_SECTION_SYM - | BSF_OLD_COMMON - | BSF_NOT_AT_END - | BSF_CONSTRUCTOR - | BSF_WARNING - | BSF_INDIRECT - | BSF_FILE - | BSF_DYNAMIC)) - strcat (buffer, " unknown-bits"); - - return buffer; -} #endif /* Create a new BFD as if by bfd_openr. Rather than opening a file, diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index 59d9c3f1389..9f0efa5b4b7 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -1,6 +1,6 @@ /* ELF linking support for BFD. 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 BFD, the Binary File Descriptor library. @@ -18,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #define ARCH_SIZE 0 @@ -185,16 +185,6 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) return FALSE; } - if (! info->traditional_format) - { - s = bfd_make_section_with_flags (abfd, ".eh_frame_hdr", - flags | SEC_READONLY); - if (s == NULL - || ! bfd_set_section_alignment (abfd, s, 2)) - return FALSE; - elf_hash_table (info)->eh_info.hdr_sec = s; - } - /* Create sections to hold version informations. These are removed if they are not needed. */ s = bfd_make_section_with_flags (abfd, ".gnu.version_d", @@ -240,12 +230,30 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) if (!_bfd_elf_define_linkage_sym (abfd, info, s, "_DYNAMIC")) return FALSE; - s = bfd_make_section_with_flags (abfd, ".hash", - flags | SEC_READONLY); - if (s == NULL - || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) - return FALSE; - elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; + if (info->emit_hash) + { + s = bfd_make_section_with_flags (abfd, ".hash", flags | SEC_READONLY); + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; + } + + if (info->emit_gnu_hash) + { + s = bfd_make_section_with_flags (abfd, ".gnu.hash", + flags | SEC_READONLY); + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + /* For 64-bit ELF, .gnu.hash is a non-uniform entity size section: + 4 32-bit words followed by variable count of 64-bit words, then + variable count of 32-bit words. */ + if (bed->s->arch_size == 64) + elf_section_data (s)->this_hdr.sh_entsize = 0; + else + elf_section_data (s)->this_hdr.sh_entsize = 4; + } /* Let the backend create the rest of the sections. This lets the backend set the right flags. The backend will normally create @@ -426,6 +434,29 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info, return TRUE; } +/* Mark a symbol dynamic. */ + +void +bfd_elf_link_mark_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + struct bfd_elf_dynamic_list *d = info->dynamic_list; + + /* It may be called more than once on the same H. */ + if(h->dynamic || info->relocatable) + return; + + if ((info->dynamic_data + && (h->type == STT_OBJECT + || (sym != NULL + && ELF_ST_TYPE (sym->st_info) == STT_OBJECT))) + || (d != NULL + && h->root.type == bfd_link_hash_new + && (*d->match) (&d->head, NULL, h->root.root.string))) + h->dynamic = 1; +} + /* Record an assignment to a symbol made by a linker script. We need this in case some dynamic object refers to this symbol. */ @@ -459,7 +490,10 @@ bfd_elf_record_link_assignment (bfd *output_bfd, } if (h->root.type == bfd_link_hash_new) - h->non_elf = 0; + { + bfd_elf_link_mark_dynamic_symbol (info, h, NULL); + h->non_elf = 0; + } /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -676,6 +710,8 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info, asection *p) { + struct elf_link_hash_table *htab; + switch (elf_section_data (p)->this_hdr.sh_type) { case SHT_PROGBITS: @@ -683,15 +719,21 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, /* If sh_type is yet undecided, assume it could be SHT_PROGBITS/SHT_NOBITS. */ case SHT_NULL: + htab = elf_hash_table (info); + if (p == htab->tls_sec) + return FALSE; + + if (htab->text_index_section != NULL) + return p != htab->text_index_section && p != htab->data_index_section; + if (strcmp (p->name, ".got") == 0 || strcmp (p->name, ".got.plt") == 0 || strcmp (p->name, ".plt") == 0) { asection *ip; - bfd *dynobj = elf_hash_table (info)->dynobj; - if (dynobj != NULL - && (ip = bfd_get_section_by_name (dynobj, p->name)) != NULL + if (htab->dynobj != NULL + && (ip = bfd_get_section_by_name (htab->dynobj, p->name)) != NULL && (ip->flags & SEC_LINKER_CREATED) && ip->output_section == p) return TRUE; @@ -727,6 +769,8 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd, && (p->flags & SEC_ALLOC) != 0 && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p)) elf_section_data (p)->dynindx = ++dynsymcount; + else + elf_section_data (p)->dynindx = 0; } *section_sym_count = dynsymcount; @@ -796,6 +840,15 @@ _bfd_elf_merge_symbol (bfd *abfd, sec = *psec; bind = ELF_ST_BIND (sym->st_info); + /* Silently discard TLS symbols from --just-syms. There's no way to + combine a static TLS block with a new TLS block for this executable. */ + if (ELF_ST_TYPE (sym->st_info) == STT_TLS + && sec->sec_info_type == ELF_INFO_TYPE_JUST_SYMS) + { + *skip = TRUE; + return TRUE; + } + if (! bfd_is_und_section (sec)) h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE); else @@ -816,6 +869,11 @@ _bfd_elf_merge_symbol (bfd *abfd, || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + /* We have to check it for every instance since the first few may be + refereences and not all compilers emit symbol type for undefined + symbols. */ + bfd_elf_link_mark_dynamic_symbol (info, h, sym); + /* If we just created the symbol, mark it as being an ELF symbol. Other than that, there is nothing to do--there is no merge issue with a newly defined symbol--so we just return. */ @@ -889,6 +947,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && h->root.type != bfd_link_hash_undefweak && h->root.type != bfd_link_hash_common); + bed = get_elf_backend_data (abfd); /* When we try to create a default indirect symbol from the dynamic definition with the default version, we skip it if its type and the type of existing regular definition mismatch. We only do it @@ -903,7 +962,9 @@ _bfd_elf_merge_symbol (bfd *abfd, && (olddef || h->root.type == bfd_link_hash_common) && ELF_ST_TYPE (sym->st_info) != h->type && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE - && h->type != STT_NOTYPE) + && h->type != STT_NOTYPE + && !(bed->is_function_type (ELF_ST_TYPE (sym->st_info)) + && bed->is_function_type (h->type))) { *skip = TRUE; return TRUE; @@ -1007,7 +1068,41 @@ _bfd_elf_merge_symbol (bfd *abfd, relocatable file and the old definition comes from a dynamic object, we remove the old definition. */ if ((*sym_hash)->root.type == bfd_link_hash_indirect) - h = *sym_hash; + { + /* Handle the case where the old dynamic definition is + default versioned. We need to copy the symbol info from + the symbol with default version to the normal one if it + was referenced before. */ + if (h->ref_regular) + { + const struct elf_backend_data *bed + = get_elf_backend_data (abfd); + struct elf_link_hash_entry *vh = *sym_hash; + vh->root.type = h->root.type; + h->root.type = bfd_link_hash_indirect; + (*bed->elf_backend_copy_indirect_symbol) (info, vh, h); + /* Protected symbols will override the dynamic definition + with default version. */ + if (ELF_ST_VISIBILITY (sym->st_other) == STV_PROTECTED) + { + h->root.u.i.link = (struct bfd_link_hash_entry *) vh; + vh->dynamic_def = 1; + vh->ref_dynamic = 1; + } + else + { + h->root.type = vh->root.type; + vh->ref_dynamic = 0; + /* We have to hide it here since it was made dynamic + global with extra bits when the symbol info was + copied from the old dynamic definition. */ + (*bed->elf_backend_hide_symbol) (info, vh, TRUE); + } + h = vh; + } + else + h = *sym_hash; + } if ((h->root.u.undef.next || info->hash->undefs_tail == &h->root) && bfd_is_und_section (sec)) @@ -1060,6 +1155,11 @@ _bfd_elf_merge_symbol (bfd *abfd, if (olddef && newdyn) oldweak = FALSE; + /* Allow changes between different types of funciton symbol. */ + if (bed->is_function_type (ELF_ST_TYPE (sym->st_info)) + && bed->is_function_type (h->type)) + *type_change_ok = TRUE; + /* It's OK to change the type if either the existing symbol or the new symbol is weak. A type change is also OK if the old symbol is undefined and the new symbol is defined. */ @@ -1106,7 +1206,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && (sec->flags & SEC_ALLOC) != 0 && (sec->flags & SEC_LOAD) == 0 && sym->st_size > 0 - && ELF_ST_TYPE (sym->st_info) != STT_FUNC) + && !bed->is_function_type (ELF_ST_TYPE (sym->st_info))) newdyncommon = TRUE; else newdyncommon = FALSE; @@ -1118,14 +1218,13 @@ _bfd_elf_merge_symbol (bfd *abfd, && (h->root.u.def.section->flags & SEC_ALLOC) != 0 && (h->root.u.def.section->flags & SEC_LOAD) == 0 && h->size > 0 - && h->type != STT_FUNC) + && !bed->is_function_type (h->type)) olddyncommon = TRUE; else olddyncommon = FALSE; /* We now know everything about the old and new symbols. We ask the backend to check if we can merge them. */ - bed = get_elf_backend_data (abfd); if (bed->merge_symbol && !bed->merge_symbol (info, sym_hash, h, sym, psec, pvalue, pold_alignment, skip, override, @@ -1180,7 +1279,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && (olddef || (h->root.type == bfd_link_hash_common && (newweak - || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))) + || bed->is_function_type (ELF_ST_TYPE (sym->st_info)))))) { *override = TRUE; newdef = FALSE; @@ -1235,7 +1334,7 @@ _bfd_elf_merge_symbol (bfd *abfd, && (newdef || (bfd_is_com_section (sec) && (oldweak - || h->type == STT_FUNC))) + || bed->is_function_type (h->type)))) && olddyn && olddef && h->def_dynamic) @@ -1464,6 +1563,10 @@ _bfd_elf_add_default_symbol (bfd *abfd, hi = h; } + /* Check if HI is a warning symbol. */ + if (hi->root.type == bfd_link_hash_warning) + hi = (struct elf_link_hash_entry *) hi->root.u.i.link; + /* If there is a duplicate definition somewhere, then HI may not point to an indirect symbol. We will have reported an error to the user in that case. */ @@ -1574,6 +1677,10 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data) { struct elf_info_failed *eif = data; + /* Ignore this if we won't export it. */ + if (!eif->info->export_dynamic && !h->dynamic) + return TRUE; + /* Ignore indirect symbols. These are added by the versioning code. */ if (h->root.type == bfd_link_hash_indirect) return TRUE; @@ -1840,7 +1947,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data) /* We could not find the version for a symbol when generating a shared archive. Return an error. */ (*_bfd_error_handler) - (_("%B: undefined versioned symbol name %s"), + (_("%B: version node not found for symbol %s"), sinfo->output_bfd, h->root.root.string); bfd_set_error (bfd_error_bad_value); sinfo->failed = TRUE; @@ -2327,7 +2434,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, if (h->needs_plt && eif->info->shared && is_elf_hash_table (eif->info->hash) - && (eif->info->symbolic + && (SYMBOLIC_BIND (eif->info, h) || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) && h->def_regular) { @@ -2502,6 +2609,52 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data) return TRUE; } +/* Adjust the dynamic symbol, H, for copy in the dynamic bss section, + DYNBSS. */ + +bfd_boolean +_bfd_elf_adjust_dynamic_copy (struct elf_link_hash_entry *h, + asection *dynbss) +{ + unsigned int power_of_two; + bfd_vma mask; + asection *sec = h->root.u.def.section; + + /* The section aligment of definition is the maximum alignment + requirement of symbols defined in the section. Since we don't + know the symbol alignment requirement, we start with the + maximum alignment and check low bits of the symbol address + for the minimum alignment. */ + power_of_two = bfd_get_section_alignment (sec->owner, sec); + mask = ((bfd_vma) 1 << power_of_two) - 1; + while ((h->root.u.def.value & mask) != 0) + { + mask >>= 1; + --power_of_two; + } + + if (power_of_two > bfd_get_section_alignment (dynbss->owner, + dynbss)) + { + /* Adjust the section alignment if needed. */ + if (! bfd_set_section_alignment (dynbss->owner, dynbss, + power_of_two)) + return FALSE; + } + + /* We make sure that the symbol will be aligned properly. */ + dynbss->size = BFD_ALIGN (dynbss->size, mask + 1); + + /* Define the symbol as being at this point in DYNBSS. */ + h->root.u.def.section = dynbss; + h->root.u.def.value = dynbss->size; + + /* Increment the size of DYNBSS to make room for the symbol. */ + dynbss->size += h->size; + + return TRUE; +} + /* Adjust all external symbols pointing into SEC_MERGE sections to reflect the object merging within the sections. */ @@ -2540,6 +2693,8 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, bfd_boolean ignore_protected) { bfd_boolean binding_stays_local_p; + const struct elf_backend_data *bed; + struct elf_link_hash_table *hash_table; if (h == NULL) return FALSE; @@ -2556,7 +2711,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, /* Identify the cases where name binding rules say that a visible symbol resolves locally. */ - binding_stays_local_p = info->executable || info->symbolic; + binding_stays_local_p = info->executable || SYMBOLIC_BIND (info, h); switch (ELF_ST_VISIBILITY (h->other)) { @@ -2565,10 +2720,16 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, return FALSE; case STV_PROTECTED: + hash_table = elf_hash_table (info); + if (!is_elf_hash_table (hash_table)) + return FALSE; + + bed = get_elf_backend_data (hash_table->dynobj); + /* Proper resolution for function pointer equality may require that these symbols perhaps be resolved dynamically, even though we should be resolving them to the current module. */ - if (!ignore_protected || h->type != STT_FUNC) + if (!ignore_protected || !bed->is_function_type (h->type)) binding_stays_local_p = TRUE; break; @@ -2595,6 +2756,9 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, struct bfd_link_info *info, bfd_boolean local_protected) { + const struct elf_backend_data *bed; + struct elf_link_hash_table *hash_table; + /* If it's a local sym, of course we resolve locally. */ if (h == NULL) return TRUE; @@ -2619,7 +2783,7 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, /* At this point, we know the symbol is defined and dynamic. In an executable it must resolve locally, likewise when building symbolic shared libraries. */ - if (info->executable || info->symbolic) + if (info->executable || SYMBOLIC_BIND (info, h)) return TRUE; /* Now deal with defined dynamic symbols in shared libraries. Ones @@ -2631,8 +2795,14 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, if (ELF_ST_VISIBILITY (h->other) != STV_PROTECTED) return TRUE; + hash_table = elf_hash_table (info); + if (!is_elf_hash_table (hash_table)) + return TRUE; + + bed = get_elf_backend_data (hash_table->dynobj); + /* STV_PROTECTED non-function symbols are local. */ - if (h->type != STT_FUNC) + if (!bed->is_function_type (h->type)) return TRUE; /* Function pointer equality tests may require that STV_PROTECTED @@ -2681,8 +2851,9 @@ is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED, && ELF_ST_BIND (sym->st_info) < STB_LOOS) return FALSE; + bed = get_elf_backend_data (abfd); /* Function symbols do not count. */ - if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) + if (bed->is_function_type (ELF_ST_TYPE (sym->st_info))) return FALSE; /* If the section is undefined, then so is the symbol. */ @@ -2691,7 +2862,6 @@ is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED, /* If the symbol is defined in the common section, then it is a common definition and so does not count. */ - bed = get_elf_backend_data (abfd); if (bed->common_definition (sym)) return FALSE; @@ -3080,6 +3250,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) struct elf_link_hash_table *htab; bfd_size_type amt; void *alloc_mark = NULL; + struct bfd_hash_entry **old_table = NULL; + unsigned int old_size = 0; + unsigned int old_count = 0; void *old_tab = NULL; void *old_hash; void *old_ent; @@ -3126,7 +3299,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) const char *name; name = bfd_get_section_name (abfd, s); - if (strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0) + if (CONST_STRNEQ (name, ".gnu.warning.")) { char *msg; bfd_size_type sz; @@ -3511,6 +3684,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) memcpy (old_hash, sym_hash, hashsize); old_undefs = htab->root.undefs; old_undefs_tail = htab->root.undefs_tail; + old_table = htab->root.table.table; + old_size = htab->root.table.size; + old_count = htab->root.table.count; old_dynsymcount = htab->dynsymcount; for (i = 0; i < htab->root.table.size; i++) @@ -3592,12 +3768,10 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) sec = bfd_abs_section_ptr; else if (sec->kept_section) { - /* Symbols from discarded section are undefined, and have - default visibility. */ + /* Symbols from discarded section are undefined. We keep + its visibility. */ sec = bfd_und_section_ptr; isym->st_shndx = SHN_UNDEF; - isym->st_other = (STV_DEFAULT - | (isym->st_other & ~ ELF_ST_VISIBILITY (-1))); } else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) value -= sec->vma; @@ -3622,7 +3796,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) goto error_free_vers; if (isym->st_shndx == SHN_COMMON - && ELF_ST_TYPE (isym->st_info) == STT_TLS) + && ELF_ST_TYPE (isym->st_info) == STT_TLS + && !info->relocatable) { asection *tcomm = bfd_get_section_by_name (abfd, ".tcommon"); @@ -3694,8 +3869,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) if it is not a function, because it might be the version symbol itself. FIXME: What if it isn't? */ if ((iver.vs_vers & VERSYM_HIDDEN) != 0 - || (vernum > 1 && (! bfd_is_abs_section (sec) - || ELF_ST_TYPE (isym->st_info) == STT_FUNC))) + || (vernum > 1 + && (!bfd_is_abs_section (sec) + || bed->is_function_type (ELF_ST_TYPE (isym->st_info))))) { const char *verstr; size_t namelen, verlen, newlen; @@ -3842,7 +4018,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) if (dynamic && definition && (flags & BSF_WEAK) != 0 - && ELF_ST_TYPE (isym->st_info) != STT_FUNC + && !bed->is_function_type (ELF_ST_TYPE (isym->st_info)) && is_elf_hash_table (htab) && h->u.weakdef == NULL) { @@ -3929,18 +4105,30 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } if (normal_align < common_align) - (*_bfd_error_handler) - (_("Warning: alignment %u of symbol `%s' in %B" - " is smaller than %u in %B"), - normal_bfd, common_bfd, - 1 << normal_align, name, 1 << common_align); + { + /* PR binutils/2735 */ + if (normal_bfd == NULL) + (*_bfd_error_handler) + (_("Warning: alignment %u of common symbol `%s' in %B" + " is greater than the alignment (%u) of its section %A"), + common_bfd, h->root.u.def.section, + 1 << common_align, name, 1 << normal_align); + else + (*_bfd_error_handler) + (_("Warning: alignment %u of symbol `%s' in %B" + " is smaller than %u in %B"), + normal_bfd, common_bfd, + 1 << normal_align, name, 1 << common_align); + } } - /* Remember the symbol size and type. */ - if (isym->st_size != 0 + /* Remember the symbol size if it isn't undefined. */ + if ((isym->st_size != 0 && isym->st_shndx != SHN_UNDEF) && (definition || h->size == 0)) { - if (h->size != 0 && h->size != isym->st_size && ! size_change_ok) + if (h->size != 0 + && h->size != isym->st_size + && ! size_change_ok) (*_bfd_error_handler) (_("Warning: size of symbol `%s' changed" " from %lu in %B to %lu in %B"), @@ -3955,7 +4143,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) to be the size of the common symbol. The code just above won't fix the size if a common symbol becomes larger. We don't warn about a size change here, because that is - covered by --warn-common. */ + covered by --warn-common. Allow changed between different + function types. */ if (h->root.type == bfd_link_hash_common) h->size = h->root.u.c.size; @@ -3989,13 +4178,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) isym->st_other = (STV_HIDDEN | (isym->st_other & ~ELF_ST_VISIBILITY (-1))); - if (isym->st_other != 0 && !dynamic) + if (ELF_ST_VISIBILITY (isym->st_other) != 0 && !dynamic) { unsigned char hvis, symvis, other, nvis; - /* Take the balance of OTHER from the definition. */ - other = (definition ? isym->st_other : h->other); - other &= ~ ELF_ST_VISIBILITY (-1); + /* Only merge the visibility. Leave the remainder of the + st_other field to elf_backend_merge_symbol_attribute. */ + other = h->other & ~ELF_ST_VISIBILITY (-1); /* Combine visibilities, using the most constraining one. */ hvis = ELF_ST_VISIBILITY (h->other); @@ -4045,6 +4234,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) dynsym = TRUE; } + if (definition && (sec->flags & SEC_DEBUGGING)) + { + /* We don't want to make debug symbol dynamic. */ + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + dynsym = FALSE; + } + /* Check to see if we need to add an indirect symbol for the default name. */ if (definition || h->root.type == bfd_link_hash_common) @@ -4145,9 +4341,14 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) unsigned int i; /* Restore the symbol table. */ + if (bed->as_needed_cleanup) + (*bed->as_needed_cleanup) (abfd, info); old_hash = (char *) old_tab + tabsize; old_ent = (char *) old_hash + hashsize; sym_hash = elf_sym_hashes (abfd); + htab->root.table.table = old_table; + htab->root.table.size = old_size; + htab->root.table.count = old_count; memcpy (htab->root.table.table, old_tab, tabsize); memcpy (sym_hash, old_hash, hashsize); htab->root.undefs = old_undefs; @@ -4285,7 +4486,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) h = *hpp; if (h != NULL && h->root.type == bfd_link_hash_defined - && h->type != STT_FUNC) + && !bed->is_function_type (h->type)) { *sym_hash = h; sym_hash++; @@ -4457,7 +4658,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) asection *stab; for (stab = abfd->sections; stab; stab = stab->next) - if (strncmp (".stab", stab->name, 5) == 0 + if (CONST_STRNEQ (stab->name, ".stab") && (!stab->name[5] || (stab->name[5] == '.' && ISDIGIT (stab->name[6]))) && (stab->flags & SEC_MERGE) == 0 @@ -4807,6 +5008,131 @@ elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data) return TRUE; } +struct collect_gnu_hash_codes +{ + bfd *output_bfd; + const struct elf_backend_data *bed; + unsigned long int nsyms; + unsigned long int maskbits; + unsigned long int *hashcodes; + unsigned long int *hashval; + unsigned long int *indx; + unsigned long int *counts; + bfd_vma *bitmask; + bfd_byte *contents; + long int min_dynindx; + unsigned long int bucketcount; + unsigned long int symindx; + long int local_indx; + long int shift1, shift2; + unsigned long int mask; +}; + +/* This function will be called though elf_link_hash_traverse to store + all hash value of the exported symbols in an array. */ + +static bfd_boolean +elf_collect_gnu_hash_codes (struct elf_link_hash_entry *h, void *data) +{ + struct collect_gnu_hash_codes *s = data; + const char *name; + char *p; + unsigned long ha; + char *alc = NULL; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->dynindx == -1) + return TRUE; + + /* Ignore also local symbols and undefined symbols. */ + if (! (*s->bed->elf_hash_symbol) (h)) + return TRUE; + + name = h->root.root.string; + p = strchr (name, ELF_VER_CHR); + if (p != NULL) + { + alc = bfd_malloc (p - name + 1); + memcpy (alc, name, p - name); + alc[p - name] = '\0'; + name = alc; + } + + /* Compute the hash value. */ + ha = bfd_elf_gnu_hash (name); + + /* Store the found hash value in the array for compute_bucket_count, + and also for .dynsym reordering purposes. */ + s->hashcodes[s->nsyms] = ha; + s->hashval[h->dynindx] = ha; + ++s->nsyms; + if (s->min_dynindx < 0 || s->min_dynindx > h->dynindx) + s->min_dynindx = h->dynindx; + + if (alc != NULL) + free (alc); + + return TRUE; +} + +/* This function will be called though elf_link_hash_traverse to do + final dynaminc symbol renumbering. */ + +static bfd_boolean +elf_renumber_gnu_hash_syms (struct elf_link_hash_entry *h, void *data) +{ + struct collect_gnu_hash_codes *s = data; + unsigned long int bucket; + unsigned long int val; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Ignore indirect symbols. */ + if (h->dynindx == -1) + return TRUE; + + /* Ignore also local symbols and undefined symbols. */ + if (! (*s->bed->elf_hash_symbol) (h)) + { + if (h->dynindx >= s->min_dynindx) + h->dynindx = s->local_indx++; + return TRUE; + } + + bucket = s->hashval[h->dynindx] % s->bucketcount; + val = (s->hashval[h->dynindx] >> s->shift1) + & ((s->maskbits >> s->shift1) - 1); + s->bitmask[val] |= ((bfd_vma) 1) << (s->hashval[h->dynindx] & s->mask); + s->bitmask[val] + |= ((bfd_vma) 1) << ((s->hashval[h->dynindx] >> s->shift2) & s->mask); + val = s->hashval[h->dynindx] & ~(unsigned long int) 1; + if (s->counts[bucket] == 1) + /* Last element terminates the chain. */ + val |= 1; + bfd_put_32 (s->output_bfd, val, + s->contents + (s->indx[bucket] - s->symindx) * 4); + --s->counts[bucket]; + h->dynindx = s->indx[bucket]++; + return TRUE; +} + +/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ + +bfd_boolean +_bfd_elf_hash_symbol (struct elf_link_hash_entry *h) +{ + return !(h->forced_local + || h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak + || ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->output_section == NULL)); +} + /* Array used to determine the number of hash table buckets to use based on the number of symbols there are. If there are fewer than 3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets, @@ -4828,42 +5154,26 @@ static const size_t elf_buckets[] = Therefore the result is always a good payoff between few collisions (= short chain lengths) and table size. */ static size_t -compute_bucket_count (struct bfd_link_info *info) +compute_bucket_count (struct bfd_link_info *info, unsigned long int *hashcodes, + unsigned long int nsyms, int gnu_hash) { size_t dynsymcount = elf_hash_table (info)->dynsymcount; size_t best_size = 0; - unsigned long int *hashcodes; - unsigned long int *hashcodesp; unsigned long int i; bfd_size_type amt; - /* Compute the hash values for all exported symbols. At the same - time store the values in an array so that we could use them for - optimizations. */ - amt = dynsymcount; - amt *= sizeof (unsigned long int); - hashcodes = bfd_malloc (amt); - if (hashcodes == NULL) - return 0; - hashcodesp = hashcodes; - - /* Put all hash values in HASHCODES. */ - elf_link_hash_traverse (elf_hash_table (info), - elf_collect_hash_codes, &hashcodesp); - /* We have a problem here. The following code to optimize the table size requires an integer type with more the 32 bits. If BFD_HOST_U_64_BIT is set we know about such a type. */ #ifdef BFD_HOST_U_64_BIT if (info->optimize) { - unsigned long int nsyms = hashcodesp - hashcodes; size_t minsize; size_t maxsize; BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0); - unsigned long int *counts ; bfd *dynobj = elf_hash_table (info)->dynobj; const struct elf_backend_data *bed = get_elf_backend_data (dynobj); + unsigned long int *counts; /* Possible optimization parameters: if we have NSYMS symbols we say that the hashing table must at least have NSYMS/4 and at most @@ -4872,6 +5182,13 @@ compute_bucket_count (struct bfd_link_info *info) if (minsize == 0) minsize = 1; best_size = maxsize = nsyms * 2; + if (gnu_hash) + { + if (minsize < 2) + minsize = 2; + if ((best_size & 31) == 0) + ++best_size; + } /* Create array where we count the collisions in. We must use bfd_malloc since the size could be large. */ @@ -4879,10 +5196,7 @@ compute_bucket_count (struct bfd_link_info *info) amt *= sizeof (unsigned long int); counts = bfd_malloc (amt); if (counts == NULL) - { - free (hashcodes); - return 0; - } + return 0; /* Compute the "optimal" size for the hash table. The criteria is a minimal chain length. The minor criteria is (of course) the size @@ -4894,6 +5208,9 @@ compute_bucket_count (struct bfd_link_info *info) unsigned long int j; unsigned long int fact; + if (gnu_hash && (i & 31) == 0) + continue; + memset (counts, '\0', i * sizeof (unsigned long int)); /* Determine how often each hash bucket is used. */ @@ -4909,9 +5226,9 @@ compute_bucket_count (struct bfd_link_info *info) # define BFD_TARGET_PAGESIZE (4096) # endif - /* We in any case need 2 + NSYMS entries for the size values and - the chains. */ - max = (2 + nsyms) * (bed->s->arch_size / 8); + /* We in any case need 2 + DYNSYMCOUNT entries for the size values + and the chains. */ + max = (2 + dynsymcount) * bed->s->sizeof_hash_entry; # if 1 /* Variant 1: optimize for short chains. We add the squares @@ -4921,7 +5238,7 @@ compute_bucket_count (struct bfd_link_info *info) max += counts[j] * counts[j]; /* This adds penalties for the overall size of the table. */ - fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1; + fact = i / (BFD_TARGET_PAGESIZE / bed->s->sizeof_hash_entry) + 1; max *= fact * fact; # else /* Variant 2: Optimize a lot more for small table. Here we @@ -4932,7 +5249,7 @@ compute_bucket_count (struct bfd_link_info *info) /* The overall size of the table is considered, but not as strong as in variant 1, where it is squared. */ - fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1; + fact = i / (BFD_TARGET_PAGESIZE / bed->s->sizeof_hash_entry) + 1; max *= fact; # endif @@ -4955,14 +5272,13 @@ compute_bucket_count (struct bfd_link_info *info) for (i = 0; elf_buckets[i] != 0; i++) { best_size = elf_buckets[i]; - if (dynsymcount < elf_buckets[i + 1]) + if (nsyms < elf_buckets[i + 1]) break; } + if (gnu_hash && best_size < 2) + best_size = 2; } - /* Free the arrays we needed. */ - free (hashcodes); - return best_size; } @@ -4993,6 +5309,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, if (!is_elf_hash_table (info->hash)) return TRUE; + bed = get_elf_backend_data (output_bfd); elf_tdata (output_bfd)->relro = info->relro; if (info->execstack) elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; @@ -5019,7 +5336,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, exec = PF_X; notesec = s; } - else + else if (bed->default_execstack) exec = PF_X; } if (notesec) @@ -5040,11 +5357,13 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, /* The backend may have to create some sections regardless of whether we're dynamic or not. */ - bed = get_elf_backend_data (output_bfd); if (bed->elf_backend_always_size_sections && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) return FALSE; + if (! _bfd_elf_maybe_strip_eh_frame_hdr (info)) + return FALSE; + dynobj = elf_hash_table (info)->dynobj; /* If there were no dynamic objects in the link, there is nothing to @@ -5052,9 +5371,6 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, if (dynobj == NULL) return TRUE; - if (! _bfd_elf_maybe_strip_eh_frame_hdr (info)) - return FALSE; - if (elf_hash_table (info)->dynamic_sections_created) { struct elf_info_failed eif; @@ -5135,7 +5451,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, /* If we are supposed to export all symbols into the dynamic symbol table (this is not the normal case), then do so. */ - if (info->export_dynamic) + if (info->export_dynamic + || (info->executable && info->dynamic)) { elf_link_hash_traverse (elf_hash_table (info), _bfd_elf_export_symbol, @@ -5277,15 +5594,16 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) - for (o = sub->sections; o != NULL; o = o->next) - if (elf_section_data (o)->this_hdr.sh_type - == SHT_PREINIT_ARRAY) - { - (*_bfd_error_handler) - (_("%B: .preinit_array section is not allowed in DSO"), - sub); - break; - } + if (bfd_get_flavour (sub) == bfd_target_elf_flavour) + for (o = sub->sections; o != NULL; o = o->next) + if (elf_section_data (o)->this_hdr.sh_type + == SHT_PREINIT_ARRAY) + { + (*_bfd_error_handler) + (_("%B: .preinit_array section is not allowed in DSO"), + sub); + break; + } bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -5320,7 +5638,10 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, bfd_size_type strsize; strsize = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); - if (!_bfd_elf_add_dynamic_entry (info, DT_HASH, 0) + if ((info->emit_hash + && !_bfd_elf_add_dynamic_entry (info, DT_HASH, 0)) + || (info->emit_gnu_hash + && !_bfd_elf_add_dynamic_entry (info, DT_GNU_HASH, 0)) || !_bfd_elf_add_dynamic_entry (info, DT_STRTAB, 0) || !_bfd_elf_add_dynamic_entry (info, DT_SYMTAB, 0) || !_bfd_elf_add_dynamic_entry (info, DT_STRSZ, strsize) @@ -5709,21 +6030,68 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, return TRUE; } +/* Find the first non-excluded output section. We'll use its + section symbol for some emitted relocs. */ +void +_bfd_elf_init_1_index_section (bfd *output_bfd, struct bfd_link_info *info) +{ + asection *s; + + for (s = output_bfd->sections; s != NULL; s = s->next) + if ((s->flags & (SEC_EXCLUDE | SEC_ALLOC)) == SEC_ALLOC + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->text_index_section = s; + break; + } +} + +/* Find two non-excluded output sections, one for code, one for data. + We'll use their section symbols for some emitted relocs. */ +void +_bfd_elf_init_2_index_sections (bfd *output_bfd, struct bfd_link_info *info) +{ + asection *s; + + for (s = output_bfd->sections; s != NULL; s = s->next) + if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) + == (SEC_ALLOC | SEC_READONLY)) + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->text_index_section = s; + break; + } + + for (s = output_bfd->sections; s != NULL; s = s->next) + if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC) + && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + { + elf_hash_table (info)->data_index_section = s; + break; + } + + if (elf_hash_table (info)->text_index_section == NULL) + elf_hash_table (info)->text_index_section + = elf_hash_table (info)->data_index_section; +} + bfd_boolean bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) { + const struct elf_backend_data *bed; + if (!is_elf_hash_table (info->hash)) return TRUE; + bed = get_elf_backend_data (output_bfd); + (*bed->elf_backend_init_index_section) (output_bfd, info); + if (elf_hash_table (info)->dynamic_sections_created) { bfd *dynobj; - const struct elf_backend_data *bed; asection *s; bfd_size_type dynsymcount; unsigned long section_sym_count; - size_t bucketcount = 0; - size_t hash_entry_size; unsigned int dtagcount; dynobj = elf_hash_table (info)->dynobj; @@ -5759,7 +6127,6 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) section as we went along in elf_link_add_object_symbols. */ s = bfd_get_section_by_name (dynobj, ".dynsym"); BFD_ASSERT (s != NULL); - bed = get_elf_backend_data (output_bfd); s->size = dynsymcount * bed->s->sizeof_sym; if (dynsymcount != 0) @@ -5774,23 +6141,215 @@ bfd_elf_size_dynsym_hash_dynstr (bfd *output_bfd, struct bfd_link_info *info) memset (s->contents, 0, section_sym_count * bed->s->sizeof_sym); } + elf_hash_table (info)->bucketcount = 0; + /* Compute the size of the hashing table. As a side effect this computes the hash values for all the names we export. */ - bucketcount = compute_bucket_count (info); + if (info->emit_hash) + { + unsigned long int *hashcodes; + unsigned long int *hashcodesp; + bfd_size_type amt; + unsigned long int nsyms; + size_t bucketcount; + size_t hash_entry_size; - s = bfd_get_section_by_name (dynobj, ".hash"); - BFD_ASSERT (s != NULL); - hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize; - s->size = ((2 + bucketcount + dynsymcount) * hash_entry_size); - s->contents = bfd_zalloc (output_bfd, s->size); - if (s->contents == NULL) - return FALSE; + /* Compute the hash values for all exported symbols. At the same + time store the values in an array so that we could use them for + optimizations. */ + amt = dynsymcount * sizeof (unsigned long int); + hashcodes = bfd_malloc (amt); + if (hashcodes == NULL) + return FALSE; + hashcodesp = hashcodes; - bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); - bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, - s->contents + hash_entry_size); + /* Put all hash values in HASHCODES. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_collect_hash_codes, &hashcodesp); - elf_hash_table (info)->bucketcount = bucketcount; + nsyms = hashcodesp - hashcodes; + bucketcount + = compute_bucket_count (info, hashcodes, nsyms, 0); + free (hashcodes); + + if (bucketcount == 0) + return FALSE; + + elf_hash_table (info)->bucketcount = bucketcount; + + s = bfd_get_section_by_name (dynobj, ".hash"); + BFD_ASSERT (s != NULL); + hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize; + s->size = ((2 + bucketcount + dynsymcount) * hash_entry_size); + s->contents = bfd_zalloc (output_bfd, s->size); + if (s->contents == NULL) + return FALSE; + + bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); + bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, + s->contents + hash_entry_size); + } + + if (info->emit_gnu_hash) + { + size_t i, cnt; + unsigned char *contents; + struct collect_gnu_hash_codes cinfo; + bfd_size_type amt; + size_t bucketcount; + + memset (&cinfo, 0, sizeof (cinfo)); + + /* Compute the hash values for all exported symbols. At the same + time store the values in an array so that we could use them for + optimizations. */ + amt = dynsymcount * 2 * sizeof (unsigned long int); + cinfo.hashcodes = bfd_malloc (amt); + if (cinfo.hashcodes == NULL) + return FALSE; + + cinfo.hashval = cinfo.hashcodes + dynsymcount; + cinfo.min_dynindx = -1; + cinfo.output_bfd = output_bfd; + cinfo.bed = bed; + + /* Put all hash values in HASHCODES. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_collect_gnu_hash_codes, &cinfo); + + bucketcount + = compute_bucket_count (info, cinfo.hashcodes, cinfo.nsyms, 1); + + if (bucketcount == 0) + { + free (cinfo.hashcodes); + return FALSE; + } + + s = bfd_get_section_by_name (dynobj, ".gnu.hash"); + BFD_ASSERT (s != NULL); + + if (cinfo.nsyms == 0) + { + /* Empty .gnu.hash section is special. */ + BFD_ASSERT (cinfo.min_dynindx == -1); + free (cinfo.hashcodes); + s->size = 5 * 4 + bed->s->arch_size / 8; + contents = bfd_zalloc (output_bfd, s->size); + if (contents == NULL) + return FALSE; + s->contents = contents; + /* 1 empty bucket. */ + bfd_put_32 (output_bfd, 1, contents); + /* SYMIDX above the special symbol 0. */ + bfd_put_32 (output_bfd, 1, contents + 4); + /* Just one word for bitmask. */ + bfd_put_32 (output_bfd, 1, contents + 8); + /* Only hash fn bloom filter. */ + bfd_put_32 (output_bfd, 0, contents + 12); + /* No hashes are valid - empty bitmask. */ + bfd_put (bed->s->arch_size, output_bfd, 0, contents + 16); + /* No hashes in the only bucket. */ + bfd_put_32 (output_bfd, 0, + contents + 16 + bed->s->arch_size / 8); + } + else + { + unsigned long int maskwords, maskbitslog2; + BFD_ASSERT (cinfo.min_dynindx != -1); + + maskbitslog2 = bfd_log2 (cinfo.nsyms) + 1; + if (maskbitslog2 < 3) + maskbitslog2 = 5; + else if ((1 << (maskbitslog2 - 2)) & cinfo.nsyms) + maskbitslog2 = maskbitslog2 + 3; + else + maskbitslog2 = maskbitslog2 + 2; + if (bed->s->arch_size == 64) + { + if (maskbitslog2 == 5) + maskbitslog2 = 6; + cinfo.shift1 = 6; + } + else + cinfo.shift1 = 5; + cinfo.mask = (1 << cinfo.shift1) - 1; + cinfo.shift2 = maskbitslog2; + cinfo.maskbits = 1 << maskbitslog2; + maskwords = 1 << (maskbitslog2 - cinfo.shift1); + amt = bucketcount * sizeof (unsigned long int) * 2; + amt += maskwords * sizeof (bfd_vma); + cinfo.bitmask = bfd_malloc (amt); + if (cinfo.bitmask == NULL) + { + free (cinfo.hashcodes); + return FALSE; + } + + cinfo.counts = (void *) (cinfo.bitmask + maskwords); + cinfo.indx = cinfo.counts + bucketcount; + cinfo.symindx = dynsymcount - cinfo.nsyms; + memset (cinfo.bitmask, 0, maskwords * sizeof (bfd_vma)); + + /* Determine how often each hash bucket is used. */ + memset (cinfo.counts, 0, bucketcount * sizeof (cinfo.counts[0])); + for (i = 0; i < cinfo.nsyms; ++i) + ++cinfo.counts[cinfo.hashcodes[i] % bucketcount]; + + for (i = 0, cnt = cinfo.symindx; i < bucketcount; ++i) + if (cinfo.counts[i] != 0) + { + cinfo.indx[i] = cnt; + cnt += cinfo.counts[i]; + } + BFD_ASSERT (cnt == dynsymcount); + cinfo.bucketcount = bucketcount; + cinfo.local_indx = cinfo.min_dynindx; + + s->size = (4 + bucketcount + cinfo.nsyms) * 4; + s->size += cinfo.maskbits / 8; + contents = bfd_zalloc (output_bfd, s->size); + if (contents == NULL) + { + free (cinfo.bitmask); + free (cinfo.hashcodes); + return FALSE; + } + + s->contents = contents; + bfd_put_32 (output_bfd, bucketcount, contents); + bfd_put_32 (output_bfd, cinfo.symindx, contents + 4); + bfd_put_32 (output_bfd, maskwords, contents + 8); + bfd_put_32 (output_bfd, cinfo.shift2, contents + 12); + contents += 16 + cinfo.maskbits / 8; + + for (i = 0; i < bucketcount; ++i) + { + if (cinfo.counts[i] == 0) + bfd_put_32 (output_bfd, 0, contents); + else + bfd_put_32 (output_bfd, cinfo.indx[i], contents); + contents += 4; + } + + cinfo.contents = contents; + + /* Renumber dynamic symbols, populate .gnu.hash section. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_renumber_gnu_hash_syms, &cinfo); + + contents = s->contents + 16; + for (i = 0; i < maskwords; ++i) + { + bfd_put (bed->s->arch_size, output_bfd, cinfo.bitmask[i], + contents); + contents += bed->s->arch_size / 8; + } + + free (cinfo.bitmask); + free (cinfo.hashcodes); + } + } s = bfd_get_section_by_name (dynobj, ".dynstr"); BFD_ASSERT (s != NULL); @@ -5866,6 +6425,719 @@ struct elf_outext_info struct elf_final_link_info *finfo; }; + +/* Support for evaluating a complex relocation. + + Complex relocations are generalized, self-describing relocations. The + implementation of them consists of two parts: complex symbols, and the + relocations themselves. + + The relocations are use a reserved elf-wide relocation type code (R_RELC + external / BFD_RELOC_RELC internal) and an encoding of relocation field + information (start bit, end bit, word width, etc) into the addend. This + information is extracted from CGEN-generated operand tables within gas. + + Complex symbols are mangled symbols (BSF_RELC external / STT_RELC + internal) representing prefix-notation expressions, including but not + limited to those sorts of expressions normally encoded as addends in the + addend field. The symbol mangling format is: + + := + | ':' + | ':' ':' + ; + + := 's' ':' + | 'S' ':' + | '#' + ; + + := as in C + := as in C, plus "0-" for unambiguous negation. */ + +static void +set_symbol_value (bfd * bfd_with_globals, + struct elf_final_link_info * finfo, + int symidx, + bfd_vma val) +{ + bfd_boolean is_local; + Elf_Internal_Sym * sym; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry * h; + + sym_hashes = elf_sym_hashes (bfd_with_globals); + sym = finfo->internal_syms + symidx; + is_local = ELF_ST_BIND(sym->st_info) == STB_LOCAL; + + if (is_local) + { + /* It is a local symbol: move it to the + "absolute" section and give it a value. */ + sym->st_shndx = SHN_ABS; + sym->st_value = val; + } + else + { + /* It is a global symbol: set its link type + to "defined" and give it a value. */ + h = sym_hashes [symidx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + h->root.type = bfd_link_hash_defined; + h->root.u.def.value = val; + h->root.u.def.section = bfd_abs_section_ptr; + } +} + +static bfd_boolean +resolve_symbol (const char * name, + bfd * input_bfd, + struct elf_final_link_info * finfo, + bfd_vma * result, + size_t locsymcount) +{ + Elf_Internal_Sym * sym; + struct bfd_link_hash_entry * global_entry; + const char * candidate = NULL; + Elf_Internal_Shdr * symtab_hdr; + asection * sec = NULL; + size_t i; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + + for (i = 0; i < locsymcount; ++ i) + { + sym = finfo->internal_syms + i; + sec = finfo->sections [i]; + + if (ELF_ST_BIND (sym->st_info) != STB_LOCAL) + continue; + + candidate = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); +#ifdef DEBUG + printf ("Comparing string: '%s' vs. '%s' = 0x%x\n", + name, candidate, (unsigned int)sym->st_value); +#endif + if (candidate && strcmp (candidate, name) == 0) + { + * result = sym->st_value; + + if (sym->st_shndx > SHN_UNDEF && + sym->st_shndx < SHN_LORESERVE) + { +#ifdef DEBUG + printf ("adjusting for sec '%s' @ 0x%x + 0x%x\n", + sec->output_section->name, + (unsigned int)sec->output_section->vma, + (unsigned int)sec->output_offset); +#endif + * result += sec->output_offset + sec->output_section->vma; + } +#ifdef DEBUG + printf ("Found symbol with effective value %8.8x\n", (unsigned int)* result); +#endif + return TRUE; + } + } + + /* Hmm, haven't found it yet. perhaps it is a global. */ + global_entry = bfd_link_hash_lookup (finfo->info->hash, name, FALSE, FALSE, TRUE); + if (!global_entry) + return FALSE; + + if (global_entry->type == bfd_link_hash_defined + || global_entry->type == bfd_link_hash_defweak) + { + * result = global_entry->u.def.value + + global_entry->u.def.section->output_section->vma + + global_entry->u.def.section->output_offset; +#ifdef DEBUG + printf ("Found GLOBAL symbol '%s' with value %8.8x\n", + global_entry->root.string, (unsigned int)*result); +#endif + return TRUE; + } + + if (global_entry->type == bfd_link_hash_common) + { + *result = global_entry->u.def.value + + bfd_com_section_ptr->output_section->vma + + bfd_com_section_ptr->output_offset; +#ifdef DEBUG + printf ("Found COMMON symbol '%s' with value %8.8x\n", + global_entry->root.string, (unsigned int)*result); +#endif + return TRUE; + } + + return FALSE; +} + +static bfd_boolean +resolve_section (const char * name, + asection * sections, + bfd_vma * result) +{ + asection * curr; + unsigned int len; + + for (curr = sections; curr; curr = curr->next) + if (strcmp (curr->name, name) == 0) + { + *result = curr->vma; + return TRUE; + } + + /* Hmm. still haven't found it. try pseudo-section names. */ + for (curr = sections; curr; curr = curr->next) + { + len = strlen (curr->name); + if (len > strlen (name)) + continue; + + if (strncmp (curr->name, name, len) == 0) + { + if (strncmp (".end", name + len, 4) == 0) + { + *result = curr->vma + curr->size; + return TRUE; + } + + /* Insert more pseudo-section names here, if you like. */ + } + } + + return FALSE; +} + +static void +undefined_reference (const char * reftype, + const char * name) +{ + _bfd_error_handler (_("undefined %s reference in complex symbol: %s"), reftype, name); +} + +static bfd_boolean +eval_symbol (bfd_vma * result, + char * sym, + char ** advanced, + bfd * input_bfd, + struct elf_final_link_info * finfo, + bfd_vma addr, + bfd_vma section_offset, + size_t locsymcount, + int signed_p) +{ + int len; + int symlen; + bfd_vma a; + bfd_vma b; + const int bufsz = 4096; + char symbuf [bufsz]; + const char * symend; + bfd_boolean symbol_is_section = FALSE; + + len = strlen (sym); + symend = sym + len; + + if (len < 1 || len > bufsz) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + switch (* sym) + { + case '.': + * result = addr + section_offset; + * advanced = sym + 1; + return TRUE; + + case '#': + ++ sym; + * result = strtoul (sym, advanced, 16); + return TRUE; + + case 'S': + symbol_is_section = TRUE; + case 's': + ++ sym; + symlen = strtol (sym, &sym, 10); + ++ sym; /* Skip the trailing ':'. */ + + if ((symend < sym) || ((symlen + 1) > bufsz)) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + memcpy (symbuf, sym, symlen); + symbuf [symlen] = '\0'; + * advanced = sym + symlen; + + /* Is it always possible, with complex symbols, that gas "mis-guessed" + the symbol as a section, or vice-versa. so we're pretty liberal in our + interpretation here; section means "try section first", not "must be a + section", and likewise with symbol. */ + + if (symbol_is_section) + { + if ((resolve_section (symbuf, finfo->output_bfd->sections, result) != TRUE) + && (resolve_symbol (symbuf, input_bfd, finfo, result, locsymcount) != TRUE)) + { + undefined_reference ("section", symbuf); + return FALSE; + } + } + else + { + if ((resolve_symbol (symbuf, input_bfd, finfo, result, locsymcount) != TRUE) + && (resolve_section (symbuf, finfo->output_bfd->sections, + result) != TRUE)) + { + undefined_reference ("symbol", symbuf); + return FALSE; + } + } + + return TRUE; + + /* All that remains are operators. */ + +#define UNARY_OP(op) \ + if (strncmp (sym, #op, strlen (#op)) == 0) \ + { \ + sym += strlen (#op); \ + if (* sym == ':') \ + ++ sym; \ + if (eval_symbol (& a, sym, & sym, input_bfd, finfo, addr, \ + section_offset, locsymcount, signed_p) \ + != TRUE) \ + return FALSE; \ + if (signed_p) \ + * result = op ((signed)a); \ + else \ + * result = op a; \ + * advanced = sym; \ + return TRUE; \ + } + +#define BINARY_OP(op) \ + if (strncmp (sym, #op, strlen (#op)) == 0) \ + { \ + sym += strlen (#op); \ + if (* sym == ':') \ + ++ sym; \ + if (eval_symbol (& a, sym, & sym, input_bfd, finfo, addr, \ + section_offset, locsymcount, signed_p) \ + != TRUE) \ + return FALSE; \ + ++ sym; \ + if (eval_symbol (& b, sym, & sym, input_bfd, finfo, addr, \ + section_offset, locsymcount, signed_p) \ + != TRUE) \ + return FALSE; \ + if (signed_p) \ + * result = ((signed) a) op ((signed) b); \ + else \ + * result = a op b; \ + * advanced = sym; \ + return TRUE; \ + } + + default: + UNARY_OP (0-); + BINARY_OP (<<); + BINARY_OP (>>); + BINARY_OP (==); + BINARY_OP (!=); + BINARY_OP (<=); + BINARY_OP (>=); + BINARY_OP (&&); + BINARY_OP (||); + UNARY_OP (~); + UNARY_OP (!); + BINARY_OP (*); + BINARY_OP (/); + BINARY_OP (%); + BINARY_OP (^); + BINARY_OP (|); + BINARY_OP (&); + BINARY_OP (+); + BINARY_OP (-); + BINARY_OP (<); + BINARY_OP (>); +#undef UNARY_OP +#undef BINARY_OP + _bfd_error_handler (_("unknown operator '%c' in complex symbol"), * sym); + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } +} + +/* Entry point to evaluator, called from elf_link_input_bfd. */ + +static bfd_boolean +evaluate_complex_relocation_symbols (bfd * input_bfd, + struct elf_final_link_info * finfo, + size_t locsymcount) +{ + const struct elf_backend_data * bed; + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + asection * reloc_sec; + bfd_boolean result = TRUE; + + /* For each section, we're going to check and see if it has any + complex relocations, and we're going to evaluate any of them + we can. */ + + if (finfo->info->relocatable) + return TRUE; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + bed = get_elf_backend_data (input_bfd); + + for (reloc_sec = input_bfd->sections; reloc_sec; reloc_sec = reloc_sec->next) + { + Elf_Internal_Rela * internal_relocs; + unsigned long i; + + /* This section was omitted from the link. */ + if (! reloc_sec->linker_mark) + continue; + + /* Only process sections containing relocs. */ + if ((reloc_sec->flags & SEC_RELOC) == 0) + continue; + + if (reloc_sec->reloc_count == 0) + continue; + + /* Read in the relocs for this section. */ + internal_relocs + = _bfd_elf_link_read_relocs (input_bfd, reloc_sec, NULL, + (Elf_Internal_Rela *) NULL, + FALSE); + if (internal_relocs == NULL) + continue; + + for (i = reloc_sec->reloc_count; i--;) + { + Elf_Internal_Rela * rel; + char * sym_name; + bfd_vma index; + Elf_Internal_Sym * sym; + bfd_vma result; + bfd_vma section_offset; + bfd_vma addr; + int signed_p = 0; + + rel = internal_relocs + i; + section_offset = reloc_sec->output_section->vma + + reloc_sec->output_offset; + addr = rel->r_offset; + + index = ELF32_R_SYM (rel->r_info); + if (bed->s->arch_size == 64) + index >>= 24; + + if (index == STN_UNDEF) + continue; + + if (index < locsymcount) + { + /* The symbol is local. */ + sym = finfo->internal_syms + index; + + /* We're only processing STT_RELC or STT_SRELC type symbols. */ + if ((ELF_ST_TYPE (sym->st_info) != STT_RELC) && + (ELF_ST_TYPE (sym->st_info) != STT_SRELC)) + continue; + + sym_name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + + signed_p = (ELF_ST_TYPE (sym->st_info) == STT_SRELC); + } + else + { + /* The symbol is global. */ + struct elf_link_hash_entry * h; + + if (elf_bad_symtab (input_bfd)) + continue; + + h = sym_hashes [index - locsymcount]; + while ( h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->type != STT_RELC && h->type != STT_SRELC) + continue; + + signed_p = (h->type == STT_SRELC); + sym_name = (char *) h->root.root.string; + } +#ifdef DEBUG + printf ("Encountered a complex symbol!"); + printf (" (input_bfd %s, section %s, reloc %ld\n", + input_bfd->filename, reloc_sec->name, i); + printf (" symbol: idx %8.8lx, name %s\n", + index, sym_name); + printf (" reloc : info %8.8lx, addr %8.8lx\n", + rel->r_info, addr); + printf (" Evaluating '%s' ...\n ", sym_name); +#endif + if (eval_symbol (& result, sym_name, & sym_name, input_bfd, + finfo, addr, section_offset, locsymcount, + signed_p)) + /* Symbol evaluated OK. Update to absolute value. */ + set_symbol_value (input_bfd, finfo, index, result); + + else + result = FALSE; + } + + if (internal_relocs != elf_section_data (reloc_sec)->relocs) + free (internal_relocs); + } + + /* If nothing went wrong, then we adjusted + everything we wanted to adjust. */ + return result; +} + +static void +put_value (bfd_vma size, + unsigned long chunksz, + bfd * input_bfd, + bfd_vma x, + bfd_byte * location) +{ + location += (size - chunksz); + + for (; size; size -= chunksz, location -= chunksz, x >>= (chunksz * 8)) + { + switch (chunksz) + { + default: + case 0: + abort (); + case 1: + bfd_put_8 (input_bfd, x, location); + break; + case 2: + bfd_put_16 (input_bfd, x, location); + break; + case 4: + bfd_put_32 (input_bfd, x, location); + break; + case 8: +#ifdef BFD64 + bfd_put_64 (input_bfd, x, location); +#else + abort (); +#endif + break; + } + } +} + +static bfd_vma +get_value (bfd_vma size, + unsigned long chunksz, + bfd * input_bfd, + bfd_byte * location) +{ + bfd_vma x = 0; + + for (; size; size -= chunksz, location += chunksz) + { + switch (chunksz) + { + default: + case 0: + abort (); + case 1: + x = (x << (8 * chunksz)) | bfd_get_8 (input_bfd, location); + break; + case 2: + x = (x << (8 * chunksz)) | bfd_get_16 (input_bfd, location); + break; + case 4: + x = (x << (8 * chunksz)) | bfd_get_32 (input_bfd, location); + break; + case 8: +#ifdef BFD64 + x = (x << (8 * chunksz)) | bfd_get_64 (input_bfd, location); +#else + abort (); +#endif + break; + } + } + return x; +} + +static void +decode_complex_addend + (unsigned long * start, /* in bits */ + unsigned long * oplen, /* in bits */ + unsigned long * len, /* in bits */ + unsigned long * wordsz, /* in bytes */ + unsigned long * chunksz, /* in bytes */ + unsigned long * lsb0_p, + unsigned long * signed_p, + unsigned long * trunc_p, + unsigned long encoded) +{ + * start = encoded & 0x3F; + * len = (encoded >> 6) & 0x3F; + * oplen = (encoded >> 12) & 0x3F; + * wordsz = (encoded >> 18) & 0xF; + * chunksz = (encoded >> 22) & 0xF; + * lsb0_p = (encoded >> 27) & 1; + * signed_p = (encoded >> 28) & 1; + * trunc_p = (encoded >> 29) & 1; +} + +void +bfd_elf_perform_complex_relocation + (bfd * output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info * info, + bfd * input_bfd, + asection * input_section, + bfd_byte * contents, + Elf_Internal_Rela * rel, + Elf_Internal_Sym * local_syms, + asection ** local_sections) +{ + const struct elf_backend_data * bed; + Elf_Internal_Shdr * symtab_hdr; + asection * sec; + bfd_vma relocation = 0, shift, x; + bfd_vma r_symndx; + bfd_vma mask; + unsigned long start, oplen, len, wordsz, + chunksz, lsb0_p, signed_p, trunc_p; + + /* Perform this reloc, since it is complex. + (this is not to say that it necessarily refers to a complex + symbol; merely that it is a self-describing CGEN based reloc. + i.e. the addend has the complete reloc information (bit start, end, + word size, etc) encoded within it.). */ + r_symndx = ELF32_R_SYM (rel->r_info); + bed = get_elf_backend_data (input_bfd); + if (bed->s->arch_size == 64) + r_symndx >>= 24; + +#ifdef DEBUG + printf ("Performing complex relocation %ld...\n", r_symndx); +#endif + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + if (r_symndx < symtab_hdr->sh_info) + { + /* The symbol is local. */ + Elf_Internal_Sym * sym; + + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = sym->st_value; + if (sym->st_shndx > SHN_UNDEF && + sym->st_shndx < SHN_LORESERVE) + relocation += (sec->output_offset + + sec->output_section->vma); + } + else + { + /* The symbol is global. */ + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry * h; + + sym_hashes = elf_sym_hashes (input_bfd); + h = sym_hashes [r_symndx]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = h->root.u.def.value; + + if (! bfd_is_abs_section (sec)) + relocation += (sec->output_section->vma + + sec->output_offset); + } + if (h->root.type == bfd_link_hash_undefined + && !((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + info->unresolved_syms_in_objects == RM_GENERATE_ERROR + || ELF_ST_VISIBILITY (h->other)))) + return; + } + + decode_complex_addend (& start, & oplen, & len, & wordsz, + & chunksz, & lsb0_p, & signed_p, + & trunc_p, rel->r_addend); + + mask = (((1L << (len - 1)) - 1) << 1) | 1; + + if (lsb0_p) + shift = (start + 1) - len; + else + shift = (8 * wordsz) - (start + len); + + x = get_value (wordsz, chunksz, input_bfd, contents + rel->r_offset); + +#ifdef DEBUG + printf ("Doing complex reloc: " + "lsb0? %ld, signed? %ld, trunc? %ld, wordsz %ld, " + "chunksz %ld, start %ld, len %ld, oplen %ld\n" + " dest: %8.8lx, mask: %8.8lx, reloc: %8.8lx\n", + lsb0_p, signed_p, trunc_p, wordsz, chunksz, start, len, + oplen, x, mask, relocation); +#endif + + if (! trunc_p) + { + /* Now do an overflow check. */ + if (bfd_check_overflow ((signed_p ? + complain_overflow_signed : + complain_overflow_unsigned), + len, 0, (8 * wordsz), + relocation) == bfd_reloc_overflow) + (*_bfd_error_handler) + ("%s (%s + 0x%lx): relocation overflow: 0x%lx %sdoes not fit " + "within 0x%lx", + input_bfd->filename, input_section->name, rel->r_offset, + relocation, (signed_p ? "(signed) " : ""), mask); + } + + /* Do the deed. */ + x = (x & ~(mask << shift)) | ((relocation & mask) << shift); + +#ifdef DEBUG + printf (" relocation: %8.8lx\n" + " shifted mask: %8.8lx\n" + " shifted/masked reloc: %8.8lx\n" + " result: %8.8lx\n", + relocation, (mask << shift), + ((relocation & mask) << shift), x); +#endif + put_value (wordsz, chunksz, input_bfd, x, contents + rel->r_offset); +} + /* When performing a relocatable link, the input relocations are preserved. But, if they reference global symbols, the indices referenced must be updated. Update all the relocations in @@ -5994,7 +7266,9 @@ elf_link_sort_cmp2 (const void *A, const void *B) static size_t elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) { - asection *reldyn; + asection *dynamic_relocs; + asection *rela_dyn; + asection *rel_dyn; bfd_size_type count, size; size_t i, ret, sort_elt, ext_size; bfd_byte *sort, *s_non_relative, *p; @@ -6005,39 +7279,170 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); struct bfd_link_order *lo; bfd_vma r_sym_mask; + bfd_boolean use_rela; - reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); - if (reldyn == NULL || reldyn->size == 0) + /* Find a dynamic reloc section. */ + rela_dyn = bfd_get_section_by_name (abfd, ".rela.dyn"); + rel_dyn = bfd_get_section_by_name (abfd, ".rel.dyn"); + if (rela_dyn != NULL && rela_dyn->size > 0 + && rel_dyn != NULL && rel_dyn->size > 0) { - reldyn = bfd_get_section_by_name (abfd, ".rel.dyn"); - if (reldyn == NULL || reldyn->size == 0) - return 0; - ext_size = bed->s->sizeof_rel; - swap_in = bed->s->swap_reloc_in; - swap_out = bed->s->swap_reloc_out; + bfd_boolean use_rela_initialised = FALSE; + + /* This is just here to stop gcc from complaining. + It's initialization checking code is not perfect. */ + use_rela = TRUE; + + /* Both sections are present. Examine the sizes + of the indirect sections to help us choose. */ + for (lo = rela_dyn->map_head.link_order; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + asection *o = lo->u.indirect.section; + + if ((o->size % bed->s->sizeof_rela) == 0) + { + if ((o->size % bed->s->sizeof_rel) == 0) + /* Section size is divisible by both rel and rela sizes. + It is of no help to us. */ + ; + else + { + /* Section size is only divisible by rela. */ + if (use_rela_initialised && (use_rela == FALSE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = TRUE; + use_rela_initialised = TRUE; + } + } + } + else if ((o->size % bed->s->sizeof_rel) == 0) + { + /* Section size is only divisible by rel. */ + if (use_rela_initialised && (use_rela == TRUE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = FALSE; + use_rela_initialised = TRUE; + } + } + else + { + /* The section size is not divisible by either - something is wrong. */ + _bfd_error_handler + (_("%B: Unable to sort relocs - they are of an unknown size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + } + + for (lo = rel_dyn->map_head.link_order; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + asection *o = lo->u.indirect.section; + + if ((o->size % bed->s->sizeof_rela) == 0) + { + if ((o->size % bed->s->sizeof_rel) == 0) + /* Section size is divisible by both rel and rela sizes. + It is of no help to us. */ + ; + else + { + /* Section size is only divisible by rela. */ + if (use_rela_initialised && (use_rela == FALSE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = TRUE; + use_rela_initialised = TRUE; + } + } + } + else if ((o->size % bed->s->sizeof_rel) == 0) + { + /* Section size is only divisible by rel. */ + if (use_rela_initialised && (use_rela == TRUE)) + { + _bfd_error_handler + (_("%B: Unable to sort relocs - they are in more than one size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + else + { + use_rela = FALSE; + use_rela_initialised = TRUE; + } + } + else + { + /* The section size is not divisible by either - something is wrong. */ + _bfd_error_handler + (_("%B: Unable to sort relocs - they are of an unknown size"), abfd); + bfd_set_error (bfd_error_invalid_operation); + return 0; + } + } + + if (! use_rela_initialised) + /* Make a guess. */ + use_rela = TRUE; } + else if (rela_dyn != NULL && rela_dyn->size > 0) + use_rela = TRUE; + else if (rel_dyn != NULL && rel_dyn->size > 0) + use_rela = FALSE; else + return 0; + + if (use_rela) { + dynamic_relocs = rela_dyn; ext_size = bed->s->sizeof_rela; swap_in = bed->s->swap_reloca_in; swap_out = bed->s->swap_reloca_out; } - count = reldyn->size / ext_size; + else + { + dynamic_relocs = rel_dyn; + ext_size = bed->s->sizeof_rel; + swap_in = bed->s->swap_reloc_in; + swap_out = bed->s->swap_reloc_out; + } size = 0; - for (lo = reldyn->map_head.link_order; lo != NULL; lo = lo->next) + for (lo = dynamic_relocs->map_head.link_order; lo != NULL; lo = lo->next) if (lo->type == bfd_indirect_link_order) - { - asection *o = lo->u.indirect.section; - size += o->size; - } + size += lo->u.indirect.section->size; - if (size != reldyn->size) + if (size != dynamic_relocs->size) return 0; sort_elt = (sizeof (struct elf_link_sort_rela) + (i2e - 1) * sizeof (Elf_Internal_Rela)); + + count = dynamic_relocs->size / ext_size; sort = bfd_zmalloc (sort_elt * count); + if (sort == NULL) { (*info->callbacks->warning) @@ -6050,7 +7455,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) else r_sym_mask = ~(bfd_vma) 0xffffffff; - for (lo = reldyn->map_head.link_order; lo != NULL; lo = lo->next) + for (lo = dynamic_relocs->map_head.link_order; lo != NULL; lo = lo->next) if (lo->type == bfd_indirect_link_order) { bfd_byte *erel, *erelend; @@ -6067,9 +7472,11 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) erel = o->contents; erelend = o->contents + o->size; p = sort + o->output_offset / ext_size * sort_elt; + while (erel < erelend) { struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p; + (*swap_in) (abfd, erel, s->rela); s->type = (*bed->elf_backend_reloc_type_class) (s->rela); s->u.sym_mask = r_sym_mask; @@ -6100,7 +7507,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) qsort (s_non_relative, count - ret, sort_elt, elf_link_sort_cmp2); - for (lo = reldyn->map_head.link_order; lo != NULL; lo = lo->next) + for (lo = dynamic_relocs->map_head.link_order; lo != NULL; lo = lo->next) if (lo->type == bfd_indirect_link_order) { bfd_byte *erel, *erelend; @@ -6119,7 +7526,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) } free (sort); - *psec = reldyn; + *psec = dynamic_relocs; return ret; } @@ -6657,11 +8064,6 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) if (h->dynindx != -1 && elf_hash_table (finfo->info)->dynamic_sections_created) { - size_t bucketcount; - size_t bucket; - size_t hash_entry_size; - bfd_byte *bucketpos; - bfd_vma chain; bfd_byte *esym; sym.st_name = h->dynstr_index; @@ -6673,17 +8075,27 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) } bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0); - bucketcount = elf_hash_table (finfo->info)->bucketcount; - bucket = h->u.elf_hash_value % bucketcount; - hash_entry_size - = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; - bucketpos = ((bfd_byte *) finfo->hash_sec->contents - + (bucket + 2) * hash_entry_size); - chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos); - bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos); - bfd_put (8 * hash_entry_size, finfo->output_bfd, chain, - ((bfd_byte *) finfo->hash_sec->contents - + (bucketcount + 2 + h->dynindx) * hash_entry_size)); + if (finfo->hash_sec != NULL) + { + size_t hash_entry_size; + bfd_byte *bucketpos; + bfd_vma chain; + size_t bucketcount; + size_t bucket; + + bucketcount = elf_hash_table (finfo->info)->bucketcount; + bucket = h->u.elf_hash_value % bucketcount; + + hash_entry_size + = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; + bucketpos = ((bfd_byte *) finfo->hash_sec->contents + + (bucket + 2) * hash_entry_size); + chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, chain, + ((bfd_byte *) finfo->hash_sec->contents + + (bucketcount + 2 + h->dynindx) * hash_entry_size)); + } if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL) { @@ -6784,14 +8196,15 @@ _bfd_elf_default_action_discarded (asection *sec) /* Find a match between a section and a member of a section group. */ static asection * -match_group_member (asection *sec, asection *group) +match_group_member (asection *sec, asection *group, + struct bfd_link_info *info) { asection *first = elf_next_in_group (group); asection *s = first; while (s != NULL) { - if (bfd_elf_match_symbols_in_sections (s, sec)) + if (bfd_elf_match_symbols_in_sections (s, sec, info)) return s; s = elf_next_in_group (s); @@ -6803,21 +8216,22 @@ match_group_member (asection *sec, asection *group) } /* Check if the kept section of a discarded section SEC can be used - to replace it. Return the replacement if it is OK. Otherwise return - NULL. */ + to replace it. Return the replacement if it is OK. Otherwise return + NULL. */ asection * -_bfd_elf_check_kept_section (asection *sec) +_bfd_elf_check_kept_section (asection *sec, struct bfd_link_info *info) { asection *kept; kept = sec->kept_section; if (kept != NULL) { - if (elf_sec_group (sec) != NULL) - kept = match_group_member (sec, kept); + if ((kept->flags & SEC_GROUP) != 0) + kept = match_group_member (sec, kept, info); if (kept != NULL && sec->size != kept->size) kept = NULL; + sec->kept_section = kept; } return kept; } @@ -6830,7 +8244,7 @@ _bfd_elf_check_kept_section (asection *sec) static bfd_boolean elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) { - bfd_boolean (*relocate_section) + int (*relocate_section) (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); bfd *output_bfd; @@ -6844,7 +8258,6 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) asection **ppsection; asection *o; const struct elf_backend_data *bed; - bfd_boolean emit_relocs; struct elf_link_hash_entry **sym_hashes; output_bfd = finfo->output_bfd; @@ -6857,9 +8270,6 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if ((input_bfd->flags & DYNAMIC) != 0) return TRUE; - emit_relocs = (finfo->info->relocatable - || finfo->info->emitrelocations); - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (elf_bad_symtab (input_bfd)) { @@ -6883,6 +8293,15 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if (isymbuf == NULL) return FALSE; } + /* evaluate_complex_relocation_symbols looks for symbols in + finfo->internal_syms. */ + else if (isymbuf != NULL && locsymcount != 0) + { + bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0, + finfo->internal_syms, + finfo->external_syms, + finfo->locsym_shndx); + } /* Find local symbol sections and adjust values of symbols in SEC_MERGE sections. Write out those local symbols we know are @@ -7020,6 +8439,9 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) return FALSE; } + if (! evaluate_complex_relocation_symbols (input_bfd, finfo, locsymcount)) + return FALSE; + /* Relocate the contents of each section. */ sym_hashes = elf_sym_hashes (input_bfd); for (o = input_bfd->sections; o != NULL; o = o->next) @@ -7063,6 +8485,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) Elf_Internal_Rela *internal_relocs; bfd_vma r_type_mask; int r_sym_shift; + int ret; /* Get the swapped relocs. */ internal_relocs @@ -7168,23 +8591,14 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) { asection *kept; - kept = _bfd_elf_check_kept_section (sec); + kept = _bfd_elf_check_kept_section (sec, + finfo->info); if (kept != NULL) { *ps = kept; continue; } } - - /* Remove the symbol reference from the reloc, but - don't kill the reloc completely. This is so that - a zero value will be written into the section, - which may have non-zero contents put there by the - assembler. Zero in things like an eh_frame fde - pc_begin allows stack unwinders to recognize the - fde as bogus. */ - rel->r_info &= r_type_mask; - rel->r_addend = 0; } } } @@ -7209,14 +8623,17 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) corresponding to the output section, which will require the addend to be adjusted. */ - if (! (*relocate_section) (output_bfd, finfo->info, + ret = (*relocate_section) (output_bfd, finfo->info, input_bfd, o, contents, internal_relocs, isymbuf, - finfo->sections)) + finfo->sections); + if (!ret) return FALSE; - if (emit_relocs) + if (ret == 2 + || finfo->info->relocatable + || finfo->info->emitrelocations) { Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; @@ -7263,7 +8680,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) /* This is a reloc for a deleted entry or somesuch. Turn it into an R_*_NONE reloc, at the same offset as the last reloc. elf_eh_frame.c and - elf_bfd_discard_info rely on reloc offsets + bfd_elf_discard_info rely on reloc offsets being ordered. */ irela->r_offset = last_offset; irela->r_info = 0; @@ -7338,8 +8755,10 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) /* If we have discarded a section, the output section will be the absolute section. In - case of discarded link-once and discarded - SEC_MERGE sections, use the kept section. */ + case of discarded SEC_MERGE sections, use + the kept section. relocate_section should + have already handled discarded linkonce + sections. */ if (bfd_is_abs_section (osec) && sec->kept_section != NULL && sec->kept_section->output_section != NULL) @@ -7351,6 +8770,24 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) if (!bfd_is_abs_section (osec)) { r_symndx = osec->target_index; + if (r_symndx == 0) + { + struct elf_link_hash_table *htab; + asection *oi; + + htab = elf_hash_table (finfo->info); + oi = htab->text_index_section; + if ((osec->flags & SEC_READONLY) == 0 + && htab->data_index_section != NULL) + oi = htab->data_index_section; + + if (oi != NULL) + { + irela->r_addend += osec->vma - oi->vma; + r_symndx = oi->target_index; + } + } + BFD_ASSERT (r_symndx != 0); } } @@ -7446,7 +8883,8 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) /* Write out the modified section contents. */ if (bed->elf_backend_write_section - && (*bed->elf_backend_write_section) (output_bfd, o, contents)) + && (*bed->elf_backend_write_section) (output_bfd, finfo->info, o, + contents)) { /* Section written out. */ } @@ -7828,6 +9266,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) size_t relativecount = 0; asection *reldyn = 0; bfd_size_type amt; + asection *attr_section = NULL; + bfd_vma attr_size = 0; + const char *std_attrs_section; if (! is_elf_hash_table (info->hash)) return FALSE; @@ -7857,7 +9298,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) { finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym"); finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash"); - BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL); + BFD_ASSERT (finfo.dynsym_sec != NULL); finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version"); /* Note that it is OK if symver_sec is NULL. */ } @@ -7875,6 +9316,40 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) finfo.symbuf_count = 0; finfo.shndxbuf_size = 0; + /* The object attributes have been merged. Remove the input + sections from the link, and set the contents of the output + secton. */ + std_attrs_section = get_elf_backend_data (abfd)->obj_attrs_section; + for (o = abfd->sections; o != NULL; o = o->next) + { + if ((std_attrs_section && strcmp (o->name, std_attrs_section) == 0) + || strcmp (o->name, ".gnu.attributes") == 0) + { + for (p = o->map_head.link_order; p != NULL; p = p->next) + { + asection *input_section; + + if (p->type != bfd_indirect_link_order) + continue; + input_section = p->u.indirect.section; + /* Hack: reset the SEC_HAS_CONTENTS flag so that + elf_link_input_bfd ignores this section. */ + input_section->flags &= ~SEC_HAS_CONTENTS; + } + + attr_size = bfd_elf_obj_attr_size (abfd); + if (attr_size) + { + bfd_set_section_size (abfd, o, attr_size); + attr_section = o; + /* Skip this section later on. */ + o->map_head.link_order = NULL; + } + else + o->flags |= SEC_EXCLUDE; + } + } + /* Count up the number of relocations we will output for each output section, so that we know the sizes of the reloc sections. We also figure out some maximum sizes. */ @@ -7920,13 +9395,18 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) { Elf_Internal_Rela * relocs; - relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + relocs = _bfd_elf_link_read_relocs (sec->owner, sec, + NULL, NULL, info->keep_memory); - reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs); + if (relocs != NULL) + { + reloc_count + = (*bed->elf_backend_count_relocs) (sec, relocs); - if (elf_section_data (o)->relocs != relocs) - free (relocs); + if (elf_section_data (sec)->relocs != relocs) + free (relocs); + } } if (sec->rawsize > max_contents_size) @@ -8141,18 +9621,19 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) elfsym.st_size = 0; elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); elfsym.st_other = 0; + elfsym.st_value = 0; for (i = 1; i < elf_numsections (abfd); i++) { o = bfd_section_from_elf_index (abfd, i); if (o != NULL) - o->target_index = bfd_get_symcount (abfd); - elfsym.st_shndx = i; - if (info->relocatable || o == NULL) - elfsym.st_value = 0; - else - elfsym.st_value = o->vma; - if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) - goto error_return; + { + o->target_index = bfd_get_symcount (abfd); + elfsym.st_shndx = i; + if (!info->relocatable) + elfsym.st_value = o->vma; + if (!elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) + goto error_return; + } if (i == SHN_LORESERVE - 1) i += SHN_HIRESERVE + 1 - SHN_LORESERVE; } @@ -8298,6 +9779,18 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) } } + /* Free symbol buffer if needed. */ + if (!info->reduce_memory_overheads) + { + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + if (bfd_get_flavour (sub) == bfd_target_elf_flavour + && elf_tdata (sub)->symbuf) + { + free (elf_tdata (sub)->symbuf); + elf_tdata (sub)->symbuf = NULL; + } + } + /* Output any global symbols that got converted to local in a version script or due to symbol visibility. We do this in a separate step since ELF requires all local symbols to appear @@ -8312,6 +9805,19 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (eoinfo.failed) return FALSE; + /* If backend needs to output some local symbols not present in the hash + table, do it now. */ + if (bed->elf_backend_output_arch_local_syms) + { + typedef bfd_boolean (*out_sym_func) + (void *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *); + + if (! ((*bed->elf_backend_output_arch_local_syms) + (abfd, info, &finfo, (out_sym_func) elf_link_output_sym))) + return FALSE; + } + /* That wrote out all the local symbols. Finish up the symbol table with the global symbols. Even if we want to strip everything we can, we still need to deal with those global symbols that got @@ -8603,6 +10109,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) case DT_HASH: name = ".hash"; goto get_vma; + case DT_GNU_HASH: + name = ".gnu.hash"; + goto get_vma; case DT_STRTAB: name = ".dynstr"; goto get_vma; @@ -8686,8 +10195,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (dyn.d_tag == DT_TEXTREL) { - _bfd_error_handler - (_("warning: creating a DT_TEXTREL in a shared object.")); + info->callbacks->einfo + (_("%P: warning: creating a DT_TEXTREL in a shared object.\n")); break; } } @@ -8785,6 +10294,16 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) elf_tdata (abfd)->linker = TRUE; + if (attr_section) + { + bfd_byte *contents = bfd_malloc (attr_size); + if (contents == NULL) + goto error_return; + bfd_elf_set_obj_attr_contents (abfd, contents, attr_size); + bfd_set_section_contents (abfd, attr_section, contents, 0, attr_size); + free (contents); + } + return TRUE; error_return: @@ -8822,18 +10341,44 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) /* Garbage collect unused sections. */ +/* Default gc_mark_hook. */ + +asection * +_bfd_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) +{ + if (h != NULL) + { + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + else + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + return NULL; +} + /* The mark phase of garbage collection. For a given section, mark it and any sections in this section's group, and all the sections which define symbols to which it refers. */ -typedef asection * (*gc_mark_hook_fn) - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *); - bfd_boolean _bfd_elf_gc_mark (struct bfd_link_info *info, asection *sec, - gc_mark_hook_fn gc_mark_hook) + elf_gc_mark_hook_fn gc_mark_hook) { bfd_boolean ret; bfd_boolean is_eh; @@ -8954,7 +10499,8 @@ _bfd_elf_gc_mark (struct bfd_link_info *info, /* Sweep symbols in swept sections. Called via elf_link_hash_traverse. */ -struct elf_gc_sweep_symbol_info { +struct elf_gc_sweep_symbol_info +{ struct bfd_link_info *info; void (*hide_symbol) (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); @@ -9017,6 +10563,9 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) to remove a section from the output. */ o->flags |= SEC_EXCLUDE; + if (info->print_gc_sections && o->size != 0) + _bfd_error_handler (_("Removing unused section '%s' in file '%B'"), sub, o->name); + /* But we also have to update some of the relocation info we collected before. */ if (gc_sweep_hook @@ -9198,9 +10747,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) { bfd_boolean ok = TRUE; bfd *sub; - asection * (*gc_mark_hook) - (asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *h, Elf_Internal_Sym *); + elf_gc_mark_hook_fn gc_mark_hook; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if (!bed->can_gc_sections @@ -9242,11 +10789,15 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) continue; for (o = sub->sections; o != NULL; o = o->next) - if ((o->flags & SEC_KEEP) != 0 && !o->gc_mark) + if ((o->flags & (SEC_EXCLUDE | SEC_KEEP)) == SEC_KEEP && !o->gc_mark) if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) return FALSE; } + /* Allow the backend to mark additional target specific sections. */ + if (bed->gc_mark_extra_sections) + bed->gc_mark_extra_sections(info, gc_mark_hook); + /* ... again for sections marked from eh_frame. */ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) { @@ -9262,30 +10813,38 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) easily due to needing special relocs to handle the difference of two symbols in separate sections. Don't keep code sections referenced by .eh_frame. */ +#define TEXT_PREFIX ".text." +#define TEXT_PREFIX2 ".gnu.linkonce.t." +#define GCC_EXCEPT_TABLE_PREFIX ".gcc_except_table." for (o = sub->sections; o != NULL; o = o->next) if (!o->gc_mark && o->gc_mark_from_eh && (o->flags & SEC_CODE) == 0) { - if (strncmp (o->name, ".gcc_except_table.", 18) == 0) + if (CONST_STRNEQ (o->name, GCC_EXCEPT_TABLE_PREFIX)) { - unsigned long len; char *fn_name; + const char *sec_name; asection *fn_text; + unsigned o_name_prefix_len , fn_name_prefix_len, tmp; - len = strlen (o->name + 18) + 1; - fn_name = bfd_malloc (len + 16); + o_name_prefix_len = strlen (GCC_EXCEPT_TABLE_PREFIX); + sec_name = o->name + o_name_prefix_len; + fn_name_prefix_len = strlen (TEXT_PREFIX); + tmp = strlen (TEXT_PREFIX2); + if (tmp > fn_name_prefix_len) + fn_name_prefix_len = tmp; + fn_name + = bfd_malloc (fn_name_prefix_len + strlen (sec_name) + 1); if (fn_name == NULL) return FALSE; /* Try the first prefix. */ - memcpy (fn_name, ".text.", 6); - memcpy (fn_name + 6, o->name + 18, len); + sprintf (fn_name, "%s%s", TEXT_PREFIX, sec_name); fn_text = bfd_get_section_by_name (sub, fn_name); /* Try the second prefix. */ if (fn_text == NULL) { - memcpy (fn_name, ".gnu.linkonce.t.", 16); - memcpy (fn_name + 16, o->name + 18, len); + sprintf (fn_name, "%s%s", TEXT_PREFIX2, sec_name); fn_text = bfd_get_section_by_name (sub, fn_name); } @@ -9637,12 +11196,15 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) if ((abfd->flags & DYNAMIC) != 0) continue; - eh = bfd_get_section_by_name (abfd, ".eh_frame"); - if (info->relocatable - || (eh != NULL + eh = NULL; + if (!info->relocatable) + { + eh = bfd_get_section_by_name (abfd, ".eh_frame"); + if (eh != NULL && (eh->size == 0 - || bfd_is_abs_section (eh->output_section)))) - eh = NULL; + || bfd_is_abs_section (eh->output_section))) + eh = NULL; + } stab = bfd_get_section_by_name (abfd, ".stab"); if (stab != NULL @@ -9683,7 +11245,10 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) cookie.locsymcount, 0, NULL, NULL, NULL); if (cookie.locsyms == NULL) - return FALSE; + { + info->callbacks->einfo (_("%P%X: can not read symbols: %E\n")); + return FALSE; + } } if (stab != NULL) @@ -9753,39 +11318,28 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) } void -_bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) +_bfd_elf_section_already_linked (bfd *abfd, struct bfd_section *sec, + struct bfd_link_info *info) { flagword flags; const char *name, *p; struct bfd_section_already_linked *l; struct bfd_section_already_linked_hash_entry *already_linked_list; - asection *group; - /* A single member comdat group section may be discarded by a - linkonce section. See below. */ if (sec->output_section == bfd_abs_section_ptr) return; flags = sec->flags; - /* Check if it belongs to a section group. */ - group = elf_sec_group (sec); - - /* Return if it isn't a linkonce section nor a member of a group. A - comdat group section also has SEC_LINK_ONCE set. */ - if ((flags & SEC_LINK_ONCE) == 0 && group == NULL) + /* Return if it isn't a linkonce section. A comdat group section + also has SEC_LINK_ONCE set. */ + if ((flags & SEC_LINK_ONCE) == 0) return; - if (group) - { - /* If this is the member of a single member comdat group, check if - the group should be discarded. */ - if (elf_next_in_group (sec) == sec - && (group->flags & SEC_LINK_ONCE) != 0) - sec = group; - else - return; - } + /* Don't put group member sections on our list of already linked + sections. They are handled as a group via their group section. */ + if (elf_sec_group (sec) != NULL) + return; /* FIXME: When doing a relocatable link, we may have trouble copying relocations in other sections that refer to local symbols @@ -9806,7 +11360,7 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) name = bfd_get_section_name (abfd, sec); - if (strncmp (name, ".gnu.linkonce.", sizeof (".gnu.linkonce.") - 1) == 0 + if (CONST_STRNEQ (name, ".gnu.linkonce.") && (p = strchr (name + sizeof (".gnu.linkonce.") - 1, '.')) != NULL) p++; else @@ -9816,11 +11370,8 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) for (l = already_linked_list->entry; l != NULL; l = l->next) { - /* We may have 3 different sections on the list: group section, - comdat section and linkonce section. SEC may be a linkonce or - group section. We match a group section with a group section, - a linkonce section with a linkonce section, and ignore comdat - section. */ + /* We may have 2 different types of sections on the list: group + sections and linkonce sections. Match like sections. */ if ((flags & SEC_GROUP) == (l->sec->flags & SEC_GROUP) && strcmp (name, l->sec->name) == 0 && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL) @@ -9908,31 +11459,28 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) } } - if (group) + /* A single member comdat group section may be discarded by a + linkonce section and vice versa. */ + + if ((flags & SEC_GROUP) != 0) { - /* If this is the member of a single member comdat group and the - group hasn't be discarded, we check if it matches a linkonce - section. We only record the discarded comdat group. Otherwise - the undiscarded group will be discarded incorrectly later since - itself has been recorded. */ - for (l = already_linked_list->entry; l != NULL; l = l->next) - if ((l->sec->flags & SEC_GROUP) == 0 - && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL - && bfd_elf_match_symbols_in_sections (l->sec, - elf_next_in_group (sec))) - { - elf_next_in_group (sec)->output_section = bfd_abs_section_ptr; - elf_next_in_group (sec)->kept_section = l->sec; - group->output_section = bfd_abs_section_ptr; - break; - } - if (l == NULL) - return; + asection *first = elf_next_in_group (sec); + + if (first != NULL && elf_next_in_group (first) == first) + /* Check this single member group against linkonce sections. */ + for (l = already_linked_list->entry; l != NULL; l = l->next) + if ((l->sec->flags & SEC_GROUP) == 0 + && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL + && bfd_elf_match_symbols_in_sections (l->sec, first, info)) + { + first->output_section = bfd_abs_section_ptr; + first->kept_section = l->sec; + sec->output_section = bfd_abs_section_ptr; + break; + } } else - /* There is no direct match. But for linkonce section, we should - check if there is a match with comdat group member. We always - record the linkonce section, discarded or not. */ + /* Check this linkonce section against single member groups. */ for (l = already_linked_list->entry; l != NULL; l = l->next) if (l->sec->flags & SEC_GROUP) { @@ -9940,10 +11488,10 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec) if (first != NULL && elf_next_in_group (first) == first - && bfd_elf_match_symbols_in_sections (first, sec)) + && bfd_elf_match_symbols_in_sections (first, sec, info)) { sec->output_section = bfd_abs_section_ptr; - sec->kept_section = l->sec; + sec->kept_section = first; break; } } diff --git a/contrib/binutils/bfd/elfn32-mips.c b/contrib/binutils/bfd/elfn32-mips.c index b1211f0c65e..e0994a0dd06 100644 --- a/contrib/binutils/bfd/elfn32-mips.c +++ b/contrib/binutils/bfd/elfn32-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -29,8 +29,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. different MIPS ELF from other targets. This matters when linking. This file supports both, switching at runtime. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -61,8 +61,6 @@ static bfd_reloc_status_type gprel32_with_gp (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma); static bfd_reloc_status_type mips_elf_shift6_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); -static bfd_reloc_status_type mips16_jump_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup @@ -756,6 +754,21 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* The relocation table used for SHT_RELA sections. */ @@ -1429,6 +1442,21 @@ static reloc_howto_type elf_mips_howto_table_rela[] = 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + /* 32 bit relocation with no addend. */ + HOWTO (R_MIPS_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; static reloc_howto_type elf_mips16_howto_table_rel[] = @@ -1444,7 +1472,7 @@ static reloc_howto_type elf_mips16_howto_table_rel[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ TRUE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1516,7 +1544,7 @@ static reloc_howto_type elf_mips16_howto_table_rela[] = /* This needs complex overflow detection, because the upper four bits must match the PC. */ - mips16_jump_reloc, /* special_function */ + _bfd_mips_elf_generic_reloc, /* special_function */ "R_MIPS16_26", /* name */ FALSE, /* partial_inplace */ 0x3ffffff, /* src_mask */ @@ -1901,28 +1929,6 @@ mips_elf_shift6_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, error_message); } -/* Handle a mips16 jump. */ - -static bfd_reloc_status_type -mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, - arelent *reloc_entry ATTRIBUTE_UNUSED, - asymbol *symbol ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED, - asection *input_section, bfd *output_bfd ATTRIBUTE_UNUSED, - char **error_message ATTRIBUTE_UNUSED) -{ - static bfd_boolean warned = FALSE; - - /* FIXME. */ - if (! warned) - (*_bfd_error_handler) - (_("Linking mips16 objects into %s format is not supported"), - bfd_get_target (input_section->output_section->owner)); - warned = TRUE; - - return bfd_reloc_undefined; -} - /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type @@ -2075,6 +2081,40 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, } } +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (elf_mips_howto_table_rela) + / sizeof (elf_mips_howto_table_rela[0])); + i++) + if (elf_mips_howto_table_rela[i].name != NULL + && strcasecmp (elf_mips_howto_table_rela[i].name, r_name) == 0) + return &elf_mips_howto_table_rela[i]; + + for (i = 0; + i < (sizeof (elf_mips16_howto_table_rela) + / sizeof (elf_mips16_howto_table_rela[0])); + i++) + if (elf_mips16_howto_table_rela[i].name != NULL + && strcasecmp (elf_mips16_howto_table_rela[i].name, r_name) == 0) + return &elf_mips16_howto_table_rela[i]; + + if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0) + return &elf_mips_gnu_vtinherit_howto; + if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0) + return &elf_mips_gnu_vtentry_howto; + if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0) + return &elf_mips_gnu_rel16_s2; + if (strcasecmp (elf_mips_gnu_rela16_s2.name, r_name) == 0) + return &elf_mips_gnu_rela16_s2; + + return NULL; +} + /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * @@ -2317,12 +2357,15 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_create_dynamic_sections \ _bfd_mips_elf_create_dynamic_sections #define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_merge_symbol_attribute \ + _bfd_mips_elf_merge_symbol_attribute #define elf_backend_adjust_dynamic_symbol \ _bfd_mips_elf_adjust_dynamic_symbol #define elf_backend_always_size_sections \ _bfd_mips_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_mips_elf_size_dynamic_sections +#define elf_backend_init_index_section _bfd_elf_init_1_index_section #define elf_backend_relocate_section _bfd_mips_elf_relocate_section #define elf_backend_finish_dynamic_symbol \ _bfd_mips_elf_finish_dynamic_symbol @@ -2380,10 +2423,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define TARGET_BIG_SYM bfd_elf32_nbigmips_vec #define TARGET_BIG_NAME "elf32-nbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses - a value of 0x1000, and we are compatible. - FIXME: How does this affect NewABI? */ -#define ELF_MAXPAGESIZE 0x1000 +#define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #include "elf32-target.h" @@ -2394,15 +2435,15 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #undef TARGET_BIG_NAME #undef ELF_MAXPAGESIZE +#undef ELF_COMMONPAGESIZE #define TARGET_LITTLE_SYM bfd_elf32_ntradlittlemips_vec #define TARGET_LITTLE_NAME "elf32-ntradlittlemips" #define TARGET_BIG_SYM bfd_elf32_ntradbigmips_vec #define TARGET_BIG_NAME "elf32-ntradbigmips" -/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses - page sizes of up to that limit, so we need to respect it. */ #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x1000 #define elf32_bed elf32_tradbed /* Include the target file again for this target. */ diff --git a/contrib/binutils/bfd/elfxx-ia64.c b/contrib/binutils/bfd/elfxx-ia64.c index 6b3257afdf1..68f2010c619 100644 --- a/contrib/binutils/bfd/elfxx-ia64.c +++ b/contrib/binutils/bfd/elfxx-ia64.c @@ -1,5 +1,5 @@ /* IA-64 support for 64-bit ELF - 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. Contributed by David Mosberger-Tang @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "elf-bfd.h" #include "opcode/ia64.h" @@ -215,10 +215,6 @@ static bfd_boolean elfNN_ia64_add_symbol_hook PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym, const char **namep, flagword *flagsp, asection **secp, bfd_vma *valp)); -static int elfNN_ia64_additional_program_headers - PARAMS ((bfd *abfd)); -static bfd_boolean elfNN_ia64_modify_segment_map - PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elfNN_ia64_is_local_label_name PARAMS ((bfd *abfd, const char *name)); static bfd_boolean elfNN_ia64_dynamic_symbol_p @@ -617,6 +613,22 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_code) return lookup_howto (rtype); } +static reloc_howto_type * +elfNN_ia64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (ia64_howto_table) / sizeof (ia64_howto_table[0]); + i++) + if (ia64_howto_table[i].name != NULL + && strcasecmp (ia64_howto_table[i].name, r_name) == 0) + return &ia64_howto_table[i]; + + return NULL; +} + /* Given a ELF reloc, return the matching HOWTO structure. */ static void @@ -1428,22 +1440,15 @@ elfNN_ia64_relax_ldxmov (contents, off) /* Return TRUE if NAME is an unwind table section name. */ static inline bfd_boolean -is_unwind_section_name (abfd, name) - bfd *abfd; - const char *name; +is_unwind_section_name (bfd *abfd, const char *name) { - size_t len1, len2, len3; - if (elfNN_ia64_hpux_vec (abfd->xvec) && !strcmp (name, ELF_STRING_ia64_unwind_hdr)) return FALSE; - len1 = sizeof (ELF_STRING_ia64_unwind) - 1; - len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; - len3 = sizeof (ELF_STRING_ia64_unwind_once) - 1; - return ((strncmp (name, ELF_STRING_ia64_unwind, len1) == 0 - && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0) - || strncmp (name, ELF_STRING_ia64_unwind_once, len3) == 0); + return ((CONST_STRNEQ (name, ELF_STRING_ia64_unwind) + && ! CONST_STRNEQ (name, ELF_STRING_ia64_unwind_info)) + || CONST_STRNEQ (name, ELF_STRING_ia64_unwind_once)); } /* Handle an IA-64 specific section when reading an object file. This @@ -1637,8 +1642,8 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) /* Return the number of additional phdrs we will need. */ static int -elfNN_ia64_additional_program_headers (abfd) - bfd *abfd; +elfNN_ia64_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int ret = 0; @@ -1657,9 +1662,8 @@ elfNN_ia64_additional_program_headers (abfd) } static bfd_boolean -elfNN_ia64_modify_segment_map (abfd, info) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; +elfNN_ia64_modify_segment_map (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { struct elf_segment_map *m, **pm; Elf_Internal_Shdr *hdr; @@ -1742,17 +1746,30 @@ elfNN_ia64_modify_segment_map (abfd, info) } } - /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of - the input sections for each output section in the segment and testing - for SHF_IA_64_NORECOV on each. */ - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + return TRUE; +} + +/* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of + the input sections for each output section in the segment and testing + for SHF_IA_64_NORECOV on each. */ + +static bfd_boolean +elfNN_ia64_modify_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + struct elf_obj_tdata *tdata = elf_tdata (abfd); + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + + for (p = tdata->phdr, m = tdata->segment_map; m != NULL; m = m->next, p++) if (m->p_type == PT_LOAD) { int i; for (i = m->count - 1; i >= 0; --i) { struct bfd_link_order *order = m->sections[i]->map_head.link_order; - while (order) + + while (order != NULL) { if (order->type == bfd_indirect_link_order) { @@ -1760,7 +1777,7 @@ elfNN_ia64_modify_segment_map (abfd, info) bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags; if (flags & SHF_IA_64_NORECOV) { - m->p_flags |= PF_IA_64_NORECOV; + p->p_flags |= PF_IA_64_NORECOV; goto found; } } @@ -2208,7 +2225,7 @@ addend_compare (const void *xp, const void *yp) const struct elfNN_ia64_dyn_sym_info *y = (const struct elfNN_ia64_dyn_sym_info *) yp; - return x->addend - y->addend; + return x->addend < y->addend ? -1 : x->addend > y->addend ? 1 : 0; } /* Sort elfNN_ia64_dyn_sym_info array and remove duplicates. */ @@ -2217,37 +2234,62 @@ static unsigned int sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, unsigned int count) { - bfd_vma curr, prev; - unsigned int i, dup, diff, dest, src, len; + bfd_vma curr, prev, got_offset; + unsigned int i, kept, dup, diff, dest, src, len; qsort (info, count, sizeof (*info), addend_compare); /* Find the first duplicate. */ prev = info [0].addend; + got_offset = info [0].got_offset; for (i = 1; i < count; i++) { curr = info [i].addend; if (curr == prev) - break; + { + /* For duplicates, make sure that GOT_OFFSET is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [i].got_offset; + break; + } + got_offset = info [i].got_offset; prev = curr; } + /* We may move a block of elements to here. */ + dest = i++; + /* Remove duplicates. */ if (i < count) { - /* We need to move a block of elements to here. */ - dest = i++; while (i < count) { + /* For duplicates, make sure that the kept one has a valid + got_offset. */ + kept = dest - 1; + if (got_offset != (bfd_vma) -1) + info [kept].got_offset = got_offset; + curr = info [i].addend; + got_offset = info [i].got_offset; /* Move a block of elements whose first one is different from the previous. */ if (curr == prev) { for (src = i + 1; src < count; src++) - if (info [src].addend != curr) - break; + { + if (info [src].addend != curr) + break; + /* For duplicates, make sure that GOT_OFFSET is + valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [src].got_offset; + } + + /* Make sure that the kept one has a valid got_offset. */ + if (got_offset != (bfd_vma) -1) + info [kept].got_offset = got_offset; } else src = i; @@ -2255,13 +2297,25 @@ sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, if (src >= count) break; - /* Find the next duplicate. */ + /* Find the next duplicate. SRC will be kept. */ prev = info [src].addend; + got_offset = info [src].got_offset; for (dup = src + 1; dup < count; dup++) { curr = info [dup].addend; if (curr == prev) - break; + { + /* Make sure that got_offset is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [dup].got_offset; + + /* For duplicates, make sure that the kept one has + a valid got_offset. */ + if (got_offset != (bfd_vma) -1) + info [dup - 1].got_offset = got_offset; + break; + } + got_offset = info [dup].got_offset; prev = curr; } @@ -2272,20 +2326,41 @@ sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, if (len == 1 && dup < count) { /* If we only move 1 element, we combine it with the next - one. Find the next different one. */ + one. There must be at least a duplicate. Find the + next different one. */ for (diff = dup + 1, src++; diff < count; diff++, src++) - if (info [diff].addend != curr) - break; + { + if (info [diff].addend != curr) + break; + /* Make sure that got_offset is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [diff].got_offset; + } + + /* Makre sure that the last duplicated one has an valid + offset. */ + BFD_ASSERT (curr == prev); + if (got_offset != (bfd_vma) -1) + info [diff - 1].got_offset = got_offset; if (diff < count) { - /* Find the next duplicate. */ + /* Find the next duplicate. Track the current valid + offset. */ prev = info [diff].addend; + got_offset = info [diff].got_offset; for (dup = diff + 1; dup < count; dup++) { curr = info [dup].addend; if (curr == prev) - break; + { + /* For duplicates, make sure that GOT_OFFSET + is valid. */ + if (got_offset == (bfd_vma) -1) + got_offset = info [dup].got_offset; + break; + } + got_offset = info [dup].got_offset; prev = curr; diff++; } @@ -2302,6 +2377,19 @@ sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info, count = dest; } + else + { + /* When we get here, either there is no duplicate at all or + the only duplicate is the last element. */ + if (dest < count) + { + /* If the last element is a duplicate, make sure that the + kept one has a valid got_offset. We also update count. */ + if (got_offset != (bfd_vma) -1) + info [dest - 1].got_offset = got_offset; + count = dest; + } + } return count; } @@ -2424,6 +2512,7 @@ has_space: /* Append the new one to the array. */ dyn_i = info + count; memset (dyn_i, 0, sizeof (*dyn_i)); + dyn_i->got_offset = (bfd_vma) -1; dyn_i->addend = addend; /* We increment count only since the new ones are unsorted and @@ -2613,10 +2702,10 @@ get_reloc_section (abfd, ia64_info, sec, create) if (srel_name == NULL) return NULL; - BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + BFD_ASSERT ((CONST_STRNEQ (srel_name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), srel_name+5) == 0) - || (strncmp (srel_name, ".rel", 4) == 0 + || (CONST_STRNEQ (srel_name, ".rel") && strcmp (bfd_get_section_name (abfd, sec), srel_name+4) == 0)); @@ -2733,7 +2822,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) have yet been processed. Do something with what we know, as this may help reduce memory usage and processing time later. */ maybe_dynamic = (h && ((!info->executable - && (!info->symbolic + && (!SYMBOLIC_BIND (info, h) || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || !h->def_regular || h->root.type == bfd_link_hash_defweak)); @@ -2905,7 +2994,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) have yet been processed. Do something with what we know, as this may help reduce memory usage and processing time later. */ maybe_dynamic = (h && ((!info->executable - && (!info->symbolic + && (!SYMBOLIC_BIND (info, h) || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || !h->def_regular || h->root.type == bfd_link_hash_defweak)); @@ -3694,7 +3783,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) if (strcmp (name, ".got.plt") == 0) strip = FALSE; - else if (strncmp (name, ".rel", 4) == 0) + else if (CONST_STRNEQ (name, ".rel")) { if (!strip) { @@ -4358,7 +4447,7 @@ elfNN_ia64_choose_gp (abfd, info) continue; lo = os->vma; - hi = os->vma + os->size; + hi = os->vma + (os->rawsize ? os->rawsize : os->size); if (hi < lo) hi = (bfd_vma) -1; @@ -4556,7 +4645,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, elf_section_data(input_section->output_section) ->this_hdr.sh_flags |= flags; - return TRUE; } gp_val = _bfd_get_gp_value (output_bfd); @@ -4605,7 +4693,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, sym_sec = local_sections[r_symndx]; msec = sym_sec; value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel); - if ((sym_sec->flags & SEC_MERGE) + if (!info->relocatable + && (sym_sec->flags & SEC_MERGE) != 0 && ELF_ST_TYPE (sym->st_info) == STT_SECTION && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE) { @@ -4634,9 +4723,15 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, - sym_sec->output_section->vma - sym_sec->output_offset; } - - qsort (loc_h->info, loc_h->count, - sizeof (*loc_h->info), addend_compare); + + /* We may have introduced duplicated entries. We need + to remove them properly. */ + count = sort_dyn_sym_info (loc_h->info, loc_h->count); + if (count != loc_h->count) + { + loc_h->count = count; + loc_h->sorted_count = count; + } loc_h->sec_merge_done = 1; } @@ -4659,6 +4754,20 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, continue; } + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + if (sym_sec != NULL && elf_discarded_section (sym_sec)) + { + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + hit_addr = contents + rel->r_offset; value += rel->r_addend; dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info, r_type); @@ -4990,13 +5099,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_SEGREL32LSB: case R_IA64_SEGREL64MSB: case R_IA64_SEGREL64LSB: - if (r_symndx == 0) - { - /* If the input section was discarded from the output, then - do nothing. */ - r = bfd_reloc_ok; - } - else { struct elf_segment_map *m; Elf_Internal_Phdr *p; @@ -5561,9 +5663,9 @@ elfNN_ia64_reloc_type_class (rela) static const struct bfd_elf_special_section elfNN_ia64_special_sections[] = { - { ".sbss", 5, -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, - { ".sdata", 6, -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".sbss"), -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + { STRING_COMMA_LEN (".sdata"), -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + { NULL, 0, 0, 0, 0 } }; static bfd_boolean @@ -5590,7 +5692,7 @@ elfNN_ia64_object_p (bfd *abfd) if (elf_sec_group (sec) == NULL && ((sec->flags & (SEC_LINK_ONCE | SEC_CODE | SEC_GROUP)) == (SEC_LINK_ONCE | SEC_CODE)) - && strncmp (sec->name, ".gnu.linkonce.t.", 16) == 0) + && CONST_STRNEQ (sec->name, ".gnu.linkonce.t.")) { name = sec->name + 16; @@ -5673,7 +5775,7 @@ elfNN_hpux_post_process_headers (abfd, info) { Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; + i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; i_ehdrp->e_ident[EI_ABIVERSION] = 1; } @@ -5717,6 +5819,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define ELF_MACHINE_ALT1 1999 /* EAS2.3 */ #define ELF_MACHINE_ALT2 1998 /* EAS2.2 */ #define ELF_MAXPAGESIZE 0x10000 /* 64KB */ +#define ELF_COMMONPAGESIZE 0x4000 /* 16KB */ #define elf_backend_section_from_shdr \ elfNN_ia64_section_from_shdr @@ -5732,11 +5835,15 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_additional_program_headers #define elf_backend_modify_segment_map \ elfNN_ia64_modify_segment_map +#define elf_backend_modify_program_headers \ + elfNN_ia64_modify_program_headers #define elf_info_to_howto \ elfNN_ia64_info_to_howto #define bfd_elfNN_bfd_reloc_type_lookup \ elfNN_ia64_reloc_type_lookup +#define bfd_elfNN_bfd_reloc_name_lookup \ + elfNN_ia64_reloc_name_lookup #define bfd_elfNN_bfd_is_local_label_name \ elfNN_ia64_is_local_label_name #define bfd_elfNN_bfd_relax_section \ @@ -5758,6 +5865,8 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ elfNN_ia64_size_dynamic_sections +#define elf_backend_omit_section_dynsym \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) #define elf_backend_relocate_section \ elfNN_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ @@ -5789,6 +5898,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_reloc_type_class elfNN_ia64_reloc_type_class #define elf_backend_rela_normal 1 #define elf_backend_special_sections elfNN_ia64_special_sections +#define elf_backend_default_execstack 0 /* FIXME: PR 290: The Intel C compiler generates SHT_IA_64_UNWIND with SHF_LINK_ORDER. But it doesn't set the sh_link or sh_info fields. @@ -5823,7 +5933,10 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_want_p_paddr_set_to_zero 1 #undef ELF_MAXPAGESIZE -#define ELF_MAXPAGESIZE 0x1000 /* 1K */ +#define ELF_MAXPAGESIZE 0x1000 /* 4K */ +#undef ELF_COMMONPAGESIZE +#undef ELF_OSABI +#define ELF_OSABI ELFOSABI_HPUX #undef elfNN_bed #define elfNN_bed elfNN_ia64_hpux_bed diff --git a/contrib/binutils/bfd/elfxx-mips.c b/contrib/binutils/bfd/elfxx-mips.c index a9aea661f44..eac685ff0ab 100644 --- a/contrib/binutils/bfd/elfxx-mips.c +++ b/contrib/binutils/bfd/elfxx-mips.c @@ -1,6 +1,6 @@ /* MIPS-specific support for ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -27,8 +27,8 @@ /* This file handles functionality common to the different MIPS ABI's. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "elf-bfd.h" @@ -488,12 +488,12 @@ typedef struct runtime_pdr { static struct mips_got_entry *mips_elf_create_local_got_entry (bfd *, struct bfd_link_info *, bfd *, struct mips_got_info *, asection *, - asection *, bfd_vma, unsigned long, struct mips_elf_link_hash_entry *, int); + bfd_vma, unsigned long, struct mips_elf_link_hash_entry *, int); static bfd_boolean mips_elf_sort_hash_table_f (struct mips_elf_link_hash_entry *, void *); static bfd_vma mips_elf_high (bfd_vma); -static bfd_boolean mips_elf_stub_section_p +static bfd_boolean mips16_stub_section_p (bfd *, asection *); static bfd_boolean mips_elf_create_dynamic_relocation (bfd *, struct bfd_link_info *, const Elf_Internal_Rela *, @@ -709,6 +709,10 @@ static bfd *reldyn_sorting_bfd; #define FN_STUB ".mips16.fn." #define CALL_STUB ".mips16.call." #define CALL_FP_STUB ".mips16.call.fp." + +#define FN_STUB_P(name) CONST_STRNEQ (name, FN_STUB) +#define CALL_STUB_P(name) CONST_STRNEQ (name, CALL_STUB) +#define CALL_FP_STUB_P(name) CONST_STRNEQ (name, CALL_FP_STUB) /* The format of the first PLT entry in a VxWorks executable. */ static const bfd_vma mips_vxworks_exec_plt0_entry[] = { @@ -838,13 +842,16 @@ mips_elf_link_hash_newfunc (struct bfd_hash_entry *entry, bfd_boolean _bfd_mips_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _mips_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _mips_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -1689,11 +1696,20 @@ sort_dynamic_relocs (const void *arg1, const void *arg2) { Elf_Internal_Rela int_reloc1; Elf_Internal_Rela int_reloc2; + int diff; bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg1, &int_reloc1); bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg2, &int_reloc2); - return ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info); + diff = ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info); + if (diff != 0) + return diff; + + if (int_reloc1.r_offset < int_reloc2.r_offset) + return -1; + if (int_reloc1.r_offset > int_reloc2.r_offset) + return 1; + return 0; } /* Like sort_dynamic_relocs, but used for elf64 relocations. */ @@ -1711,8 +1727,16 @@ sort_dynamic_relocs_64 (const void *arg1 ATTRIBUTE_UNUSED, (*get_elf_backend_data (reldyn_sorting_bfd)->s->swap_reloc_in) (reldyn_sorting_bfd, arg2, int_reloc2); - return (ELF64_R_SYM (int_reloc1[0].r_info) - - ELF64_R_SYM (int_reloc2[0].r_info)); + if (ELF64_R_SYM (int_reloc1[0].r_info) < ELF64_R_SYM (int_reloc2[0].r_info)) + return -1; + if (ELF64_R_SYM (int_reloc1[0].r_info) > ELF64_R_SYM (int_reloc2[0].r_info)) + return 1; + + if (int_reloc1[0].r_offset < int_reloc2[0].r_offset) + return -1; + if (int_reloc1[0].r_offset > int_reloc2[0].r_offset) + return 1; + return 0; #else abort (); #endif @@ -2389,16 +2413,14 @@ mips_elf_gotplt_index (struct bfd_link_info *info, return got_address - got_value; } -/* Return the GOT offset for address VALUE, which was derived from - a symbol belonging to INPUT_SECTION. If there is not yet a GOT +/* Return the GOT offset for address VALUE. If there is not yet a GOT entry for this value, create one. If R_SYMNDX refers to a TLS symbol, create a TLS GOT entry instead. Return -1 if no satisfactory GOT offset can be found. */ static bfd_vma mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, - asection *input_section, bfd_vma value, - unsigned long r_symndx, + bfd_vma value, unsigned long r_symndx, struct mips_elf_link_hash_entry *h, int r_type) { asection *sgot; @@ -2408,8 +2430,7 @@ mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot, - input_section, value, - r_symndx, h, r_type); + value, r_symndx, h, r_type); if (!entry) return MINUS_ONE; @@ -2510,16 +2531,15 @@ mips_elf_global_got_index (bfd *abfd, bfd *ibfd, struct elf_link_hash_entry *h, return index; } -/* Find a GOT page entry that points to within 32KB of VALUE, which was - calculated from a symbol belonging to INPUT_SECTION. These entries - are supposed to be placed at small offsets in the GOT, i.e., within - 32KB of GP. Return the index of the GOT entry, or -1 if no entry - could be created. If OFFSETP is nonnull, use it to return the +/* Find a GOT page entry that points to within 32KB of VALUE. These + entries are supposed to be placed at small offsets in the GOT, i.e., + within 32KB of GP. Return the index of the GOT entry, or -1 if no + entry could be created. If OFFSETP is nonnull, use it to return the offset of the GOT entry from VALUE. */ static bfd_vma mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, - asection *input_section, bfd_vma value, bfd_vma *offsetp) + bfd_vma value, bfd_vma *offsetp) { asection *sgot; struct mips_got_info *g; @@ -2530,8 +2550,7 @@ mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, page = (value + 0x8000) & ~(bfd_vma) 0xffff; entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot, - input_section, page, 0, - NULL, R_MIPS_GOT_PAGE); + page, 0, NULL, R_MIPS_GOT_PAGE); if (!entry) return MINUS_ONE; @@ -2544,15 +2563,13 @@ mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, return index; } -/* Find a local GOT entry for an R_MIPS_GOT16 relocation against VALUE, - which was calculated from a symbol belonging to INPUT_SECTION. +/* Find a local GOT entry for an R_MIPS_GOT16 relocation against VALUE. EXTERNAL is true if the relocation was against a global symbol that has been forced local. */ static bfd_vma mips_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, - asection *input_section, bfd_vma value, - bfd_boolean external) + bfd_vma value, bfd_boolean external) { asection *sgot; struct mips_got_info *g; @@ -2568,8 +2585,7 @@ mips_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info, g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot, - input_section, value, 0, - NULL, R_MIPS_GOT16); + value, 0, NULL, R_MIPS_GOT16); if (entry) return entry->gotidx; else @@ -2602,8 +2618,8 @@ mips_elf_got_offset_from_index (bfd *dynobj, bfd *output_bfd, static struct mips_got_entry * mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info, bfd *ibfd, struct mips_got_info *gg, - asection *sgot, asection *input_section, - bfd_vma value, unsigned long r_symndx, + asection *sgot, bfd_vma value, + unsigned long r_symndx, struct mips_elf_link_hash_entry *h, int r_type) { @@ -2684,30 +2700,23 @@ mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info, MIPS_ELF_PUT_WORD (abfd, value, (sgot->contents + entry.gotidx)); - /* These GOT entries need a dynamic relocation on VxWorks. Because - the offset between segments is not fixed, the relocation must be - against a symbol in the same segment as the original symbol. - The easiest way to do this is to take INPUT_SECTION's output - section and emit a relocation against its section symbol. */ + /* These GOT entries need a dynamic relocation on VxWorks. */ if (htab->is_vxworks) { Elf_Internal_Rela outrel; - asection *s, *output_section; + asection *s; bfd_byte *loc; bfd_vma got_address; - int dynindx; s = mips_elf_rel_dyn_section (info, FALSE); - output_section = input_section->output_section; - dynindx = elf_section_data (output_section)->dynindx; got_address = (sgot->output_section->vma + sgot->output_offset + entry.gotidx); loc = s->contents + (s->reloc_count++ * sizeof (Elf32_External_Rela)); outrel.r_offset = got_address; - outrel.r_info = ELF32_R_INFO (dynindx, R_MIPS_32); - outrel.r_addend = value - output_section->vma; + outrel.r_info = ELF32_R_INFO (STN_UNDEF, R_MIPS_32); + outrel.r_addend = value; bfd_elf32_swap_reloca_out (abfd, &outrel, loc); } @@ -3085,8 +3094,7 @@ mips_elf_merge_gots (void **bfd2got_, void *p) if (tcount > 0) { unsigned int primary_total = lcount + tcount + arg->global_count; - if (primary_total * MIPS_ELF_GOT_SIZE (bfd2got->bfd) - >= MIPS_ELF_GOT_MAX_SIZE (arg->info)) + if (primary_total > maxcnt) too_many_for_tls = TRUE; } @@ -3178,6 +3186,7 @@ mips_elf_initialize_tls_index (void **entryp, void *p) struct mips_got_entry *entry = (struct mips_got_entry *)*entryp; struct mips_got_info *g = p; bfd_vma next_index; + unsigned char tls_type; /* We're only interested in TLS symbols. */ if (entry->tls_type == 0) @@ -3193,6 +3202,7 @@ mips_elf_initialize_tls_index (void **entryp, void *p) return 1; entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE; entry->d.h->tls_got_offset = next_index; + tls_type = entry->d.h->tls_type; } else { @@ -3209,12 +3219,13 @@ mips_elf_initialize_tls_index (void **entryp, void *p) g->tls_ldm_offset = next_index; } entry->gotidx = next_index; + tls_type = entry->tls_type; } /* Account for the entries we've just allocated. */ - if (entry->tls_type & (GOT_TLS_GD | GOT_TLS_LDM)) + if (tls_type & (GOT_TLS_GD | GOT_TLS_LDM)) g->tls_assigned_gotno += 2; - if (entry->tls_type & GOT_TLS_IE) + if (tls_type & GOT_TLS_IE) g->tls_assigned_gotno += 1; return 1; @@ -3580,16 +3591,18 @@ mips_elf_next_relocation (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type, const Elf_Internal_Rela *relocation, const Elf_Internal_Rela *relend) { + unsigned long r_symndx = ELF_R_SYM (abfd, relocation->r_info); + while (relocation < relend) { - if (ELF_R_TYPE (abfd, relocation->r_info) == r_type) + if (ELF_R_TYPE (abfd, relocation->r_info) == r_type + && ELF_R_SYM (abfd, relocation->r_info) == r_symndx) return relocation; ++relocation; } /* We didn't find it. */ - bfd_set_error (bfd_error_bad_value); return NULL; } @@ -4056,9 +4069,10 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, a stub. */ if (r_type != R_MIPS16_26 && !info->relocatable && ((h != NULL && h->fn_stub != NULL) - || (local_p && elf_tdata (input_bfd)->local_stubs != NULL + || (local_p + && elf_tdata (input_bfd)->local_stubs != NULL && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL)) - && !mips_elf_stub_section_p (input_bfd, input_section)) + && !mips16_stub_section_p (input_bfd, input_section)) { /* This is a 32- or 64-bit call to a 16-bit function. We should have already noticed that we were going to need the @@ -4072,38 +4086,46 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, } symbol = sec->output_section->vma + sec->output_offset; + /* The target is 16-bit, but the stub isn't. */ + target_is_16_bit_code_p = FALSE; } /* If this is a 16-bit call to a 32- or 64-bit function with a stub, we need to redirect the call to the stub. */ else if (r_type == R_MIPS16_26 && !info->relocatable - && h != NULL - && (h->call_stub != NULL || h->call_fp_stub != NULL) + && ((h != NULL && (h->call_stub != NULL || h->call_fp_stub != NULL)) + || (local_p + && elf_tdata (input_bfd)->local_call_stubs != NULL + && elf_tdata (input_bfd)->local_call_stubs[r_symndx] != NULL)) && !target_is_16_bit_code_p) { - /* If both call_stub and call_fp_stub are defined, we can figure - out which one to use by seeing which one appears in the input - file. */ - if (h->call_stub != NULL && h->call_fp_stub != NULL) - { - asection *o; - - sec = NULL; - for (o = input_bfd->sections; o != NULL; o = o->next) - { - if (strncmp (bfd_get_section_name (input_bfd, o), - CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - { - sec = h->call_fp_stub; - break; - } - } - if (sec == NULL) - sec = h->call_stub; - } - else if (h->call_stub != NULL) - sec = h->call_stub; + if (local_p) + sec = elf_tdata (input_bfd)->local_call_stubs[r_symndx]; else - sec = h->call_fp_stub; + { + /* If both call_stub and call_fp_stub are defined, we can figure + out which one to use by checking which one appears in the input + file. */ + if (h->call_stub != NULL && h->call_fp_stub != NULL) + { + asection *o; + + sec = NULL; + for (o = input_bfd->sections; o != NULL; o = o->next) + { + if (CALL_FP_STUB_P (bfd_get_section_name (input_bfd, o))) + { + sec = h->call_fp_stub; + break; + } + } + if (sec == NULL) + sec = h->call_stub; + } + else if (h->call_stub != NULL) + sec = h->call_stub; + else + sec = h->call_fp_stub; + } BFD_ASSERT (sec->size > 0); symbol = sec->output_section->vma + sec->output_offset; @@ -4145,7 +4167,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, if (r_type == R_MIPS_TLS_LDM) { g = mips_elf_local_got_index (abfd, input_bfd, info, - sec, 0, 0, NULL, r_type); + 0, 0, NULL, r_type); if (g == MINUS_ONE) return bfd_reloc_outofrange; } @@ -4191,7 +4213,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, break; else { - g = mips_elf_local_got_index (abfd, input_bfd, info, sec, + g = mips_elf_local_got_index (abfd, input_bfd, info, symbol + addend, r_symndx, h, r_type); if (g == MINUS_ONE) return bfd_reloc_outofrange; @@ -4240,6 +4262,13 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, outrel.r_info = ELF32_R_INFO (h->root.dynindx, r_type); outrel.r_addend = addend; bfd_elf32_swap_reloca_out (abfd, &outrel, loc); + + /* If we've written this relocation for a readonly section, + we need to set DF_TEXTREL again, so that we do not delete the + DT_TEXTREL tag. */ + if (MIPS_ELF_READONLY_SECTION (input_section)) + info->flags |= DF_TEXTREL; + *valuep = 0; return bfd_reloc_ok; } @@ -4326,6 +4355,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, break; case R_MIPS_TLS_DTPREL_LO16: + case R_MIPS_TLS_DTPREL32: + case R_MIPS_TLS_DTPREL64: value = (symbol + addend - dtprel_base (info)) & howto->dst_mask; break; @@ -4435,7 +4466,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, forced = ! mips_elf_local_relocation_p (input_bfd, relocation, local_sections, FALSE); - value = mips_elf_got16_entry (abfd, input_bfd, info, sec, + value = mips_elf_got16_entry (abfd, input_bfd, info, symbol + addend, forced); if (value == MINUS_ONE) return bfd_reloc_outofrange; @@ -4466,7 +4497,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, case R_MIPS_GNU_REL16_S2: value = symbol + _bfd_mips_elf_sign_extend (addend, 18) - p; overflowed_p = mips_elf_overflow_p (value, 18); - value = (value >> 2) & howto->dst_mask; + value >>= howto->rightshift; + value &= howto->dst_mask; break; case R_MIPS_GOT_HI16: @@ -4490,8 +4522,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, 0. */ if (! local_p) goto got_disp; - value = mips_elf_got_page (abfd, input_bfd, info, sec, - symbol + addend, NULL); + value = mips_elf_got_page (abfd, input_bfd, info, symbol + addend, NULL); if (value == MINUS_ONE) return bfd_reloc_outofrange; value = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, value); @@ -4500,8 +4531,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, case R_MIPS_GOT_OFST: if (local_p) - mips_elf_got_page (abfd, input_bfd, info, sec, - symbol + addend, &value); + mips_elf_got_page (abfd, input_bfd, info, symbol + addend, &value); else value = addend; overflowed_p = mips_elf_overflow_p (value, 16); @@ -4677,13 +4707,11 @@ mips_elf_perform_relocation (struct bfd_link_info *info, /* Returns TRUE if SECTION is a MIPS16 stub section. */ static bfd_boolean -mips_elf_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section) +mips16_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section) { const char *name = bfd_get_section_name (abfd, section); - return (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0 - || strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0); + return FN_STUB_P (name) || CALL_STUB_P (name) || CALL_FP_STUB_P (name); } /* Add room for N relocations to the .rel(a).dyn section in ABFD. */ @@ -4745,10 +4773,13 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, outrel[0].r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel[0].r_offset); - outrel[1].r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); - outrel[2].r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + if (ABI_64_P (output_bfd)) + { + outrel[1].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); + outrel[2].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + } if (outrel[0].r_offset == MINUS_ONE) /* The relocation field has been deleted. */ @@ -4791,6 +4822,11 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, else { indx = elf_section_data (sec->output_section)->dynindx; + if (indx == 0) + { + asection *osec = htab->root.text_index_section; + indx = elf_section_data (osec)->dynindx; + } if (indx == 0) abort (); } @@ -4976,39 +5012,30 @@ _bfd_elf_mips_mach (flagword flags) default: case E_MIPS_ARCH_1: return bfd_mach_mips3000; - break; case E_MIPS_ARCH_2: return bfd_mach_mips6000; - break; case E_MIPS_ARCH_3: return bfd_mach_mips4000; - break; case E_MIPS_ARCH_4: return bfd_mach_mips8000; - break; case E_MIPS_ARCH_5: return bfd_mach_mips5; - break; case E_MIPS_ARCH_32: return bfd_mach_mipsisa32; - break; case E_MIPS_ARCH_64: return bfd_mach_mipsisa64; - break; case E_MIPS_ARCH_32R2: return bfd_mach_mipsisa32r2; - break; case E_MIPS_ARCH_64R2: return bfd_mach_mipsisa64r2; - break; } } @@ -5098,6 +5125,7 @@ _bfd_mips_elf_symbol_processing (bfd *abfd, asymbol *asym) /* Common symbols less than the GP size are automatically treated as SHN_MIPS_SCOMMON symbols on IRIX5. */ if (asym->value > elf_gp_size (abfd) + || ELF_ST_TYPE (elfsym->internal_elf_sym.st_info) == STT_TLS || IRIX_COMPAT (abfd) == ict_irix6) break; /* Fall through. */ @@ -5409,7 +5437,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_GPTAB: - if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) != 0) + if (! CONST_STRNEQ (name, ".gptab.")) return FALSE; break; case SHT_MIPS_UCODE: @@ -5432,7 +5460,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_CONTENT: - if (strncmp (name, ".MIPS.content", sizeof ".MIPS.content" - 1) != 0) + if (! CONST_STRNEQ (name, ".MIPS.content")) return FALSE; break; case SHT_MIPS_OPTIONS: @@ -5440,7 +5468,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_DWARF: - if (strncmp (name, ".debug_", sizeof ".debug_" - 1) != 0) + if (! CONST_STRNEQ (name, ".debug_")) return FALSE; break; case SHT_MIPS_SYMBOL_LIB: @@ -5448,9 +5476,8 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, return FALSE; break; case SHT_MIPS_EVENTS: - if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) != 0 - && strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) != 0) + if (! CONST_STRNEQ (name, ".MIPS.events") + && ! CONST_STRNEQ (name, ".MIPS.post_rel")) return FALSE; break; default: @@ -5556,11 +5583,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, bfd_boolean _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) { - register const char *name; - unsigned int sh_type; - - name = bfd_get_section_name (abfd, sec); - sh_type = hdr->sh_type; + const char *name = bfd_get_section_name (abfd, sec); if (strcmp (name, ".liblist") == 0) { @@ -5570,7 +5593,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) } else if (strcmp (name, ".conflict") == 0) hdr->sh_type = SHT_MIPS_CONFLICT; - else if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0) + else if (CONST_STRNEQ (name, ".gptab.")) { hdr->sh_type = SHT_MIPS_GPTAB; hdr->sh_entsize = sizeof (Elf32_External_gptab); @@ -5627,7 +5650,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) hdr->sh_type = SHT_MIPS_IFACE; hdr->sh_flags |= SHF_MIPS_NOSTRIP; } - else if (strncmp (name, ".MIPS.content", strlen (".MIPS.content")) == 0) + else if (CONST_STRNEQ (name, ".MIPS.content")) { hdr->sh_type = SHT_MIPS_CONTENT; hdr->sh_flags |= SHF_MIPS_NOSTRIP; @@ -5639,7 +5662,7 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) hdr->sh_entsize = 1; hdr->sh_flags |= SHF_MIPS_NOSTRIP; } - else if (strncmp (name, ".debug_", sizeof ".debug_" - 1) == 0) + else if (CONST_STRNEQ (name, ".debug_")) hdr->sh_type = SHT_MIPS_DWARF; else if (strcmp (name, ".MIPS.symlib") == 0) { @@ -5647,9 +5670,8 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) /* The sh_link and sh_info fields are set in final_write_processing. */ } - else if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) == 0 - || strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) == 0) + else if (CONST_STRNEQ (name, ".MIPS.events") + || CONST_STRNEQ (name, ".MIPS.post_rel")) { hdr->sh_type = SHT_MIPS_EVENTS; hdr->sh_flags |= SHF_MIPS_NOSTRIP; @@ -5662,12 +5684,6 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) hdr->sh_entsize = 8; } - /* In the unlikely event a special section is empty it has to lose its - special meaning. This may happen e.g. when using `strip' with the - "--only-keep-debug" option. */ - if (sec->size > 0 && !(sec->flags & SEC_HAS_CONTENTS)) - hdr->sh_type = sh_type; - /* The generic elf_fake_sections will set up REL_HDR using the default kind of relocations. We used to set up a second header for the non-default kind of relocations here, but only NewABI would use @@ -5738,6 +5754,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, /* Common symbols less than the GP size are automatically treated as SHN_MIPS_SCOMMON symbols. */ if (sym->st_size > elf_gp_size (abfd) + || ELF_ST_TYPE (sym->st_info) == STT_TLS || IRIX_COMPAT (abfd) == ict_irix6) break; /* Fall through. */ @@ -6119,7 +6136,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* Check for the mips16 stub sections. */ name = bfd_get_section_name (abfd, sec); - if (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0) + if (FN_STUB_P (name)) { unsigned long r_symndx; @@ -6144,12 +6161,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* We can ignore stub sections when looking for relocs. */ if ((o->flags & SEC_RELOC) == 0 || o->reloc_count == 0 - || strncmp (bfd_get_section_name (abfd, o), FN_STUB, - sizeof FN_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_STUB, - sizeof CALL_STUB - 1) == 0 - || strncmp (bfd_get_section_name (abfd, o), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) == 0) + || mips16_stub_section_p (abfd, o)) continue; sec_relocs @@ -6201,6 +6213,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, elf_tdata (abfd)->local_stubs = n; } + sec->flags |= SEC_KEEP; elf_tdata (abfd)->local_stubs[r_symndx] = sec; /* We don't need to set mips16_stubs_seen in this case. @@ -6221,12 +6234,23 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* H is the symbol this stub is for. */ + /* If we already have an appropriate stub for this function, we + don't need another one, so we can discard this one. Since + this function is called before the linker maps input sections + to output sections, we can easily discard it by setting the + SEC_EXCLUDE flag. */ + if (h->fn_stub != NULL) + { + sec->flags |= SEC_EXCLUDE; + return TRUE; + } + + sec->flags |= SEC_KEEP; h->fn_stub = sec; mips_elf_hash_table (info)->mips16_stubs_seen = TRUE; } } - else if (strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0 - || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) + else if (CALL_STUB_P (name) || CALL_FP_STUB_P (name)) { unsigned long r_symndx; struct mips_elf_link_hash_entry *h; @@ -6240,42 +6264,106 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx < extsymoff || sym_hashes[r_symndx - extsymoff] == NULL) { - /* This stub was actually built for a static symbol defined - in the same file. We assume that all static symbols in - mips16 code are themselves mips16, so we can simply - discard this stub. Since this function is called before - the linker maps input sections to output sections, we can - easily discard it by setting the SEC_EXCLUDE flag. */ - sec->flags |= SEC_EXCLUDE; - return TRUE; + asection *o; + + /* This stub is for a local symbol. This stub will only be + needed if there is some relocation (R_MIPS16_26) in this BFD + that refers to this symbol. */ + for (o = abfd->sections; o != NULL; o = o->next) + { + Elf_Internal_Rela *sec_relocs; + const Elf_Internal_Rela *r, *rend; + + /* We can ignore stub sections when looking for relocs. */ + if ((o->flags & SEC_RELOC) == 0 + || o->reloc_count == 0 + || mips16_stub_section_p (abfd, o)) + continue; + + sec_relocs + = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, + info->keep_memory); + if (sec_relocs == NULL) + return FALSE; + + rend = sec_relocs + o->reloc_count; + for (r = sec_relocs; r < rend; r++) + if (ELF_R_SYM (abfd, r->r_info) == r_symndx + && ELF_R_TYPE (abfd, r->r_info) == R_MIPS16_26) + break; + + if (elf_section_data (o)->relocs != sec_relocs) + free (sec_relocs); + + if (r < rend) + break; + } + + if (o == NULL) + { + /* There is no non-call reloc for this stub, so we do + not need it. Since this function is called before + the linker maps input sections to output sections, we + can easily discard it by setting the SEC_EXCLUDE + flag. */ + sec->flags |= SEC_EXCLUDE; + return TRUE; + } + + /* Record this stub in an array of local symbol call_stubs for + this BFD. */ + if (elf_tdata (abfd)->local_call_stubs == NULL) + { + unsigned long symcount; + asection **n; + bfd_size_type amt; + + if (elf_bad_symtab (abfd)) + symcount = NUM_SHDR_ENTRIES (symtab_hdr); + else + symcount = symtab_hdr->sh_info; + amt = symcount * sizeof (asection *); + n = bfd_zalloc (abfd, amt); + if (n == NULL) + return FALSE; + elf_tdata (abfd)->local_call_stubs = n; + } + + sec->flags |= SEC_KEEP; + elf_tdata (abfd)->local_call_stubs[r_symndx] = sec; + + /* We don't need to set mips16_stubs_seen in this case. + That flag is used to see whether we need to look through + the global symbol table for stubs. We don't need to set + it here, because we just have a local stub. */ } - - h = ((struct mips_elf_link_hash_entry *) - sym_hashes[r_symndx - extsymoff]); - - /* H is the symbol this stub is for. */ - - if (strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0) - loc = &h->call_fp_stub; else - loc = &h->call_stub; - - /* If we already have an appropriate stub for this function, we - don't need another one, so we can discard this one. Since - this function is called before the linker maps input sections - to output sections, we can easily discard it by setting the - SEC_EXCLUDE flag. We can also discard this section if we - happen to already know that this is a mips16 function; it is - not necessary to check this here, as it is checked later, but - it is slightly faster to check now. */ - if (*loc != NULL || h->root.other == STO_MIPS16) { - sec->flags |= SEC_EXCLUDE; - return TRUE; - } + h = ((struct mips_elf_link_hash_entry *) + sym_hashes[r_symndx - extsymoff]); + + /* H is the symbol this stub is for. */ + + if (CALL_FP_STUB_P (name)) + loc = &h->call_fp_stub; + else + loc = &h->call_stub; + + /* If we already have an appropriate stub for this function, we + don't need another one, so we can discard this one. Since + this function is called before the linker maps input sections + to output sections, we can easily discard it by setting the + SEC_EXCLUDE flag. */ + if (*loc != NULL) + { + sec->flags |= SEC_EXCLUDE; + return TRUE; + } - *loc = sec; - mips_elf_hash_table (info)->mips16_stubs_seen = TRUE; + sec->flags |= SEC_KEEP; + *loc = sec; + mips_elf_hash_table (info)->mips16_stubs_seen = TRUE; + } } if (dynobj == NULL) @@ -6395,6 +6483,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, return FALSE; } mips_elf_allocate_dynamic_relocations (dynobj, info, 1); + if (MIPS_ELF_READONLY_SECTION (sec)) + /* We tell the dynamic linker that there are + relocations against the text segment. */ + info->flags |= DF_TEXTREL; } } else if (r_type == R_MIPS_CALL_LO16 @@ -6640,12 +6732,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, References from a stub section do not count. */ if (h != NULL && r_type != R_MIPS16_26 - && strncmp (bfd_get_section_name (abfd, sec), FN_STUB, - sizeof FN_STUB - 1) != 0 - && strncmp (bfd_get_section_name (abfd, sec), CALL_STUB, - sizeof CALL_STUB - 1) != 0 - && strncmp (bfd_get_section_name (abfd, sec), CALL_FP_STUB, - sizeof CALL_FP_STUB - 1) != 0) + && !mips16_stub_section_p (abfd, sec)) { struct mips_elf_link_hash_entry *mh; @@ -6938,7 +7025,6 @@ _bfd_mips_vxworks_adjust_dynamic_symbol (struct bfd_link_info *info, bfd *dynobj; struct mips_elf_link_hash_entry *hmips; struct mips_elf_link_hash_table *htab; - unsigned int power_of_two; htab = mips_elf_hash_table (info); dynobj = elf_hash_table (info)->dynobj; @@ -7061,26 +7147,7 @@ _bfd_mips_vxworks_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ - htab->sdynbss->size = BFD_ALIGN (htab->sdynbss->size, - (bfd_size_type) 1 << power_of_two); - if (power_of_two > bfd_get_section_alignment (dynobj, htab->sdynbss) - && !bfd_set_section_alignment (dynobj, htab->sdynbss, power_of_two)) - return FALSE; - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = htab->sdynbss; - h->root.u.def.value = htab->sdynbss->size; - - /* Increment the section size to make room for the symbol. */ - htab->sdynbss->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, htab->sdynbss); } /* Return the number of dynamic section symbols required by OUTPUT_BFD. @@ -7094,7 +7161,7 @@ count_section_dynsyms (bfd *output_bfd, struct bfd_link_info *info) bfd_size_type count; count = 0; - if (info->shared) + if (info->shared || elf_hash_table (info)->is_relocatable_executable) { asection *p; const struct elf_backend_data *bed; @@ -7293,7 +7360,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, if ((s->flags & SEC_LINKER_CREATED) == 0) continue; - if (strncmp (name, ".rel", 4) == 0) + if (CONST_STRNEQ (name, ".rel")) { if (s->size != 0) { @@ -7345,7 +7412,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, mips_elf_allocate_dynamic_relocations (dynobj, info, count); } } - else if (!htab->is_vxworks && strncmp (name, ".got", 4) == 0) + else if (!htab->is_vxworks && CONST_STRNEQ (name, ".got")) { /* _bfd_mips_elf_always_size_sections() has already done most of the work, but some symbols may have been mapped @@ -7421,16 +7488,16 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, } else if (! info->shared && ! mips_elf_hash_table (info)->use_rld_obj_head - && strncmp (name, ".rld_map", 8) == 0) + && CONST_STRNEQ (name, ".rld_map")) { /* We add a room for __rld_map. It will be filled in by the rtld to contain a pointer to the _r_debug structure. */ s->size += 4; } else if (SGI_COMPAT (output_bfd) - && strncmp (name, ".compact_rel", 12) == 0) + && CONST_STRNEQ (name, ".compact_rel")) s->size += mips_elf_hash_table (info)->compact_rel_size; - else if (strncmp (name, ".init", 5) != 0 + else if (! CONST_STRNEQ (name, ".init") && s != htab->sgotplt && s != htab->splt) { @@ -7480,29 +7547,22 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, /* Add some entries to the .dynamic section. We fill in the values later, in _bfd_mips_elf_finish_dynamic_sections, but we must add the entries now so that we get the correct size for - the .dynamic section. The DT_DEBUG entry is filled in by the - dynamic linker and used by the debugger. */ - if (! info->shared) - { - /* SGI object has the equivalence of DT_DEBUG in the - DT_MIPS_RLD_MAP entry. */ - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0)) - return FALSE; - if (!SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) - return FALSE; - } - } - else - { - /* Shared libraries on traditional mips have DT_DEBUG. */ - if (!SGI_COMPAT (output_bfd)) - { - if (!MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) - return FALSE; - } - } + the .dynamic section. */ + + /* SGI object has the equivalence of DT_DEBUG in the + DT_MIPS_RLD_MAP entry. This must come first because glibc + only fills in DT_MIPS_RLD_MAP (not DT_DEBUG) and GDB only + looks at the first one it sees. */ + if (!info->shared + && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0)) + return FALSE; + + /* The DT_DEBUG entry may be filled in by the dynamic linker and + used by the debugger. */ + if (info->executable + && !SGI_COMPAT (output_bfd) + && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0)) + return FALSE; if (reltext && (SGI_COMPAT (output_bfd) || htab->is_vxworks)) info->flags |= DF_TEXTREL; @@ -7669,8 +7729,54 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, bfd_boolean rela_relocation_p = TRUE; unsigned int r_type = ELF_R_TYPE (output_bfd, rel->r_info); const char *msg; + unsigned long r_symndx; + asection *sec; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry *h; /* Find the relocation howto for this relocation. */ + howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, r_type, + NEWABI_P (input_bfd) + && (MIPS_RELOC_RELA_P + (input_bfd, input_section, + rel - relocs))); + + r_symndx = ELF_R_SYM (input_bfd, rel->r_info); + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + if (mips_elf_local_relocation_p (input_bfd, rel, local_sections, FALSE)) + { + sec = local_sections[r_symndx]; + h = NULL; + } + else + { + unsigned long extsymoff; + + extsymoff = 0; + if (!elf_bad_symtab (input_bfd)) + extsymoff = symtab_hdr->sh_info; + h = elf_sym_hashes (input_bfd) [r_symndx - extsymoff]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + sec = NULL; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + sec = h->root.u.def.section; + } + + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + if (r_type == R_MIPS_64 && ! NEWABI_P (input_bfd)) { /* Some 32-bit code uses R_MIPS_64. In particular, people use @@ -7686,13 +7792,6 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if (bfd_big_endian (input_bfd)) rel->r_offset += 4; } - else - /* NewABI defaults to RELA relocations. */ - howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, r_type, - NEWABI_P (input_bfd) - && (MIPS_RELOC_RELA_P - (input_bfd, input_section, - rel - relocs))); if (!use_saved_addend_p) { @@ -7733,10 +7832,8 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, && mips_elf_local_relocation_p (input_bfd, rel, local_sections, FALSE))) { - bfd_vma l; const Elf_Internal_Rela *lo16_relocation; reloc_howto_type *lo16_howto; - bfd_byte *lo16_location; int lo16_type; if (r_type == R_MIPS16_HI16) @@ -7759,32 +7856,56 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, several relocations for the same address. In that case, the R_MIPS_LO16 relocation may occur as one of these. We permit a similar extension - in general, as that is useful for GCC. */ + in general, as that is useful for GCC. + + In some cases GCC dead code elimination removes + the LO16 but keeps the corresponding HI16. This + is strictly speaking a violation of the ABI but + not immediately harmful. */ lo16_relocation = mips_elf_next_relocation (input_bfd, lo16_type, rel, relend); if (lo16_relocation == NULL) - return FALSE; + { + const char *name; - lo16_location = contents + lo16_relocation->r_offset; + if (h) + name = h->root.root.string; + else + name = bfd_elf_sym_name (input_bfd, symtab_hdr, + local_syms + r_symndx, + sec); + (*_bfd_error_handler) + (_("%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%A'"), + input_bfd, input_section, name, howto->name, + rel->r_offset); + } + else + { + bfd_byte *lo16_location; + bfd_vma l; - /* Obtain the addend kept there. */ - lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, - lo16_type, FALSE); - _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type, FALSE, - lo16_location); - l = mips_elf_obtain_contents (lo16_howto, lo16_relocation, - input_bfd, contents); - _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type, FALSE, - lo16_location); - l &= lo16_howto->src_mask; - l <<= lo16_howto->rightshift; - l = _bfd_mips_elf_sign_extend (l, 16); + lo16_location = contents + lo16_relocation->r_offset; - addend <<= 16; + /* Obtain the addend kept there. */ + lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, + lo16_type, FALSE); + _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type, + FALSE, lo16_location); + l = mips_elf_obtain_contents (lo16_howto, + lo16_relocation, + input_bfd, contents); + _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type, + FALSE, lo16_location); + l &= lo16_howto->src_mask; + l <<= lo16_howto->rightshift; + l = _bfd_mips_elf_sign_extend (l, 16); - /* Compute the combined addend. */ - addend += l; + addend <<= 16; + + /* Compute the combined addend. */ + addend += l; + } } else addend <<= howto->rightshift; @@ -8792,11 +8913,10 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000, sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd)); } - } - if (sgot != NULL) - elf_section_data (sgot->output_section)->this_hdr.sh_entsize - = MIPS_ELF_GOT_SIZE (output_bfd); + elf_section_data (sgot->output_section)->this_hdr.sh_entsize + = MIPS_ELF_GOT_SIZE (output_bfd); + } /* Generate dynamic relocations for the non-primary gots. */ if (gg != NULL && gg->next) @@ -8870,6 +8990,10 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, * (ABI_64_P (output_bfd) ? sizeof (Elf64_Mips_External_Rel) : sizeof (Elf32_External_Rel))); + /* Adjust the section size too. Tools like the prelinker + can reasonably expect the values to the same. */ + elf_section_data (s->output_section)->this_hdr.sh_size + = dyn.d_un.d_val; break; default: @@ -9095,7 +9219,7 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, BFD_ASSERT ((*hdrpp)->bfd_section != NULL); name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); BFD_ASSERT (name != NULL - && strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0); + && CONST_STRNEQ (name, ".gptab.")); sec = bfd_get_section_by_name (abfd, name + sizeof ".gptab" - 1); BFD_ASSERT (sec != NULL); (*hdrpp)->sh_info = elf_section_data (sec)->this_idx; @@ -9105,8 +9229,7 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, BFD_ASSERT ((*hdrpp)->bfd_section != NULL); name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); BFD_ASSERT (name != NULL - && strncmp (name, ".MIPS.content", - sizeof ".MIPS.content" - 1) == 0); + && CONST_STRNEQ (name, ".MIPS.content")); sec = bfd_get_section_by_name (abfd, name + sizeof ".MIPS.content" - 1); BFD_ASSERT (sec != NULL); @@ -9126,13 +9249,12 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, BFD_ASSERT ((*hdrpp)->bfd_section != NULL); name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section); BFD_ASSERT (name != NULL); - if (strncmp (name, ".MIPS.events", sizeof ".MIPS.events" - 1) == 0) + if (CONST_STRNEQ (name, ".MIPS.events")) sec = bfd_get_section_by_name (abfd, name + sizeof ".MIPS.events" - 1); else { - BFD_ASSERT (strncmp (name, ".MIPS.post_rel", - sizeof ".MIPS.post_rel" - 1) == 0); + BFD_ASSERT (CONST_STRNEQ (name, ".MIPS.post_rel")); sec = bfd_get_section_by_name (abfd, (name + sizeof ".MIPS.post_rel" - 1)); @@ -9149,7 +9271,8 @@ _bfd_mips_elf_final_write_processing (bfd *abfd, segments. */ int -_bfd_mips_elf_additional_program_headers (bfd *abfd) +_bfd_mips_elf_additional_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { asection *s; int ret = 0; @@ -9171,6 +9294,12 @@ _bfd_mips_elf_additional_program_headers (bfd *abfd) && bfd_get_section_by_name (abfd, ".mdebug")) ++ret; + /* Allocate a PT_NULL header in dynamic objects. See + _bfd_mips_elf_modify_segment_map for details. */ + if (!SGI_COMPAT (abfd) + && bfd_get_section_by_name (abfd, ".dynamic")) + ++ret; + return ret; } @@ -9240,15 +9369,18 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, || (*pm)->p_type == PT_INTERP)) pm = &(*pm)->next; - amt = sizeof (struct elf_segment_map); - options_segment = bfd_zalloc (abfd, amt); - options_segment->next = *pm; - options_segment->p_type = PT_MIPS_OPTIONS; - options_segment->p_flags = PF_R; - options_segment->p_flags_valid = TRUE; - options_segment->count = 1; - options_segment->sections[0] = s; - *pm = options_segment; + if (*pm == NULL || (*pm)->p_type != PT_MIPS_OPTIONS) + { + amt = sizeof (struct elf_segment_map); + options_segment = bfd_zalloc (abfd, amt); + options_segment->next = *pm; + options_segment->p_type = PT_MIPS_OPTIONS; + options_segment->p_flags = PF_R; + options_segment->p_flags_valid = TRUE; + options_segment->count = 1; + options_segment->sections[0] = s; + *pm = options_segment; + } } } else @@ -9318,8 +9450,18 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, m->p_flags_valid = 1; } } - if (m != NULL - && m->count == 1 && strcmp (m->sections[0]->name, ".dynamic") == 0) + /* GNU/Linux binaries do not need the extended PT_DYNAMIC section. + glibc's dynamic linker has traditionally derived the number of + tags from the p_filesz field, and sometimes allocates stack + arrays of that size. An overly-big PT_DYNAMIC segment can + be actively harmful in such cases. Making PT_DYNAMIC contain + other sections can also make life hard for the prelinker, + which might move one of the other sections to a different + PT_LOAD segment. */ + if (SGI_COMPAT (abfd) + && m != NULL + && m->count == 1 + && strcmp (m->sections[0]->name, ".dynamic") == 0) { static const char *sec_names[] = { @@ -9376,6 +9518,38 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, } } + /* Allocate a spare program header in dynamic objects so that tools + like the prelinker can add an extra PT_LOAD entry. + + If the prelinker needs to make room for a new PT_LOAD entry, its + standard procedure is to move the first (read-only) sections into + the new (writable) segment. However, the MIPS ABI requires + .dynamic to be in a read-only segment, and the section will often + start within sizeof (ElfNN_Phdr) bytes of the last program header. + + Although the prelinker could in principle move .dynamic to a + writable segment, it seems better to allocate a spare program + header instead, and avoid the need to move any sections. + There is a long tradition of allocating spare dynamic tags, + so allocating a spare program header seems like a natural + extension. */ + if (!SGI_COMPAT (abfd) + && bfd_get_section_by_name (abfd, ".dynamic")) + { + for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next) + if ((*pm)->p_type == PT_NULL) + break; + if (*pm == NULL) + { + m = bfd_zalloc (abfd, sizeof (*m)); + if (m == NULL) + return FALSE; + + m->p_type = PT_NULL; + *pm = m; + } + } + return TRUE; } @@ -9384,7 +9558,7 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd, asection * _bfd_mips_elf_gc_mark_hook (asection *sec, - struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) @@ -9392,32 +9566,14 @@ _bfd_mips_elf_gc_mark_hook (asection *sec, /* ??? Do mips16 stub sections need to be handled special? */ if (h != NULL) - { - switch (ELF_R_TYPE (sec->owner, rel->r_info)) - { - case R_MIPS_GNU_VTINHERIT: - case R_MIPS_GNU_VTENTRY: - break; + switch (ELF_R_TYPE (sec->owner, rel->r_info)) + { + case R_MIPS_GNU_VTINHERIT: + case R_MIPS_GNU_VTENTRY: + return NULL; + } - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } - } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -9512,7 +9668,7 @@ _bfd_mips_elf_hide_symbol (struct bfd_link_info *info, dynobj = elf_hash_table (info)->dynobj; if (dynobj != NULL && force_local && h->root.type != STT_TLS - && (got = mips_elf_got_section (dynobj, FALSE)) != NULL + && (got = mips_elf_got_section (dynobj, TRUE)) != NULL && (g = mips_elf_section_data (got)->u.got_info) != NULL) { if (g->next) @@ -9637,8 +9793,9 @@ _bfd_mips_elf_ignore_discarded_relocs (asection *sec) } bfd_boolean -_bfd_mips_elf_write_section (bfd *output_bfd, asection *sec, - bfd_byte *contents) +_bfd_mips_elf_write_section (bfd *output_bfd, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + asection *sec, bfd_byte *contents) { bfd_byte *to, *from, *end; int i; @@ -10437,7 +10594,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) mdebug_sec = o; } - if (strncmp (o->name, ".gptab.", sizeof ".gptab." - 1) == 0) + if (CONST_STRNEQ (o->name, ".gptab.")) { const char *subname; unsigned int c; @@ -10815,6 +10972,112 @@ mips_32bit_flags_p (flagword flags) } +/* Merge object attributes from IBFD into OBFD. Raise an error if + there are conflicting attributes. */ +static bfd_boolean +mips_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr; + obj_attribute *out_attr; + + if (!elf_known_obj_attributes_proc (obfd)[0].i) + { + /* This is the first object. Copy the attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + + return TRUE; + } + + /* Check for conflicting Tag_GNU_MIPS_ABI_FP attributes and merge + non-conflicting ones. */ + in_attr = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU]; + out_attr = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU]; + if (in_attr[Tag_GNU_MIPS_ABI_FP].i != out_attr[Tag_GNU_MIPS_ABI_FP].i) + { + out_attr[Tag_GNU_MIPS_ABI_FP].type = 1; + if (out_attr[Tag_GNU_MIPS_ABI_FP].i == 0) + out_attr[Tag_GNU_MIPS_ABI_FP].i = in_attr[Tag_GNU_MIPS_ABI_FP].i; + else if (in_attr[Tag_GNU_MIPS_ABI_FP].i == 0) + ; + else if (in_attr[Tag_GNU_MIPS_ABI_FP].i > 3) + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), ibfd, + in_attr[Tag_GNU_MIPS_ABI_FP].i); + else if (out_attr[Tag_GNU_MIPS_ABI_FP].i > 3) + _bfd_error_handler + (_("Warning: %B uses unknown floating point ABI %d"), obfd, + out_attr[Tag_GNU_MIPS_ABI_FP].i); + else + switch (out_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 1: + switch (in_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 2: + _bfd_error_handler + (_("Warning: %B uses -msingle-float, %B uses -mdouble-float"), + obfd, ibfd); + + case 3: + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), + obfd, ibfd); + break; + + default: + abort (); + } + break; + + case 2: + switch (in_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 1: + _bfd_error_handler + (_("Warning: %B uses -msingle-float, %B uses -mdouble-float"), + ibfd, obfd); + + case 3: + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), + obfd, ibfd); + break; + + default: + abort (); + } + break; + + case 3: + switch (in_attr[Tag_GNU_MIPS_ABI_FP].i) + { + case 1: + case 2: + _bfd_error_handler + (_("Warning: %B uses hard float, %B uses soft float"), + ibfd, obfd); + break; + + default: + abort (); + } + break; + + default: + abort (); + } + } + + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); + + return TRUE; +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -10848,6 +11111,9 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) return FALSE; } + if (!mips_elf_merge_obj_attributes (ibfd, obfd)) + return FALSE; + new_flags = elf_elfheader (ibfd)->e_flags; elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER; old_flags = elf_elfheader (obfd)->e_flags; @@ -10860,7 +11126,9 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) = elf_elfheader (ibfd)->e_ident[EI_CLASS]; if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) - && bfd_get_arch_info (obfd)->the_default) + && (bfd_get_arch_info (obfd)->the_default + || mips_mach_extends_p (bfd_get_mach (obfd), + bfd_get_mach (ibfd)))) { if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd))) @@ -11071,37 +11339,52 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) fprintf (file, _(" [no abi set]")); if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1) - fprintf (file, _(" [mips1]")); + fprintf (file, " [mips1]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2) - fprintf (file, _(" [mips2]")); + fprintf (file, " [mips2]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3) - fprintf (file, _(" [mips3]")); + fprintf (file, " [mips3]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4) - fprintf (file, _(" [mips4]")); + fprintf (file, " [mips4]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5) - fprintf (file, _(" [mips5]")); + fprintf (file, " [mips5]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32) - fprintf (file, _(" [mips32]")); + fprintf (file, " [mips32]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64) - fprintf (file, _(" [mips64]")); + fprintf (file, " [mips64]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2) - fprintf (file, _(" [mips32r2]")); + fprintf (file, " [mips32r2]"); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R2) - fprintf (file, _(" [mips64r2]")); + fprintf (file, " [mips64r2]"); else fprintf (file, _(" [unknown ISA]")); if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MDMX) - fprintf (file, _(" [mdmx]")); + fprintf (file, " [mdmx]"); if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_M16) - fprintf (file, _(" [mips16]")); + fprintf (file, " [mips16]"); if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE) - fprintf (file, _(" [32bitmode]")); + fprintf (file, " [32bitmode]"); else fprintf (file, _(" [not 32bitmode]")); + if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER) + fprintf (file, " [noreorder]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) + fprintf (file, " [PIC]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_CPIC) + fprintf (file, " [CPIC]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_XGOT) + fprintf (file, " [XGOT]"); + + if (elf_elfheader (abfd)->e_flags & EF_MIPS_UCODE) + fprintf (file, " [UCODE]"); + fputc ('\n', file); return TRUE; @@ -11109,24 +11392,34 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] = { - { ".lit4", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".lit8", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".mdebug", 7, 0, SHT_MIPS_DEBUG, 0 }, - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, - { ".ucode", 6, 0, SHT_MIPS_UCODE, 0 }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".lit4"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".lit8"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".mdebug"), 0, SHT_MIPS_DEBUG, 0 }, + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL }, + { STRING_COMMA_LEN (".ucode"), 0, SHT_MIPS_UCODE, 0 }, + { NULL, 0, 0, 0, 0 } }; -/* Ensure that the STO_OPTIONAL flag is copied into h->other, - even if this is not a defintion of the symbol. */ +/* Merge non visibility st_other attributes. Ensure that the + STO_OPTIONAL flag is copied into h->other, even if this is not a + definiton of the symbol. */ void _bfd_mips_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, const Elf_Internal_Sym *isym, bfd_boolean definition, bfd_boolean dynamic ATTRIBUTE_UNUSED) { - if (! definition + if ((isym->st_other & ~ELF_ST_VISIBILITY (-1)) != 0) + { + unsigned char other; + + other = (definition ? isym->st_other : h->other); + other &= ~ELF_ST_VISIBILITY (-1); + h->other = other | ELF_ST_VISIBILITY (h->other); + } + + if (!definition && ELF_MIPS_IS_OPTIONAL (isym->st_other)) h->other |= STO_OPTIONAL; } @@ -11138,3 +11431,11 @@ _bfd_mips_elf_ignore_undef_symbol (struct elf_link_hash_entry *h) { return ELF_MIPS_IS_OPTIONAL (h->other) ? TRUE : FALSE; } + +bfd_boolean +_bfd_mips_elf_common_definition (Elf_Internal_Sym *sym) +{ + return (sym->st_shndx == SHN_COMMON + || sym->st_shndx == SHN_MIPS_ACOMMON + || sym->st_shndx == SHN_MIPS_SCOMMON); +} diff --git a/contrib/binutils/bfd/elfxx-mips.h b/contrib/binutils/bfd/elfxx-mips.h index 6c3c9a30f6e..3e97cc04ab6 100644 --- a/contrib/binutils/bfd/elfxx-mips.h +++ b/contrib/binutils/bfd/elfxx-mips.h @@ -1,5 +1,6 @@ /* MIPS ELF specific backend routines. - Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -68,7 +69,7 @@ extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections extern void _bfd_mips_elf_final_write_processing (bfd *, bfd_boolean); extern int _bfd_mips_elf_additional_program_headers - (bfd *); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_mips_elf_modify_segment_map (bfd *, struct bfd_link_info *); extern asection * _bfd_mips_elf_gc_mark_hook @@ -108,7 +109,7 @@ extern bfd_boolean _bfd_mips_elf_print_private_bfd_data extern bfd_boolean _bfd_mips_elf_discard_info (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *); extern bfd_boolean _bfd_mips_elf_write_section - (bfd *, asection *, bfd_byte *); + (bfd *, struct bfd_link_info *, asection *, bfd_byte *); extern bfd_boolean _bfd_mips_elf_read_ecoff_info (bfd *, asection *, struct ecoff_debug_info *); @@ -141,6 +142,9 @@ extern bfd_boolean _bfd_mips_elf_ignore_undef_symbol extern const struct bfd_elf_special_section _bfd_mips_elf_special_sections []; +extern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *); + +#define elf_backend_common_definition _bfd_mips_elf_common_definition #define elf_backend_name_local_section_symbols \ _bfd_mips_elf_name_local_section_symbols #define elf_backend_special_sections _bfd_mips_elf_special_sections diff --git a/contrib/binutils/bfd/elfxx-sparc.c b/contrib/binutils/bfd/elfxx-sparc.c index ef7ff482d2e..708af290e3c 100644 --- a/contrib/binutils/bfd/elfxx-sparc.c +++ b/contrib/binutils/bfd/elfxx-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for ELF - Copyright 2005, 2006 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ /* This file handles functionality common to the different SPARC ABI's. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "libiberty.h" @@ -384,6 +384,30 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } +reloc_howto_type * +_bfd_sparc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (_bfd_sparc_elf_howto_table) + / sizeof (_bfd_sparc_elf_howto_table[0])); + i++) + if (_bfd_sparc_elf_howto_table[i].name != NULL + && strcasecmp (_bfd_sparc_elf_howto_table[i].name, r_name) == 0) + return &_bfd_sparc_elf_howto_table[i]; + + if (strcasecmp (sparc_vtinherit_howto.name, r_name) == 0) + return &sparc_vtinherit_howto; + if (strcasecmp (sparc_vtentry_howto.name, r_name) == 0) + return &sparc_vtentry_howto; + if (strcasecmp (sparc_rev32_howto.name, r_name) == 0) + return &sparc_rev32_howto; + + return NULL; +} + reloc_howto_type * _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type) { @@ -487,11 +511,14 @@ struct _bfd_sparc_elf_obj_tdata bfd_boolean _bfd_sparc_elf_mkobject (bfd *abfd) { - bfd_size_type amt = sizeof (struct _bfd_sparc_elf_obj_tdata); - abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return FALSE; - return TRUE; + { + bfd_size_type amt = sizeof (struct _bfd_sparc_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + } + return bfd_elf_mkobject (abfd); } static void @@ -507,27 +534,14 @@ sparc_put_word_64 (bfd *bfd, bfd_vma val, void *ptr) } static void -sparc_elf_append_rela_64 (bfd *abfd ATTRIBUTE_UNUSED, - asection *s ATTRIBUTE_UNUSED, - Elf_Internal_Rela *rel ATTRIBUTE_UNUSED) +sparc_elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel) { -#ifdef BFD64 - Elf64_External_Rela *loc64; + const struct elf_backend_data *bed; + bfd_byte *loc; - loc64 = (Elf64_External_Rela *) s->contents; - loc64 += s->reloc_count++; - bfd_elf64_swap_reloca_out (abfd, rel, (bfd_byte *) loc64); -#endif -} - -static void -sparc_elf_append_rela_32 (bfd *abfd, asection *s, Elf_Internal_Rela *rel) -{ - Elf32_External_Rela *loc32; - - loc32 = (Elf32_External_Rela *) s->contents; - loc32 += s->reloc_count++; - bfd_elf32_swap_reloca_out (abfd, rel, (bfd_byte *) loc32); + bed = get_elf_backend_data (abfd); + loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela); + bed->s->swap_reloca_out (abfd, rel, loc); } static bfd_vma @@ -746,9 +760,6 @@ static const bfd_vma sparc_vxworks_shared_plt_entry[] = #define SPARC_ELF_PUT_WORD(htab, bfd, val, ptr) \ htab->put_word(bfd, val, ptr) -#define SPARC_ELF_APPEND_RELA(htab, bfd, sec, rela) \ - htab->append_rela(bfd, sec, rela) - #define SPARC_ELF_R_INFO(htab, in_rel, index, type) \ htab->r_info(in_rel, index, type) @@ -824,7 +835,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd) if (ABI_64_P (abfd)) { ret->put_word = sparc_put_word_64; - ret->append_rela = sparc_elf_append_rela_64; ret->r_info = sparc_elf_r_info_64; ret->r_symndx = sparc_elf_r_symndx_64; ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF64; @@ -840,7 +850,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd) else { ret->put_word = sparc_put_word_32; - ret->append_rela = sparc_elf_append_rela_32; ret->r_info = sparc_elf_r_info_32; ret->r_symndx = sparc_elf_r_symndx_32; ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF32; @@ -1427,7 +1436,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -1529,35 +1538,14 @@ _bfd_sparc_elf_gc_mark_hook (asection *sec, Elf_Internal_Sym *sym) { if (h != NULL) - { - struct _bfd_sparc_elf_link_hash_table *htab; - - htab = _bfd_sparc_elf_hash_table (info); - switch (SPARC_ELF_R_TYPE (rel->r_info)) + switch (SPARC_ELF_R_TYPE (rel->r_info)) { case R_SPARC_GNU_VTINHERIT: case R_SPARC_GNU_VTENTRY: - break; - - default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; - - case bfd_link_hash_common: - return h->root.u.c.p->section; - - default: - break; - } + return NULL; } - } - else - return bfd_section_from_elf_index (sec->owner, sym->st_shndx); - return NULL; + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } /* Update the got entry reference counts for the section being removed. */ @@ -1713,7 +1701,6 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, struct _bfd_sparc_elf_link_hash_entry * eh; struct _bfd_sparc_elf_dyn_relocs *p; asection *s; - unsigned int power_of_two; htab = _bfd_sparc_elf_hash_table (info); @@ -1830,29 +1817,9 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > htab->align_power_max) - power_of_two = htab->align_power_max; - - /* Apply the required alignment. */ s = htab->sdynbss; - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2287,7 +2254,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, /* Strip this section if we don't need it; see the comment below. */ } - else if (strncmp (s->name, ".rela", 5) == 0) + else if (CONST_STRNEQ (s->name, ".rela")) { if (s->size != 0) { @@ -2434,13 +2401,16 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, bfd_boolean _bfd_sparc_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _bfd_sparc_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _bfd_sparc_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = (struct _bfd_sparc_elf_section_data *) bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = (PTR) sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } @@ -2486,10 +2456,14 @@ tpoff (struct bfd_link_info *info, bfd_vma address) /* Relocate a SPARC ELF section. */ bfd_boolean -_bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, - bfd *input_bfd, asection *input_section, - bfd_byte *contents, Elf_Internal_Rela *relocs, - Elf_Internal_Sym *local_syms, asection **local_sections) +_bfd_sparc_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { struct _bfd_sparc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -2501,9 +2475,6 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, Elf_Internal_Rela *relend; int num_relocs; - if (info->relocatable) - return TRUE; - htab = _bfd_sparc_elf_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -2547,7 +2518,6 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } howto = _bfd_sparc_elf_howto_table + r_type; - /* This is a final link. */ r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info); h = NULL; sym = NULL; @@ -2579,6 +2549,21 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } } + if (sec != NULL && elf_discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce + sections, or sections discarded by a linker script, we + just want the section contents zeroed. Avoid any + special processing. */ + _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset); + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + switch (r_type) { case R_SPARC_GOT10: @@ -2660,7 +2645,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, 0, R_SPARC_RELATIVE); outrel.r_addend = relocation; relocation = 0; - SPARC_ELF_APPEND_RELA (htab, output_bfd, s, &outrel); + sparc_elf_append_rela (output_bfd, s, &outrel); } SPARC_ELF_PUT_WORD (htab, output_bfd, relocation, @@ -2767,11 +2752,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, case R_SPARC_L44: case R_SPARC_UA64: r_sparc_plt32: - /* r_symndx will be zero only for relocs against symbols - from removed linkonce sections, or sections discarded by - a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared @@ -2879,6 +2860,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { long indx; + outrel.r_addend = relocation + rel->r_addend; + if (is_plt) sec = htab->splt; @@ -2893,9 +2876,20 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + if (indx == 0) + { + osec = htab->elf.text_index_section; + indx = elf_section_data (osec)->dynindx; + } + /* FIXME: we really should be able to link non-pic shared libraries. */ if (indx == 0) @@ -2909,12 +2903,12 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } } - outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx, r_type); - outrel.r_addend = relocation + rel->r_addend; + outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx, + r_type); } } - SPARC_ELF_APPEND_RELA (htab, output_bfd, sreloc, &outrel); + sparc_elf_append_rela (output_bfd, sreloc, &outrel); /* This reloc will be computed at runtime, so there's no need to do anything now. */ @@ -3022,7 +3016,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, else outrel.r_addend = 0; outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, indx, dr_type); - SPARC_ELF_APPEND_RELA (htab, output_bfd, htab->srelgot, &outrel); + sparc_elf_append_rela (output_bfd, htab->srelgot, &outrel); if (r_type == R_SPARC_TLS_GD_HI22 || r_type == R_SPARC_TLS_GD_LO10) @@ -3043,7 +3037,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, indx, SPARC_ELF_DTPOFF_RELOC (htab)); outrel.r_offset += SPARC_ELF_WORD_BYTES (htab); - SPARC_ELF_APPEND_RELA (htab, output_bfd, htab->srelgot, &outrel); + sparc_elf_append_rela (output_bfd, htab->srelgot, + &outrel); } } else if (dr_type == SPARC_ELF_DTPMOD_RELOC (htab)) @@ -3112,7 +3107,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, + rel->r_addend; } - SPARC_ELF_APPEND_RELA (htab, output_bfd, sreloc, &outrel); + sparc_elf_append_rela (output_bfd, sreloc, &outrel); continue; } relocation = tpoff (info, relocation); @@ -3633,9 +3628,11 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, { bfd *dynobj; struct _bfd_sparc_elf_link_hash_table *htab; + const struct elf_backend_data *bed; htab = _bfd_sparc_elf_hash_table (info); dynobj = htab->elf.dynobj; + bed = get_elf_backend_data (output_bfd); if (h->plt.offset != (bfd_vma) -1) { @@ -3705,18 +3702,8 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, thus .plt[4] has corresponding .rela.plt[0] and so on. */ loc = srela->contents; -#ifdef BFD64 - if (ABI_64_P (output_bfd)) - { - loc += rela_index * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); - } - else -#endif - { - loc += rela_index * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - } + loc += rela_index * bed->s->sizeof_rela; + bed->s->swap_reloca_out (output_bfd, &rela, loc); if (!h->def_regular) { @@ -3773,7 +3760,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, SPARC_ELF_PUT_WORD (htab, output_bfd, 0, sgot->contents + (h->got.offset & ~(bfd_vma) 1)); - SPARC_ELF_APPEND_RELA (htab, output_bfd, srela, &rela); + sparc_elf_append_rela (output_bfd, srela, &rela); } if (h->needs_copy) @@ -3793,7 +3780,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, + h->root.u.def.section->output_offset); rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_COPY); rela.r_addend = 0; - SPARC_ELF_APPEND_RELA (htab, output_bfd, s, &rela); + sparc_elf_append_rela (output_bfd, s, &rela); } /* Mark some specially defined symbols as absolute. On VxWorks, @@ -3809,83 +3796,30 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, /* Finish up the dynamic sections. */ -#ifdef BFD64 static bfd_boolean -sparc64_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, - bfd *dynobj, asection *sdyn, - asection *splt ATTRIBUTE_UNUSED) +sparc_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, + bfd *dynobj, asection *sdyn, + asection *splt ATTRIBUTE_UNUSED) { - Elf64_External_Dyn *dyncon, *dynconend; - int stt_regidx = -1; - - dyncon = (Elf64_External_Dyn *) sdyn->contents; - dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size); - for (; dyncon < dynconend; dyncon++) - { - Elf_Internal_Dyn dyn; - const char *name; - bfd_boolean size; - - bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); - - switch (dyn.d_tag) - { - case DT_PLTGOT: name = ".plt"; size = FALSE; break; - case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; - case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; - case DT_SPARC_REGISTER: - if (stt_regidx == -1) - { - stt_regidx = - _bfd_elf_link_lookup_local_dynindx (info, output_bfd, -1); - if (stt_regidx == -1) - return FALSE; - } - dyn.d_un.d_val = stt_regidx++; - bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); - /* fallthrough */ - default: name = NULL; size = FALSE; break; - } - - if (name != NULL) - { - asection *s; - - s = bfd_get_section_by_name (output_bfd, name); - if (s == NULL) - dyn.d_un.d_val = 0; - else - { - if (! size) - dyn.d_un.d_ptr = s->vma; - else - dyn.d_un.d_val = s->size; - } - bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); - } - } - return TRUE; -} -#endif - -static bfd_boolean -sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, - bfd *dynobj, asection *sdyn, - asection *splt ATTRIBUTE_UNUSED) -{ - Elf32_External_Dyn *dyncon, *dynconend; struct _bfd_sparc_elf_link_hash_table *htab; + const struct elf_backend_data *bed; + bfd_byte *dyncon, *dynconend; + size_t dynsize; + int stt_regidx = -1; + bfd_boolean abi_64_p; htab = _bfd_sparc_elf_hash_table (info); - dyncon = (Elf32_External_Dyn *) sdyn->contents; - dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); - for (; dyncon < dynconend; dyncon++) + bed = get_elf_backend_data (output_bfd); + dynsize = bed->s->sizeof_dyn; + dynconend = sdyn->contents + sdyn->size; + abi_64_p = ABI_64_P (output_bfd); + for (dyncon = sdyn->contents; dyncon < dynconend; dyncon += dynsize) { Elf_Internal_Dyn dyn; const char *name; bfd_boolean size; - bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); + bed->s->swap_dyn_in (dynobj, dyncon, &dyn); if (htab->is_vxworks && dyn.d_tag == DT_RELASZ) { @@ -3894,7 +3828,7 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, if (htab->srelplt) { dyn.d_un.d_val -= htab->srelplt->size; - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); } } else if (htab->is_vxworks && dyn.d_tag == DT_PLTGOT) @@ -3905,9 +3839,21 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, { dyn.d_un.d_val = (htab->sgotplt->output_section->vma + htab->sgotplt->output_offset); - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); } } + else if (abi_64_p && dyn.d_tag == DT_SPARC_REGISTER) + { + if (stt_regidx == -1) + { + stt_regidx = + _bfd_elf_link_lookup_local_dynindx (info, output_bfd, -1); + if (stt_regidx == -1) + return FALSE; + } + dyn.d_un.d_val = stt_regidx++; + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); + } else { switch (dyn.d_tag) @@ -3915,7 +3861,7 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, case DT_PLTGOT: name = ".plt"; size = FALSE; break; case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; - default: name = NULL; size = FALSE; break; + default: name = NULL; size = FALSE; break; } if (name != NULL) @@ -3932,7 +3878,7 @@ sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, else dyn.d_un.d_val = s->size; } - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); } } } @@ -4046,20 +3992,12 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i if (elf_hash_table (info)->dynamic_sections_created) { asection *splt; - bfd_boolean ret; splt = bfd_get_section_by_name (dynobj, ".plt"); BFD_ASSERT (splt != NULL && sdyn != NULL); -#ifdef BFD64 - if (ABI_64_P (output_bfd)) - ret = sparc64_finish_dyn (output_bfd, info, dynobj, sdyn, splt); - else -#endif - ret = sparc32_finish_dyn (output_bfd, info, dynobj, sdyn, splt); - - if (ret != TRUE) - return ret; + if (!sparc_finish_dyn (output_bfd, info, dynobj, sdyn, splt)) + return FALSE; /* Initialize the contents of the .plt section. */ if (splt->size > 0) @@ -4081,7 +4019,8 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i } elf_section_data (splt->output_section)->this_hdr.sh_entsize - = htab->plt_entry_size; + = (htab->is_vxworks || !ABI_64_P (output_bfd)) + ? 0 : htab->plt_entry_size; } /* Set the first entry in the global offset table to the address of diff --git a/contrib/binutils/bfd/elfxx-sparc.h b/contrib/binutils/bfd/elfxx-sparc.h index 0a5a88b6fe3..787fd33c6d7 100644 --- a/contrib/binutils/bfd/elfxx-sparc.h +++ b/contrib/binutils/bfd/elfxx-sparc.h @@ -1,5 +1,5 @@ /* SPARC ELF specific backend routines. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -71,7 +71,6 @@ struct _bfd_sparc_elf_link_hash_table asection *sgotplt; void (*put_word) (bfd *, bfd_vma, void *); - void (*append_rela) (bfd *, asection *, Elf_Internal_Rela *); bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma); bfd_vma (*r_symndx) (bfd_vma); int (*build_plt_entry) (bfd *, asection *, bfd_vma, bfd_vma, bfd_vma *); @@ -97,6 +96,8 @@ struct _bfd_sparc_elf_link_hash_table extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup + (bfd *, const char *); extern void _bfd_sparc_elf_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h index 503726d2b86..be0cfecfde0 100644 --- a/contrib/binutils/bfd/elfxx-target.h +++ b/contrib/binutils/bfd/elfxx-target.h @@ -29,7 +29,9 @@ #ifndef bfd_elfNN_close_and_cleanup #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup #endif -#define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +#ifndef bfd_elfNN_bfd_free_cached_info +#define bfd_elfNN_bfd_free_cached_info _bfd_free_cached_info +#endif #ifndef bfd_elfNN_get_section_contents #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents #endif @@ -101,6 +103,9 @@ #ifndef elf_backend_want_p_paddr_set_to_zero #define elf_backend_want_p_paddr_set_to_zero 0 #endif +#ifndef elf_backend_default_execstack +#define elf_backend_default_execstack 1 +#endif #define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void @@ -129,7 +134,10 @@ #define elf_backend_gc_mark_dynamic_ref bfd_elf_gc_mark_dynamic_ref_symbol #endif #ifndef elf_backend_gc_mark_hook -#define elf_backend_gc_mark_hook NULL +#define elf_backend_gc_mark_hook _bfd_elf_gc_mark_hook +#endif +#ifndef elf_backend_gc_mark_extra_sections +#define elf_backend_gc_mark_extra_sections NULL #endif #ifndef elf_backend_gc_sweep_hook #define elf_backend_gc_sweep_hook NULL @@ -283,6 +291,10 @@ #define elf_info_to_howto_rel 0 #endif +#ifndef ELF_OSABI +#define ELF_OSABI ELFOSABI_NONE +#endif + #ifndef ELF_MAXPAGESIZE #error ELF_MAXPAGESIZE is not defined #define ELF_MAXPAGESIZE 1 @@ -292,6 +304,10 @@ #define ELF_MINPAGESIZE ELF_MAXPAGESIZE #endif +#ifndef ELF_COMMONPAGESIZE +#define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE +#endif + #ifndef ELF_DYNAMIC_SEC_FLAGS /* Note that we set the SEC_IN_MEMORY flag for these sections. */ #define ELF_DYNAMIC_SEC_FLAGS \ @@ -366,6 +382,9 @@ #ifndef elf_backend_check_directives #define elf_backend_check_directives 0 #endif +#ifndef elf_backend_as_needed_cleanup +#define elf_backend_as_needed_cleanup 0 +#endif #ifndef elf_backend_adjust_dynamic_symbol #define elf_backend_adjust_dynamic_symbol 0 #endif @@ -375,6 +394,10 @@ #ifndef elf_backend_size_dynamic_sections #define elf_backend_size_dynamic_sections 0 #endif +#ifndef elf_backend_init_index_section +#define elf_backend_init_index_section \ + ((void (*) (bfd *, struct bfd_link_info *)) bfd_void) +#endif #ifndef elf_backend_relocate_section #define elf_backend_relocate_section 0 #endif @@ -396,6 +419,9 @@ #ifndef elf_backend_modify_segment_map #define elf_backend_modify_segment_map 0 #endif +#ifndef elf_backend_modify_program_headers +#define elf_backend_modify_program_headers 0 +#endif #ifndef elf_backend_ecoff_debug_swap #define elf_backend_ecoff_debug_swap 0 #endif @@ -405,12 +431,27 @@ #ifndef elf_backend_got_header_size #define elf_backend_got_header_size 0 #endif +#ifndef elf_backend_obj_attrs_vendor +#define elf_backend_obj_attrs_vendor NULL +#endif +#ifndef elf_backend_obj_attrs_section +#define elf_backend_obj_attrs_section NULL +#endif +#ifndef elf_backend_obj_attrs_arg_type +#define elf_backend_obj_attrs_arg_type NULL +#endif +#ifndef elf_backend_obj_attrs_section_type +#define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES +#endif #ifndef elf_backend_post_process_headers #define elf_backend_post_process_headers NULL #endif #ifndef elf_backend_print_symbol_all #define elf_backend_print_symbol_all NULL #endif +#ifndef elf_backend_output_arch_local_syms +#define elf_backend_output_arch_local_syms NULL +#endif #ifndef elf_backend_output_arch_syms #define elf_backend_output_arch_syms NULL #endif @@ -441,6 +482,9 @@ #ifndef elf_backend_grok_psinfo #define elf_backend_grok_psinfo NULL #endif +#ifndef elf_backend_write_core_note +#define elf_backend_write_core_note NULL +#endif #ifndef elf_backend_sprintf_vma #define elf_backend_sprintf_vma _bfd_elf_sprintf_vma #endif @@ -551,15 +595,24 @@ #define elf_backend_merge_symbol NULL #endif +#ifndef elf_backend_hash_symbol +#define elf_backend_hash_symbol _bfd_elf_hash_symbol +#endif + +#ifndef elf_backend_is_function_type +#define elf_backend_is_function_type _bfd_elf_is_function_type +#endif + extern const struct elf_size_info _bfd_elfNN_size_info; -#ifndef INCLUDED_TARGET_FILE -static const struct elf_backend_data elfNN_bed = +static struct elf_backend_data elfNN_bed = { ELF_ARCH, /* arch */ ELF_MACHINE_CODE, /* elf_machine_code */ + ELF_OSABI, /* elf_osabi */ ELF_MAXPAGESIZE, /* maxpagesize */ ELF_MINPAGESIZE, /* minpagesize */ + ELF_COMMONPAGESIZE, /* commonpagesize */ ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */ elf_info_to_howto, elf_info_to_howto_rel, @@ -583,9 +636,11 @@ static const struct elf_backend_data elfNN_bed = elf_backend_omit_section_dynsym, elf_backend_check_relocs, elf_backend_check_directives, + elf_backend_as_needed_cleanup, elf_backend_adjust_dynamic_symbol, elf_backend_always_size_sections, elf_backend_size_dynamic_sections, + elf_backend_init_index_section, elf_backend_relocate_section, elf_backend_finish_dynamic_symbol, elf_backend_finish_dynamic_sections, @@ -593,11 +648,14 @@ static const struct elf_backend_data elfNN_bed = elf_backend_final_write_processing, elf_backend_additional_program_headers, elf_backend_modify_segment_map, + elf_backend_modify_program_headers, elf_backend_gc_mark_dynamic_ref, elf_backend_gc_mark_hook, + elf_backend_gc_mark_extra_sections, elf_backend_gc_sweep_hook, elf_backend_post_process_headers, elf_backend_print_symbol_all, + elf_backend_output_arch_local_syms, elf_backend_output_arch_syms, elf_backend_copy_indirect_symbol, elf_backend_hide_symbol, @@ -608,6 +666,7 @@ static const struct elf_backend_data elfNN_bed = elf_backend_count_relocs, elf_backend_grok_prstatus, elf_backend_grok_psinfo, + elf_backend_write_core_note, elf_backend_sprintf_vma, elf_backend_fprintf_vma, elf_backend_reloc_type_class, @@ -628,6 +687,8 @@ static const struct elf_backend_data elfNN_bed = elf_backend_common_section_index, elf_backend_common_section, elf_backend_merge_symbol, + elf_backend_hash_symbol, + elf_backend_is_function_type, elf_backend_link_order_error_handler, elf_backend_relplt_name, ELF_MACHINE_ALT1, @@ -635,6 +696,10 @@ static const struct elf_backend_data elfNN_bed = &elf_backend_size_info, elf_backend_special_sections, elf_backend_got_header_size, + elf_backend_obj_attrs_vendor, + elf_backend_obj_attrs_section, + elf_backend_obj_attrs_arg_type, + elf_backend_obj_attrs_section_type, elf_backend_collect, elf_backend_type_change_ok, elf_backend_may_use_rel_p, @@ -651,9 +716,9 @@ static const struct elf_backend_data elfNN_bed = elf_backend_can_refcount, elf_backend_want_got_sym, elf_backend_want_dynbss, - elf_backend_want_p_paddr_set_to_zero + elf_backend_want_p_paddr_set_to_zero, + elf_backend_default_execstack }; -#endif /* Forward declaration for use when initialising alternative_target field. */ #ifdef TARGET_LITTLE_SYM diff --git a/contrib/binutils/bfd/format.c b/contrib/binutils/bfd/format.c index 6a34dd2bea4..51438984353 100644 --- a/contrib/binutils/bfd/format.c +++ b/contrib/binutils/bfd/format.c @@ -1,6 +1,6 @@ /* Generic BFD support for file formats. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, - 2003, 2005 Free Software Foundation, Inc. + 2003, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -42,8 +42,8 @@ SUBSECTION File format functions */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* IMPORT from targets.c. */ diff --git a/contrib/binutils/bfd/freebsd.h b/contrib/binutils/bfd/freebsd.h index 5bc5bbcaa90..67e67fc69c9 100644 --- a/contrib/binutils/bfd/freebsd.h +++ b/contrib/binutils/bfd/freebsd.h @@ -1,5 +1,5 @@ /* BFD back-end definitions used by all FreeBSD targets. - Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001, 2002, 2005 + Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -60,8 +60,8 @@ ((exec).a_info = \ ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26)) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/contrib/binutils/bfd/gen-aout.c b/contrib/binutils/bfd/gen-aout.c index c81d3d0027b..80e90c05eae 100644 --- a/contrib/binutils/bfd/gen-aout.c +++ b/contrib/binutils/bfd/gen-aout.c @@ -1,5 +1,5 @@ /* Generate parameters for an a.out system. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -99,8 +99,8 @@ main (argc, argv) printf("\n#define MY(OP) CONCAT2 (%s_,OP)\n\n", target); printf("#define TARGETNAME \"a.out-%s\"\n\n", target); - printf("#include \"bfd.h\"\n"); printf("#include \"sysdep.h\"\n"); + printf("#include \"bfd.h\"\n"); printf("#include \"libbfd.h\"\n"); printf("#include \"libaout.h\"\n"); printf("\n#include \"aout-target.h\"\n"); diff --git a/contrib/binutils/bfd/hash.c b/contrib/binutils/bfd/hash.c index ce9ba5c6297..2b67dc5eb02 100644 --- a/contrib/binutils/bfd/hash.c +++ b/contrib/binutils/bfd/hash.c @@ -1,6 +1,6 @@ /* hash.c -- hash table routines for BFD Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "objalloc.h" #include "libiberty.h" @@ -299,6 +299,58 @@ SUBSUBSECTION /* The default number of entries to use when creating a hash table. */ #define DEFAULT_SIZE 4051 + +/* The following function returns a nearest prime number which is + greater than N, and near a power of two. Copied from libiberty. + Returns zero for ridiculously large N to signify an error. */ + +static unsigned long +higher_prime_number (unsigned long n) +{ + /* These are primes that are near, but slightly smaller than, a + power of two. */ + static const unsigned long primes[] = { + (unsigned long) 127, + (unsigned long) 2039, + (unsigned long) 32749, + (unsigned long) 65521, + (unsigned long) 131071, + (unsigned long) 262139, + (unsigned long) 524287, + (unsigned long) 1048573, + (unsigned long) 2097143, + (unsigned long) 4194301, + (unsigned long) 8388593, + (unsigned long) 16777213, + (unsigned long) 33554393, + (unsigned long) 67108859, + (unsigned long) 134217689, + (unsigned long) 268435399, + (unsigned long) 536870909, + (unsigned long) 1073741789, + (unsigned long) 2147483647, + /* 4294967291L */ + ((unsigned long) 2147483647) + ((unsigned long) 2147483644), + }; + + const unsigned long *low = &primes[0]; + const unsigned long *high = &primes[sizeof (primes) / sizeof (primes[0])]; + + while (low != high) + { + const unsigned long *mid = low + (high - low) / 2; + if (n >= *mid) + low = mid + 1; + else + high = mid; + } + + if (n >= *low) + return 0; + + return *low; +} + static size_t bfd_default_hash_table_size = DEFAULT_SIZE; /* Create a new hash table, given a number of entries. */ @@ -330,6 +382,8 @@ bfd_hash_table_init_n (struct bfd_hash_table *table, memset ((void *) table->table, 0, alloc); table->size = size; table->entsize = entsize; + table->count = 0; + table->frozen = 0; table->newfunc = newfunc; return TRUE; } @@ -416,6 +470,45 @@ bfd_hash_lookup (struct bfd_hash_table *table, hashp->hash = hash; hashp->next = table->table[index]; table->table[index] = hashp; + table->count++; + + if (!table->frozen && table->count > table->size * 3 / 4) + { + unsigned long newsize = higher_prime_number (table->size); + struct bfd_hash_entry **newtable; + unsigned int hi; + unsigned long alloc = newsize * sizeof (struct bfd_hash_entry *); + + /* If we can't find a higher prime, or we can't possibly alloc + that much memory, don't try to grow the table. */ + if (newsize == 0 || alloc / sizeof (struct bfd_hash_entry *) != newsize) + { + table->frozen = 1; + return hashp; + } + + newtable = ((struct bfd_hash_entry **) + objalloc_alloc ((struct objalloc *) table->memory, alloc)); + memset ((PTR) newtable, 0, alloc); + + for (hi = 0; hi < table->size; hi ++) + while (table->table[hi]) + { + struct bfd_hash_entry *chain = table->table[hi]; + struct bfd_hash_entry *chain_end = chain; + int index; + + while (chain_end->next && chain_end->next->hash == chain->hash) + chain_end = chain_end->next; + + table->table[hi] = chain_end->next; + index = chain->hash % newsize; + chain_end->next = newtable[index]; + newtable[index] = chain; + } + table->table = newtable; + table->size = newsize; + } return hashp; } @@ -480,14 +573,17 @@ bfd_hash_traverse (struct bfd_hash_table *table, { unsigned int i; + table->frozen = 1; for (i = 0; i < table->size; i++) { struct bfd_hash_entry *p; for (p = table->table[i]; p != NULL; p = p->next) if (! (*func) (p, info)) - return; + goto out; } + out: + table->frozen = 0; } void diff --git a/contrib/binutils/bfd/host-aout.c b/contrib/binutils/bfd/host-aout.c index 902a0206696..12e59510d86 100644 --- a/contrib/binutils/bfd/host-aout.c +++ b/contrib/binutils/bfd/host-aout.c @@ -1,5 +1,5 @@ /* BFD backend for local host's a.out binaries - Copyright 1990, 1991, 1992, 1994, 1995, 2001 + Copyright 1990, 1991, 1992, 1994, 1995, 2001, 2007 Free Software Foundation, Inc. Written by Cygnus Support. Probably John Gilmore's fault. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #define ARCH_SIZE 32 diff --git a/contrib/binutils/bfd/i386aout.c b/contrib/binutils/bfd/i386aout.c index 128e9d20dc0..936ffb21de1 100644 --- a/contrib/binutils/bfd/i386aout.c +++ b/contrib/binutils/bfd/i386aout.c @@ -1,6 +1,6 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003, 2005, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -39,8 +39,8 @@ #define TARGETNAME "a.out-i386" #define NO_WRITE_HEADER_KLUDGE 1 -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "libaout.h" diff --git a/contrib/binutils/bfd/i386bsd.c b/contrib/binutils/bfd/i386bsd.c index 3f98ee4025c..f8b109edae7 100644 --- a/contrib/binutils/bfd/i386bsd.c +++ b/contrib/binutils/bfd/i386bsd.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries under BSD. - Copyright 1990, 1991, 1992, 1993, 1994, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 2001, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -42,8 +42,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MY(OP) CONCAT2 (i386bsd_,OP) #define TARGETNAME "a.out-i386-bsd" -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/contrib/binutils/bfd/i386linux.c b/contrib/binutils/bfd/i386linux.c index 17c618006ff..83f9965a3c3 100644 --- a/contrib/binutils/bfd/i386linux.c +++ b/contrib/binutils/bfd/i386linux.c @@ -1,6 +1,6 @@ /* BFD back-end for linux flavored i386 a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003, - 2004, 2006 Free Software Foundation, Inc. + 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define MACHTYPE_OK(mtype) ((mtype) == M_386 || (mtype) == M_UNKNOWN) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -93,8 +93,7 @@ i386linux_write_object_contents (abfd) #define GOT_REF_PREFIX "__GOT_" #endif -#define IS_GOT_SYM(name) \ - (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) +#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX)) /* See if a symbol name is a reference to the procedure linkage table. */ @@ -102,8 +101,7 @@ i386linux_write_object_contents (abfd) #define PLT_REF_PREFIX "__PLT_" #endif -#define IS_PLT_SYM(name) \ - (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0) +#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX)) /* This string is used to generate specialized error messages. */ @@ -312,9 +310,8 @@ linux_link_create_dynamic_sections (abfd, info) /* We choose to use the name ".linux-dynamic" for the fixup table. Why not? */ - s = bfd_make_section (abfd, ".linux-dynamic"); + s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; s->size = 0; @@ -442,8 +439,7 @@ linux_tally_symbols (h, data) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_undefined - && strncmp (h->root.root.root.string, NEEDS_SHRLIB, - sizeof NEEDS_SHRLIB - 1) == 0) + && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { const char *name; char *p; diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c index be8455c617f..727869e669c 100644 --- a/contrib/binutils/bfd/ieee.c +++ b/contrib/binutils/bfd/ieee.c @@ -1,6 +1,6 @@ /* BFD back-end for ieee-695 objects. 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. Written by Steve Chamberlain of Cygnus Support. @@ -27,8 +27,8 @@ token (which is one byte in this lexicon) lookahead recursive decent parser. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "ieee.h" #include "libieee.h" @@ -370,7 +370,7 @@ parse_int (common_header_type *ieee, bfd_vma *value_ptr) static int parse_i (common_header_type *ieee, bfd_boolean *ok) { - bfd_vma x; + bfd_vma x = 0; *ok = parse_int (ieee, &x); return x; } @@ -378,7 +378,7 @@ parse_i (common_header_type *ieee, bfd_boolean *ok) static bfd_vma must_parse_int (common_header_type *ieee) { - bfd_vma result; + bfd_vma result = 0; BFD_ASSERT (parse_int (ieee, &result)); return result; } @@ -767,7 +767,7 @@ ieee_slurp_external_symbols (bfd *abfd) unsigned int symbol_name_index; unsigned int symbol_type_index; unsigned int symbol_attribute_def; - bfd_vma value; + bfd_vma value = 0; switch (read_2bytes (&ieee->h)) { @@ -1080,7 +1080,6 @@ get_section_entry (bfd *abfd, ieee_data_type *ieee, unsigned int index) sprintf (tmp, " fsec%4d", index); section = bfd_make_section (abfd, tmp); ieee->section_table[index] = section; - section->flags = SEC_NO_FLAGS; section->target_index = index; ieee->section_table[index] = section; } @@ -1268,14 +1267,15 @@ ieee_slurp_debug (bfd *abfd) ieee_data_type *ieee = IEEE_DATA (abfd); asection *sec; file_ptr debug_end; + flagword flags; if (ieee->w.r.debug_information_part == 0) return TRUE; - sec = bfd_make_section (abfd, ".debug"); + flags = SEC_DEBUGGING | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".debug", flags); if (sec == NULL) return FALSE; - sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS; sec->filepos = ieee->w.r.debug_information_part; debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part); @@ -1875,8 +1875,8 @@ ieee_object_p (bfd *abfd) family[9] = '\0'; } } - else if ((strncmp (processor, "cpu32", 5) == 0) /* CPU32 and CPU32+ */ - || (strncmp (processor, "CPU32", 5) == 0)) + else if ((CONST_STRNEQ (processor, "cpu32")) /* CPU32 and CPU32+ */ + || (CONST_STRNEQ (processor, "CPU32"))) strcpy (family, "68332"); else { @@ -2014,12 +2014,15 @@ ieee_print_symbol (bfd *abfd, static bfd_boolean ieee_new_section_hook (bfd *abfd, asection *newsect) { - newsect->used_by_bfd = bfd_alloc (abfd, (bfd_size_type) sizeof (ieee_per_section_type)); if (!newsect->used_by_bfd) - return FALSE; + { + newsect->used_by_bfd = bfd_alloc (abfd, sizeof (ieee_per_section_type)); + if (!newsect->used_by_bfd) + return FALSE; + } ieee_per_section (newsect)->data = NULL; ieee_per_section (newsect)->section = newsect; - return TRUE; + return _bfd_generic_new_section_hook (abfd, newsect); } static long @@ -3712,7 +3715,7 @@ ieee_generic_stat_arch_elt (bfd *abfd, struct stat *buf) static int ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean x ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -3744,6 +3747,7 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ieee_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define ieee_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define ieee_set_arch_mach _bfd_generic_set_arch_mach diff --git a/contrib/binutils/bfd/ihex.c b/contrib/binutils/bfd/ihex.c index fb2ab96c99e..9f765b33f77 100644 --- a/contrib/binutils/bfd/ihex.c +++ b/contrib/binutils/bfd/ihex.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel Hex objects. - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -118,8 +118,8 @@ The MRI compiler uses this, which is a repeat of type 5: 18..19 Checksum in hex notation 20..21 Carriage return, line feed. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "safe-ctype.h" @@ -355,6 +355,7 @@ ihex_scan (bfd *abfd) char secbuf[20]; char *secname; bfd_size_type amt; + flagword flags; sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1); amt = strlen (secbuf) + 1; @@ -362,10 +363,10 @@ ihex_scan (bfd *abfd) if (secname == NULL) goto error_return; strcpy (secname, secbuf); - sec = bfd_make_section (abfd, secname); + flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; + sec = bfd_make_section_with_flags (abfd, secname, flags); if (sec == NULL) goto error_return; - sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; sec->vma = extbase + segbase + addr; sec->lma = extbase + segbase + addr; sec->size = len; @@ -553,7 +554,6 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents) { char hdr[8]; unsigned int len; - bfd_vma addr; unsigned int type; unsigned int i; @@ -568,7 +568,6 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents) goto error_return; len = HEX2 (hdr); - addr = HEX4 (hdr + 2); type = HEX2 (hdr + 6); /* We should only see type 0 records here. */ @@ -900,7 +899,8 @@ ihex_set_arch_mach (bfd *abfd, /* Get the size of the headers, for the linker. */ static int -ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUSED) +ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -924,9 +924,6 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean exec ATTRIBUTE_UNUS #define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols #define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol -#define ihex_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l) -#define ihex_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l) -#define ihex_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define ihex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define ihex_bfd_relax_section bfd_generic_relax_section #define ihex_bfd_gc_sections bfd_generic_gc_sections @@ -985,7 +982,7 @@ const bfd_target ihex_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (ihex), - BFD_JUMP_TABLE_RELOCS (ihex), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (ihex), BFD_JUMP_TABLE_LINK (ihex), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/contrib/binutils/bfd/init.c b/contrib/binutils/bfd/init.c index a34acbf9faf..49f5533f2e2 100644 --- a/contrib/binutils/bfd/init.c +++ b/contrib/binutils/bfd/init.c @@ -1,5 +1,5 @@ /* bfd initialization stuff - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2003 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2003, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" /* diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h index bb3ee808267..879de1380bd 100644 --- a/contrib/binutils/bfd/libaout.h +++ b/contrib/binutils/bfd/libaout.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for a.out (and similar) files. 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. Written by Cygnus Support. @@ -525,6 +525,9 @@ extern void NAME (aout, swap_std_reloc_in) extern reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type * NAME (aout, reloc_name_lookup) + (bfd *, const char *); + extern bfd_boolean NAME (aout, slurp_reloc_table) (bfd *, sec_ptr, asymbol **); @@ -557,7 +560,7 @@ extern asymbol * NAME (aout, minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, asymbol *); extern int NAME (aout, sizeof_headers) - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean NAME (aout, adjust_sizes_and_vmas) (bfd *, bfd_size_type *, file_ptr *); diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h index ee2484f25c1..3555e6a8eef 100644 --- a/contrib/binutils/bfd/libbfd-in.h +++ b/contrib/binutils/bfd/libbfd-in.h @@ -2,7 +2,7 @@ (This include file is not for users of the library.) Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -155,6 +155,8 @@ bfd * _bfd_new_bfd (void); void _bfd_delete_bfd (bfd *); +bfd_boolean _bfd_free_cached_info + (bfd *); bfd_boolean bfd_false (bfd *ignore); @@ -215,8 +217,8 @@ int bfd_generic_stat_arch_elt #define _bfd_generic_close_and_cleanup bfd_true #define _bfd_generic_bfd_free_cached_info bfd_true -#define _bfd_generic_new_section_hook \ - ((bfd_boolean (*) (bfd *, asection *)) bfd_true) +extern bfd_boolean _bfd_generic_new_section_hook + (bfd *, asection *); extern bfd_boolean _bfd_generic_get_section_contents (bfd *, asection *, void *, file_ptr, bfd_size_type); extern bfd_boolean _bfd_generic_get_section_contents_in_window @@ -346,12 +348,13 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ -#define _bfd_norelocs_get_reloc_upper_bound \ - ((long (*) (bfd *, asection *)) _bfd_n1) -#define _bfd_norelocs_canonicalize_reloc \ - ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1) +extern long _bfd_norelocs_get_reloc_upper_bound (bfd *, asection *); +extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, + arelent **, asymbol **); #define _bfd_norelocs_bfd_reloc_type_lookup \ ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) +#define _bfd_norelocs_bfd_reloc_name_lookup \ + ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ @@ -373,7 +376,8 @@ extern bfd_boolean _bfd_generic_set_section_contents /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0) +#define _bfd_nolink_sizeof_headers \ + ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) #define _bfd_nolink_bfd_get_relocated_section_contents \ ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ bfd_byte *, bfd_boolean, asymbol **)) \ @@ -407,7 +411,7 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nolink_bfd_link_split_section \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) #define _bfd_nolink_section_already_linked \ - ((void (*) (bfd *, struct bfd_section *)) bfd_void) + ((void (*) (bfd *, struct bfd_section *, struct bfd_link_info *)) bfd_void) /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC @@ -521,7 +525,7 @@ extern bfd_boolean _bfd_generic_link_split_section (bfd *, struct bfd_section *); extern void _bfd_generic_section_already_linked - (bfd *, struct bfd_section *); + (bfd *, struct bfd_section *, struct bfd_link_info *); /* Generic reloc_link_order processing routine. */ extern bfd_boolean _bfd_generic_reloc_link_order @@ -544,6 +548,10 @@ extern bfd_reloc_status_type _bfd_final_link_relocate extern bfd_reloc_status_type _bfd_relocate_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *); +/* Clear a given location using a given howto. */ +extern void _bfd_clear_contents (reloc_howto_type *howto, bfd *input_bfd, + bfd_byte *location); + /* Link stabs in sections in the first pass. */ extern bfd_boolean _bfd_link_section_stabs diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c index 57cfabcd460..7dada1cbf53 100644 --- a/contrib/binutils/bfd/libbfd.c +++ b/contrib/binutils/bfd/libbfd.c @@ -1,6 +1,6 @@ /* Assorted BFD support routines, only used internally. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifndef HAVE_GETPAGESIZE @@ -103,6 +103,23 @@ bfd_void (bfd *ignore ATTRIBUTE_UNUSED) { } +long +_bfd_norelocs_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED) +{ + return sizeof (arelent *); +} + +long +_bfd_norelocs_canonicalize_reloc (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + arelent **relptr, + asymbol **symbols ATTRIBUTE_UNUSED) +{ + *relptr = NULL; + return 0; +} + bfd_boolean _bfd_nocore_core_file_matches_executable_p (bfd *ignore_core_bfd ATTRIBUTE_UNUSED, diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h index 2a590a395a5..4c1414f826f 100644 --- a/contrib/binutils/bfd/libbfd.h +++ b/contrib/binutils/bfd/libbfd.h @@ -7,7 +7,7 @@ (This include file is not for users of the library.) Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -160,6 +160,8 @@ bfd * _bfd_new_bfd (void); void _bfd_delete_bfd (bfd *); +bfd_boolean _bfd_free_cached_info + (bfd *); bfd_boolean bfd_false (bfd *ignore); @@ -220,8 +222,8 @@ int bfd_generic_stat_arch_elt #define _bfd_generic_close_and_cleanup bfd_true #define _bfd_generic_bfd_free_cached_info bfd_true -#define _bfd_generic_new_section_hook \ - ((bfd_boolean (*) (bfd *, asection *)) bfd_true) +extern bfd_boolean _bfd_generic_new_section_hook + (bfd *, asection *); extern bfd_boolean _bfd_generic_get_section_contents (bfd *, asection *, void *, file_ptr, bfd_size_type); extern bfd_boolean _bfd_generic_get_section_contents_in_window @@ -351,12 +353,13 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ -#define _bfd_norelocs_get_reloc_upper_bound \ - ((long (*) (bfd *, asection *)) _bfd_n1) -#define _bfd_norelocs_canonicalize_reloc \ - ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1) +extern long _bfd_norelocs_get_reloc_upper_bound (bfd *, asection *); +extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, + arelent **, asymbol **); #define _bfd_norelocs_bfd_reloc_type_lookup \ ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) +#define _bfd_norelocs_bfd_reloc_name_lookup \ + ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ @@ -378,7 +381,8 @@ extern bfd_boolean _bfd_generic_set_section_contents /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0) +#define _bfd_nolink_sizeof_headers \ + ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) #define _bfd_nolink_bfd_get_relocated_section_contents \ ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ bfd_byte *, bfd_boolean, asymbol **)) \ @@ -412,7 +416,7 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nolink_bfd_link_split_section \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) #define _bfd_nolink_section_already_linked \ - ((void (*) (bfd *, struct bfd_section *)) bfd_void) + ((void (*) (bfd *, struct bfd_section *, struct bfd_link_info *)) bfd_void) /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC @@ -526,7 +530,7 @@ extern bfd_boolean _bfd_generic_link_split_section (bfd *, struct bfd_section *); extern void _bfd_generic_section_already_linked - (bfd *, struct bfd_section *); + (bfd *, struct bfd_section *, struct bfd_link_info *); /* Generic reloc_link_order processing routine. */ extern bfd_boolean _bfd_generic_reloc_link_order @@ -549,6 +553,10 @@ extern bfd_reloc_status_type _bfd_final_link_relocate extern bfd_reloc_status_type _bfd_relocate_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *); +/* Clear a given location using a given howto. */ +extern void _bfd_clear_contents (reloc_howto_type *howto, bfd *input_bfd, + bfd_byte *location); + /* Link stabs in sections in the first pass. */ extern bfd_boolean _bfd_link_section_stabs @@ -899,6 +907,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_TLS_DTPOFF64", "BFD_RELOC_SPARC_TLS_TPOFF32", "BFD_RELOC_SPARC_TLS_TPOFF64", + "BFD_RELOC_SPU_IMM7", + "BFD_RELOC_SPU_IMM8", + "BFD_RELOC_SPU_IMM10", + "BFD_RELOC_SPU_IMM10W", + "BFD_RELOC_SPU_IMM16", + "BFD_RELOC_SPU_IMM16W", + "BFD_RELOC_SPU_IMM18", + "BFD_RELOC_SPU_PCREL9a", + "BFD_RELOC_SPU_PCREL9b", + "BFD_RELOC_SPU_PCREL16", + "BFD_RELOC_SPU_LO16", + "BFD_RELOC_SPU_HI16", + "BFD_RELOC_SPU_PPU32", + "BFD_RELOC_SPU_PPU64", "BFD_RELOC_ALPHA_GPDISP_HI16", "BFD_RELOC_ALPHA_GPDISP_LO16", "BFD_RELOC_ALPHA_GPDISP", @@ -1206,6 +1228,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARM_SBREL32", "BFD_RELOC_ARM_TARGET2", "BFD_RELOC_ARM_PREL31", + "BFD_RELOC_ARM_MOVW", + "BFD_RELOC_ARM_MOVT", + "BFD_RELOC_ARM_MOVW_PCREL", + "BFD_RELOC_ARM_MOVT_PCREL", + "BFD_RELOC_ARM_THUMB_MOVW", + "BFD_RELOC_ARM_THUMB_MOVT", + "BFD_RELOC_ARM_THUMB_MOVW_PCREL", + "BFD_RELOC_ARM_THUMB_MOVT_PCREL", "BFD_RELOC_ARM_JUMP_SLOT", "BFD_RELOC_ARM_GLOB_DAT", "BFD_RELOC_ARM_GOT32", @@ -1221,9 +1251,38 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARM_TLS_TPOFF32", "BFD_RELOC_ARM_TLS_IE32", "BFD_RELOC_ARM_TLS_LE32", + "BFD_RELOC_ARM_ALU_PC_G0_NC", + "BFD_RELOC_ARM_ALU_PC_G0", + "BFD_RELOC_ARM_ALU_PC_G1_NC", + "BFD_RELOC_ARM_ALU_PC_G1", + "BFD_RELOC_ARM_ALU_PC_G2", + "BFD_RELOC_ARM_LDR_PC_G0", + "BFD_RELOC_ARM_LDR_PC_G1", + "BFD_RELOC_ARM_LDR_PC_G2", + "BFD_RELOC_ARM_LDRS_PC_G0", + "BFD_RELOC_ARM_LDRS_PC_G1", + "BFD_RELOC_ARM_LDRS_PC_G2", + "BFD_RELOC_ARM_LDC_PC_G0", + "BFD_RELOC_ARM_LDC_PC_G1", + "BFD_RELOC_ARM_LDC_PC_G2", + "BFD_RELOC_ARM_ALU_SB_G0_NC", + "BFD_RELOC_ARM_ALU_SB_G0", + "BFD_RELOC_ARM_ALU_SB_G1_NC", + "BFD_RELOC_ARM_ALU_SB_G1", + "BFD_RELOC_ARM_ALU_SB_G2", + "BFD_RELOC_ARM_LDR_SB_G0", + "BFD_RELOC_ARM_LDR_SB_G1", + "BFD_RELOC_ARM_LDR_SB_G2", + "BFD_RELOC_ARM_LDRS_SB_G0", + "BFD_RELOC_ARM_LDRS_SB_G1", + "BFD_RELOC_ARM_LDRS_SB_G2", + "BFD_RELOC_ARM_LDC_SB_G0", + "BFD_RELOC_ARM_LDC_SB_G1", + "BFD_RELOC_ARM_LDC_SB_G2", "BFD_RELOC_ARM_IMMEDIATE", "BFD_RELOC_ARM_ADRL_IMMEDIATE", "BFD_RELOC_ARM_T32_IMMEDIATE", + "BFD_RELOC_ARM_T32_ADD_IMM", "BFD_RELOC_ARM_T32_IMM12", "BFD_RELOC_ARM_T32_ADD_PC12", "BFD_RELOC_ARM_SHIFT_IMM", @@ -1473,6 +1532,27 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MCORE_PCREL_32", "BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2", "BFD_RELOC_MCORE_RVA", + "BFD_RELOC_MEP_8", + "BFD_RELOC_MEP_16", + "BFD_RELOC_MEP_32", + "BFD_RELOC_MEP_PCREL8A2", + "BFD_RELOC_MEP_PCREL12A2", + "BFD_RELOC_MEP_PCREL17A2", + "BFD_RELOC_MEP_PCREL24A2", + "BFD_RELOC_MEP_PCABS24A2", + "BFD_RELOC_MEP_LOW16", + "BFD_RELOC_MEP_HI16U", + "BFD_RELOC_MEP_HI16S", + "BFD_RELOC_MEP_GPREL", + "BFD_RELOC_MEP_TPREL", + "BFD_RELOC_MEP_TPREL7", + "BFD_RELOC_MEP_TPREL7A2", + "BFD_RELOC_MEP_TPREL7A4", + "BFD_RELOC_MEP_UIMM24", + "BFD_RELOC_MEP_ADDR24A4", + "BFD_RELOC_MEP_GNU_VTINHERIT", + "BFD_RELOC_MEP_GNU_VTENTRY", + "BFD_RELOC_MMIX_GETA", "BFD_RELOC_MMIX_GETA_1", "BFD_RELOC_MMIX_GETA_2", @@ -1509,7 +1589,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AVR_HH8_LDI_NEG", "BFD_RELOC_AVR_MS8_LDI_NEG", "BFD_RELOC_AVR_LO8_LDI_PM", + "BFD_RELOC_AVR_LO8_LDI_GS", "BFD_RELOC_AVR_HI8_LDI_PM", + "BFD_RELOC_AVR_HI8_LDI_GS", "BFD_RELOC_AVR_HH8_LDI_PM", "BFD_RELOC_AVR_LO8_LDI_PM_NEG", "BFD_RELOC_AVR_HI8_LDI_PM_NEG", @@ -1568,6 +1650,17 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_390_GOT20", "BFD_RELOC_390_GOTPLT20", "BFD_RELOC_390_TLS_GOTIE20", + "BFD_RELOC_SCORE_DUMMY1", + "BFD_RELOC_SCORE_GPREL15", + "BFD_RELOC_SCORE_DUMMY2", + "BFD_RELOC_SCORE_JMP", + "BFD_RELOC_SCORE_BRANCH", + "BFD_RELOC_SCORE16_JMP", + "BFD_RELOC_SCORE16_BRANCH", + "BFD_RELOC_SCORE_GOT15", + "BFD_RELOC_SCORE_GOT_LO16", + "BFD_RELOC_SCORE_CALL15", + "BFD_RELOC_SCORE_DUMMY_HI16", "BFD_RELOC_IP2K_FR9", "BFD_RELOC_IP2K_BANK", "BFD_RELOC_IP2K_ADDR16CJP", @@ -1712,6 +1805,33 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_16C_IMM24_C", "BFD_RELOC_16C_IMM32", "BFD_RELOC_16C_IMM32_C", + "BFD_RELOC_CR16_NUM8", + "BFD_RELOC_CR16_NUM16", + "BFD_RELOC_CR16_NUM32", + "BFD_RELOC_CR16_NUM32a", + "BFD_RELOC_CR16_REGREL0", + "BFD_RELOC_CR16_REGREL4", + "BFD_RELOC_CR16_REGREL4a", + "BFD_RELOC_CR16_REGREL14", + "BFD_RELOC_CR16_REGREL14a", + "BFD_RELOC_CR16_REGREL16", + "BFD_RELOC_CR16_REGREL20", + "BFD_RELOC_CR16_REGREL20a", + "BFD_RELOC_CR16_ABS20", + "BFD_RELOC_CR16_ABS24", + "BFD_RELOC_CR16_IMM4", + "BFD_RELOC_CR16_IMM8", + "BFD_RELOC_CR16_IMM16", + "BFD_RELOC_CR16_IMM20", + "BFD_RELOC_CR16_IMM24", + "BFD_RELOC_CR16_IMM32", + "BFD_RELOC_CR16_IMM32a", + "BFD_RELOC_CR16_DISP4", + "BFD_RELOC_CR16_DISP8", + "BFD_RELOC_CR16_DISP16", + "BFD_RELOC_CR16_DISP20", + "BFD_RELOC_CR16_DISP24", + "BFD_RELOC_CR16_DISP24a", "BFD_RELOC_CRX_REL4", "BFD_RELOC_CRX_REL8", "BFD_RELOC_CRX_REL8_CMP", @@ -1796,6 +1916,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_XSTORMY16_12", "BFD_RELOC_XSTORMY16_24", "BFD_RELOC_XSTORMY16_FPTR16", + "BFD_RELOC_RELC", + "BFD_RELOC_XC16X_PAG", "BFD_RELOC_XC16X_POF", "BFD_RELOC_XC16X_SEG", diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h index f2bc264b3b9..fdb1a59b814 100644 --- a/contrib/binutils/bfd/libcoff-in.h +++ b/contrib/binutils/bfd/libcoff-in.h @@ -348,7 +348,7 @@ extern bfd_boolean coff_find_nearest_line extern bfd_boolean coff_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_coff_reloc16_relax_section (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h index f756f30b1bf..e26fce06415 100644 --- a/contrib/binutils/bfd/libcoff.h +++ b/contrib/binutils/bfd/libcoff.h @@ -352,7 +352,7 @@ extern bfd_boolean coff_find_nearest_line extern bfd_boolean coff_find_inliner_info (bfd *, const char **, const char **, unsigned int *); extern int coff_sizeof_headers - (bfd *, bfd_boolean); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_coff_reloc16_relax_section (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents diff --git a/contrib/binutils/bfd/libecoff.h b/contrib/binutils/bfd/libecoff.h index 8c5e218ee58..165e75585a3 100644 --- a/contrib/binutils/bfd/libecoff.h +++ b/contrib/binutils/bfd/libecoff.h @@ -1,6 +1,6 @@ /* BFD ECOFF object file private structure. Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2006 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -301,7 +301,7 @@ extern bfd_boolean _bfd_ecoff_set_arch_mach extern bfd_boolean _bfd_ecoff_set_section_contents (bfd *, asection *, const void * location, file_ptr, bfd_size_type); -extern int _bfd_ecoff_sizeof_headers (bfd *, bfd_boolean); +extern int _bfd_ecoff_sizeof_headers (bfd *, struct bfd_link_info *); /* ecoff_bfd_get_relocated_section_contents defined by backend. */ /* ecoff_bfd_relax_section defined by backend. */ extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create diff --git a/contrib/binutils/bfd/libpei.h b/contrib/binutils/bfd/libpei.h index f0f6580fe4b..0e08e039bc0 100644 --- a/contrib/binutils/bfd/libpei.h +++ b/contrib/binutils/bfd/libpei.h @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI; common header information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. Written by Cygnus Solutions. @@ -204,7 +204,38 @@ #define PUT_SCNHDR_LNNOPTR H_PUT_32 #endif -#ifdef COFF_WITH_pep +#ifdef COFF_WITH_pex64 + +#define GET_OPTHDR_IMAGE_BASE H_GET_64 +#define PUT_OPTHDR_IMAGE_BASE H_PUT_64 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64 +#define GET_PDATA_ENTRY bfd_get_32 + +#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pex64_bfd_copy_private_bfd_data_common +#define _bfd_XX_bfd_copy_private_section_data _bfd_pex64_bfd_copy_private_section_data +#define _bfd_XX_get_symbol_info _bfd_pex64_get_symbol_info +#define _bfd_XX_only_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out +#define _bfd_XX_print_private_bfd_data_common _bfd_pex64_print_private_bfd_data_common +#define _bfd_XXi_final_link_postscript _bfd_pex64i_final_link_postscript +#define _bfd_XXi_only_swap_filehdr_out _bfd_pex64i_only_swap_filehdr_out +#define _bfd_XXi_swap_aouthdr_in _bfd_pex64i_swap_aouthdr_in +#define _bfd_XXi_swap_aouthdr_out _bfd_pex64i_swap_aouthdr_out +#define _bfd_XXi_swap_aux_in _bfd_pex64i_swap_aux_in +#define _bfd_XXi_swap_aux_out _bfd_pex64i_swap_aux_out +#define _bfd_XXi_swap_lineno_in _bfd_pex64i_swap_lineno_in +#define _bfd_XXi_swap_lineno_out _bfd_pex64i_swap_lineno_out +#define _bfd_XXi_swap_scnhdr_out _bfd_pex64i_swap_scnhdr_out +#define _bfd_XXi_swap_sym_in _bfd_pex64i_swap_sym_in +#define _bfd_XXi_swap_sym_out _bfd_pex64i_swap_sym_out + +#elif defined COFF_WITH_pep #define GET_OPTHDR_IMAGE_BASE H_GET_64 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64 @@ -224,7 +255,6 @@ #define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out #define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common #define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript -#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript #define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out #define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in #define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out @@ -256,7 +286,6 @@ #define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out #define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common #define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript -#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript #define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out #define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in #define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out @@ -270,10 +299,27 @@ #endif /* !COFF_WITH_pep */ -/* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file. */ -#define bfd_pe_executable_p(abfd) \ - (strncmp ((abfd)->xvec->name, "pei-", 4) == 0 \ - || strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0) +/* Returns true if the target is a PE executable target. */ +#define bfd_target_pei_p(xvec) \ + (CONST_STRNEQ ((xvec)->name, "pei-")) + +/* Return the arch string of a PE executable target. */ +#define bfd_target_pei_arch(xvec) \ + ((xvec)->name + sizeof ("pei-") - 1) + +/* Returns true if the target is an EFI target. */ +#define bfd_target_efi_p(xvec) \ + (CONST_STRNEQ ((xvec)->name, "efi-app-")) + +/* Return the arch string of an EFI target. */ +#define bfd_target_efi_arch(xvec) \ + ((xvec)->name + sizeof ("efi-app-") - 1) + +/* Macro: Returns true if the bfd is a PE executable as opposed to a + PE object file. */ +#define bfd_pe_executable_p(abfd) \ + (bfd_target_pei_p ((abfd)->xvec) \ + || bfd_target_efi_p ((abfd)->xvec)) /* These functions are architecture dependent, and are in peicode.h: coff_swap_reloc_in diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c index 14eeae4df0c..497b5c23556 100644 --- a/contrib/binutils/bfd/linker.c +++ b/contrib/binutils/bfd/linker.c @@ -1,6 +1,7 @@ /* linker.c -- BFD linker routines Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -562,11 +563,11 @@ bfd_wrapped_link_hash_lookup (bfd *abfd, #undef WRAP -#undef REAL +#undef REAL #define REAL "__real_" if (*l == '_' - && strncmp (l, REAL, sizeof REAL - 1) == 0 + && CONST_STRNEQ (l, REAL) && bfd_hash_lookup (info->wrap_hash, l + sizeof REAL - 1, FALSE, FALSE) != NULL) { @@ -1659,8 +1660,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, s = name + 1; while (*s == '_') ++s; - if (s[0] == 'G' - && strncmp (s, CONS_PREFIX, CONS_PREFIX_LEN - 1) == 0) + if (s[0] == 'G' && CONST_STRNEQ (s, CONS_PREFIX)) { char c; @@ -2877,14 +2877,15 @@ FUNCTION bfd_section_already_linked SYNOPSIS - void bfd_section_already_linked (bfd *abfd, asection *sec); + void bfd_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info); DESCRIPTION Check if @var{sec} has been already linked during a reloceatable or final link. -.#define bfd_section_already_linked(abfd, sec) \ -. BFD_SEND (abfd, _section_already_linked, (abfd, sec)) +.#define bfd_section_already_linked(abfd, sec, info) \ +. BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) . */ @@ -2970,7 +2971,8 @@ bfd_section_already_linked_table_free (void) /* This is used on non-ELF inputs. */ void -_bfd_generic_section_already_linked (bfd *abfd, asection *sec) +_bfd_generic_section_already_linked (bfd *abfd, asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { flagword flags; const char *name; @@ -3074,7 +3076,7 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec) bfd_section_already_linked_table_insert (already_linked_list, sec); } -/* Convert symbols in excluded output sections to absolute. */ +/* Convert symbols in excluded output sections to use a kept section. */ static bfd_boolean fix_syms (struct bfd_link_hash_entry *h, void *data) @@ -3093,8 +3095,64 @@ fix_syms (struct bfd_link_hash_entry *h, void *data) && (s->output_section->flags & SEC_EXCLUDE) != 0 && bfd_section_removed_from_list (obfd, s->output_section)) { + asection *op, *op1; + h->u.def.value += s->output_offset + s->output_section->vma; - h->u.def.section = bfd_abs_section_ptr; + + /* Find preceding kept section. */ + for (op1 = s->output_section->prev; op1 != NULL; op1 = op1->prev) + if ((op1->flags & SEC_EXCLUDE) == 0 + && !bfd_section_removed_from_list (obfd, op1)) + break; + + /* Find following kept section. Start at prev->next because + other sections may have been added after S was removed. */ + if (s->output_section->prev != NULL) + op = s->output_section->prev->next; + else + op = s->output_section->owner->sections; + for (; op != NULL; op = op->next) + if ((op->flags & SEC_EXCLUDE) == 0 + && !bfd_section_removed_from_list (obfd, op)) + break; + + /* Choose better of two sections, based on flags. The idea + is to choose a section that will be in the same segment + as S would have been if it was kept. */ + if (op1 == NULL) + { + if (op == NULL) + op = bfd_abs_section_ptr; + } + else if (op == NULL) + op = op1; + else if (((op1->flags ^ op->flags) + & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0) + { + if (((op->flags ^ s->flags) + & (SEC_ALLOC | SEC_THREAD_LOCAL)) != 0) + op = op1; + } + else if (((op1->flags ^ op->flags) & SEC_READONLY) != 0) + { + if (((op->flags ^ s->flags) & SEC_READONLY) != 0) + op = op1; + } + else if (((op1->flags ^ op->flags) & SEC_CODE) != 0) + { + if (((op->flags ^ s->flags) & SEC_CODE) != 0) + op = op1; + } + else + { + /* Flags we care about are the same. Prefer the following + section if that will result in a positive valued sym. */ + if (h->u.def.value < op->vma) + op = op1; + } + + h->u.def.value -= op->vma; + h->u.def.section = op; } } diff --git a/contrib/binutils/bfd/mep-relocs.pl b/contrib/binutils/bfd/mep-relocs.pl new file mode 100755 index 00000000000..d227b8252c0 --- /dev/null +++ b/contrib/binutils/bfd/mep-relocs.pl @@ -0,0 +1,274 @@ +#!/usr/bin/perl +# -*- perl -*- +# +# Toshiba MeP Media Engine Relocation Generator +# Copyright (C) 2001, 2007 Free Software Foundation, Inc. +# This file is part of BFD. +# Originally written by DJ Delorie +# +# 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: Run this anywhere inside your source tree. It will read +# include/elf/mep.h and scan the comments therein. It will renumber +# the relocs to be sequential (this is needed so that bfd/elf32-mep.h +# works) if needed. It will then update the reloc list in bfd/reloc.c +# and the howto, mapping, and apply routines in bfd/elf32-mep.c. You +# can then regenerate bfd-in2.h and check everything in. + +# FIXME: After the relocation list is finalized, change this to +# *verify* the reloc list, rather than resequence it. + +while (! -f "include/elf/mep.h" && ! -f "bfd/reloc.c") { + chdir ".."; + $pwd = `pwd`; + if ($pwd !~ m@/.*/@) { + print STDERR "Cannot find include/elf/mep.h or bfd/reloc.h\n"; + exit 1; + } +} +$pwd = `pwd`; +print "srctop is $pwd"; + +printf "Reading include/elf/mep.h ...\n"; +open(MEPH, "include/elf/mep.h"); +open(MEPHO, "> include/elf/mep.h.new") || die("mep.h.new create: $!"); +$val = 0; +while () { + if (($pre,$rel,$rest) = /(.*RELOC_NUMBER \()([^,]+), *\d+(.*)/) { + $rest =~ s/[\r\n]+$//; + print (MEPHO "$pre$rel, $val$rest\n") || die("mep.h.new write: $!"); + $val ++; + $rel =~ s/R_MEP_//; + push(@relocs, $rel); + + $rest =~ s@.*/\* @@; + ($pattern, $sign, $attrs) = $rest =~ m@(.*) ([US]) (.*)\*/@; + $pattern =~ s/ //g; + push(@pattern, $pattern); + push(@sign, $sign); + push(@attrs, $attrs); + + printf "%4d $rel p=`$pattern' s=`$sign' a=`$attrs'\n", $#pattern; + + } else { + print(MEPHO) || die("mep.h.new write: $!"); + } +} +close(MEPH); +close(MEPHO) || die("mep.h.new close: $!"); + +&swapfile("include/elf/mep.h"); + +redo_file ("bfd/reloc.c", + "", + "ENUMDOC\n Toshiba Media Processor Relocations.\n\nCOMMENT\n", + "ENUM\n BFD_RELOC_MEP_%s\n", + ""); + +$autogen = " /* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */\n"; + +redo_file ("bfd/elf32-mep.c", + "MEPRELOC:HOWTO", + $autogen, + "MEPRELOC:END", + "", + "&emit_howto();", + "MEPRELOC:MAP", + $autogen, + "MEPRELOC:END", + "", + " MAP(%s);\n", + "MEPRELOC:APPLY", + $autogen, + "MEPRELOC:END", + "", + "&emit_apply();", + ); + +sub mask2shifts { + my ($mask) = @_; + my ($bits, $left, $right, $ci, $c, $cv); + $bits = 0; + $left = 0; + $right = 32; + for ($ci=0; $ci 9; + $right = $cv unless $right < $cv; + $bits = $cv+1 unless $bits > $cv+1; + } + $mask =~ tr/-/1/c; + $mask =~ tr/-/0/; + ($rmask = $mask) =~ tr/01/10/; + $mask = unpack("H*", pack("B*", $mask)); + $rmask = unpack("H*", pack("B*", $rmask)); + return ($bits, $left, $right, $mask, $rmask); +} + +sub emit_howto { + for ($i=2; $i<=$#relocs; $i++) { + $mask = $pattern[$i]; + + if (length($mask) == 8) { $bytesize = 0; } + elsif (length($mask) == 16) { $bytesize = 1; } + elsif (length($mask) == 32) { $bytesize = 2; } + + ($bits, $left, $right, $mask) = mask2shifts ($mask); + $bits[$i] = $bits; + $pcrel = 0; + $pcrel = 1 if $attrs[$i] =~ /pc-rel/i; + $overflow = $sign[$i]; + $overflow = 'N' if $attrs[$i] =~ /no-overflow/; + + $c = "$relocs[$i],"; + printf(NEW " MEPREL (R_MEP_%-10s%d,%3d,%2d,%2d,%2d,%2s, 0x%s),\n", + $c, $bytesize, $bits, $left, $right, $pcrel, $overflow, $mask); + } +} + +sub emit_apply { + for ($i=2; $i<=$#relocs; $i++) { + $v = "u"; + $v = "s" if $sign[$i] =~ /S/; + if (length($pattern[$i]) == 8) { + $e = ''; # no endian swap for bytes + } elsif ($pattern[$i] =~ /-/ || length($pattern[$i]) == 16) { + $e = '^e2'; # endian swap - 2byte words only + } else { + $e = '^e4' # endian swap for data + } + print NEW " case R_MEP_$relocs[$i]: /* $pattern[$i] */\n"; + if ($attrs[$i] =~ /tp-rel/i) { + print NEW " $v -= mep_tpoff_base(rel->r_offset);\n"; + } + if ($attrs[$i] =~ /gp-rel/i) { + print NEW " $v -= mep_sdaoff_base(rel->r_offset);\n"; + } + if ($attrs[$i] !~ /no-overflow/ && $bits[$i] < 32) { + if ($v eq "u") { + $max = (1 << $bits[$i]) - 1; + print NEW " if (u > $max) r = bfd_reloc_overflow;\n"; + } else { + $min = -(1 << ($bits[$i]-1)); + $max = (1 << ($bits[$i]-1)) - 1; + print NEW " if ($min > s || s > $max) r = bfd_reloc_overflow;\n"; + } + } + for ($b=0; $b $right) { $left -= $right; $right = 0; } + else { $right -= $left; $left = 0; } + + if ($mask ne "00") { + $bb = $b / 8; + print NEW " byte[$bb$e] = "; + print NEW "(byte[$bb$e] & 0x$rmask) | " if $rmask ne "00"; + if ($left) { + print NEW "(($v << $left) & 0x$mask)"; + } elsif ($right) { + print NEW "(($v >> $right) & 0x$mask)"; + } else { + print NEW "($v & 0x$mask)"; + } + print NEW ";\n"; + } + } + print NEW " break;\n"; + } +} + + +#----------------------------------------------------------------------------- + +sub redo_file { + my ($file, @control) = @_; + open(OLD, $file); + open(NEW, "> $file.new") || die("$file.new create: $!"); + + print "Scanning file $file ...\n"; + + while (1) { + $start = shift @control; + $prefix = shift @control; + $end = shift @control; + $suffix = shift @control; + $pattern = shift @control; + + if (!$start) { + print NEW while ; + last; + } + + print " looking for $start\n"; + while () { + print NEW; + last if /\Q$start\E/; + } + print "can't find $start\n" unless $_; + last unless $_; + + print NEW $prefix; + if ($pattern =~ /^\&/) { + eval $pattern; + die("$pattern: $@") if $@; + } else { + for $i (2..$#relocs) { + printf (NEW "$pattern", $relocs[$i]) || die("$file.new write: $!"); + $pattern =~ s/^ENUM\n/ENUMX\n/; + } + } + print NEW $suffix; + while () { + last if /\Q$end\E/; + } + print NEW; + } + + close(OLD); + close(NEW) || die("$file.new close: $!"); + &swapfile($file); +} + +#----------------------------------------------------------------------------- + +sub swapfile { + my ($f) = @_; + if ( ! -f "$f.save") { + system "cp $f $f.save"; + } + open(ORIG, $f); + open(NEW, "$f.new"); + while () { + $n = ; + if ($n ne $_) { + close(ORIG); + close(NEW); + print " Updating $f\n"; + rename "$f", "$f.old"; + rename "$f.new", "$f"; + return; + } + } + close(ORIG); + close(NEW); + print " No change to $f\n"; + unlink "$f.new"; +} diff --git a/contrib/binutils/bfd/merge.c b/contrib/binutils/bfd/merge.c index c1795d29112..71b31d378b5 100644 --- a/contrib/binutils/bfd/merge.c +++ b/contrib/binutils/bfd/merge.c @@ -1,5 +1,5 @@ /* SEC_MERGE support. - Copyright 2001, 2002, 2003, 2004, 2005, 2006 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Jakub Jelinek . @@ -22,8 +22,8 @@ /* This file contains support for merging duplicate entities within sections, as used in ELF SHF_MERGE. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "hashtab.h" #include "libiberty.h" @@ -766,7 +766,7 @@ _bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, the hash table at all. */ for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) if (secinfo->first_str == NULL) - secinfo->sec->flags |= SEC_EXCLUDE; + secinfo->sec->flags |= SEC_EXCLUDE | SEC_KEEP; } return TRUE; diff --git a/contrib/binutils/bfd/mipsbsd.c b/contrib/binutils/bfd/mipsbsd.c index b8621e486ae..6edb9728361 100644 --- a/contrib/binutils/bfd/mipsbsd.c +++ b/contrib/binutils/bfd/mipsbsd.c @@ -1,6 +1,6 @@ /* BFD backend for MIPS BSD (a.out) binaries. - Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2007 Free Software Foundation, Inc. Written by Ralph Campbell. This file is part of BFD, the Binary File Descriptor library. @@ -40,8 +40,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. the tokens. */ #define MY(OP) CONCAT2 (mipsbsd_,OP) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" @@ -56,7 +56,8 @@ static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); /* We can't use MY(x) here because it leads to a recursive call to CONCAT2 when expanded inside JUMP_TABLE. */ -#define MY_bfd_reloc_type_lookup mipsbsd_reloc_howto_type_lookup +#define MY_bfd_reloc_type_lookup mipsbsd_reloc_type_lookup +#define MY_bfd_reloc_name_lookup mipsbsd_reloc_name_lookup #define MY_canonicalize_reloc mipsbsd_canonicalize_reloc #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create @@ -72,8 +73,6 @@ static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); static bfd_reloc_status_type mips_fix_jmp_addr PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *, bfd *, char **)); -static reloc_howto_type *MY(reloc_howto_type_lookup) - PARAMS ((bfd *, bfd_reloc_code_real_type)); long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); @@ -302,9 +301,7 @@ static reloc_howto_type mips_howto_table_ext[] = { }; static reloc_howto_type * -MY(reloc_howto_type_lookup) (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; +MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) { if (bfd_get_arch (abfd) != bfd_arch_mips) @@ -330,6 +327,22 @@ MY(reloc_howto_type_lookup) (abfd, code) } } +static reloc_howto_type * +MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (mips_howto_table_ext) / sizeof (mips_howto_table_ext[0]); + i++) + if (mips_howto_table_ext[i].name != NULL + && strcasecmp (mips_howto_table_ext[i].name, r_name) == 0) + return &mips_howto_table_ext[i]; + + return NULL; +} + /* This is just like the standard aoutx.h version but we need to do our own mapping of external reloc type values to howto entries. */ long diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c index e9111a98501..913e862f9a4 100644 --- a/contrib/binutils/bfd/netbsd-core.c +++ b/contrib/binutils/bfd/netbsd-core.c @@ -1,6 +1,6 @@ /* BFD back end for NetBSD style core files Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Paul Kranenburg, EUR @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" /* BFD a.out internal data structures. */ @@ -126,11 +126,10 @@ netbsd_core_file_p (bfd *abfd) flags = SEC_ALLOC + SEC_HAS_CONTENTS; break; } - asect = bfd_make_section_anyway (abfd, sname); + asect = bfd_make_section_anyway_with_flags (abfd, sname, flags); if (asect == NULL) goto punt; - asect->flags = flags; asect->size = coreseg.c_size; asect->vma = coreseg.c_addr; asect->filepos = offset; @@ -159,11 +158,12 @@ netbsd_core_file_p (bfd *abfd) asect->size = wcookie_offset; /* And create the .wcookie section. */ - asect = bfd_make_section_anyway (abfd, ".wcookie"); + flags = SEC_ALLOC + SEC_HAS_CONTENTS; + asect = bfd_make_section_anyway_with_flags (abfd, ".wcookie", + flags); if (asect == NULL) goto punt; - asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; asect->size = coreseg.c_size - wcookie_offset; asect->vma = 0; asect->filepos = offset + wcookie_offset; diff --git a/contrib/binutils/bfd/netbsd.h b/contrib/binutils/bfd/netbsd.h index 92f6a7d2fd1..7182eda9047 100644 --- a/contrib/binutils/bfd/netbsd.h +++ b/contrib/binutils/bfd/netbsd.h @@ -1,6 +1,6 @@ /* BFD back-end definitions used by all NetBSD targets. - Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2005 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002, + 2005, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -50,8 +50,8 @@ ((exec).a_info = \ ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26)) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c index b02b137889a..4457a797cf4 100644 --- a/contrib/binutils/bfd/opncls.c +++ b/contrib/binutils/bfd/opncls.c @@ -1,6 +1,6 @@ /* opncls.c -- open and close a BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -21,8 +21,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "objalloc.h" #include "libbfd.h" #include "libiberty.h" @@ -115,11 +115,35 @@ _bfd_new_bfd_contained_in (bfd *obfd) void _bfd_delete_bfd (bfd *abfd) { - bfd_hash_table_free (&abfd->section_htab); - objalloc_free ((struct objalloc *) abfd->memory); + if (abfd->memory) + { + bfd_hash_table_free (&abfd->section_htab); + objalloc_free ((struct objalloc *) abfd->memory); + } free (abfd); } +/* Free objalloc memory. */ + +bfd_boolean +_bfd_free_cached_info (bfd *abfd) +{ + if (abfd->memory) + { + bfd_hash_table_free (&abfd->section_htab); + objalloc_free ((struct objalloc *) abfd->memory); + + abfd->sections = NULL; + abfd->section_last = NULL; + abfd->outsymbols = NULL; + abfd->tdata.any = NULL; + abfd->usrdata = NULL; + abfd->memory = NULL; + } + + return TRUE; +} + /* SECTION Opening and closing BFDs @@ -360,7 +384,10 @@ SYNOPSIS file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)); + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)); DESCRIPTION @@ -387,6 +414,10 @@ DESCRIPTION <>. @var{close} either succeeds returning 0, or fails returning -1 (setting <>). + Calls @var{stat} to fill in a stat structure for bfd_stat, + bfd_get_size, and bfd_get_mtime calls. @var{stat} returns 0 + on success, or returns -1 on failure (setting <>). + If <> returns <> then an error has occurred. Possible errors are <>, <> and <>. @@ -399,6 +430,7 @@ struct opncls file_ptr (*pread) (struct bfd *abfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset); int (*close) (struct bfd *abfd, void *stream); + int (*stat) (struct bfd *abfd, void *stream, struct stat *sb); file_ptr where; }; @@ -461,10 +493,15 @@ opncls_bflush (struct bfd *abfd ATTRIBUTE_UNUSED) } static int -opncls_bstat (struct bfd *abfd ATTRIBUTE_UNUSED, struct stat *sb) +opncls_bstat (struct bfd *abfd, struct stat *sb) { + struct opncls *vec = abfd->iostream; + memset (sb, 0, sizeof (*sb)); - return 0; + if (vec->stat == NULL) + return 0; + + return (vec->stat) (abfd, vec->stream, sb); } static const struct bfd_iovec opncls_iovec = { @@ -483,7 +520,10 @@ bfd_openr_iovec (const char *filename, const char *target, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, - void *stream)) + void *stream), + int (*stat) (struct bfd *abfd, + void *stream, + struct stat *sb)) { bfd *nbfd; const bfd_target *target_vec; @@ -515,6 +555,7 @@ bfd_openr_iovec (const char *filename, const char *target, vec->stream = stream; vec->pread = pread; vec->close = close; + vec->stat = stat; nbfd->iovec = &opncls_iovec; nbfd->iostream = vec; @@ -1321,6 +1362,7 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename) { asection *sect; bfd_size_type debuglink_size; + flagword flags; if (abfd == NULL || filename == NULL) { @@ -1339,16 +1381,11 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename) return NULL; } - sect = bfd_make_section (abfd, GNU_DEBUGLINK); + flags = SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING; + sect = bfd_make_section_with_flags (abfd, GNU_DEBUGLINK, flags); if (sect == NULL) return NULL; - if (! bfd_set_section_flags (abfd, sect, - SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING)) - /* XXX Should we delete the section from the bfd ? */ - return NULL; - - debuglink_size = strlen (filename) + 1; debuglink_size += 3; debuglink_size &= ~3; diff --git a/contrib/binutils/bfd/osf-core.c b/contrib/binutils/bfd/osf-core.c index cc6c4dccd00..b9472abe390 100644 --- a/contrib/binutils/bfd/osf-core.c +++ b/contrib/binutils/bfd/osf-core.c @@ -1,6 +1,6 @@ /* BFD back-end for OSF/1 core files. - Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2006, + 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. /* This file can only be compiled on systems which use OSF/1 style core files. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include @@ -67,11 +67,10 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos) { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; @@ -95,7 +94,7 @@ osf_core_core_file_p (abfd) if (val != sizeof core_header) return NULL; - if (strncmp (core_header.magic, "Core", 4) != 0) + if (! CONST_STRNEQ (core_header.magic, "Core")) return NULL; core_hdr (abfd) = (struct osf_core_struct *) diff --git a/contrib/binutils/bfd/pe-arm-wince.c b/contrib/binutils/bfd/pe-arm-wince.c new file mode 100644 index 00000000000..a13594fd894 --- /dev/null +++ b/contrib/binutils/bfd/pe-arm-wince.c @@ -0,0 +1,37 @@ +/* BFD back-end for ARM WINCE PE files. + Copyright 2006 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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. */ + +#define TARGET_UNDERSCORE 0 +#define USER_LABEL_PREFIX "" + +#define TARGET_LITTLE_SYM arm_wince_pe_little_vec +#define TARGET_LITTLE_NAME "pe-arm-wince-little" +#define TARGET_BIG_SYM arm_wince_pe_big_vec +#define TARGET_BIG_NAME "pe-arm-wince-big" + +#define bfd_arm_allocate_interworking_sections \ + bfd_arm_wince_pe_allocate_interworking_sections +#define bfd_arm_get_bfd_for_interworking \ + bfd_arm_wince_pe_get_bfd_for_interworking +#define bfd_arm_process_before_allocation \ + bfd_arm_wince_pe_process_before_allocation + +#define LOCAL_LABEL_PREFIX "." + +#include "pe-arm.c" diff --git a/contrib/binutils/bfd/pe-arm.c b/contrib/binutils/bfd/pe-arm.c index dba9c1b40e4..5700e2382a8 100644 --- a/contrib/binutils/bfd/pe-arm.c +++ b/contrib/binutils/bfd/pe-arm.c @@ -1,5 +1,6 @@ /* BFD back-end for ARM PECOFF files. - Copyright 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2000, 2001, 2002, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,19 @@ 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" +/* Do this before including bfd.h, so we prototype the right functions. */ + +#ifndef bfd_arm_allocate_interworking_sections +#define bfd_arm_allocate_interworking_sections \ + bfd_armpe_allocate_interworking_sections +#define bfd_arm_get_bfd_for_interworking \ + bfd_armpe_get_bfd_for_interworking +#define bfd_arm_process_before_allocation \ + bfd_armpe_process_before_allocation +#endif + #include "sysdep.h" +#include "bfd.h" #ifndef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM armpe_little_vec @@ -31,17 +43,22 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define PCRELOFFSET TRUE #define COFF_LONG_SECTION_NAMES -#ifndef bfd_arm_allocate_interworking_sections -#define bfd_arm_allocate_interworking_sections \ - bfd_arm_pe_allocate_interworking_sections -#define bfd_arm_get_bfd_for_interworking \ - bfd_arm_pe_get_bfd_for_interworking -#define bfd_arm_process_before_allocation \ - bfd_arm_pe_process_before_allocation -#endif - -#ifdef ARM_WINCE -#define TARGET_UNDERSCORE 0 -#endif +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } #include "coff-arm.c" diff --git a/contrib/binutils/bfd/pe-i386.c b/contrib/binutils/bfd/pe-i386.c index 7c102b42de8..72aacf0a893 100644 --- a/contrib/binutils/bfd/pe-i386.c +++ b/contrib/binutils/bfd/pe-i386.c @@ -1,5 +1,6 @@ /* BFD back-end for Intel 386 PECOFF files. - Copyright 1995, 1996, 1999, 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2001, 2002, 2004, 2007 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +18,8 @@ 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 "sysdep.h" +#include "bfd.h" #define TARGET_SYM i386pe_vec #define TARGET_NAME "pe-i386" @@ -34,10 +35,16 @@ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".data$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".rdata$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".text$"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ diff --git a/contrib/binutils/bfd/pe-mips.c b/contrib/binutils/bfd/pe-mips.c index 03d6beca981..628cecf9a71 100644 --- a/contrib/binutils/bfd/pe-mips.c +++ b/contrib/binutils/bfd/pe-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS PE COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Modified from coff-i386.c by DJ Delorie, dj@cygnus.com This file is part of BFD, the Binary File Descriptor library. @@ -23,8 +23,8 @@ #define COFF_LONG_SECTION_NAMES #define PCRELOFFSET TRUE -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/mipspe.h" #include "coff/internal.h" @@ -453,6 +453,7 @@ coff_mips_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, #define coff_rtype_to_howto coff_mips_rtype_to_howto #define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup +#define coff_bfd_reloc_name_lookup coff_mips_reloc_name_lookup /* Get the howto structure for a generic reloc type. */ @@ -496,6 +497,22 @@ coff_mips_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return & howto_table [mips_type]; } +static reloc_howto_type * +coff_mips_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (howto_table) / sizeof (howto_table[0]); + i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; + + return NULL; +} + static void mips_swap_reloc_in (bfd * abfd, void * src, void * dst) { diff --git a/contrib/binutils/bfd/pe-ppc.c b/contrib/binutils/bfd/pe-ppc.c index 93cf6367c6e..fa6404e4a34 100644 --- a/contrib/binutils/bfd/pe-ppc.c +++ b/contrib/binutils/bfd/pe-ppc.c @@ -1,5 +1,5 @@ /* BFD back-end for PowerPC PECOFF files. - Copyright 1995, 1996, 1999, 2001 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2001, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,8 +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 "bfd.h" #include "sysdep.h" +#include "bfd.h" #define E_FILENMLEN 18 diff --git a/contrib/binutils/bfd/pe-x86_64.c b/contrib/binutils/bfd/pe-x86_64.c new file mode 100644 index 00000000000..0c6badf1a36 --- /dev/null +++ b/contrib/binutils/bfd/pe-x86_64.c @@ -0,0 +1,53 @@ +/* BFD back-end for Intel/AMD x86_64 PECOFF files. + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 Kai Tietz, OneVision Software GmbH&CoKg. */ + +#include "sysdep.h" +#include "bfd.h" + +#define TARGET_SYM x86_64pe_vec +#define TARGET_NAME "pe-x86-64" +#define COFF_WITH_PE +#define COFF_WITH_pex64 +#define PCRELOFFSET TRUE +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define COFF_SUPPORT_GNU_LINKONCE +#define COFF_LONG_FILENAMES + +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } + +#include "coff-x86_64.c" diff --git a/contrib/binutils/bfd/peXXigen.c b/contrib/binutils/bfd/peXXigen.c index 71300219d30..f96825f687e 100644 --- a/contrib/binutils/bfd/peXXigen.c +++ b/contrib/binutils/bfd/peXXigen.c @@ -1,6 +1,6 @@ /* Support for the generic parts of PE/PEI; the common executable parts. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -52,12 +52,12 @@ on this code has a chance of getting something accomplished without wasting too much time. */ -/* This expands into COFF_WITH_pe or COFF_WITH_pep depending on whether - we're compiling for straight PE or PE+. */ +/* This expands into COFF_WITH_pe, COFF_WITH_pep, or COFF_WITH_pex64 + depending on whether we're compiling for straight PE or PE+. */ #define COFF_WITH_XX -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "coff/internal.h" @@ -67,7 +67,9 @@ within PE/PEI, so we get them from there. FIXME: The lack of variance is an assumption which may prove to be incorrect if new PE/PEI targets are created. */ -#ifdef COFF_WITH_pep +#if defined COFF_WITH_pex64 +# include "coff/x86_64.h" +#elif defined COFF_WITH_pep # include "coff/ia64.h" #else # include "coff/i386.h" @@ -77,7 +79,7 @@ #include "libcoff.h" #include "libpei.h" -#ifdef COFF_WITH_pep +#if defined COFF_WITH_pep || defined COFF_WITH_pex64 # undef AOUTSZ # define AOUTSZ PEPAOUTSZ # define PEAOUTHDR PEPAOUTHDR @@ -147,6 +149,7 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) int unused_section_number = 0; asection *sec; char *name; + flagword flags; for (sec = abfd->sections; sec; sec = sec->next) if (unused_section_number <= sec->target_index) @@ -156,7 +159,8 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) if (name == NULL) return; strcpy (name, in->n_name); - sec = bfd_make_section_anyway (abfd, name); + flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD; + sec = bfd_make_section_anyway_with_flags (abfd, name, flags); sec->vma = 0; sec->lma = 0; @@ -169,7 +173,6 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) sec->userdata = NULL; sec->next = NULL; sec->alignment_power = 2; - sec->flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD; sec->target_index = unused_section_number; @@ -385,10 +388,11 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, void * aouthdr_ext1, void * aouthdr_int1) { - struct internal_extra_pe_aouthdr *a; - PEAOUTHDR * src = (PEAOUTHDR *) (aouthdr_ext1); + PEAOUTHDR * src = (PEAOUTHDR *) aouthdr_ext1; AOUTHDR * aouthdr_ext = (AOUTHDR *) aouthdr_ext1; - struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1; + struct internal_aouthdr *aouthdr_int + = (struct internal_aouthdr *) aouthdr_int1; + struct internal_extra_pe_aouthdr *a = &aouthdr_int->pe; aouthdr_int->magic = H_GET_16 (abfd, aouthdr_ext->magic); aouthdr_int->vstamp = H_GET_16 (abfd, aouthdr_ext->vstamp); @@ -398,13 +402,21 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry); aouthdr_int->text_start = GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start); -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) /* PE32+ does not have data_start member! */ aouthdr_int->data_start = GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start); + a->BaseOfData = aouthdr_int->data_start; #endif - a = &aouthdr_int->pe; + a->Magic = aouthdr_int->magic; + a->MajorLinkerVersion = H_GET_8 (abfd, aouthdr_ext->vstamp); + a->MinorLinkerVersion = H_GET_8 (abfd, aouthdr_ext->vstamp + 1); + a->SizeOfCode = aouthdr_int->tsize ; + a->SizeOfInitializedData = aouthdr_int->dsize ; + a->SizeOfUninitializedData = aouthdr_int->bsize ; + a->AddressOfEntryPoint = aouthdr_int->entry; + a->BaseOfCode = aouthdr_int->text_start; a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, src->ImageBase); a->SectionAlignment = H_GET_32 (abfd, src->SectionAlignment); a->FileAlignment = H_GET_32 (abfd, src->FileAlignment); @@ -441,6 +453,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, /* If data directory is empty, rva also should be 0. */ int size = H_GET_32 (abfd, src->DataDirectory[idx][1]); + a->DataDirectory[idx].Size = size; if (size) @@ -454,7 +467,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, if (aouthdr_int->entry) { aouthdr_int->entry += a->ImageBase; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_int->entry &= 0xffffffff; #endif } @@ -462,12 +475,12 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, if (aouthdr_int->tsize) { aouthdr_int->text_start += a->ImageBase; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_int->text_start &= 0xffffffff; #endif } -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) /* PE32+ does not have data_start member! */ if (aouthdr_int->dsize) { @@ -480,9 +493,9 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, /* These three fields are normally set up by ppc_relocate_section. In the case of reading a file in, we can pick them up from the DataDirectory. */ - first_thunk_address = a->DataDirectory[12].VirtualAddress; - thunk_size = a->DataDirectory[12].Size; - import_table_size = a->DataDirectory[1].Size; + first_thunk_address = a->DataDirectory[PE_IMPORT_ADDRESS_TABLE].VirtualAddress; + thunk_size = a->DataDirectory[PE_IMPORT_ADDRESS_TABLE].Size; + import_table_size = a->DataDirectory[PE_IMPORT_TABLE].Size; #endif } @@ -540,14 +553,14 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) fa = extra->FileAlignment; ib = extra->ImageBase; - idata2 = pe->pe_opthdr.DataDirectory[1]; - idata5 = pe->pe_opthdr.DataDirectory[12]; - tls = pe->pe_opthdr.DataDirectory[9]; + idata2 = pe->pe_opthdr.DataDirectory[PE_IMPORT_TABLE]; + idata5 = pe->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE]; + tls = pe->pe_opthdr.DataDirectory[PE_TLS_TABLE]; if (aouthdr_in->tsize) { aouthdr_in->text_start -= ib; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_in->text_start &= 0xffffffff; #endif } @@ -555,7 +568,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) if (aouthdr_in->dsize) { aouthdr_in->data_start -= ib; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_in->data_start &= 0xffffffff; #endif } @@ -563,7 +576,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) if (aouthdr_in->entry) { aouthdr_in->entry -= ib; -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) aouthdr_in->entry &= 0xffffffff; #endif } @@ -592,11 +605,11 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) So - we copy the input values into the output values, and then, if a final link is going to be performed, it can overwrite them. */ - extra->DataDirectory[1] = idata2; - extra->DataDirectory[12] = idata5; - extra->DataDirectory[9] = tls; + extra->DataDirectory[PE_IMPORT_TABLE] = idata2; + extra->DataDirectory[PE_IMPORT_ADDRESS_TABLE] = idata5; + extra->DataDirectory[PE_TLS_TABLE] = tls; - if (extra->DataDirectory[1].VirtualAddress == 0) + if (extra->DataDirectory[PE_IMPORT_TABLE].VirtualAddress == 0) /* Until other .idata fixes are made (pending patch), the entry for .idata is needed for backwards compatibility. FIXME. */ add_data_entry (abfd, extra, 1, ".idata", ib); @@ -632,16 +645,22 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) in the virt_size field). Files have been seen (from MSVC 5.0 link.exe) where the file size of the .data segment is quite small compared to the virtual size. Without this - fix, strip munges the file. */ + fix, strip munges the file. + + FIXME: We need to handle holes between sections, which may + happpen when we covert from another format. We just use + the virtual address and virtual size of the last section + for the image size. */ if (coff_section_data (abfd, sec) != NULL && pei_section_data (abfd, sec) != NULL) - isize += SA (FA (pei_section_data (abfd, sec)->virt_size)); + isize = (sec->vma - extra->ImageBase + + SA (FA (pei_section_data (abfd, sec)->virt_size))); } aouthdr_in->dsize = dsize; aouthdr_in->tsize = tsize; extra->SizeOfHeaders = hsize; - extra->SizeOfImage = SA (hsize) + isize; + extra->SizeOfImage = isize; } H_PUT_16 (abfd, aouthdr_in->magic, aouthdr_out->standard.magic); @@ -660,7 +679,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out) PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, aouthdr_out->standard.text_start); -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, aouthdr_out->standard.data_start); @@ -1017,7 +1036,7 @@ static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = N_("Bound Import Directory"), N_("Import Address Table Directory"), N_("Delay Import Directory"), - N_("Reserved"), + N_("CLR Runtime Header"), N_("Reserved") }; @@ -1051,9 +1070,9 @@ pe_print_idata (bfd * abfd, void * vfile) bfd_vma addr; - addr = extra->DataDirectory[1].VirtualAddress; + addr = extra->DataDirectory[PE_IMPORT_TABLE].VirtualAddress; - if (addr == 0 && extra->DataDirectory[1].Size == 0) + if (addr == 0 && extra->DataDirectory[PE_IMPORT_TABLE].Size == 0) { /* Maybe the extra header isn't there. Look for the section. */ section = bfd_get_section_by_name (abfd, ".idata"); @@ -1171,7 +1190,7 @@ pe_print_idata (bfd * abfd, void * vfile) bfd_size_type j; char *dll; - /* Print (i + extra->DataDirectory[1].VirtualAddress). */ + /* Print (i + extra->DataDirectory[PE_IMPORT_TABLE].VirtualAddress). */ fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); hint_addr = bfd_get_32 (abfd, data + i + dataoff); time_stamp = bfd_get_32 (abfd, data + i + 4 + dataoff); @@ -1212,8 +1231,8 @@ pe_print_idata (bfd * abfd, void * vfile) ft_data = data; ft_idx = first_thunk - adj; ft_allocated = 0; - - if (first_thunk != hint_addr) + + if (first_thunk != hint_addr) { /* Find the section which contains the first thunk. */ for (ft_section = abfd->sections; @@ -1261,6 +1280,38 @@ pe_print_idata (bfd * abfd, void * vfile) } /* Print HintName vector entries. */ +#ifdef COFF_WITH_pex64 + for (j = 0; j < datasize; j += 8) + { + unsigned long member = bfd_get_32 (abfd, data + idx + j); + unsigned long member_high = bfd_get_32 (abfd, data + idx + j + 4); + + if (!member && !member_high) + break; + + if (member_high & 0x80000000) + fprintf (file, "\t%lx%08lx\t %4lx%08lx ", + member_high,member, member_high & 0x7fffffff, member); + else + { + int ordinal; + char *member_name; + + ordinal = bfd_get_16 (abfd, data + member - adj); + member_name = (char *) data + member - adj + 2; + fprintf (file, "\t%04lx\t %4d %s",member, ordinal, member_name); + } + + /* If the time stamp is not zero, the import address + table holds actual addresses. */ + if (time_stamp != 0 + && first_thunk != 0 + && first_thunk != hint_addr) + fprintf (file, "\t%04lx", + (long) bfd_get_32 (abfd, ft_data + ft_idx + j)); + fprintf (file, "\n"); + } +#else for (j = 0; j < datasize; j += 4) { unsigned long member = bfd_get_32 (abfd, data + idx + j); @@ -1293,7 +1344,7 @@ pe_print_idata (bfd * abfd, void * vfile) fprintf (file, "\n"); } - +#endif if (ft_allocated) free (ft_data); } @@ -1336,9 +1387,9 @@ pe_print_edata (bfd * abfd, void * vfile) bfd_vma addr; - addr = extra->DataDirectory[0].VirtualAddress; + addr = extra->DataDirectory[PE_EXPORT_TABLE].VirtualAddress; - if (addr == 0 && extra->DataDirectory[0].Size == 0) + if (addr == 0 && extra->DataDirectory[PE_EXPORT_TABLE].Size == 0) { /* Maybe the extra header isn't there. Look for the section. */ section = bfd_get_section_by_name (abfd, ".edata"); @@ -1367,7 +1418,7 @@ pe_print_edata (bfd * abfd, void * vfile) } dataoff = addr - section->vma; - datasize = extra->DataDirectory[0].Size; + datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size; if (datasize > section->size - dataoff) { fprintf (file, @@ -1533,10 +1584,10 @@ pe_print_edata (bfd * abfd, void * vfile) static bfd_boolean pe_print_pdata (bfd * abfd, void * vfile) { -#ifdef COFF_WITH_pep -# define PDATA_ROW_SIZE (3*8) +#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) +# define PDATA_ROW_SIZE (3 * 8) #else -# define PDATA_ROW_SIZE (5*4) +# define PDATA_ROW_SIZE (5 * 4) #endif FILE *file = (FILE *) vfile; bfd_byte *data = 0; @@ -1559,7 +1610,7 @@ pe_print_pdata (bfd * abfd, void * vfile) fprintf (file, _("\nThe Function Table (interpreted .pdata section contents)\n")); -#ifdef COFF_WITH_pep +#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) fprintf (file, _(" vma:\t\t\tBegin Address End Address Unwind Info\n")); #else @@ -1613,7 +1664,7 @@ pe_print_pdata (bfd * abfd, void * vfile) fprintf_vma (file, begin_addr); fputc (' ', file); fprintf_vma (file, end_addr); fputc (' ', file); fprintf_vma (file, eh_handler); -#ifndef COFF_WITH_pep +#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64) fputc (' ', file); fprintf_vma (file, eh_data); fputc (' ', file); fprintf_vma (file, prolog_end_addr); @@ -1766,6 +1817,7 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; const char *subsystem_name = NULL; + const char *name; /* The MS dumpbin program reportedly ands with 0xff0f before printing the characteristics field. Not sure why. No reason to @@ -1791,6 +1843,52 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) time_t t = pe->coff.timestamp; fprintf (file, "\nTime/Date\t\t%s", ctime (&t)); } + +#ifndef IMAGE_NT_OPTIONAL_HDR_MAGIC +# define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b +#endif +#ifndef IMAGE_NT_OPTIONAL_HDR64_MAGIC +# define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b +#endif +#ifndef IMAGE_NT_OPTIONAL_HDRROM_MAGIC +# define IMAGE_NT_OPTIONAL_HDRROM_MAGIC 0x107 +#endif + + switch (i->Magic) + { + case IMAGE_NT_OPTIONAL_HDR_MAGIC: + name = "PE32"; + break; + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + name = "PE32+"; + break; + case IMAGE_NT_OPTIONAL_HDRROM_MAGIC: + name = "ROM"; + break; + default: + name = NULL; + break; + } + fprintf (file, "Magic\t\t\t%04x", i->Magic); + if (name) + fprintf (file, "\t(%s)",name); + fprintf (file, "\nMajorLinkerVersion\t%d\n", i->MajorLinkerVersion); + fprintf (file, "MinorLinkerVersion\t%d\n", i->MinorLinkerVersion); + fprintf (file, "SizeOfCode\t\t%08lx\n", i->SizeOfCode); + fprintf (file, "SizeOfInitializedData\t%08lx\n", + i->SizeOfInitializedData); + fprintf (file, "SizeOfUninitializedData\t%08lx\n", + i->SizeOfUninitializedData); + fprintf (file, "AddressOfEntryPoint\t"); + fprintf_vma (file, i->AddressOfEntryPoint); + fprintf (file, "\nBaseOfCode\t\t"); + fprintf_vma (file, i->BaseOfCode); +#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) + /* PE32+ does not have BaseOfData member! */ + fprintf (file, "\nBaseOfData\t\t"); + fprintf_vma (file, i->BaseOfData); +#endif + fprintf (file, "\nImageBase\t\t"); fprintf_vma (file, i->ImageBase); fprintf (file, "\nSectionAlignment\t"); @@ -1837,6 +1935,16 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: subsystem_name = "EFI runtime driver"; break; + // These are from revision 8.0 of the MS PE/COFF spec + case IMAGE_SUBSYSTEM_EFI_ROM: + subsystem_name = "EFI ROM"; + break; + case IMAGE_SUBSYSTEM_XBOX: + subsystem_name = "XBOX"; + break; + // Added default case for clarity - subsystem_name is NULL anyway. + default: + subsystem_name = NULL; } fprintf (file, "Subsystem\t\t%08x", i->Subsystem); @@ -1889,8 +1997,8 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd) if we don't remove this entry as well. */ if (! pe_data (obfd)->has_reloc_section) { - pe_data (obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0; - pe_data (obfd)->pe_opthdr.DataDirectory[5].Size = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[PE_BASE_RELOCATION_TABLE].VirtualAddress = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[PE_BASE_RELOCATION_TABLE].Size = 0; } return TRUE; } @@ -1949,6 +2057,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) { struct coff_link_hash_entry *h1; struct bfd_link_info *info = pfinfo->info; + bfd_boolean result = TRUE; /* There are a few fields that need to be filled in now while we have symbol table access. @@ -1962,49 +2071,103 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) ".idata$2", FALSE, FALSE, TRUE); if (h1 != NULL) { - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress = - (h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset); + /* PR ld/2729: We cannot rely upon all the output sections having been + created properly, so check before referencing them. Issue a warning + message for any sections tht could not be found. */ + if (h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[1] because .idata$2 is missing"), + abfd); + result = FALSE; + } + h1 = coff_link_hash_lookup (coff_hash_table (info), ".idata$4", FALSE, FALSE, TRUE); - pe_data (abfd)->pe_opthdr.DataDirectory[1].Size = - ((h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset) - - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress); + if (h1 != NULL + && h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].Size = + ((h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset) + - pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].VirtualAddress); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[1] because .idata$4 is missing"), + abfd); + result = FALSE; + } /* The import address table. This is the size/address of .idata$5. */ h1 = coff_link_hash_lookup (coff_hash_table (info), ".idata$5", FALSE, FALSE, TRUE); - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress = - (h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset); + if (h1 != NULL + && h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[12] because .idata$5 is missing"), + abfd); + result = FALSE; + } + h1 = coff_link_hash_lookup (coff_hash_table (info), ".idata$6", FALSE, FALSE, TRUE); - pe_data (abfd)->pe_opthdr.DataDirectory[12].Size = - ((h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset) - - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); + if (h1 != NULL + && h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE].Size = + ((h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset) + - pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_ADDRESS_TABLE].VirtualAddress); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"), + abfd); + result = FALSE; + } } h1 = coff_link_hash_lookup (coff_hash_table (info), "__tls_used", FALSE, FALSE, TRUE); if (h1 != NULL) { - pe_data (abfd)->pe_opthdr.DataDirectory[9].VirtualAddress = - (h1->root.u.def.value - + h1->root.u.def.section->output_section->vma - + h1->root.u.def.section->output_offset - - pe_data (abfd)->pe_opthdr.ImageBase); - pe_data (abfd)->pe_opthdr.DataDirectory[9].Size = 0x18; + if (h1->root.u.def.section != NULL + && h1->root.u.def.section->output_section != NULL) + pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset + - pe_data (abfd)->pe_opthdr.ImageBase); + else + { + _bfd_error_handler + (_("%B: unable to fill in DataDictionary[9] because __tls_used is missing"), + abfd); + result = FALSE; + } + + pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].Size = 0x18; } /* If we couldn't find idata$2, we either have an excessively trivial program or are in DEEP trouble; we have to assume trivial program.... */ - return TRUE; + return result; } diff --git a/contrib/binutils/bfd/pei-arm-wince.c b/contrib/binutils/bfd/pei-arm-wince.c new file mode 100644 index 00000000000..7d5a3be3515 --- /dev/null +++ b/contrib/binutils/bfd/pei-arm-wince.c @@ -0,0 +1,30 @@ +/* BFD back-end for ARM WINCE PE IMAGE COFF files. + Copyright 2006 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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. */ + +#define TARGET_UNDERSCORE 0 +#define USER_LABEL_PREFIX "" + +#define TARGET_LITTLE_SYM arm_wince_pei_little_vec +#define TARGET_LITTLE_NAME "pei-arm-wince-little" +#define TARGET_BIG_SYM arm_wince_pei_big_vec +#define TARGET_BIG_NAME "pei-arm-wince-big" + +#define LOCAL_LABEL_PREFIX "." + +#include "pei-arm.c" diff --git a/contrib/binutils/bfd/pei-mips.c b/contrib/binutils/bfd/pei-mips.c index 0c9b962f2b6..4405c0af217 100644 --- a/contrib/binutils/bfd/pei-mips.c +++ b/contrib/binutils/bfd/pei-mips.c @@ -1,5 +1,5 @@ /* BFD back-end for MIPS PE IMAGE COFF files. - Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1995, 2000, 2001, 2002, 2007 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,8 +17,8 @@ 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 "sysdep.h" +#include "bfd.h" #define TARGET_SYM mipslpei_vec #define TARGET_NAME "pei-mips" diff --git a/contrib/binutils/bfd/pei-x86_64.c b/contrib/binutils/bfd/pei-x86_64.c new file mode 100644 index 00000000000..37d9c7f2e54 --- /dev/null +++ b/contrib/binutils/bfd/pei-x86_64.c @@ -0,0 +1,54 @@ +/* BFD back-end for Intel 386 PE IMAGE COFF files. + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + 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 Kai Tietz, OneVision Software GmbH&CoKg. */ + +#include "sysdep.h" +#include "bfd.h" + +#define TARGET_SYM x86_64pei_vec +#define TARGET_NAME "pei-x86-64" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define COFF_WITH_pex64 +#define PCRELOFFSET TRUE +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define COFF_SUPPORT_GNU_LINKONCE +#define COFF_LONG_FILENAMES + +#define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \ +{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 } + +#include "coff-x86_64.c" diff --git a/contrib/binutils/bfd/peicode.h b/contrib/binutils/bfd/peicode.h index 2061f415af6..0f4858f4bfb 100644 --- a/contrib/binutils/bfd/peicode.h +++ b/contrib/binutils/bfd/peicode.h @@ -1,6 +1,6 @@ /* Support for the generic parts of PE/PEI, for BFD. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2006 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -182,6 +182,10 @@ coff_swap_filehdr_in (bfd * abfd, void * src, void * dst) #ifdef COFF_IMAGE_WITH_PE # define coff_swap_filehdr_out _bfd_XXi_only_swap_filehdr_out +#elif defined COFF_WITH_pex64 +# define coff_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out +#elif defined COFF_WITH_pep +# define coff_swap_filehdr_out _bfd_pep_only_swap_filehdr_out #else # define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out #endif @@ -217,7 +221,10 @@ coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in) if (scnhdr_int->s_vaddr != 0) { scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase; + /* Do not cut upper 32-bits for 64-bit vma. */ +#ifndef COFF_WITH_pex64 scnhdr_int->s_vaddr &= 0xffffffff; +#endif } #ifndef COFF_NO_HACK_SCNHDR_SIZE @@ -405,8 +412,16 @@ pe_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd) + NUM_ILF_SECTIONS * 9 \ + STRING_SIZE_SIZE) #define SIZEOF_IDATA2 (5 * 4) + +/* For PEx64 idata4 & 5 have thumb size of 8 bytes. */ +#ifdef COFF_WITH_pex64 +#define SIZEOF_IDATA4 (2 * 4) +#define SIZEOF_IDATA5 (2 * 4) +#else #define SIZEOF_IDATA4 (1 * 4) #define SIZEOF_IDATA5 (1 * 4) +#endif + #define SIZEOF_IDATA6 (2 + strlen (symbol_name) + 1 + 1) #define SIZEOF_IDATA7 (strlen (source_dll) + 1 + 1) #define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata)) @@ -656,9 +671,20 @@ static jump_table jtab[] = }, #endif -#ifdef MC68MAGIC - { MC68MAGIC, { /* XXX fill me in */ }, 0, 0 }, +#ifdef AMD64MAGIC + { AMD64MAGIC, + { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90 }, + 8, 2 + }, #endif + +#ifdef MC68MAGIC + { MC68MAGIC, + { /* XXX fill me in */ }, + 0, 0 + }, +#endif + #ifdef MIPS_ARCH_MAGIC_WINCE { MIPS_ARCH_MAGIC_WINCE, { 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x08, 0x8d, @@ -830,8 +856,15 @@ pe_ILF_build_a_bfd (bfd * abfd, /* XXX - treat as IMPORT_NAME ??? */ abort (); +#ifdef COFF_WITH_pex64 + ((unsigned int *) id4->contents)[0] = ordinal; + ((unsigned int *) id4->contents)[1] = 0x80000000; + ((unsigned int *) id5->contents)[0] = ordinal; + ((unsigned int *) id5->contents)[1] = 0x80000000; +#else * (unsigned int *) id4->contents = ordinal | 0x80000000; * (unsigned int *) id5->contents = ordinal | 0x80000000; +#endif } else { @@ -1071,6 +1104,12 @@ pe_ILF_object_p (bfd * abfd) #endif break; + case IMAGE_FILE_MACHINE_AMD64: +#ifdef AMD64MAGIC + magic = AMD64MAGIC; +#endif + break; + case IMAGE_FILE_MACHINE_M68K: #ifdef MC68AGIC magic = MC68MAGIC; @@ -1195,6 +1234,25 @@ pe_ILF_object_p (bfd * abfd) return abfd->xvec; } +enum arch_type +{ + arch_type_unknown, + arch_type_i386, + arch_type_x86_64 +}; + +static enum arch_type +pe_arch (const char *arch) +{ + if (strcmp (arch, "i386") == 0 || strcmp (arch, "ia32") == 0) + return arch_type_i386; + + if (strcmp (arch, "x86_64") == 0 || strcmp (arch, "x86-64") == 0) + return arch_type_x86_64; + + return arch_type_unknown; +} + static const bfd_target * pe_bfd_object_p (bfd * abfd) { @@ -1202,6 +1260,7 @@ pe_bfd_object_p (bfd * abfd) struct external_PEI_DOS_hdr dos_hdr; struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; + const bfd_target *target; /* Detect if this a Microsoft Import Library Format element. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 @@ -1266,7 +1325,60 @@ pe_bfd_object_p (bfd * abfd) return NULL; } - return coff_object_p (abfd); + target = coff_object_p (abfd); + if (target) + { + pe_data_type *pe = pe_data (abfd); + struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; + bfd_boolean efi = i->Subsystem == IMAGE_SUBSYSTEM_EFI_APPLICATION; + enum arch_type arch; + const bfd_target * const *target_ptr; + + /* Get the machine. */ + if (bfd_target_efi_p (abfd->xvec)) + arch = pe_arch (bfd_target_efi_arch (abfd->xvec)); + else + arch = pe_arch (bfd_target_pei_arch (abfd->xvec)); + + for (target_ptr = bfd_target_vector; *target_ptr != NULL; + target_ptr++) + { + if (*target_ptr == target + || (*target_ptr)->flavour != bfd_target_coff_flavour) + continue; + + if (bfd_target_efi_p (*target_ptr)) + { + /* Skip incompatible arch. */ + if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) + continue; + + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } + else if (bfd_target_pei_p (*target_ptr)) + { + /* Skip incompatible arch. */ + if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) + continue; + + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } + } + } + + return target; } #define coff_object_p pe_bfd_object_p diff --git a/contrib/binutils/bfd/po/BLD-POTFILES.in b/contrib/binutils/bfd/po/BLD-POTFILES.in index 2dbe723a50e..07ad4b3602f 100644 --- a/contrib/binutils/bfd/po/BLD-POTFILES.in +++ b/contrib/binutils/bfd/po/BLD-POTFILES.in @@ -5,4 +5,5 @@ elf64-ia64.c elf64-target.h peigen.c pepigen.c +pex64igen.c targmatch.h diff --git a/contrib/binutils/bfd/po/Make-in b/contrib/binutils/bfd/po/Make-in index f11ccb41cef..1a619929557 100644 --- a/contrib/binutils/bfd/po/Make-in +++ b/contrib/binutils/bfd/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@ @@ -78,7 +79,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/contrib/binutils/bfd/po/SRC-POTFILES.in b/contrib/binutils/bfd/po/SRC-POTFILES.in index 8bcf979a5bf..5a3d361747c 100644 --- a/contrib/binutils/bfd/po/SRC-POTFILES.in +++ b/contrib/binutils/bfd/po/SRC-POTFILES.in @@ -57,6 +57,7 @@ coff-tic80.c coff-u68k.c coff-w65.c coff-we32k.c +coff-x86_64.c coff-z80.c coff-z8k.c corefile.c @@ -65,6 +66,7 @@ cpu-arc.c cpu-arm.c cpu-avr.c cpu-bfin.c +cpu-cr16.c cpu-cr16c.c cpu-cris.c cpu-crx.c @@ -93,6 +95,7 @@ cpu-m68k.c cpu-m88k.c cpu-maxq.c cpu-mcore.c +cpu-mep.c cpu-mips.c cpu-mmix.c cpu-msp430.c @@ -105,8 +108,10 @@ cpu-pj.c cpu-powerpc.c cpu-rs6000.c cpu-s390.c +cpu-score.c cpu-sh.c cpu-sparc.c +cpu-spu.c cpu-tic30.c cpu-tic4x.c cpu-tic54x.c @@ -128,12 +133,14 @@ ecofflink.c ecoffswap.h efi-app-ia32.c efi-app-ia64.c +efi-app-x86_64.c elf32-am33lin.c elf32-arc.c elf32-arm.c elf32-avr.c elf32-bfin.c elf32.c +elf32-cr16.c elf32-cr16c.c elf32-cris.c elf32-crx.c @@ -160,6 +167,7 @@ elf32-m68hc1x.c elf32-m68k.c elf32-m88k.c elf32-mcore.c +elf32-mep.c elf32-mips.c elf32-msp430.c elf32-mt.c @@ -168,11 +176,13 @@ elf32-or32.c elf32-pj.c elf32-ppc.c elf32-s390.c +elf32-score.c elf32-sh64.c elf32-sh64-com.c elf32-sh.c elf32-sh-symbian.c elf32-sparc.c +elf32-spu.c elf32-v850.c elf32-vax.c elf32-xc16x.c @@ -190,6 +200,7 @@ elf64-s390.c elf64-sh64.c elf64-sparc.c elf64-x86-64.c +elf-attrs.c elf-bfd.h elf.c elfcode.h @@ -271,21 +282,25 @@ osf-core.c pc532-mach.c pdp11.c pe-arm.c +pe-arm-wince.c pef.c pef.h pef-traceback.h pe-i386.c pei-arm.c +pei-arm-wince.c peicode.h pei-i386.c pei-mcore.c pei-mips.c pei-ppc.c pei-sh.c +pei-x86_64.c pe-mcore.c pe-mips.c pe-ppc.c pe-sh.c +pe-x86_64.c ppcboot.c reloc16.c reloc.c diff --git a/contrib/binutils/bfd/po/bfd.pot b/contrib/binutils/bfd/po/bfd.pot index 37c57290aee..a01ee37160a 100644 --- a/contrib/binutils/bfd/po/bfd.pot +++ b/contrib/binutils/bfd/po/bfd.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-10-25 22:24+0930\n" +"POT-Creation-Date: 2007-07-02 16:16+0930\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,153 +33,162 @@ msgstr "" msgid "%B: Bad relocation record imported: %d" msgstr "" -#: aoutx.h:1244 aoutx.h:1578 +#: aoutx.h:1267 aoutx.h:1601 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1544 +#: aoutx.h:1567 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1546 +#: aoutx.h:1569 msgid "*unknown*" msgstr "" -#: aoutx.h:5281 +#: aoutx.h:5311 #, c-format msgid "%s: relocatable link from %s to %s not supported" msgstr "" -#: archive.c:1760 +#: archive.c:1764 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:2019 +#: archive.c:2027 msgid "Reading archive file mod timestamp" msgstr "" -#: archive.c:2043 +#: archive.c:2051 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:279 +#: bfd.c:288 msgid "No error" msgstr "" -#: bfd.c:280 +#: bfd.c:289 msgid "System call error" msgstr "" -#: bfd.c:281 +#: bfd.c:290 msgid "Invalid bfd target" msgstr "" -#: bfd.c:282 +#: bfd.c:291 msgid "File in wrong format" msgstr "" -#: bfd.c:283 +#: bfd.c:292 msgid "Archive object file in wrong format" msgstr "" -#: bfd.c:284 +#: bfd.c:293 msgid "Invalid operation" msgstr "" -#: bfd.c:285 +#: bfd.c:294 msgid "Memory exhausted" msgstr "" -#: bfd.c:286 +#: bfd.c:295 msgid "No symbols" msgstr "" -#: bfd.c:287 +#: bfd.c:296 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:288 +#: bfd.c:297 msgid "No more archived files" msgstr "" -#: bfd.c:289 +#: bfd.c:298 msgid "Malformed archive" msgstr "" -#: bfd.c:290 +#: bfd.c:299 msgid "File format not recognized" msgstr "" -#: bfd.c:291 +#: bfd.c:300 msgid "File format is ambiguous" msgstr "" -#: bfd.c:292 +#: bfd.c:301 msgid "Section has no contents" msgstr "" -#: bfd.c:293 +#: bfd.c:302 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:294 +#: bfd.c:303 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:295 +#: bfd.c:304 msgid "Bad value" msgstr "" -#: bfd.c:296 +#: bfd.c:305 msgid "File truncated" msgstr "" -#: bfd.c:297 +#: bfd.c:306 msgid "File too big" msgstr "" -#: bfd.c:298 +#: bfd.c:307 +#, c-format +msgid "Error reading %s: %s" +msgstr "" + +#: bfd.c:308 msgid "#" msgstr "" -#: bfd.c:771 +#: bfd.c:829 #, c-format msgid "BFD %s assertion fail %s:%d" msgstr "" -#: bfd.c:787 +#: bfd.c:841 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:791 +#: bfd.c:845 #, c-format msgid "BFD %s internal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:793 +#: bfd.c:847 msgid "Please report this bug.\n" msgstr "" -#: bfdwin.c:202 +#: bfdwin.c:207 #, c-format msgid "not mapping: data=%lx mapped=%d\n" msgstr "" -#: bfdwin.c:205 +#: bfdwin.c:210 #, c-format msgid "not mapping: env var not set\n" msgstr "" -#: binary.c:285 +#: binary.c:283 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" -#: coff64-rs6000.c:2109 coff-rs6000.c:3610 +#: cache.c:237 +msgid "reopening %B: %s\n" +msgstr "" + +#: coff64-rs6000.c:2125 coff-rs6000.c:3623 msgid "%B: symbol `%s' has unrecognized smclas %d" msgstr "" @@ -193,45 +202,45 @@ msgstr "" msgid "%B: unknown/unsupported relocation type %d" msgstr "" -#: coff-alpha.c:898 coff-alpha.c:935 coff-alpha.c:2007 coff-mips.c:985 +#: coff-alpha.c:898 coff-alpha.c:935 coff-alpha.c:2023 coff-mips.c:1001 msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1484 +#: coff-alpha.c:1500 msgid "using multiple gp values" msgstr "" -#: coff-alpha.c:1543 +#: coff-alpha.c:1559 msgid "%B: unsupported relocation: ALPHA_R_GPRELHIGH" msgstr "" -#: coff-alpha.c:1550 +#: coff-alpha.c:1566 msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW" msgstr "" -#: coff-alpha.c:1557 elf32-m32r.c:2471 elf64-alpha.c:3912 elf64-alpha.c:4038 -#: elf32-ia64.c:4108 elf64-ia64.c:4108 +#: coff-alpha.c:1573 elf32-m32r.c:2486 elf64-alpha.c:3951 elf64-alpha.c:4104 +#: elf32-ia64.c:4674 elf64-ia64.c:4674 msgid "%B: unknown relocation type %d" msgstr "" -#: coff-arm.c:990 elf32-arm.c:1926 +#: coff-arm.c:1035 #, c-format msgid "%B: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1019 elf32-arm.c:1960 +#: coff-arm.c:1064 #, c-format msgid "%B: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1319 elf32-arm.c:2683 +#: coff-arm.c:1366 elf32-arm.c:4156 #, c-format msgid "" "%B(%s): warning: interworking not enabled.\n" " first occurrence: %B: arm call to thumb" msgstr "" -#: coff-arm.c:1409 +#: coff-arm.c:1456 #, c-format msgid "" "%B(%s): warning: interworking not enabled.\n" @@ -239,105 +248,105 @@ msgid "" " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1702 cofflink.c:3015 coff-tic80.c:695 +#: coff-arm.c:1749 cofflink.c:3014 coff-tic80.c:695 msgid "%B: bad reloc address 0x%lx in section `%A'" msgstr "" -#: coff-arm.c:2028 +#: coff-arm.c:2074 msgid "%B: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2158 +#: coff-arm.c:2205 #, c-format msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d" msgstr "" -#: coff-arm.c:2174 elf32-arm.c:5093 +#: coff-arm.c:2221 elf32-arm.c:7103 #, c-format msgid "" "ERROR: %B passes floats in float registers, whereas %B passes them in " "integer registers" msgstr "" -#: coff-arm.c:2177 elf32-arm.c:5097 +#: coff-arm.c:2224 elf32-arm.c:7107 #, c-format msgid "" "ERROR: %B passes floats in integer registers, whereas %B passes them in " "float registers" msgstr "" -#: coff-arm.c:2191 +#: coff-arm.c:2238 #, c-format msgid "" "ERROR: %B is compiled as position independent code, whereas target %B is " "absolute position" msgstr "" -#: coff-arm.c:2194 +#: coff-arm.c:2241 #, c-format msgid "" "ERROR: %B is compiled as absolute position code, whereas target %B is " "position independent" msgstr "" -#: coff-arm.c:2222 elf32-arm.c:5162 +#: coff-arm.c:2269 elf32-arm.c:7172 #, c-format msgid "Warning: %B supports interworking, whereas %B does not" msgstr "" -#: coff-arm.c:2225 elf32-arm.c:5168 +#: coff-arm.c:2272 elf32-arm.c:7178 #, c-format msgid "Warning: %B does not support interworking, whereas %B does" msgstr "" -#: coff-arm.c:2249 +#: coff-arm.c:2296 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2257 elf32-arm.c:5219 +#: coff-arm.c:2304 elf32-arm.c:7229 #, c-format msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2259 +#: coff-arm.c:2306 #, c-format msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2262 elf32-arm.c:5222 +#: coff-arm.c:2309 elf32-arm.c:7232 #, c-format msgid " [position independent]" msgstr "" -#: coff-arm.c:2264 +#: coff-arm.c:2311 #, c-format msgid " [absolute position]" msgstr "" -#: coff-arm.c:2268 +#: coff-arm.c:2315 #, c-format msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2270 +#: coff-arm.c:2317 #, c-format msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2272 +#: coff-arm.c:2319 #, c-format msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2318 elf32-arm.c:4571 +#: coff-arm.c:2365 elf32-arm.c:6626 #, c-format msgid "" "Warning: Not setting interworking flag of %B since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2322 elf32-arm.c:4575 +#: coff-arm.c:2369 elf32-arm.c:6630 #, c-format msgid "Warning: Clearing the interworking flag of %B due to outside request" msgstr "" @@ -358,36 +367,40 @@ msgstr "" msgid "%B (%s): Section flag %s (0x%x) ignored" msgstr "" -#: coffcode.h:2204 +#: coffcode.h:2231 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" msgstr "" -#: coffcode.h:4211 +#: coffcode.h:2546 +msgid "%B: reloc against a non-existant symbol index: %ld" +msgstr "" + +#: coffcode.h:4269 msgid "%B: warning: line number table read failed" msgstr "" -#: coffcode.h:4243 +#: coffcode.h:4301 msgid "%B: warning: illegal symbol index %ld in line numbers" msgstr "" -#: coffcode.h:4257 +#: coffcode.h:4315 msgid "%B: warning: duplicate line number information for `%s'" msgstr "" -#: coffcode.h:4597 +#: coffcode.h:4655 msgid "%B: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coffcode.h:4723 +#: coffcode.h:4781 msgid "warning: %B: local symbol `%s' has no section" msgstr "" -#: coffcode.h:4827 coff-i860.c:586 coff-tic54x.c:376 +#: coffcode.h:4886 coff-i860.c:600 coff-tic54x.c:393 msgid "%B: warning: illegal symbol index %ld in relocs" msgstr "" -#: coffcode.h:4865 +#: coffcode.h:4924 msgid "%B: illegal relocation type %d at address 0x%lx" msgstr "" @@ -395,7 +408,7 @@ msgstr "" msgid "%B: bad string table size %lu" msgstr "" -#: coff-h8300.c:1126 +#: coff-h8300.c:1121 #, c-format msgid "cannot handle R_MEM_INDIRECT reloc when using %s output" msgstr "" @@ -405,53 +418,54 @@ msgstr "" msgid "Relocation `%s' not yet implemented\n" msgstr "" -#: coff-i960.c:137 coff-i960.c:486 +#: coff-i960.c:137 coff-i960.c:500 msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: cofflink.c:507 elflink.c:3948 +#: cofflink.c:509 elflink.c:4158 msgid "Warning: type of symbol `%s' changed from %d to %d in %B" msgstr "" -#: cofflink.c:2293 +#: cofflink.c:2292 msgid "%B: relocs in section `%A', but it has no contents" msgstr "" -#: cofflink.c:2624 coffswap.h:823 +#: cofflink.c:2623 coffswap.h:823 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: cofflink.c:2633 coffswap.h:809 +#: cofflink.c:2632 coffswap.h:809 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coff-m68k.c:482 elf32-bfin.c:2722 elf32-m68k.c:2193 +#: coff-m68k.c:505 elf32-bfin.c:5434 elf32-m68k.c:2392 msgid "unsupported reloc type" msgstr "" -#: coff-maxq.c:128 +#: coff-maxq.c:126 msgid "Can't Make it a Short Jump" msgstr "" -#: coff-maxq.c:193 +#: coff-maxq.c:191 msgid "Exceeds Long Jump Range" msgstr "" -#: coff-maxq.c:204 coff-maxq.c:278 +#: coff-maxq.c:202 coff-maxq.c:276 msgid "Absolute address Exceeds 16 bit Range" msgstr "" -#: coff-maxq.c:242 +#: coff-maxq.c:240 msgid "Absolute address Exceeds 8 bit Range" msgstr "" -#: coff-maxq.c:335 +#: coff-maxq.c:333 msgid "Unrecognized Reloc Type" msgstr "" -#: coff-mips.c:686 elf32-mips.c:940 elf64-mips.c:1864 elfn32-mips.c:1718 +#: coff-mips.c:686 elf32-mips.c:956 elf32-score.c:344 elf64-mips.c:1896 +#: elfn32-mips.c:1750 msgid "GP relative relocation when _gp not defined" msgstr "" @@ -459,22 +473,22 @@ msgstr "" msgid "Unrecognized reloc" msgstr "" -#: coff-rs6000.c:2785 +#: coff-rs6000.c:2798 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: coff-rs6000.c:2878 +#: coff-rs6000.c:2891 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" -#: coff-tic4x.c:174 coff-tic54x.c:282 coff-tic80.c:458 +#: coff-tic4x.c:191 coff-tic54x.c:299 coff-tic80.c:458 #, c-format msgid "Unrecognized reloc type 0x%x" msgstr "" -#: coff-tic4x.c:219 +#: coff-tic4x.c:236 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" @@ -484,543 +498,644 @@ msgstr "" msgid "ignoring reloc %s\n" msgstr "" -#: cpu-arm.c:184 cpu-arm.c:193 +#: cpu-arm.c:188 cpu-arm.c:199 msgid "ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale" msgstr "" -#: cpu-arm.c:324 +#: cpu-arm.c:331 #, c-format msgid "warning: unable to update contents of %s section in %s" msgstr "" -#: dwarf2.c:315 +#: dwarf2.c:329 msgid "Dwarf Error: Can't find .debug_str section." msgstr "" -#: dwarf2.c:333 +#: dwarf2.c:347 #, c-format msgid "" "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str " "size (%lu)." msgstr "" -#: dwarf2.c:426 +#: dwarf2.c:440 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:441 +#: dwarf2.c:455 #, c-format msgid "" "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size " "(%lu)." msgstr "" -#: dwarf2.c:656 +#: dwarf2.c:670 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %u." msgstr "" -#: dwarf2.c:856 +#: dwarf2.c:873 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:947 +#: dwarf2.c:985 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:964 +#: dwarf2.c:1002 #, c-format msgid "" "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%" "lu)." msgstr "" -#: dwarf2.c:1192 +#: dwarf2.c:1228 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1382 +#: dwarf2.c:1416 msgid "Dwarf Error: Can't find .debug_ranges section." msgstr "" -#: dwarf2.c:1544 dwarf2.c:1660 dwarf2.c:1930 +#: dwarf2.c:1579 dwarf2.c:1695 dwarf2.c:1965 #, c-format msgid "Dwarf Error: Could not find abbrev number %u." msgstr "" -#: dwarf2.c:1891 +#: dwarf2.c:1926 #, c-format msgid "" "Dwarf Error: found dwarf version '%u', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1898 +#: dwarf2.c:1933 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1921 +#: dwarf2.c:1956 #, c-format msgid "Dwarf Error: Bad abbrev number: %u." msgstr "" -#: ecoff.c:1227 +#: ecoff.c:1226 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1484 +#: ecoff.c:1483 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1491 ecoff.c:1494 +#: ecoff.c:1490 ecoff.c:1493 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1506 +#: ecoff.c:1505 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1513 +#: ecoff.c:1512 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1521 +#: ecoff.c:1520 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1526 +#: ecoff.c:1525 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1531 +#: ecoff.c:1530 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1537 +#: ecoff.c:1536 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf32-arm.c:2315 +#: elf32-arm.c:2516 +#, c-format +msgid "unable to find THUMB glue '%s' for '%s'" +msgstr "" + +#: elf32-arm.c:2549 +#, c-format +msgid "unable to find ARM glue '%s' for '%s'" +msgstr "" + +#: elf32-arm.c:3119 msgid "%B: BE8 images only valid in big-endian mode." msgstr "" -#: elf32-arm.c:2471 +#. Give a warning, but do as the user requests anyway. +#: elf32-arm.c:3320 +msgid "" +"%B: warning: selected VFP11 erratum workaround is not necessary for target " +"architecture" +msgstr "" + +#: elf32-arm.c:3854 elf32-arm.c:3874 +msgid "%B: unable to find VFP11 veneer `%s'" +msgstr "" + +#: elf32-arm.c:3919 #, c-format msgid "Invalid TARGET2 relocation type '%s'." msgstr "" -#: elf32-arm.c:2578 +#: elf32-arm.c:4060 msgid "" "%B(%s): warning: interworking not enabled.\n" " first occurrence: %B: thumb call to arm" msgstr "" -#: elf32-arm.c:3044 +#: elf32-arm.c:4748 msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "" -#: elf32-arm.c:3227 +#: elf32-arm.c:5047 msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "" -#: elf32-arm.c:3889 +#: elf32-arm.c:5738 msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object" msgstr "" -#: elf32-arm.c:4290 elf32-sh.c:4618 elf64-sh64.c:1537 +#: elf32-arm.c:5939 +msgid "" +"%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group " +"relocations" +msgstr "" + +#: elf32-arm.c:5979 elf32-arm.c:6066 elf32-arm.c:6149 elf32-arm.c:6234 +msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s" +msgstr "" + +#: elf32-arm.c:6417 elf32-sh.c:3303 elf64-sh64.c:1555 msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section" msgstr "" -#: elf32-arm.c:4351 elf64-ppc.c:9672 +#: elf32-arm.c:6506 elf64-ppc.c:9972 msgid "%B(%A+0x%lx): %s used with TLS symbol %s" msgstr "" -#: elf32-arm.c:4352 elf64-ppc.c:9673 +#: elf32-arm.c:6507 elf64-ppc.c:9973 msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s" msgstr "" -#: elf32-arm.c:4375 elf32-i386.c:3038 elf32-m32r.c:2653 elf32-m68k.c:1737 -#: elf32-ppc.c:6561 elf32-s390.c:3012 elf32-sh.c:4717 elf32-xtensa.c:2311 -#: elf64-ppc.c:10825 elf64-s390.c:3010 elf64-sh64.c:1626 elf64-x86-64.c:2522 -#: elf-hppa.h:1413 elf-m10300.c:1460 elfxx-sparc.c:3137 +#: elf32-arm.c:6530 elf32-i386.c:3305 elf32-m32r.c:2597 elf32-m68k.c:1981 +#: elf32-ppc.c:6791 elf32-s390.c:3048 elf32-sh.c:3407 elf32-xtensa.c:2290 +#: elf64-ppc.c:11137 elf64-s390.c:3009 elf64-sh64.c:1647 elf64-x86-64.c:3001 +#: elf-hppa.h:2193 elf-m10300.c:1459 elfxx-sparc.c:3254 msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'" msgstr "" -#: elf32-arm.c:4411 elf32-avr.c:880 elf32-cr16c.c:773 elf32-cris.c:1502 -#: elf32-crx.c:911 elf32-d10v.c:536 elf32-fr30.c:595 elf32-frv.c:4107 -#: elf32-h8300.c:494 elf32-i860.c:1189 elf32-ip2k.c:1474 elf32-iq2000.c:616 -#: elf32-m32c.c:465 elf32-m32r.c:3111 elf32-m68hc1x.c:1194 elf32-ms1.c:373 -#: elf32-msp430.c:508 elf32-openrisc.c:383 elf32-v850.c:1672 -#: elf32-xstormy16.c:909 elf64-mmix.c:1517 elf-m10200.c:427 elf-m10300.c:1509 -msgid "internal error: out of range error" +#: elf32-arm.c:6564 +msgid "out of range" msgstr "" -#: elf32-arm.c:4415 elf32-avr.c:884 elf32-cr16c.c:777 elf32-cris.c:1506 -#: elf32-crx.c:915 elf32-d10v.c:540 elf32-fr30.c:599 elf32-frv.c:4111 -#: elf32-h8300.c:498 elf32-i860.c:1193 elf32-iq2000.c:620 elf32-m32c.c:469 -#: elf32-m32r.c:3115 elf32-m68hc1x.c:1198 elf32-msp430.c:512 -#: elf32-openrisc.c:387 elf32-v850.c:1676 elf32-xstormy16.c:913 -#: elf64-mmix.c:1521 elf-m10200.c:431 elf-m10300.c:1513 elfxx-mips.c:7212 -msgid "internal error: unsupported relocation error" +#: elf32-arm.c:6568 +msgid "unsupported relocation" msgstr "" -#: elf32-arm.c:4419 elf32-cr16c.c:781 elf32-crx.c:919 elf32-d10v.c:544 -#: elf32-h8300.c:502 elf32-m32r.c:3119 elf32-m68hc1x.c:1202 elf-m10200.c:435 -#: elf-m10300.c:1517 -msgid "internal error: dangerous error" +#: elf32-arm.c:6576 +msgid "unknown error" msgstr "" -#: elf32-arm.c:4423 elf32-avr.c:892 elf32-cr16c.c:785 elf32-cris.c:1514 -#: elf32-crx.c:923 elf32-d10v.c:548 elf32-fr30.c:607 elf32-frv.c:4119 -#: elf32-h8300.c:506 elf32-i860.c:1201 elf32-ip2k.c:1489 elf32-iq2000.c:628 -#: elf32-m32c.c:477 elf32-m32r.c:3123 elf32-m68hc1x.c:1206 elf32-ms1.c:381 -#: elf32-msp430.c:520 elf32-openrisc.c:395 elf32-v850.c:1696 -#: elf32-xstormy16.c:921 elf64-mmix.c:1529 elf-m10200.c:439 elf-m10300.c:1521 -msgid "internal error: unknown error" -msgstr "" - -#: elf32-arm.c:4664 +#: elf32-arm.c:6676 msgid "" "Warning: Clearing the interworking flag of %B because non-interworking code " "in %B has been linked with it" msgstr "" -#: elf32-arm.c:4751 +#: elf32-arm.c:6778 msgid "ERROR: %B uses VFP register arguments, %B does not" msgstr "" -#: elf32-arm.c:4798 +#: elf32-arm.c:6828 msgid "ERROR: %B: Conflicting architecture profiles %c/%c" msgstr "" -#: elf32-arm.c:4813 +#: elf32-arm.c:6843 msgid "Warning: %B: Conflicting platform configuration" msgstr "" -#: elf32-arm.c:4821 +#: elf32-arm.c:6852 msgid "ERROR: %B: Conflicting use of R9" msgstr "" -#: elf32-arm.c:4833 +#: elf32-arm.c:6864 msgid "ERROR: %B: SB relative addressing conflicts with use of R9" msgstr "" -#: elf32-arm.c:4855 +#: elf32-arm.c:6886 msgid "ERROR: %B: Conflicting definitions of wchar_t" msgstr "" -#: elf32-arm.c:4881 -msgid "ERROR: %B: Conflicting enum sizes" +#: elf32-arm.c:6915 +msgid "" +"warning: %B uses %s enums yet the output is to use %s enums; use of enum " +"values across objects may fail" msgstr "" -#: elf32-arm.c:4892 +#: elf32-arm.c:6928 msgid "ERROR: %B uses iWMMXt register arguments, %B does not" msgstr "" -#: elf32-arm.c:4912 -msgid "ERROR: %B: Must be processed by '%s' toolchain" -msgstr "" - -#: elf32-arm.c:4932 elf32-arm.c:4951 -msgid "ERROR: %B: Incompatible object tag '%s':%d" -msgstr "" - -#: elf32-arm.c:4961 +#: elf32-arm.c:6951 msgid "Warning: %B: Unknown EABI object attribute %d" msgstr "" -#: elf32-arm.c:5069 +#: elf32-arm.c:7076 msgid "" "ERROR: Source object %B has EABI version %d, but target %B has EABI version %" "d" msgstr "" -#: elf32-arm.c:5082 +#: elf32-arm.c:7092 msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d" msgstr "" -#: elf32-arm.c:5107 +#: elf32-arm.c:7117 msgid "ERROR: %B uses VFP instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:5111 +#: elf32-arm.c:7121 msgid "ERROR: %B uses FPA instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:5121 +#: elf32-arm.c:7131 msgid "ERROR: %B uses Maverick instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:5125 +#: elf32-arm.c:7135 msgid "ERROR: %B does not use Maverick instructions, whereas %B does" msgstr "" -#: elf32-arm.c:5144 +#: elf32-arm.c:7154 msgid "ERROR: %B uses software FP, whereas %B uses hardware FP" msgstr "" -#: elf32-arm.c:5148 +#: elf32-arm.c:7158 msgid "ERROR: %B uses hardware FP, whereas %B uses software FP" msgstr "" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. #. Ignore init flag - it may not be set, despite the flags field containing valid data. -#: elf32-arm.c:5195 elf32-bfin.c:2164 elf32-cris.c:3243 elf32-m68hc1x.c:1338 -#: elf32-m68k.c:428 elf32-vax.c:528 elfxx-mips.c:9933 +#: elf32-arm.c:7205 elf32-bfin.c:4795 elf32-cris.c:3233 elf32-m68hc1x.c:1276 +#: elf32-m68k.c:619 elf32-score.c:3752 elf32-vax.c:537 elfxx-mips.c:11310 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.c:5204 +#: elf32-arm.c:7214 #, c-format msgid " [interworking enabled]" msgstr "" -#: elf32-arm.c:5212 +#: elf32-arm.c:7222 #, c-format msgid " [VFP float format]" msgstr "" -#: elf32-arm.c:5214 +#: elf32-arm.c:7224 #, c-format msgid " [Maverick float format]" msgstr "" -#: elf32-arm.c:5216 +#: elf32-arm.c:7226 #, c-format msgid " [FPA float format]" msgstr "" -#: elf32-arm.c:5225 +#: elf32-arm.c:7235 #, c-format msgid " [new ABI]" msgstr "" -#: elf32-arm.c:5228 +#: elf32-arm.c:7238 #, c-format msgid " [old ABI]" msgstr "" -#: elf32-arm.c:5231 +#: elf32-arm.c:7241 #, c-format msgid " [software FP]" msgstr "" -#: elf32-arm.c:5240 +#: elf32-arm.c:7250 #, c-format msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.c:5243 elf32-arm.c:5254 +#: elf32-arm.c:7253 elf32-arm.c:7264 #, c-format msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.c:5245 elf32-arm.c:5256 +#: elf32-arm.c:7255 elf32-arm.c:7266 #, c-format msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.c:5251 +#: elf32-arm.c:7261 #, c-format msgid " [Version2 EABI]" msgstr "" -#: elf32-arm.c:5259 +#: elf32-arm.c:7269 #, c-format msgid " [dynamic symbols use segment index]" msgstr "" -#: elf32-arm.c:5262 +#: elf32-arm.c:7272 #, c-format msgid " [mapping symbols precede others]" msgstr "" -#: elf32-arm.c:5269 +#: elf32-arm.c:7279 #, c-format msgid " [Version3 EABI]" msgstr "" -#: elf32-arm.c:5273 +#: elf32-arm.c:7283 #, c-format msgid " [Version4 EABI]" msgstr "" -#: elf32-arm.c:5276 +#: elf32-arm.c:7287 +#, c-format +msgid " [Version5 EABI]" +msgstr "" + +#: elf32-arm.c:7290 #, c-format msgid " [BE8]" msgstr "" -#: elf32-arm.c:5279 +#: elf32-arm.c:7293 #, c-format msgid " [LE8]" msgstr "" -#: elf32-arm.c:5285 +#: elf32-arm.c:7299 #, c-format msgid " " msgstr "" -#: elf32-arm.c:5292 +#: elf32-arm.c:7306 #, c-format msgid " [relocatable executable]" msgstr "" -#: elf32-arm.c:5295 +#: elf32-arm.c:7309 #, c-format msgid " [has entry point]" msgstr "" -#: elf32-arm.c:5300 +#: elf32-arm.c:7314 #, c-format msgid "" msgstr "" -#: elf32-arm.c:5536 elf32-i386.c:902 elf32-s390.c:989 elf32-xtensa.c:784 -#: elf64-s390.c:942 elf64-x86-64.c:666 elfxx-sparc.c:1016 +#: elf32-arm.c:7545 elf32-i386.c:960 elf32-s390.c:1003 elf32-xtensa.c:814 +#: elf64-s390.c:958 elf64-x86-64.c:772 elfxx-sparc.c:1113 msgid "%B: bad symbol index: %d" msgstr "" -#: elf32-arm.c:6023 elf32-cris.c:2385 elf32-hppa.c:1813 elf32-i370.c:491 -#: elf32-i386.c:1465 elf32-m32r.c:1913 elf32-m68k.c:1088 elf32-ppc.c:4145 -#: elf32-s390.c:1686 elf32-sh.c:3920 elf32-vax.c:1059 elf64-ppc.c:5717 -#: elf64-s390.c:1659 elf64-sh64.c:3442 elf64-x86-64.c:1252 elf-m10300.c:4107 -#: elfxx-sparc.c:1720 +#: elf32-arm.c:8091 elf32-cris.c:2399 elf32-hppa.c:1905 elf32-i370.c:506 +#: elf32-i386.c:1517 elf32-m32r.c:1930 elf32-m68k.c:1330 elf32-ppc.c:4309 +#: elf32-s390.c:1679 elf32-sh.c:2583 elf32-vax.c:1049 elf64-ppc.c:5897 +#: elf64-s390.c:1654 elf64-sh64.c:3437 elf64-x86-64.c:1381 elf-m10300.c:4206 +#: elfxx-sparc.c:1795 #, c-format msgid "dynamic variable `%s' is zero size" msgstr "" -#: elf32-avr.c:888 elf32-cris.c:1510 elf32-fr30.c:603 elf32-frv.c:4115 -#: elf32-i860.c:1197 elf32-ip2k.c:1485 elf32-iq2000.c:624 elf32-m32c.c:473 -#: elf32-ms1.c:377 elf32-msp430.c:516 elf32-openrisc.c:391 elf32-v850.c:1680 -#: elf32-xstormy16.c:917 elf64-mmix.c:1525 +#: elf32-arm.c:8609 +#, c-format +msgid "Errors encountered processing file %s" +msgstr "" + +#: elf32-arm.c:9837 elf32-arm.c:9859 +msgid "%B: error: VFP11 veneer out of range" +msgstr "" + +#: elf32-avr.c:1253 elf32-bfin.c:2795 elf32-cr16.c:887 elf32-cr16c.c:789 +#: elf32-cris.c:1537 elf32-crx.c:932 elf32-d10v.c:517 elf32-fr30.c:615 +#: elf32-frv.c:4128 elf32-h8300.c:515 elf32-i860.c:1217 elf32-ip2k.c:1499 +#: elf32-iq2000.c:647 elf32-m32c.c:560 elf32-m32r.c:3123 elf32-m68hc1x.c:1132 +#: elf32-mep.c:639 elf32-msp430.c:496 elf32-mt.c:401 elf32-openrisc.c:411 +#: elf32-score.c:2455 elf32-spu.c:2813 elf32-v850.c:1700 elf32-xstormy16.c:946 +#: elf64-mmix.c:1531 elf-m10200.c:455 elf-m10300.c:1522 +msgid "internal error: out of range error" +msgstr "" + +#: elf32-avr.c:1257 elf32-bfin.c:2799 elf32-cr16.c:891 elf32-cr16c.c:793 +#: elf32-cris.c:1541 elf32-crx.c:936 elf32-d10v.c:521 elf32-fr30.c:619 +#: elf32-frv.c:4132 elf32-h8300.c:519 elf32-i860.c:1221 elf32-iq2000.c:651 +#: elf32-m32c.c:564 elf32-m32r.c:3127 elf32-m68hc1x.c:1136 elf32-mep.c:643 +#: elf32-msp430.c:500 elf32-openrisc.c:415 elf32-score.c:2459 elf32-spu.c:2817 +#: elf32-v850.c:1704 elf32-xstormy16.c:950 elf64-mmix.c:1535 elf-m10200.c:459 +#: elf-m10300.c:1526 elfxx-mips.c:8019 +msgid "internal error: unsupported relocation error" +msgstr "" + +#: elf32-avr.c:1261 elf32-bfin.c:2803 elf32-cris.c:1545 elf32-fr30.c:623 +#: elf32-frv.c:4136 elf32-i860.c:1225 elf32-ip2k.c:1510 elf32-iq2000.c:655 +#: elf32-m32c.c:568 elf32-mep.c:647 elf32-msp430.c:504 elf32-mt.c:405 +#: elf32-openrisc.c:419 elf32-v850.c:1708 elf32-xstormy16.c:954 +#: elf64-mmix.c:1539 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-bfin.c:96 -msgid "Division by zero. " +#: elf32-avr.c:1265 elf32-bfin.c:2807 elf32-cr16.c:899 elf32-cr16c.c:801 +#: elf32-cris.c:1549 elf32-crx.c:944 elf32-d10v.c:529 elf32-fr30.c:627 +#: elf32-frv.c:4140 elf32-h8300.c:527 elf32-i860.c:1229 elf32-ip2k.c:1514 +#: elf32-iq2000.c:659 elf32-m32c.c:572 elf32-m32r.c:3135 elf32-m68hc1x.c:1144 +#: elf32-mep.c:651 elf32-msp430.c:508 elf32-mt.c:409 elf32-openrisc.c:423 +#: elf32-score.c:2467 elf32-spu.c:2825 elf32-v850.c:1724 elf32-xstormy16.c:958 +#: elf64-mmix.c:1543 elf-m10200.c:467 elf-m10300.c:1539 +msgid "internal error: unknown error" msgstr "" -#: elf32-bfin.c:1958 +#: elf32-avr.c:2369 elf32-hppa.c:594 elf32-m68hc1x.c:163 elf64-ppc.c:3801 +msgid "%B: cannot create stub entry %s" +msgstr "" + +#: elf32-bfin.c:2274 +msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend" +msgstr "" + +#: elf32-bfin.c:2288 elf32-frv.c:2918 +msgid "relocation references symbol not defined in the module" +msgstr "" + +#: elf32-bfin.c:2385 +msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend" +msgstr "" + +#: elf32-bfin.c:2424 elf32-bfin.c:2547 elf32-frv.c:3655 elf32-frv.c:3776 +msgid "cannot emit fixups in read-only section" +msgstr "" + +#: elf32-bfin.c:2452 elf32-bfin.c:2587 elf32-frv.c:3686 elf32-frv.c:3820 +msgid "cannot emit dynamic relocations in read-only section" +msgstr "" + +#: elf32-bfin.c:2505 +msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend" +msgstr "" + +#: elf32-bfin.c:2673 +msgid "relocations between different segments are not supported" +msgstr "" + +#: elf32-bfin.c:2674 +msgid "warning: relocation references a different segment" +msgstr "" + +#: elf32-bfin.c:3083 msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-bfin.c:1991 elf32-i386.c:3079 elf32-m68k.c:1778 elf32-s390.c:3064 -#: elf64-s390.c:3062 elf64-x86-64.c:2567 +#: elf32-bfin.c:3116 elf32-i386.c:3346 elf32-m68k.c:2022 elf32-s390.c:3100 +#: elf64-s390.c:3061 elf64-x86-64.c:3040 msgid "%B(%A+0x%lx): reloc against `%s': error %d" msgstr "" -#: elf32-cris.c:1050 +#: elf32-bfin.c:4687 elf32-frv.c:6422 +msgid "%B: unsupported relocation type %i" +msgstr "" + +#: elf32-bfin.c:4868 elf32-frv.c:6830 +#, c-format +msgid "%s: cannot link non-fdpic object file into fdpic executable" +msgstr "" + +#: elf32-bfin.c:4872 elf32-frv.c:6834 +#, c-format +msgid "%s: cannot link fdpic object file into non-fdpic executable" +msgstr "" + +#: elf32-cr16.c:895 elf32-cr16c.c:797 elf32-crx.c:940 elf32-d10v.c:525 +#: elf32-h8300.c:523 elf32-m32r.c:3131 elf32-m68hc1x.c:1140 elf32-score.c:2463 +#: elf32-spu.c:2821 elf-m10200.c:463 +msgid "internal error: dangerous error" +msgstr "" + +#: elf32-cris.c:1059 msgid "%B, section %A: unresolvable relocation %s against symbol `%s'" msgstr "" -#: elf32-cris.c:1105 +#: elf32-cris.c:1128 msgid "%B, section %A: No PLT nor GOT for relocation %s against symbol `%s'" msgstr "" -#: elf32-cris.c:1107 +#: elf32-cris.c:1130 msgid "%B, section %A: No PLT for relocation %s against symbol `%s'" msgstr "" -#: elf32-cris.c:1113 elf32-cris.c:1245 +#: elf32-cris.c:1136 elf32-cris.c:1268 msgid "[whose name is lost]" msgstr "" -#: elf32-cris.c:1231 +#: elf32-cris.c:1254 msgid "" "%B, section %A: relocation %s with non-zero addend %d against local symbol" msgstr "" -#: elf32-cris.c:1239 +#: elf32-cris.c:1262 msgid "" "%B, section %A: relocation %s with non-zero addend %d against symbol `%s'" msgstr "" -#: elf32-cris.c:1265 +#: elf32-cris.c:1288 msgid "%B, section %A: relocation %s is not allowed for global symbol: `%s'" msgstr "" -#: elf32-cris.c:1281 +#: elf32-cris.c:1304 msgid "%B, section %A: relocation %s with no GOT created" msgstr "" -#: elf32-cris.c:1399 +#: elf32-cris.c:1422 msgid "%B: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-cris.c:2520 +#: elf32-cris.c:2510 msgid "" "%B, section %A:\n" " v10/v32 compatible object %s must not contain a PIC relocation" msgstr "" -#: elf32-cris.c:2707 elf32-cris.c:2775 +#: elf32-cris.c:2697 elf32-cris.c:2765 msgid "" "%B, section %A:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -#: elf32-cris.c:3192 +#: elf32-cris.c:3182 msgid "Unexpected machine number" msgstr "" -#: elf32-cris.c:3246 +#: elf32-cris.c:3236 #, c-format msgid " [symbols have a _ prefix]" msgstr "" -#: elf32-cris.c:3249 +#: elf32-cris.c:3239 #, c-format msgid " [v10 and v32]" msgstr "" -#: elf32-cris.c:3252 +#: elf32-cris.c:3242 #, c-format msgid " [v32]" msgstr "" -#: elf32-cris.c:3297 +#: elf32-cris.c:3287 msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "" -#: elf32-cris.c:3298 +#: elf32-cris.c:3288 msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "" -#: elf32-cris.c:3317 +#: elf32-cris.c:3307 msgid "%B contains CRIS v32 code, incompatible with previous objects" msgstr "" -#: elf32-cris.c:3319 +#: elf32-cris.c:3309 msgid "%B contains non-CRIS-v32 code, incompatible with previous objects" msgstr "" @@ -1028,119 +1143,93 @@ msgstr "" msgid "relocation requires zero addend" msgstr "" -#: elf32-frv.c:2901 +#: elf32-frv.c:2905 msgid "%B(%A+0x%x): relocation to `%s+%x' may have caused the error above" msgstr "" -#: elf32-frv.c:2914 -msgid "relocation references symbol not defined in the module" -msgstr "" - -#: elf32-frv.c:2990 +#: elf32-frv.c:2994 msgid "R_FRV_GETTLSOFF not applied to a call instruction" msgstr "" -#: elf32-frv.c:3032 +#: elf32-frv.c:3036 msgid "R_FRV_GOTTLSDESC12 not applied to an lddi instruction" msgstr "" -#: elf32-frv.c:3103 +#: elf32-frv.c:3107 msgid "R_FRV_GOTTLSDESCHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3140 +#: elf32-frv.c:3144 msgid "R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3188 +#: elf32-frv.c:3192 msgid "R_FRV_TLSDESC_RELAX not applied to an ldd instruction" msgstr "" -#: elf32-frv.c:3272 +#: elf32-frv.c:3276 msgid "R_FRV_GETTLSOFF_RELAX not applied to a calll instruction" msgstr "" -#: elf32-frv.c:3327 +#: elf32-frv.c:3331 msgid "R_FRV_GOTTLSOFF12 not applied to an ldi instruction" msgstr "" -#: elf32-frv.c:3357 +#: elf32-frv.c:3361 msgid "R_FRV_GOTTLSOFFHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3386 +#: elf32-frv.c:3390 msgid "R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3417 +#: elf32-frv.c:3421 msgid "R_FRV_TLSOFF_RELAX not applied to an ld instruction" msgstr "" -#: elf32-frv.c:3462 +#: elf32-frv.c:3466 msgid "R_FRV_TLSMOFFHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3489 +#: elf32-frv.c:3493 msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3610 +#: elf32-frv.c:3614 msgid "R_FRV_FUNCDESC references dynamic symbol with nonzero addend" msgstr "" -#: elf32-frv.c:3649 elf32-frv.c:3762 -msgid "cannot emit fixups in read-only section" -msgstr "" - -#: elf32-frv.c:3675 elf32-frv.c:3802 -msgid "cannot emit dynamic relocations in read-only section" -msgstr "" - -#: elf32-frv.c:3720 +#: elf32-frv.c:3734 msgid "R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend" msgstr "" -#: elf32-frv.c:3970 elf32-frv.c:4126 +#: elf32-frv.c:3991 elf32-frv.c:4147 msgid "%B(%A+0x%lx): reloc against `%s': %s" msgstr "" -#: elf32-frv.c:3972 elf32-frv.c:3976 +#: elf32-frv.c:3993 elf32-frv.c:3997 msgid "relocation references a different segment" msgstr "" -#: elf32-frv.c:6324 -msgid "%B: unsupported relocation type %i" -msgstr "" - -#: elf32-frv.c:6642 +#: elf32-frv.c:6744 #, c-format msgid "" "%s: compiled with %s and linked with modules that use non-pic relocations" msgstr "" -#: elf32-frv.c:6695 elf32-iq2000.c:801 elf32-m32c.c:785 +#: elf32-frv.c:6797 elf32-iq2000.c:808 elf32-m32c.c:819 #, c-format msgid "%s: compiled with %s and linked with modules compiled with %s" msgstr "" -#: elf32-frv.c:6707 +#: elf32-frv.c:6809 #, c-format msgid "" "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%" "lx)" msgstr "" -#: elf32-frv.c:6728 -#, c-format -msgid "%s: cannot link non-fdpic object file into fdpic executable" -msgstr "" - -#: elf32-frv.c:6732 -#, c-format -msgid "%s: cannot link fdpic object file into non-fdpic executable" -msgstr "" - -#: elf32-frv.c:6757 elf32-iq2000.c:838 elf32-m32c.c:821 elf32-ms1.c:596 +#: elf32-frv.c:6859 elf32-iq2000.c:845 elf32-m32c.c:855 elf32-mt.c:586 #, c-format msgid "private flags = 0x%lx:" msgstr "" @@ -1149,423 +1238,461 @@ msgstr "" msgid "%B: Relocations in generic ELF (EM: %d)" msgstr "" -#: elf32-hppa.c:569 elf32-m68hc1x.c:161 elf64-ppc.c:3660 -msgid "%B: cannot create stub entry %s" -msgstr "" - -#: elf32-hppa.c:822 elf32-hppa.c:3411 +#: elf32-hppa.c:843 elf32-hppa.c:3576 msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1212 +#: elf32-hppa.c:1252 msgid "" "%B: relocation %s can not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1405 +#: elf32-hppa.c:1505 #, c-format msgid "Could not find relocation section for %s" msgstr "" -#: elf32-hppa.c:2677 +#: elf32-hppa.c:2794 msgid "%B: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3266 +#: elf32-hppa.c:3412 msgid "" "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link" msgstr "" -#: elf32-hppa.c:3895 +#: elf32-hppa.c:4266 msgid "%B(%A+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4189 +#: elf32-hppa.c:4573 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:327 elf32-s390.c:368 elf64-ppc.c:2124 elf64-s390.c:390 -#: elf64-x86-64.c:204 +#: elf32-i386.c:363 elf32-ppc.c:1615 elf32-s390.c:379 elf64-ppc.c:2147 +#: elf64-s390.c:403 elf64-x86-64.c:220 msgid "%B: invalid relocation type %d" msgstr "" -#: elf32-i386.c:1015 elf32-s390.c:1171 elf32-sh.c:6389 elf64-s390.c:1133 -#: elfxx-sparc.c:1144 +#: elf32-i386.c:1084 elf32-s390.c:1185 elf32-sh.c:5062 elf64-s390.c:1149 +#: elfxx-sparc.c:1241 msgid "%B: `%s' accessed both as normal and thread local symbol" msgstr "" -#: elf32-i386.c:1130 elf32-s390.c:1280 elf64-ppc.c:4731 elf64-s390.c:1245 -#: elf64-x86-64.c:910 +#: elf32-i386.c:1199 elf32-s390.c:1294 elf64-ppc.c:4863 elf64-s390.c:1261 +#: elf64-x86-64.c:1050 msgid "%B: bad relocation section name `%s'" msgstr "" -#: elf32-i386.c:2149 +#: elf32-i386.c:2252 msgid "%B: unrecognized relocation (0x%x) in section `%A'" msgstr "" -#: elf32-i386.c:2409 +#: elf32-i386.c:2474 msgid "" "%B: relocation R_386_GOTOFF against protected function `%s' can not be used " "when making a shared object" msgstr "" -#: elf32-ip2k.c:853 elf32-ip2k.c:859 elf32-ip2k.c:926 elf32-ip2k.c:932 +#: elf32-ip2k.c:868 elf32-ip2k.c:874 elf32-ip2k.c:941 elf32-ip2k.c:947 msgid "" "ip2k relaxer: switch table without complete matching relocation information." msgstr "" -#: elf32-ip2k.c:876 elf32-ip2k.c:959 +#: elf32-ip2k.c:891 elf32-ip2k.c:974 msgid "ip2k relaxer: switch table header corrupt." msgstr "" -#: elf32-ip2k.c:1301 +#: elf32-ip2k.c:1316 #, c-format msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)." msgstr "" -#: elf32-ip2k.c:1317 +#: elf32-ip2k.c:1332 #, c-format msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)." msgstr "" #. Only if it's not an unresolved symbol. -#: elf32-ip2k.c:1481 +#: elf32-ip2k.c:1506 msgid "unsupported relocation between data/insn address spaces" msgstr "" -#: elf32-iq2000.c:814 elf32-m32c.c:797 +#: elf32-iq2000.c:821 elf32-m32c.c:831 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-m32r.c:1436 +#: elf32-m32r.c:1452 msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "" -#: elf32-m32r.c:3048 +#: elf32-m32r.c:3060 msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)" msgstr "" -#: elf32-m32r.c:3576 +#: elf32-m32r.c:3588 msgid "%B: Instruction set mismatch with previous modules" msgstr "" -#: elf32-m32r.c:3597 +#: elf32-m32r.c:3609 #, c-format msgid "private flags = %lx" msgstr "" -#: elf32-m32r.c:3602 +#: elf32-m32r.c:3614 #, c-format msgid ": m32r instructions" msgstr "" -#: elf32-m32r.c:3603 +#: elf32-m32r.c:3615 #, c-format msgid ": m32rx instructions" msgstr "" -#: elf32-m32r.c:3604 +#: elf32-m32r.c:3616 #, c-format msgid ": m32r2 instructions" msgstr "" -#: elf32-m68hc1x.c:1106 +#: elf32-m68hc1x.c:1044 #, c-format msgid "" "Reference to the far symbol `%s' using a wrong relocation may result in " "incorrect execution" msgstr "" -#: elf32-m68hc1x.c:1129 +#: elf32-m68hc1x.c:1067 #, c-format msgid "" "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked " "address [%lx:%04lx] (%lx)" msgstr "" -#: elf32-m68hc1x.c:1148 +#: elf32-m68hc1x.c:1086 #, c-format msgid "" "reference to a banked address [%lx:%04lx] in the normal address space at %" "04lx" msgstr "" -#: elf32-m68hc1x.c:1281 +#: elf32-m68hc1x.c:1219 msgid "" "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-" "bit integers" msgstr "" -#: elf32-m68hc1x.c:1288 +#: elf32-m68hc1x.c:1226 msgid "" "%B: linking files compiled for 32-bit double (-fshort-double) and others for " "64-bit double" msgstr "" -#: elf32-m68hc1x.c:1297 +#: elf32-m68hc1x.c:1235 msgid "%B: linking files compiled for HCS12 with others compiled for HC12" msgstr "" -#: elf32-m68hc1x.c:1313 elf32-ppc.c:3576 elf64-sparc.c:696 elfxx-mips.c:9894 +#: elf32-m68hc1x.c:1251 elf32-ppc.c:3733 elf64-sparc.c:696 elfxx-mips.c:11271 msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-m68hc1x.c:1341 +#: elf32-m68hc1x.c:1279 #, c-format msgid "[abi=32-bit int, " msgstr "" -#: elf32-m68hc1x.c:1343 +#: elf32-m68hc1x.c:1281 #, c-format msgid "[abi=16-bit int, " msgstr "" -#: elf32-m68hc1x.c:1346 +#: elf32-m68hc1x.c:1284 #, c-format msgid "64-bit double, " msgstr "" -#: elf32-m68hc1x.c:1348 +#: elf32-m68hc1x.c:1286 #, c-format msgid "32-bit double, " msgstr "" -#: elf32-m68hc1x.c:1351 +#: elf32-m68hc1x.c:1289 #, c-format msgid "cpu=HC11]" msgstr "" -#: elf32-m68hc1x.c:1353 +#: elf32-m68hc1x.c:1291 #, c-format msgid "cpu=HCS12]" msgstr "" -#: elf32-m68hc1x.c:1355 +#: elf32-m68hc1x.c:1293 #, c-format msgid "cpu=HC12]" msgstr "" -#: elf32-m68hc1x.c:1358 +#: elf32-m68hc1x.c:1296 #, c-format msgid " [memory=bank-model]" msgstr "" -#: elf32-m68hc1x.c:1360 +#: elf32-m68hc1x.c:1298 #, c-format msgid " [memory=flat]" msgstr "" -#: elf32-m68k.c:431 -#, c-format -msgid " [cpu32]" +#: elf32-m68k.c:634 elf32-m68k.c:635 +msgid "unknown" msgstr "" -#: elf32-m68k.c:434 -#, c-format -msgid " [m68000]" -msgstr "" - -#: elf32-mcore.c:98 elf32-mcore.c:428 +#: elf32-mcore.c:98 elf32-mcore.c:441 msgid "%B: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:414 +#: elf32-mcore.c:427 msgid "%B: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:971 elf64-mips.c:1929 elfn32-mips.c:1774 +#: elf32-mep.c:809 +msgid "%B and %B are for different cores" +msgstr "" + +#: elf32-mep.c:826 +msgid "%B and %B are for different configurations" +msgstr "" + +#: elf32-mep.c:864 +#, c-format +msgid "private flags = 0x%lx" +msgstr "" + +#: elf32-mips.c:987 elf64-mips.c:1961 elfn32-mips.c:1806 msgid "literal relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1011 elf64-mips.c:1972 elfn32-mips.c:1815 +#: elf32-mips.c:1027 elf32-score.c:483 elf64-mips.c:2004 elfn32-mips.c:1847 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1134 elf64-mips.c:2066 elfn32-mips.c:1915 -#, c-format -msgid "Linking mips16 objects into %s format is not supported" -msgstr "" - -#: elf32-ppc.c:1652 +#: elf32-ppc.c:1680 #, c-format msgid "generic linker can't handle %s" msgstr "" -#: elf32-ppc.c:2080 +#: elf32-ppc.c:2162 msgid "corrupt or empty %s section in %B" msgstr "" -#: elf32-ppc.c:2087 +#: elf32-ppc.c:2169 msgid "unable to read in %s section from %B" msgstr "" -#: elf32-ppc.c:2093 +#: elf32-ppc.c:2175 msgid "corrupt %s section in %B" msgstr "" -#: elf32-ppc.c:2136 +#: elf32-ppc.c:2218 msgid "warning: unable to set size of %s section in %B" msgstr "" -#: elf32-ppc.c:2183 +#: elf32-ppc.c:2266 msgid "failed to allocate space for new APUinfo section." msgstr "" -#: elf32-ppc.c:2202 +#: elf32-ppc.c:2285 msgid "failed to compute new APUinfo section." msgstr "" -#: elf32-ppc.c:2205 +#: elf32-ppc.c:2288 msgid "failed to install new APUinfo section." msgstr "" -#: elf32-ppc.c:2941 +#: elf32-ppc.c:3021 msgid "%B: relocation %s cannot be used when making a shared object" msgstr "" #. It does not make sense to have a procedure linkage #. table entry for a local symbol. -#: elf32-ppc.c:3211 +#: elf32-ppc.c:3291 msgid "%B(%A+0x%lx): %s reloc against local symbol" msgstr "" -#: elf32-ppc.c:3541 +#: elf32-ppc.c:3632 elf32-ppc.c:3636 elfxx-mips.c:11015 elfxx-mips.c:11034 +#: elfxx-mips.c:11049 +msgid "Warning: %B uses hard float, %B uses soft float" +msgstr "" + +#: elf32-ppc.c:3639 elf32-ppc.c:3643 elfxx-mips.c:10996 elfxx-mips.c:11000 +msgid "Warning: %B uses unknown floating point ABI %d" +msgstr "" + +#: elf32-ppc.c:3698 msgid "" "%B: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:3549 +#: elf32-ppc.c:3706 msgid "" "%B: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:5768 elf64-ppc.c:10186 +#: elf32-ppc.c:3792 +msgid "Using bss-plt due to %B" +msgstr "" + +#: elf32-ppc.c:5997 elf64-ppc.c:10489 msgid "%B: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:6018 +#: elf32-ppc.c:6247 msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'" msgstr "" -#: elf32-ppc.c:6365 elf32-ppc.c:6391 elf32-ppc.c:6450 +#: elf32-ppc.c:6592 elf32-ppc.c:6618 elf32-ppc.c:6677 msgid "" "%B: the target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:6505 +#: elf32-ppc.c:6732 msgid "%B: relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-ppc.c:6610 elf64-ppc.c:10872 +#: elf32-ppc.c:6840 elf64-ppc.c:11184 msgid "%B(%A+0x%lx): %s reloc against `%s': error %d" msgstr "" -#: elf32-s390.c:2253 elf64-s390.c:2225 +#: elf32-s390.c:2238 elf64-s390.c:2212 msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s" msgstr "" -#: elf32-sh64.c:218 elf64-sh64.c:2322 +#: elf32-score.c:1417 elfxx-mips.c:2695 +msgid "not enough GOT space for local GOT entries" +msgstr "" + +#: elf32-score.c:2549 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "" + +#: elf32-score.c:2600 +msgid "%B: CALL15 reloc at 0x%lx not against global symbol" +msgstr "" + +#: elf32-score.c:3755 +#, c-format +msgid " [pic]" +msgstr "" + +#: elf32-score.c:3759 +#, c-format +msgid " [fix dep]" +msgstr "" + +#: elf32-score.c:3801 elfxx-mips.c:11180 +msgid "%B: warning: linking PIC files with non-PIC files" +msgstr "" + +#: elf32-sh64.c:221 elf64-sh64.c:2349 #, c-format msgid "%s: compiled as 32-bit object and %s is 64-bit" msgstr "" -#: elf32-sh64.c:221 elf64-sh64.c:2325 +#: elf32-sh64.c:224 elf64-sh64.c:2352 #, c-format msgid "%s: compiled as 64-bit object and %s is 32-bit" msgstr "" -#: elf32-sh64.c:223 elf64-sh64.c:2327 +#: elf32-sh64.c:226 elf64-sh64.c:2354 #, c-format msgid "%s: object size does not match that of target %s" msgstr "" -#: elf32-sh64.c:446 elf64-sh64.c:2899 +#: elf32-sh64.c:449 elf64-sh64.c:2893 #, c-format msgid "%s: encountered datalabel symbol in input" msgstr "" -#: elf32-sh64.c:523 +#: elf32-sh64.c:526 msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" msgstr "" -#: elf32-sh64.c:526 +#: elf32-sh64.c:529 msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" msgstr "" -#: elf32-sh64.c:544 +#: elf32-sh64.c:547 #, c-format msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" msgstr "" -#: elf32-sh64.c:593 +#: elf32-sh64.c:596 msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n" msgstr "" -#: elf32-sh64.c:669 +#: elf32-sh64.c:672 #, c-format msgid "%s: could not write out added .cranges entries" msgstr "" -#: elf32-sh64.c:729 +#: elf32-sh64.c:732 #, c-format msgid "%s: could not write out sorted .cranges entries" msgstr "" -#: elf32-sh.c:2176 +#: elf32-sh.c:532 msgid "%B: 0x%lx: warning: bad R_SH_USES offset" msgstr "" -#: elf32-sh.c:2188 +#: elf32-sh.c:544 msgid "%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "" -#: elf32-sh.c:2205 +#: elf32-sh.c:561 msgid "%B: 0x%lx: warning: bad R_SH_USES load offset" msgstr "" -#: elf32-sh.c:2220 +#: elf32-sh.c:576 msgid "%B: 0x%lx: warning: could not find expected reloc" msgstr "" -#: elf32-sh.c:2248 +#: elf32-sh.c:604 msgid "%B: 0x%lx: warning: symbol in unexpected section" msgstr "" -#: elf32-sh.c:2361 +#: elf32-sh.c:730 msgid "%B: 0x%lx: warning: could not find expected COUNT reloc" msgstr "" -#: elf32-sh.c:2370 +#: elf32-sh.c:739 msgid "%B: 0x%lx: warning: bad count" msgstr "" -#: elf32-sh.c:2765 elf32-sh.c:3135 +#: elf32-sh.c:1143 elf32-sh.c:1513 msgid "%B: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sh.c:4566 elf64-sh64.c:1509 +#: elf32-sh.c:3248 elf64-sh64.c:1525 msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" msgstr "" -#: elf32-sh.c:4791 +#: elf32-sh.c:3485 msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation" msgstr "" -#: elf32-sh.c:4824 elf32-sh.c:4839 +#: elf32-sh.c:3518 elf32-sh.c:3533 msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx" msgstr "" -#: elf32-sh.c:4853 +#: elf32-sh.c:3547 msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32" msgstr "" -#: elf32-sh.c:4867 +#: elf32-sh.c:3561 msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32" msgstr "" -#: elf32-sh.c:6601 elf64-alpha.c:4466 +#: elf32-sh.c:5274 elf64-alpha.c:4531 msgid "%B: TLS local exec code cannot be linked into shared objects" msgstr "" @@ -1581,57 +1708,138 @@ msgstr "" msgid "%B: Failed to add renamed symbol %s" msgstr "" -#: elf32-sparc.c:87 +#: elf32-sparc.c:88 msgid "%B: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:100 +#: elf32-sparc.c:101 msgid "%B: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:160 +#: elf32-spu.c:995 +msgid "warning: call to non-function symbol %s defined in %B" +msgstr "" + +#: elf32-spu.c:1315 +msgid "%B is not allowed to define %s" +msgstr "" + +#: elf32-spu.c:1352 +#, c-format +msgid "%s in overlay section" +msgstr "" + +#: elf32-spu.c:1363 +msgid "overlay stub relocation overflow" +msgstr "" + +#: elf32-spu.c:1820 +#, c-format +msgid "warning: %s overlaps %s\n" +msgstr "" + +#: elf32-spu.c:1836 +#, c-format +msgid "warning: %s exceeds section size\n" +msgstr "" + +#: elf32-spu.c:1867 +msgid "%A:0x%v not found in function table\n" +msgstr "" + +#: elf32-spu.c:1958 +msgid "" +"%B(%A+0x%v): call to non-code section %B(%A), stack analysis incomplete\n" +msgstr "" + +#: elf32-spu.c:2079 +#, c-format +msgid "%A link_order not found\n" +msgstr "" + +#: elf32-spu.c:2358 +#, c-format +msgid "Stack analysis will ignore the call from %s to %s\n" +msgstr "" + +#: elf32-spu.c:2513 +msgid "%s: 0x%v 0x%v\n" +msgstr "" + +#: elf32-spu.c:2517 +msgid " calls:\n" +msgstr "" + +#: elf32-spu.c:2524 +#, c-format +msgid " %s%s %s\n" +msgstr "" + +#: elf32-spu.c:2585 +msgid "Stack size for call graph root nodes.\n" +msgstr "" + +#: elf32-spu.c:2586 +msgid "" +"\n" +"Stack size for functions. Annotations: '*' max stack, 't' tail call\n" +msgstr "" + +#: elf32-spu.c:2615 +msgid " %s: 0x%v\n" +msgstr "" + +#: elf32-spu.c:2625 +msgid "Maximum stack required is 0x%v\n" +msgstr "" + +#: elf32-spu.c:2751 +msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'" +msgstr "" + +#: elf32-v850.c:162 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:163 +#: elf32-v850.c:165 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:166 +#: elf32-v850.c:168 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:169 +#: elf32-v850.c:171 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:172 +#: elf32-v850.c:174 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:475 +#: elf32-v850.c:477 #, c-format msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1684 +#: elf32-v850.c:1712 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1688 +#: elf32-v850.c:1716 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1692 +#: elf32-v850.c:1720 msgid "could not locate special linker symbol __ctbp" msgstr "" @@ -1659,145 +1867,144 @@ msgstr "" msgid "v850e1 architecture" msgstr "" -#: elf32-vax.c:531 +#: elf32-vax.c:540 #, c-format msgid " [nonpic]" msgstr "" -#: elf32-vax.c:534 +#: elf32-vax.c:543 #, c-format msgid " [d-float]" msgstr "" -#: elf32-vax.c:537 +#: elf32-vax.c:546 #, c-format msgid " [g-float]" msgstr "" -#: elf32-vax.c:647 +#: elf32-vax.c:656 #, c-format msgid "" "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of " "%ld" msgstr "" -#: elf32-vax.c:1604 +#: elf32-vax.c:1583 #, c-format msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" msgstr "" -#: elf32-vax.c:1728 +#: elf32-vax.c:1720 #, c-format msgid "%s: warning: %s relocation against symbol `%s' from %s section" msgstr "" -#: elf32-vax.c:1734 +#: elf32-vax.c:1726 #, c-format msgid "%s: warning: %s relocation to 0x%x from %s section" msgstr "" -#: elf32-xstormy16.c:425 elf32-ia64.c:2563 elf64-ia64.c:2563 +#: elf32-xstormy16.c:451 elf32-ia64.c:2961 elf64-ia64.c:2961 msgid "non-zero addend in @fptr reloc" msgstr "" -#: elf32-xtensa.c:705 +#: elf32-xtensa.c:733 msgid "%B(%A): invalid property table" msgstr "" -#: elf32-xtensa.c:2199 +#: elf32-xtensa.c:2177 msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)" msgstr "" -#: elf32-xtensa.c:2256 +#: elf32-xtensa.c:2234 msgid "dynamic relocation in read-only section" msgstr "" -#: elf32-xtensa.c:2421 +#: elf32-xtensa.c:2407 msgid "internal inconsistency in size of .got.loc section" msgstr "" -#: elf32-xtensa.c:2735 +#: elf32-xtensa.c:2714 msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x" msgstr "" -#: elf32-xtensa.c:3881 elf32-xtensa.c:3889 +#: elf32-xtensa.c:3920 elf32-xtensa.c:3928 msgid "Attempt to convert L32R/CALLX to CALL failed" msgstr "" -#: elf32-xtensa.c:5467 elf32-xtensa.c:5543 elf32-xtensa.c:6496 -#: elf32-xtensa.c:6550 +#: elf32-xtensa.c:5522 elf32-xtensa.c:5598 elf32-xtensa.c:6714 msgid "" "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch" msgstr "" -#: elf32-xtensa.c:6369 elf32-xtensa.c:6532 +#: elf32-xtensa.c:6454 msgid "" "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY " "relocation; possible configuration mismatch" msgstr "" -#: elf32-xtensa.c:7855 +#: elf32-xtensa.c:8166 msgid "invalid relocation address" msgstr "" -#: elf32-xtensa.c:7904 +#: elf32-xtensa.c:8215 msgid "overflow after relaxation" msgstr "" -#: elf32-xtensa.c:9032 +#: elf32-xtensa.c:9341 msgid "%B(%A+0x%lx): unexpected fix for %s relocation" msgstr "" -#: elf64-alpha.c:443 +#: elf64-alpha.c:451 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:2363 +#: elf64-alpha.c:2402 msgid "%B: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-alpha.c:4210 elf64-alpha.c:4222 +#: elf64-alpha.c:4275 elf64-alpha.c:4287 msgid "%B: gp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4248 elf64-alpha.c:4383 +#: elf64-alpha.c:4313 elf64-alpha.c:4448 msgid "%B: pc-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4276 +#: elf64-alpha.c:4341 msgid "%B: change in gp: BRSGP %s" msgstr "" -#: elf64-alpha.c:4301 +#: elf64-alpha.c:4366 msgid "" msgstr "" -#: elf64-alpha.c:4306 +#: elf64-alpha.c:4371 msgid "%B: !samegp reloc against symbol without .prologue: %s" msgstr "" -#: elf64-alpha.c:4358 +#: elf64-alpha.c:4423 msgid "%B: unhandled dynamic relocation against %s" msgstr "" -#: elf64-alpha.c:4390 +#: elf64-alpha.c:4455 msgid "%B: pc-relative relocation against undefined weak symbol %s" msgstr "" -#: elf64-alpha.c:4450 +#: elf64-alpha.c:4515 msgid "%B: dtp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4473 +#: elf64-alpha.c:4538 msgid "%B: tp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-hppa.c:2046 +#: elf64-hppa.c:2039 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "" -#: elf64-mmix.c:1163 +#: elf64-mmix.c:1175 #, c-format msgid "" "%s: Internal inconsistency error for value for\n" @@ -1805,126 +2012,122 @@ msgid "" "08lx\n" msgstr "" -#: elf64-mmix.c:1602 +#: elf64-mmix.c:1616 #, c-format msgid "" "%s: base-plus-offset relocation against register symbol: (unknown) in %s" msgstr "" -#: elf64-mmix.c:1607 +#: elf64-mmix.c:1621 #, c-format msgid "%s: base-plus-offset relocation against register symbol: %s in %s" msgstr "" -#: elf64-mmix.c:1651 +#: elf64-mmix.c:1665 #, c-format msgid "%s: register relocation against non-register symbol: (unknown) in %s" msgstr "" -#: elf64-mmix.c:1656 +#: elf64-mmix.c:1670 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" msgstr "" -#: elf64-mmix.c:1693 +#: elf64-mmix.c:1707 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" msgstr "" -#: elf64-mmix.c:1721 +#: elf64-mmix.c:1735 #, c-format msgid "" "%s: LOCAL directive: Register $%ld is not a local register. First global " "register is $%ld." msgstr "" -#: elf64-mmix.c:2207 +#: elf64-mmix.c:2200 #, c-format msgid "" "%s: Error: multiple definition of `%s'; start of %s is set in a earlier " "linked file\n" msgstr "" -#: elf64-mmix.c:2265 +#: elf64-mmix.c:2258 msgid "Register section has contents\n" msgstr "" -#: elf64-mmix.c:2457 +#: elf64-mmix.c:2450 #, c-format msgid "" "Internal inconsistency: remaining %u != max %u.\n" " Please report this bug." msgstr "" -#: elf64-ppc.c:2500 libbfd.c:931 +#: elf64-ppc.c:2568 libbfd.c:948 msgid "%B: compiled for a big endian system and target is little endian" msgstr "" -#: elf64-ppc.c:2503 libbfd.c:933 +#: elf64-ppc.c:2571 libbfd.c:950 msgid "%B: compiled for a little endian system and target is big endian" msgstr "" -#: elf64-ppc.c:5707 +#: elf64-ppc.c:5887 #, c-format msgid "" "copy reloc against `%s' requires lazy plt linking; avoid setting " "LD_BIND_NOW=1 or upgrade gcc" msgstr "" -#: elf64-ppc.c:6155 +#: elf64-ppc.c:6315 msgid "dynreloc miscount for %B, section %A" msgstr "" -#: elf64-ppc.c:6257 +#: elf64-ppc.c:6419 msgid "%B: .opd is not a regular array of opd entries" msgstr "" -#: elf64-ppc.c:6266 +#: elf64-ppc.c:6428 msgid "%B: unexpected reloc type %u in .opd section" msgstr "" -#: elf64-ppc.c:6287 +#: elf64-ppc.c:6449 msgid "%B: undefined sym `%s' in .opd section" msgstr "" -#: elf64-ppc.c:6939 elf64-ppc.c:7318 +#: elf64-ppc.c:7156 elf64-ppc.c:7536 #, c-format msgid "%s defined in removed toc entry" msgstr "" -#: elf64-ppc.c:8041 +#: elf64-ppc.c:8271 #, c-format msgid "long branch stub `%s' offset overflow" msgstr "" -#: elf64-ppc.c:8116 +#: elf64-ppc.c:8346 #, c-format msgid "can't find branch stub `%s'" msgstr "" -#: elf64-ppc.c:8155 elf64-ppc.c:8231 +#: elf64-ppc.c:8412 elf64-ppc.c:8488 #, c-format msgid "linkage table error against `%s'" msgstr "" -#: elf64-ppc.c:8360 +#: elf64-ppc.c:8617 #, c-format msgid "can't build branch stub `%s'" msgstr "" -#: elf64-ppc.c:8784 +#: elf64-ppc.c:9069 msgid "%B section %A exceeds stub group size" msgstr "" -#: elf64-ppc.c:9295 -msgid ".glink and .plt too far apart" -msgstr "" - -#: elf64-ppc.c:9408 +#: elf64-ppc.c:9681 msgid "stubs don't match calculated size" msgstr "" -#: elf64-ppc.c:9420 +#: elf64-ppc.c:9693 #, c-format msgid "" "linker stubs in %u group%s\n" @@ -1935,28 +2138,28 @@ msgid "" " plt call %lu" msgstr "" -#: elf64-ppc.c:10075 +#: elf64-ppc.c:10377 msgid "" "%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; " "recompile with -mminimal-toc or upgrade gcc" msgstr "" -#: elf64-ppc.c:10083 +#: elf64-ppc.c:10385 msgid "" "%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic " "multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, " "or make `%s' extern" msgstr "" -#: elf64-ppc.c:10727 +#: elf64-ppc.c:11036 msgid "%B: relocation %s is not supported for symbol %s." msgstr "" -#: elf64-ppc.c:10806 +#: elf64-ppc.c:11118 msgid "%B: error: relocation %s not a multiple of %d" msgstr "" -#: elf64-sh64.c:1676 +#: elf64-sh64.c:1700 #, c-format msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" msgstr "" @@ -1981,471 +2184,519 @@ msgstr "" msgid "%B: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf64-x86-64.c:692 elf64-x86-64.c:818 elf64-x86-64.c:2069 +#: elf64-x86-64.c:798 elf64-x86-64.c:958 elf64-x86-64.c:2359 msgid "" "%B: relocation %s against `%s' can not be used when making a shared object; " "recompile with -fPIC" msgstr "" -#: elf64-x86-64.c:760 +#: elf64-x86-64.c:889 msgid "%B: %s' accessed both as normal and thread local symbol" msgstr "" -#: elf64-x86-64.c:2000 +#: elf64-x86-64.c:2271 msgid "" "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be " "used when making a shared object" msgstr "" -#: elf64-x86-64.c:2065 +#: elf64-x86-64.c:2355 msgid "" "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used " "when making a shared object" msgstr "" -#: elf.c:288 +#: elf-attrs.c:581 +msgid "ERROR: %B: Must be processed by '%s' toolchain" +msgstr "" + +#: elf-attrs.c:601 elf-attrs.c:620 +msgid "ERROR: %B: Incompatible object tag '%s':%d" +msgstr "" + +#: elf.c:309 msgid "%B: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf.c:552 +#: elf.c:411 +msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section" +msgstr "" + +#: elf.c:564 +msgid "%B: Corrupt size field in group section header: 0x%lx" +msgstr "" + +#: elf.c:600 msgid "%B: invalid SHT_GROUP entry" msgstr "" -#: elf.c:622 +#: elf.c:670 msgid "%B: no group info for section %A" msgstr "" -#: elf.c:652 elf.c:3091 elflink.c:7588 +#: elf.c:700 elf.c:3251 elflink.c:9120 msgid "%B: warning: sh_link not set for section `%A'" msgstr "" -#: elf.c:688 +#: elf.c:716 +msgid "%B: sh_link [%d] in section `%A' is incorrect" +msgstr "" + +#: elf.c:751 msgid "%B: unknown [%d] section `%s' in group [%s]" msgstr "" -#: elf.c:1071 +#: elf.c:1160 #, c-format msgid "" "\n" "Program Header:\n" msgstr "" -#: elf.c:1123 +#: elf.c:1202 #, c-format msgid "" "\n" "Dynamic Section:\n" msgstr "" -#: elf.c:1248 +#: elf.c:1328 #, c-format msgid "" "\n" "Version definitions:\n" msgstr "" -#: elf.c:1273 +#: elf.c:1353 #, c-format msgid "" "\n" "Version References:\n" msgstr "" -#: elf.c:1278 +#: elf.c:1358 #, c-format msgid " required from %s:\n" msgstr "" -#: elf.c:1985 +#: elf.c:2054 msgid "%B: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf.c:3062 +#: elf.c:2222 +msgid "" +"%B: don't know how to handle allocated, application specific section `%s' [0x" +"%8x]" +msgstr "" + +#: elf.c:2234 +msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]" +msgstr "" + +#: elf.c:2245 +msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]" +msgstr "" + +#: elf.c:2255 +msgid "%B: don't know how to handle section `%s' [0x%8x]" +msgstr "" + +#: elf.c:3208 msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'" msgstr "" -#: elf.c:4070 -msgid "%B: Not enough room for program headers (allocated %u, need %u)" +#: elf.c:3231 +msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'" msgstr "" -#: elf.c:4173 +#: elf.c:4472 msgid "" "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section" msgstr "" -#: elf.c:4217 +#: elf.c:4495 msgid "%B: Not enough room for program headers, try linking with -N" msgstr "" -#: elf.c:4308 +#: elf.c:4573 msgid "%B: section %A lma 0x%lx overlaps previous sections" msgstr "" -#: elf.c:4709 +#: elf.c:4671 +msgid "%B: section `%A' can't be allocated in segment %d" +msgstr "" + +#: elf.c:4720 msgid "%B: warning: allocated section `%s' not in segment" msgstr "" -#: elf.c:5002 +#: elf.c:5209 msgid "%B: symbol `%s' required but not present" msgstr "" -#: elf.c:5299 +#: elf.c:5522 msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n" msgstr "" -#: elf.c:5961 +#: elf.c:6425 #, c-format msgid "" "Unable to find equivalent output section for symbol '%s' from section '%s'" msgstr "" -#: elf.c:6917 +#: elf.c:7399 msgid "%B: unsupported relocation type %s" msgstr "" -#: elfcode.h:1110 +#: elfcode.h:810 +#, c-format +msgid "warning: %s has a corrupt string table index - ignoring" +msgstr "" + +#: elfcode.h:1176 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elfcode.h:1337 +#: elfcode.h:1409 #, c-format msgid "%s(%s): relocation %d has invalid symbol index %ld" msgstr "" -#: elf-hppa.h:1443 elf-hppa.h:1458 +#: elf-eh-frame.c:822 +msgid "" +"%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n" +msgstr "" + +#: elf-eh-frame.c:973 +msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n" +msgstr "" + +#: elf-hppa.h:2218 elf-hppa.h:2232 msgid "%B(%A): warning: unresolvable relocation against symbol `%s'" msgstr "" -#: elflink.c:907 +#: elflink.c:1004 msgid "" "%s: TLS definition in %B section %A mismatches non-TLS definition in %B " "section %A" msgstr "" -#: elflink.c:911 +#: elflink.c:1008 msgid "%s: TLS reference in %B mismatches non-TLS reference in %B" msgstr "" -#: elflink.c:915 +#: elflink.c:1012 msgid "%s: TLS definition in %B section %A mismatches non-TLS reference in %B" msgstr "" -#: elflink.c:919 +#: elflink.c:1016 msgid "%s: TLS reference in %B mismatches non-TLS definition in %B section %A" msgstr "" -#: elflink.c:1491 +#: elflink.c:1630 msgid "%B: unexpected redefinition of indirect versioned symbol `%s'" msgstr "" -#: elflink.c:1807 -msgid "%B: undefined versioned symbol name %s" +#: elflink.c:1950 +msgid "%B: version node not found for symbol %s" msgstr "" -#: elflink.c:1955 +#: elflink.c:2098 msgid "" "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'" msgstr "" -#: elflink.c:2147 +#: elflink.c:2290 msgid "%B: relocation size mismatch in %B section %A" msgstr "" -#: elflink.c:2437 +#: elflink.c:2598 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.c:2761 -msgid "warning: creating a DT_TEXTREL in a shared object." -msgstr "" - -#: elflink.c:3696 +#: elflink.c:3893 msgid "%B: %s: invalid version %u (max %d)" msgstr "" -#: elflink.c:3732 +#: elflink.c:3929 msgid "%B: %s: invalid needed version %d" msgstr "" -#: elflink.c:3912 +#: elflink.c:4112 +msgid "" +"Warning: alignment %u of common symbol `%s' in %B is greater than the " +"alignment (%u) of its section %A" +msgstr "" + +#: elflink.c:4118 msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B" msgstr "" -#: elflink.c:3924 +#: elflink.c:4133 msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B" msgstr "" -#: elflink.c:4091 +#: elflink.c:4309 #, c-format msgid "%s: invalid DSO for symbol `%s' definition" msgstr "" -#: elflink.c:5152 +#: elflink.c:5535 #, c-format msgid "%s: undefined version: %s" msgstr "" -#: elflink.c:5219 +#: elflink.c:5603 msgid "%B: .preinit_array section is not allowed in DSO" msgstr "" -#: elflink.c:5978 +#: elflink.c:6621 +#, c-format +msgid "undefined %s reference in complex symbol: %s" +msgstr "" + +#: elflink.c:6776 +#, c-format +msgid "unknown operator '%c' in complex symbol" +msgstr "" + +#: elflink.c:7315 elflink.c:7332 elflink.c:7369 elflink.c:7386 +msgid "%B: Unable to sort relocs - they are in more than one size" +msgstr "" + +#: elflink.c:7346 elflink.c:7400 +msgid "%B: Unable to sort relocs - they are of an unknown size" +msgstr "" + +#: elflink.c:7449 msgid "Not enough memory to sort relocations" msgstr "" -#: elflink.c:6369 +#: elflink.c:7636 +msgid "%B: Too many sections: %d (>= %d)" +msgstr "" + +#: elflink.c:7870 msgid "%B: %s symbol `%s' in %B is referenced by DSO" msgstr "" -#: elflink.c:6452 +#: elflink.c:7953 msgid "%B: could not find output section %A for input section %A" msgstr "" -#: elflink.c:6549 +#: elflink.c:8050 msgid "%B: %s symbol `%s' isn't defined" msgstr "" -#: elflink.c:7024 +#: elflink.c:8546 msgid "" "error: %B contains a reloc (0x%s) for section %A that references a non-" "existent global symbol" msgstr "" -#: elflink.c:7058 +#: elflink.c:8580 msgid "" "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' " "of %B\n" msgstr "" -#: elflink.c:7665 +#: elflink.c:9198 msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections" msgstr "" -#: elflink.c:7670 +#: elflink.c:9203 #, c-format msgid "%A has both ordered and unordered sections" msgstr "" -#: elflink.c:8487 elflink.c:8528 +#: elflink.c:10090 elflink.c:10134 msgid "%B: could not find output section %s" msgstr "" -#: elflink.c:8492 +#: elflink.c:10095 #, c-format msgid "warning: %s section has zero size" msgstr "" -#: elflink.c:9087 +#: elflink.c:10199 +msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n" +msgstr "" + +#: elflink.c:10567 +msgid "Removing unused section '%s' in file '%B'" +msgstr "" + +#: elflink.c:10758 msgid "Warning: gc-sections option ignored" msgstr "" -#: elflink.c:9704 +#: elflink.c:11249 +msgid "%P%X: can not read symbols: %E\n" +msgstr "" + +#: elflink.c:11391 msgid "%B: ignoring duplicate section `%A'" msgstr "" -#: elflink.c:9711 elflink.c:9718 +#: elflink.c:11398 elflink.c:11405 msgid "%B: duplicate section `%A' has different size" msgstr "" -#: elflink.c:9726 elflink.c:9731 +#: elflink.c:11413 elflink.c:11418 msgid "%B: warning: could not read contents of section `%A'" msgstr "" -#: elflink.c:9735 +#: elflink.c:11422 msgid "%B: warning: duplicate section `%A' has different contents" msgstr "" -#: elfxx-mips.c:866 +#: elf-m10300.c:1531 +msgid "" +"error: inappropriate relocation type for shared library (did you forget -" +"fpic?)" +msgstr "" + +#: elf-m10300.c:1534 +msgid "internal error: suspicious relocation type used in shared library" +msgstr "" + +#: elfxx-mips.c:986 msgid "static procedure (no name)" msgstr "" -#: elfxx-mips.c:2513 -msgid "not enough GOT space for local GOT entries" -msgstr "" - -#: elfxx-mips.c:4356 +#: elfxx-mips.c:4657 msgid "%B: %A+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elfxx-mips.c:4993 elfxx-mips.c:5214 +#: elfxx-mips.c:5320 elfxx-mips.c:5540 msgid "%B: Warning: bad `%s' option size %u smaller than its header" msgstr "" -#: elfxx-mips.c:5965 +#: elfxx-mips.c:6399 msgid "%B: Malformed reloc detected for section %s" msgstr "" -#: elfxx-mips.c:6041 +#: elfxx-mips.c:6441 +msgid "%B: GOT reloc at 0x%lx not expected in executables" +msgstr "" + +#: elfxx-mips.c:6511 msgid "%B: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elfxx-mips.c:9380 +#: elfxx-mips.c:7874 +msgid "" +"%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%" +"A'" +msgstr "" + +#: elfxx-mips.c:10640 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elfxx-mips.c:9719 +#: elfxx-mips.c:11010 elfxx-mips.c:11029 +msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float" +msgstr "" + +#: elfxx-mips.c:11085 msgid "%B: endianness incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:9731 +#: elfxx-mips.c:11097 msgid "%B: ABI is incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:9803 -msgid "%B: warning: linking PIC files with non-PIC files" -msgstr "" - -#: elfxx-mips.c:9820 +#: elfxx-mips.c:11197 msgid "%B: linking 32-bit code with 64-bit code" msgstr "" -#: elfxx-mips.c:9848 +#: elfxx-mips.c:11225 msgid "%B: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:9871 +#: elfxx-mips.c:11248 msgid "%B: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:9936 +#: elfxx-mips.c:11313 #, c-format msgid " [abi=O32]" msgstr "" -#: elfxx-mips.c:9938 +#: elfxx-mips.c:11315 #, c-format msgid " [abi=O64]" msgstr "" -#: elfxx-mips.c:9940 +#: elfxx-mips.c:11317 #, c-format msgid " [abi=EABI32]" msgstr "" -#: elfxx-mips.c:9942 +#: elfxx-mips.c:11319 #, c-format msgid " [abi=EABI64]" msgstr "" -#: elfxx-mips.c:9944 +#: elfxx-mips.c:11321 #, c-format msgid " [abi unknown]" msgstr "" -#: elfxx-mips.c:9946 +#: elfxx-mips.c:11323 #, c-format msgid " [abi=N32]" msgstr "" -#: elfxx-mips.c:9948 +#: elfxx-mips.c:11325 #, c-format msgid " [abi=64]" msgstr "" -#: elfxx-mips.c:9950 +#: elfxx-mips.c:11327 #, c-format msgid " [no abi set]" msgstr "" -#: elfxx-mips.c:9953 -#, c-format -msgid " [mips1]" -msgstr "" - -#: elfxx-mips.c:9955 -#, c-format -msgid " [mips2]" -msgstr "" - -#: elfxx-mips.c:9957 -#, c-format -msgid " [mips3]" -msgstr "" - -#: elfxx-mips.c:9959 -#, c-format -msgid " [mips4]" -msgstr "" - -#: elfxx-mips.c:9961 -#, c-format -msgid " [mips5]" -msgstr "" - -#: elfxx-mips.c:9963 -#, c-format -msgid " [mips32]" -msgstr "" - -#: elfxx-mips.c:9965 -#, c-format -msgid " [mips64]" -msgstr "" - -#: elfxx-mips.c:9967 -#, c-format -msgid " [mips32r2]" -msgstr "" - -#: elfxx-mips.c:9969 -#, c-format -msgid " [mips64r2]" -msgstr "" - -#: elfxx-mips.c:9971 +#: elfxx-mips.c:11348 #, c-format msgid " [unknown ISA]" msgstr "" -#: elfxx-mips.c:9974 -#, c-format -msgid " [mdmx]" -msgstr "" - -#: elfxx-mips.c:9977 -#, c-format -msgid " [mips16]" -msgstr "" - -#: elfxx-mips.c:9980 -#, c-format -msgid " [32bitmode]" -msgstr "" - -#: elfxx-mips.c:9982 +#: elfxx-mips.c:11359 #, c-format msgid " [not 32bitmode]" msgstr "" -#: elfxx-sparc.c:402 +#: elfxx-sparc.c:428 #, c-format msgid "invalid relocation type %d" msgstr "" -#: elfxx-sparc.c:2783 +#: elfxx-sparc.c:2899 msgid "%B: probably compiled without -fPIC?" msgstr "" -#: i386linux.c:457 m68klinux.c:461 sparclinux.c:458 +#: i386linux.c:454 m68klinux.c:458 sparclinux.c:453 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "" -#: i386linux.c:465 m68klinux.c:469 sparclinux.c:466 +#: i386linux.c:462 m68klinux.c:466 sparclinux.c:461 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "" -#: i386linux.c:654 i386linux.c:704 m68klinux.c:661 m68klinux.c:709 -#: sparclinux.c:656 sparclinux.c:706 +#: i386linux.c:651 i386linux.c:701 m68klinux.c:658 m68klinux.c:706 +#: sparclinux.c:651 sparclinux.c:701 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "" -#: i386linux.c:728 m68klinux.c:733 sparclinux.c:730 +#: i386linux.c:725 m68klinux.c:730 sparclinux.c:725 msgid "Warning: fixup count mismatch\n" msgstr "" @@ -2479,161 +2730,161 @@ msgstr "" msgid "%B:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -#: ihex.c:389 +#: ihex.c:390 msgid "%B:%u: bad extended address record length in Intel Hex file" msgstr "" -#: ihex.c:406 +#: ihex.c:407 msgid "%B:%u: bad extended start address length in Intel Hex file" msgstr "" -#: ihex.c:423 +#: ihex.c:424 msgid "%B:%u: bad extended linear address record length in Intel Hex file" msgstr "" -#: ihex.c:440 +#: ihex.c:441 msgid "%B:%u: bad extended linear start address length in Intel Hex file" msgstr "" -#: ihex.c:457 +#: ihex.c:458 msgid "%B:%u: unrecognized ihex type %u in Intel Hex file" msgstr "" -#: ihex.c:578 +#: ihex.c:577 msgid "%B: internal error in ihex_read_section" msgstr "" -#: ihex.c:612 +#: ihex.c:611 msgid "%B: bad section length in ihex_read_section" msgstr "" -#: ihex.c:824 +#: ihex.c:823 #, c-format msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "" -#: libbfd.c:961 +#: libbfd.c:978 #, c-format msgid "Deprecated %s called at %s line %d in %s\n" msgstr "" -#: libbfd.c:964 +#: libbfd.c:981 #, c-format msgid "Deprecated %s called\n" msgstr "" -#: linker.c:1873 +#: linker.c:1877 msgid "%B: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: linker.c:2740 +#: linker.c:2743 #, c-format msgid "Attempt to do relocatable link with %s input and %s output" msgstr "" -#: linker.c:3037 +#: linker.c:3044 msgid "%B: warning: ignoring duplicate section `%A'\n" msgstr "" -#: linker.c:3051 +#: linker.c:3058 msgid "%B: warning: duplicate section `%A' has different size\n" msgstr "" -#: merge.c:817 +#: merge.c:818 #, c-format msgid "%s: access beyond end of merged section (%ld)" msgstr "" -#: mmo.c:456 +#: mmo.c:454 #, c-format msgid "%s: No core to allocate section name %s\n" msgstr "" -#: mmo.c:531 +#: mmo.c:529 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "" -#: mmo.c:1187 +#: mmo.c:1185 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "" -#: mmo.c:1332 +#: mmo.c:1330 #, c-format msgid "" "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " "starting with `%s'\n" msgstr "" -#: mmo.c:1566 +#: mmo.c:1564 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "" -#: mmo.c:1576 +#: mmo.c:1574 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "" -#: mmo.c:1612 +#: mmo.c:1610 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -#: mmo.c:1658 +#: mmo.c:1656 #, c-format msgid "" "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" msgstr "" -#: mmo.c:1697 +#: mmo.c:1695 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1706 +#: mmo.c:1704 #, c-format msgid "" "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1729 +#: mmo.c:1727 #, c-format msgid "" "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " "for lop_fixrx\n" msgstr "" -#: mmo.c:1752 +#: mmo.c:1750 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "" -#: mmo.c:1772 +#: mmo.c:1770 #, c-format msgid "" "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" msgstr "" -#: mmo.c:1785 +#: mmo.c:1783 #, c-format msgid "" "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -#: mmo.c:1892 +#: mmo.c:1890 #, c-format msgid "" "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -#: mmo.c:1928 +#: mmo.c:1926 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "" -#: mmo.c:1941 +#: mmo.c:1939 #, c-format msgid "" "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " @@ -2686,7 +2937,7 @@ msgid "" "08lx\n" msgstr "" -#: oasys.c:876 +#: oasys.c:880 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "" @@ -2697,37 +2948,37 @@ msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" #. XXX code yet to be written. -#: peicode.h:731 +#: peicode.h:757 msgid "%B: Unhandled import type; %x" msgstr "" -#: peicode.h:736 +#: peicode.h:762 msgid "%B: Unrecognised import type; %x" msgstr "" -#: peicode.h:750 +#: peicode.h:776 msgid "%B: Unrecognised import name type; %x" msgstr "" -#: peicode.h:1120 +#: peicode.h:1159 msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#: peicode.h:1132 +#: peicode.h:1171 msgid "" "%B: Recognised but unhandled machine type (0x%x) in Import Library Format " "archive" msgstr "" -#: peicode.h:1150 +#: peicode.h:1189 msgid "%B: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:1181 +#: peicode.h:1220 msgid "%B: string not null terminated in ILF object file." msgstr "" -#: pe-mips.c:588 +#: pe-mips.c:605 msgid "%B: `ld -r' not supported with PE MIPS objects\n" msgstr "" @@ -2735,75 +2986,75 @@ msgstr "" #. src = VMA of the memory we're fixing up #. mem = pointer to memory we're fixing up #. val = VMA of what we need to refer to. -#: pe-mips.c:704 +#: pe-mips.c:721 msgid "%B: unimplemented %s\n" msgstr "" -#: pe-mips.c:730 +#: pe-mips.c:747 msgid "%B: jump too far away\n" msgstr "" -#: pe-mips.c:756 +#: pe-mips.c:773 msgid "%B: bad pair/reflo after refhi\n" msgstr "" -#: ppcboot.c:419 +#: ppcboot.c:412 #, c-format msgid "" "\n" "ppcboot header:\n" msgstr "" -#: ppcboot.c:420 +#: ppcboot.c:413 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:421 +#: ppcboot.c:414 #, c-format msgid "Length = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:424 +#: ppcboot.c:417 #, c-format msgid "Flag field = 0x%.2x\n" msgstr "" -#: ppcboot.c:430 +#: ppcboot.c:423 #, c-format msgid "Partition name = \"%s\"\n" msgstr "" -#: ppcboot.c:449 +#: ppcboot.c:442 #, c-format msgid "" "\n" "Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:455 +#: ppcboot.c:448 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:461 +#: ppcboot.c:454 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:462 +#: ppcboot.c:455 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5069 +#: som.c:5088 #, c-format msgid "" "\n" "Exec Auxiliary Header\n" msgstr "" -#: som.c:5330 +#: som.c:5349 msgid "som_sizeof_headers unimplemented" msgstr "" @@ -2811,11 +3062,11 @@ msgstr "" msgid "%B:%d: Unexpected character `%s' in S-record file\n" msgstr "" -#: stabs.c:276 +#: stabs.c:277 msgid "%B(%A+0x%lx): Stabs entry has invalid string index." msgstr "" -#: syms.c:1048 +#: syms.c:1056 msgid "Unsupported .stab relocation" msgstr "" @@ -2978,316 +3229,320 @@ msgstr "" msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:564 +#: xcofflink.c:565 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:585 +#: xcofflink.c:586 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:1148 +#: xcofflink.c:1149 msgid "%B: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1200 +#: xcofflink.c:1201 msgid "%B: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1223 +#: xcofflink.c:1224 msgid "%B: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1235 +#: xcofflink.c:1236 msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1271 +#: xcofflink.c:1272 msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1417 +#: xcofflink.c:1418 msgid "%B: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:1524 +#: xcofflink.c:1525 msgid "%B: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:1839 +#: xcofflink.c:1841 msgid "%B: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2637 +#: xcofflink.c:2639 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:2866 +#: xcofflink.c:2868 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:3033 +#: xcofflink.c:3035 msgid "error: undefined symbol __rtinit" msgstr "" -#: xcofflink.c:3653 +#: xcofflink.c:3655 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:4489 +#: xcofflink.c:4491 msgid "%B: loader reloc in unrecognized section `%A'" msgstr "" -#: xcofflink.c:4510 +#: xcofflink.c:4512 msgid "%B: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:4525 +#: xcofflink.c:4527 msgid "%B: loader reloc in read-only section %A" msgstr "" -#: xcofflink.c:4934 xcofflink.c:4996 xcofflink.c:5291 +#: xcofflink.c:4936 xcofflink.c:4998 xcofflink.c:5293 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5302 +#: xcofflink.c:5304 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: elf32-ia64.c:1139 elf64-ia64.c:1139 +#: elf32-ia64.c:1168 elf64-ia64.c:1168 msgid "" "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect " "branch." msgstr "" -#: elf32-ia64.c:2508 elf64-ia64.c:2508 +#: elf32-ia64.c:2909 elf64-ia64.c:2909 msgid "@pltoff reloc against local symbol" msgstr "" -#: elf32-ia64.c:3955 elf64-ia64.c:3955 +#: elf32-ia64.c:4522 elf64-ia64.c:4522 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "" -#: elf32-ia64.c:3966 elf64-ia64.c:3966 +#: elf32-ia64.c:4533 elf64-ia64.c:4533 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "" -#: elf32-ia64.c:4213 elf64-ia64.c:4213 +#: elf32-ia64.c:4807 elf64-ia64.c:4807 msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'" msgstr "" -#: elf32-ia64.c:4280 elf64-ia64.c:4280 +#: elf32-ia64.c:4874 elf64-ia64.c:4874 msgid "%B: @gprel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4343 elf64-ia64.c:4343 +#: elf32-ia64.c:4937 elf64-ia64.c:4937 msgid "%B: linking non-pic code in a position independent executable" msgstr "" -#: elf32-ia64.c:4480 elf64-ia64.c:4480 +#: elf32-ia64.c:5074 elf64-ia64.c:5074 msgid "%B: @internal branch to dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4482 elf64-ia64.c:4482 +#: elf32-ia64.c:5076 elf64-ia64.c:5076 msgid "%B: speculation fixup to dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4484 elf64-ia64.c:4484 +#: elf32-ia64.c:5078 elf64-ia64.c:5078 msgid "%B: @pcrel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4691 elf64-ia64.c:4691 +#: elf32-ia64.c:5278 elf64-ia64.c:5278 msgid "unsupported reloc" msgstr "" -#: elf32-ia64.c:4724 elf64-ia64.c:4724 +#: elf32-ia64.c:5311 elf64-ia64.c:5311 msgid "" "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> " "0x1000000)." msgstr "" -#: elf32-ia64.c:4985 elf64-ia64.c:4985 +#: elf32-ia64.c:5572 elf64-ia64.c:5572 msgid "%B: linking trap-on-NULL-dereference with non-trapping files" msgstr "" -#: elf32-ia64.c:4994 elf64-ia64.c:4994 +#: elf32-ia64.c:5581 elf64-ia64.c:5581 msgid "%B: linking big-endian files with little-endian files" msgstr "" -#: elf32-ia64.c:5003 elf64-ia64.c:5003 +#: elf32-ia64.c:5590 elf64-ia64.c:5590 msgid "%B: linking 64-bit files with 32-bit files" msgstr "" -#: elf32-ia64.c:5012 elf64-ia64.c:5012 +#: elf32-ia64.c:5599 elf64-ia64.c:5599 msgid "%B: linking constant-gp files with non-constant-gp files" msgstr "" -#: elf32-ia64.c:5022 elf64-ia64.c:5022 +#: elf32-ia64.c:5609 elf64-ia64.c:5609 msgid "%B: linking auto-pic files with non-auto-pic files" msgstr "" -#: peigen.c:979 pepigen.c:979 +#: peigen.c:998 pepigen.c:998 pex64igen.c:998 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1025 pepigen.c:1025 pex64igen.c:1025 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:1007 pepigen.c:1007 +#: peigen.c:1026 pepigen.c:1026 pex64igen.c:1026 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:1008 pepigen.c:1008 +#: peigen.c:1027 pepigen.c:1027 pex64igen.c:1027 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:1009 pepigen.c:1009 +#: peigen.c:1028 pepigen.c:1028 pex64igen.c:1028 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:1010 pepigen.c:1010 +#: peigen.c:1029 pepigen.c:1029 pex64igen.c:1029 msgid "Security Directory" msgstr "" -#: peigen.c:1011 pepigen.c:1011 +#: peigen.c:1030 pepigen.c:1030 pex64igen.c:1030 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:1012 pepigen.c:1012 +#: peigen.c:1031 pepigen.c:1031 pex64igen.c:1031 msgid "Debug Directory" msgstr "" -#: peigen.c:1013 pepigen.c:1013 +#: peigen.c:1032 pepigen.c:1032 pex64igen.c:1032 msgid "Description Directory" msgstr "" -#: peigen.c:1014 pepigen.c:1014 +#: peigen.c:1033 pepigen.c:1033 pex64igen.c:1033 msgid "Special Directory" msgstr "" -#: peigen.c:1015 pepigen.c:1015 +#: peigen.c:1034 pepigen.c:1034 pex64igen.c:1034 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:1016 pepigen.c:1016 +#: peigen.c:1035 pepigen.c:1035 pex64igen.c:1035 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:1017 pepigen.c:1017 +#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036 msgid "Bound Import Directory" msgstr "" -#: peigen.c:1018 pepigen.c:1018 +#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:1019 pepigen.c:1019 +#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038 msgid "Delay Import Directory" msgstr "" -#: peigen.c:1020 peigen.c:1021 pepigen.c:1020 pepigen.c:1021 +#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039 +msgid "CLR Runtime Header" +msgstr "" + +#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040 msgid "Reserved" msgstr "" -#: peigen.c:1081 pepigen.c:1081 +#: peigen.c:1100 pepigen.c:1100 pex64igen.c:1100 #, c-format msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1086 pepigen.c:1086 +#: peigen.c:1105 pepigen.c:1105 pex64igen.c:1105 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1129 pepigen.c:1129 +#: peigen.c:1148 pepigen.c:1148 pex64igen.c:1148 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1132 pepigen.c:1132 +#: peigen.c:1151 pepigen.c:1151 pex64igen.c:1151 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1140 pepigen.c:1140 +#: peigen.c:1159 pepigen.c:1159 pex64igen.c:1159 #, c-format msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1145 pepigen.c:1145 +#: peigen.c:1164 pepigen.c:1164 pex64igen.c:1164 #, c-format msgid "" "\n" "The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1148 pepigen.c:1148 +#: peigen.c:1167 pepigen.c:1167 pex64igen.c:1167 #, c-format msgid "" " vma: Hint Time Forward DLL First\n" " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1196 pepigen.c:1196 +#: peigen.c:1215 pepigen.c:1215 pex64igen.c:1215 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1207 pepigen.c:1207 +#: peigen.c:1226 pepigen.c:1226 pex64igen.c:1226 #, c-format msgid "\tvma: Hint/Ord Member-Name Bound-To\n" msgstr "" -#: peigen.c:1232 pepigen.c:1232 +#: peigen.c:1251 pepigen.c:1251 pex64igen.c:1251 #, c-format msgid "" "\n" "There is a first thunk, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1365 pepigen.c:1365 +#: peigen.c:1416 pepigen.c:1416 pex64igen.c:1416 #, c-format msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1374 pepigen.c:1374 +#: peigen.c:1425 pepigen.c:1425 pex64igen.c:1425 #, c-format msgid "" "\n" "There is an export table in %s, but it does not fit into that section\n" msgstr "" -#: peigen.c:1380 pepigen.c:1380 +#: peigen.c:1431 pepigen.c:1431 pex64igen.c:1431 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1408 pepigen.c:1408 +#: peigen.c:1459 pepigen.c:1459 pex64igen.c:1459 #, c-format msgid "" "\n" @@ -3295,128 +3550,128 @@ msgid "" "\n" msgstr "" -#: peigen.c:1412 pepigen.c:1412 +#: peigen.c:1463 pepigen.c:1463 pex64igen.c:1463 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1415 pepigen.c:1415 +#: peigen.c:1466 pepigen.c:1466 pex64igen.c:1466 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1418 pepigen.c:1418 +#: peigen.c:1469 pepigen.c:1469 pex64igen.c:1469 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1421 pepigen.c:1421 +#: peigen.c:1472 pepigen.c:1472 pex64igen.c:1472 #, c-format msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1427 pepigen.c:1427 +#: peigen.c:1478 pepigen.c:1478 pex64igen.c:1478 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1430 pepigen.c:1430 +#: peigen.c:1481 pepigen.c:1481 pex64igen.c:1481 #, c-format msgid "Number in:\n" msgstr "" -#: peigen.c:1433 pepigen.c:1433 +#: peigen.c:1484 pepigen.c:1484 pex64igen.c:1484 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1437 pepigen.c:1437 +#: peigen.c:1488 pepigen.c:1488 pex64igen.c:1488 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1440 pepigen.c:1440 +#: peigen.c:1491 pepigen.c:1491 pex64igen.c:1491 #, c-format msgid "Table Addresses\n" msgstr "" -#: peigen.c:1443 pepigen.c:1443 +#: peigen.c:1494 pepigen.c:1494 pex64igen.c:1494 #, c-format msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1448 pepigen.c:1448 +#: peigen.c:1499 pepigen.c:1499 pex64igen.c:1499 #, c-format msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1453 pepigen.c:1453 +#: peigen.c:1504 pepigen.c:1504 pex64igen.c:1504 #, c-format msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1467 pepigen.c:1467 +#: peigen.c:1518 pepigen.c:1518 pex64igen.c:1518 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1486 pepigen.c:1486 +#: peigen.c:1537 pepigen.c:1537 pex64igen.c:1537 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1497 pepigen.c:1497 +#: peigen.c:1548 pepigen.c:1548 pex64igen.c:1548 msgid "Export RVA" msgstr "" -#: peigen.c:1504 pepigen.c:1504 +#: peigen.c:1555 pepigen.c:1555 pex64igen.c:1555 #, c-format msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1557 pepigen.c:1557 +#: peigen.c:1608 pepigen.c:1608 pex64igen.c:1608 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1561 pepigen.c:1561 +#: peigen.c:1612 pepigen.c:1612 pex64igen.c:1612 #, c-format msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1564 pepigen.c:1564 +#: peigen.c:1615 pepigen.c:1615 pex64igen.c:1615 #, c-format msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr "" -#: peigen.c:1566 pepigen.c:1566 +#: peigen.c:1617 pepigen.c:1617 pex64igen.c:1617 #, c-format msgid "" " vma:\t\tBegin End EH EH PrologEnd Exception\n" " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1636 pepigen.c:1636 +#: peigen.c:1687 pepigen.c:1687 pex64igen.c:1687 #, c-format msgid " Register save millicode" msgstr "" -#: peigen.c:1639 pepigen.c:1639 +#: peigen.c:1690 pepigen.c:1690 pex64igen.c:1690 #, c-format msgid " Register restore millicode" msgstr "" -#: peigen.c:1642 pepigen.c:1642 +#: peigen.c:1693 pepigen.c:1693 pex64igen.c:1693 #, c-format msgid " Glue code sequence" msgstr "" -#: peigen.c:1692 pepigen.c:1692 +#: peigen.c:1743 pepigen.c:1743 pex64igen.c:1743 #, c-format msgid "" "\n" @@ -3424,14 +3679,14 @@ msgid "" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1722 pepigen.c:1722 +#: peigen.c:1773 pepigen.c:1773 pex64igen.c:1773 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1735 pepigen.c:1735 +#: peigen.c:1786 pepigen.c:1786 pex64igen.c:1786 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -3439,9 +3694,31 @@ msgstr "" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1773 pepigen.c:1773 +#: peigen.c:1825 pepigen.c:1825 pex64igen.c:1825 #, c-format msgid "" "\n" "Characteristics 0x%x\n" msgstr "" + +#: peigen.c:2086 pepigen.c:2086 pex64igen.c:2086 +msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing" +msgstr "" + +#: peigen.c:2104 pepigen.c:2104 pex64igen.c:2104 +msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing" +msgstr "" + +#: peigen.c:2123 pepigen.c:2123 pex64igen.c:2123 +msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing" +msgstr "" + +#: peigen.c:2141 pepigen.c:2141 pex64igen.c:2141 +msgid "" +"%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because ." +"idata$6 is missing" +msgstr "" + +#: peigen.c:2161 pepigen.c:2161 pex64igen.c:2161 +msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing" +msgstr "" diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c index 7c8a4190bac..da8c6b8019b 100644 --- a/contrib/binutils/bfd/ppcboot.c +++ b/contrib/binutils/bfd/ppcboot.c @@ -1,6 +1,6 @@ /* BFD back-end for PPCbug boot records. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, + 2007 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -32,9 +32,9 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. the file. objcopy cooperates by specially setting the start address to zero by default. */ +#include "sysdep.h" #include "safe-ctype.h" #include "bfd.h" -#include "sysdep.h" #include "libbfd.h" /* PPCbug location structure */ @@ -99,7 +99,6 @@ static long ppcboot_canonicalize_symtab PARAMS ((bfd *, asymbol **)); static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static bfd_boolean ppcboot_set_section_contents PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); -static int ppcboot_sizeof_headers PARAMS ((bfd *, bfd_boolean)); static bfd_boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR)); #define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr)) @@ -151,6 +150,7 @@ ppcboot_object_p (abfd) ppcboot_hdr_t hdr; size_t i; ppcboot_data_t *tdata; + flagword flags; BFD_ASSERT (sizeof (ppcboot_hdr_t) == 1024); @@ -205,10 +205,10 @@ ppcboot_object_p (abfd) abfd->symcount = PPCBOOT_SYMS; /* One data section. */ - sec = bfd_make_section (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".data", flags); if (sec == NULL) return NULL; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS; sec->vma = 0; sec->size = statbuf.st_size - sizeof (ppcboot_hdr_t); sec->filepos = sizeof (ppcboot_hdr_t); @@ -354,12 +354,6 @@ ppcboot_get_symbol_info (ignore_abfd, symbol, ret) #define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ppcboot_read_minisymbols _bfd_generic_read_minisymbols #define ppcboot_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol - -#define ppcboot_get_reloc_upper_bound \ - ((long (*) PARAMS ((bfd *, asection *))) bfd_0l) -#define ppcboot_canonicalize_reloc \ - ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l) -#define ppcboot_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup /* Write section contents of a ppcboot file. */ @@ -395,9 +389,8 @@ ppcboot_set_section_contents (abfd, sec, data, offset, size) static int -ppcboot_sizeof_headers (abfd, exec) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_boolean exec ATTRIBUTE_UNUSED; +ppcboot_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (ppcboot_hdr_t); } @@ -535,7 +528,7 @@ const bfd_target ppcboot_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (ppcboot), - BFD_JUMP_TABLE_RELOCS (ppcboot), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (ppcboot), BFD_JUMP_TABLE_LINK (ppcboot), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/contrib/binutils/bfd/ptrace-core.c b/contrib/binutils/bfd/ptrace-core.c index 4ac28aa1dec..8607225da16 100644 --- a/contrib/binutils/bfd/ptrace-core.c +++ b/contrib/binutils/bfd/ptrace-core.c @@ -1,6 +1,6 @@ /* BFD backend for core files which use the ptrace_user structure - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, + 2006, 2007 Free Software Foundation, Inc. The structure of this file is based on trad-core.c written by John Gilmore of Cygnus Support. Modified to work with the ptrace_user structure by Kevin A. Buettner. @@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #ifdef PTRACE_CORE -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include @@ -63,6 +63,7 @@ ptrace_unix_core_file_p (abfd) struct ptrace_user u; struct trad_core_struct *rawptr; bfd_size_type amt; + flagword flags; val = bfd_bread ((void *)&u, (bfd_size_type) sizeof u, abfd); if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC @@ -89,13 +90,17 @@ ptrace_unix_core_file_p (abfd) /* Create the sections. */ - core_stacksec (abfd) = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_stacksec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack", + flags); if (core_stacksec (abfd) == NULL) goto fail; - core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); + core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data", + flags); if (core_datasec (abfd) == NULL) goto fail; - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + SEC_HAS_CONTENTS); if (core_regsec (abfd) == NULL) goto fail; @@ -103,10 +108,6 @@ ptrace_unix_core_file_p (abfd) text. I don't think that any of these things are supported on the system on which I am developing this for though. */ - core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; - core_datasec (abfd)->size = u.pt_dsize; core_stacksec (abfd)->size = u.pt_ssize; core_regsec (abfd)->size = sizeof (u); diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c index f1d09a5ab07..1e5d4bd03fa 100644 --- a/contrib/binutils/bfd/reloc.c +++ b/contrib/binutils/bfd/reloc.c @@ -1,6 +1,6 @@ /* BFD support for handling relocation entries. 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. Written by Cygnus Support. @@ -47,8 +47,8 @@ SECTION /* DO compile in the reloc_code name table from libbfd.h. */ #define _BFD_MAKE_TABLE_bfd_reloc_code_real -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" /* @@ -1522,7 +1522,6 @@ _bfd_relocate_contents (reloc_howto_type *howto, switch (size) { default: - case 0: abort (); case 1: bfd_put_8 (input_bfd, x, location); @@ -1545,6 +1544,72 @@ _bfd_relocate_contents (reloc_howto_type *howto, return flag; } +/* Clear a given location using a given howto, by applying a relocation value + of zero and discarding any in-place addend. This is used for fixed-up + relocations against discarded symbols, to make ignorable debug or unwind + information more obvious. */ + +void +_bfd_clear_contents (reloc_howto_type *howto, + bfd *input_bfd, + bfd_byte *location) +{ + int size; + bfd_vma x = 0; + + /* Get the value we are going to relocate. */ + size = bfd_get_reloc_size (howto); + switch (size) + { + default: + case 0: + abort (); + case 1: + x = bfd_get_8 (input_bfd, location); + break; + case 2: + x = bfd_get_16 (input_bfd, location); + break; + case 4: + x = bfd_get_32 (input_bfd, location); + break; + case 8: +#ifdef BFD64 + x = bfd_get_64 (input_bfd, location); +#else + abort (); +#endif + break; + } + + /* Zero out the unwanted bits of X. */ + x &= ~howto->dst_mask; + + /* Put the relocated value back in the object file. */ + switch (size) + { + default: + case 0: + abort (); + case 1: + bfd_put_8 (input_bfd, x, location); + break; + case 2: + bfd_put_16 (input_bfd, x, location); + break; + case 4: + bfd_put_32 (input_bfd, x, location); + break; + case 8: +#ifdef BFD64 + bfd_put_64 (input_bfd, x, location); +#else + abort (); +#endif + break; + } +} + /* DOCDD INODE @@ -1883,6 +1948,37 @@ ENUMX ENUMDOC SPARC TLS relocations +ENUM + BFD_RELOC_SPU_IMM7 +ENUMX + BFD_RELOC_SPU_IMM8 +ENUMX + BFD_RELOC_SPU_IMM10 +ENUMX + BFD_RELOC_SPU_IMM10W +ENUMX + BFD_RELOC_SPU_IMM16 +ENUMX + BFD_RELOC_SPU_IMM16W +ENUMX + BFD_RELOC_SPU_IMM18 +ENUMX + BFD_RELOC_SPU_PCREL9a +ENUMX + BFD_RELOC_SPU_PCREL9b +ENUMX + BFD_RELOC_SPU_PCREL16 +ENUMX + BFD_RELOC_SPU_LO16 +ENUMX + BFD_RELOC_SPU_HI16 +ENUMX + BFD_RELOC_SPU_PPU32 +ENUMX + BFD_RELOC_SPU_PPU64 +ENUMDOC + SPU Relocations. + ENUM BFD_RELOC_ALPHA_GPDISP_HI16 ENUMDOC @@ -2701,6 +2797,24 @@ ENUM BFD_RELOC_ARM_PREL31 ENUMDOC 31-bit PC relative address. +ENUM + BFD_RELOC_ARM_MOVW +ENUMX + BFD_RELOC_ARM_MOVT +ENUMX + BFD_RELOC_ARM_MOVW_PCREL +ENUMX + BFD_RELOC_ARM_MOVT_PCREL +ENUMX + BFD_RELOC_ARM_THUMB_MOVW +ENUMX + BFD_RELOC_ARM_THUMB_MOVT +ENUMX + BFD_RELOC_ARM_THUMB_MOVW_PCREL +ENUMX + BFD_RELOC_ARM_THUMB_MOVT_PCREL +ENUMDOC + Low and High halfword relocations for MOVW and MOVT instructions. ENUM BFD_RELOC_ARM_JUMP_SLOT @@ -2738,12 +2852,73 @@ ENUMX ENUMDOC ARM thread-local storage relocations. +ENUM + BFD_RELOC_ARM_ALU_PC_G0_NC +ENUMX + BFD_RELOC_ARM_ALU_PC_G0 +ENUMX + BFD_RELOC_ARM_ALU_PC_G1_NC +ENUMX + BFD_RELOC_ARM_ALU_PC_G1 +ENUMX + BFD_RELOC_ARM_ALU_PC_G2 +ENUMX + BFD_RELOC_ARM_LDR_PC_G0 +ENUMX + BFD_RELOC_ARM_LDR_PC_G1 +ENUMX + BFD_RELOC_ARM_LDR_PC_G2 +ENUMX + BFD_RELOC_ARM_LDRS_PC_G0 +ENUMX + BFD_RELOC_ARM_LDRS_PC_G1 +ENUMX + BFD_RELOC_ARM_LDRS_PC_G2 +ENUMX + BFD_RELOC_ARM_LDC_PC_G0 +ENUMX + BFD_RELOC_ARM_LDC_PC_G1 +ENUMX + BFD_RELOC_ARM_LDC_PC_G2 +ENUMX + BFD_RELOC_ARM_ALU_SB_G0_NC +ENUMX + BFD_RELOC_ARM_ALU_SB_G0 +ENUMX + BFD_RELOC_ARM_ALU_SB_G1_NC +ENUMX + BFD_RELOC_ARM_ALU_SB_G1 +ENUMX + BFD_RELOC_ARM_ALU_SB_G2 +ENUMX + BFD_RELOC_ARM_LDR_SB_G0 +ENUMX + BFD_RELOC_ARM_LDR_SB_G1 +ENUMX + BFD_RELOC_ARM_LDR_SB_G2 +ENUMX + BFD_RELOC_ARM_LDRS_SB_G0 +ENUMX + BFD_RELOC_ARM_LDRS_SB_G1 +ENUMX + BFD_RELOC_ARM_LDRS_SB_G2 +ENUMX + BFD_RELOC_ARM_LDC_SB_G0 +ENUMX + BFD_RELOC_ARM_LDC_SB_G1 +ENUMX + BFD_RELOC_ARM_LDC_SB_G2 +ENUMDOC + ARM group relocations. + ENUM BFD_RELOC_ARM_IMMEDIATE ENUMX BFD_RELOC_ARM_ADRL_IMMEDIATE ENUMX BFD_RELOC_ARM_T32_IMMEDIATE +ENUMX + BFD_RELOC_ARM_T32_ADD_IMM ENUMX BFD_RELOC_ARM_T32_IMM12 ENUMX @@ -3529,6 +3704,50 @@ ENUMX ENUMDOC Motorola Mcore relocations. +ENUM + BFD_RELOC_MEP_8 +ENUMX + BFD_RELOC_MEP_16 +ENUMX + BFD_RELOC_MEP_32 +ENUMX + BFD_RELOC_MEP_PCREL8A2 +ENUMX + BFD_RELOC_MEP_PCREL12A2 +ENUMX + BFD_RELOC_MEP_PCREL17A2 +ENUMX + BFD_RELOC_MEP_PCREL24A2 +ENUMX + BFD_RELOC_MEP_PCABS24A2 +ENUMX + BFD_RELOC_MEP_LOW16 +ENUMX + BFD_RELOC_MEP_HI16U +ENUMX + BFD_RELOC_MEP_HI16S +ENUMX + BFD_RELOC_MEP_GPREL +ENUMX + BFD_RELOC_MEP_TPREL +ENUMX + BFD_RELOC_MEP_TPREL7 +ENUMX + BFD_RELOC_MEP_TPREL7A2 +ENUMX + BFD_RELOC_MEP_TPREL7A4 +ENUMX + BFD_RELOC_MEP_UIMM24 +ENUMX + BFD_RELOC_MEP_ADDR24A4 +ENUMX + BFD_RELOC_MEP_GNU_VTINHERIT +ENUMX + BFD_RELOC_MEP_GNU_VTENTRY +ENUMDOC + Toshiba Media Processor Relocations. +COMMENT + ENUM BFD_RELOC_MMIX_GETA ENUMX @@ -3665,11 +3884,25 @@ ENUM ENUMDOC This is a 16 bit reloc for the AVR that stores 8 bit value (usually command address) into 8 bit immediate value of LDI insn. +ENUM + BFD_RELOC_AVR_LO8_LDI_GS +ENUMDOC + This is a 16 bit reloc for the AVR that stores 8 bit value + (command address) into 8 bit immediate value of LDI insn. If the address + is beyond the 128k boundary, the linker inserts a jump stub for this reloc + in the lower 128k. ENUM BFD_RELOC_AVR_HI8_LDI_PM ENUMDOC This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit of command address) into 8 bit immediate value of LDI insn. +ENUM + BFD_RELOC_AVR_HI8_LDI_GS +ENUMDOC + This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit + of command address) into 8 bit immediate value of LDI insn. If the address + is beyond the 128k boundary, the linker inserts a jump stub for this reloc + below 128k. ENUM BFD_RELOC_AVR_HH8_LDI_PM ENUMDOC @@ -3872,6 +4105,43 @@ ENUMX ENUMDOC Long displacement extension. +ENUM + BFD_RELOC_SCORE_DUMMY1 +ENUMDOC + Score relocations +ENUM + BFD_RELOC_SCORE_GPREL15 +ENUMDOC + Low 16 bit for load/store +ENUM + BFD_RELOC_SCORE_DUMMY2 +ENUMX + BFD_RELOC_SCORE_JMP +ENUMDOC + This is a 24-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE_BRANCH +ENUMDOC + This is a 19-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE16_JMP +ENUMDOC + This is a 11-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE16_BRANCH +ENUMDOC + This is a 8-bit reloc with the right 1 bit assumed to be 0 +ENUM + BFD_RELOC_SCORE_GOT15 +ENUMX + BFD_RELOC_SCORE_GOT_LO16 +ENUMX + BFD_RELOC_SCORE_CALL15 +ENUMX + BFD_RELOC_SCORE_DUMMY_HI16 +ENUMDOC + Undocumented Score relocs + ENUM BFD_RELOC_IP2K_FR9 ENUMDOC @@ -4245,6 +4515,63 @@ ENUMX ENUMDOC NS CR16C Relocations. +ENUM + BFD_RELOC_CR16_NUM8 +ENUMX + BFD_RELOC_CR16_NUM16 +ENUMX + BFD_RELOC_CR16_NUM32 +ENUMX + BFD_RELOC_CR16_NUM32a +ENUMX + BFD_RELOC_CR16_REGREL0 +ENUMX + BFD_RELOC_CR16_REGREL4 +ENUMX + BFD_RELOC_CR16_REGREL4a +ENUMX + BFD_RELOC_CR16_REGREL14 +ENUMX + BFD_RELOC_CR16_REGREL14a +ENUMX + BFD_RELOC_CR16_REGREL16 +ENUMX + BFD_RELOC_CR16_REGREL20 +ENUMX + BFD_RELOC_CR16_REGREL20a +ENUMX + BFD_RELOC_CR16_ABS20 +ENUMX + BFD_RELOC_CR16_ABS24 +ENUMX + BFD_RELOC_CR16_IMM4 +ENUMX + BFD_RELOC_CR16_IMM8 +ENUMX + BFD_RELOC_CR16_IMM16 +ENUMX + BFD_RELOC_CR16_IMM20 +ENUMX + BFD_RELOC_CR16_IMM24 +ENUMX + BFD_RELOC_CR16_IMM32 +ENUMX + BFD_RELOC_CR16_IMM32a +ENUMX + BFD_RELOC_CR16_DISP4 +ENUMX + BFD_RELOC_CR16_DISP8 +ENUMX + BFD_RELOC_CR16_DISP16 +ENUMX + BFD_RELOC_CR16_DISP20 +ENUMX + BFD_RELOC_CR16_DISP24 +ENUMX + BFD_RELOC_CR16_DISP24a +ENUMDOC + NS CR16 Relocations. + ENUM BFD_RELOC_CRX_REL4 ENUMX @@ -4448,6 +4775,12 @@ ENUMX ENUMDOC Sony Xstormy16 Relocations. +ENUM + BFD_RELOC_RELC +ENUMDOC + Self-describing complex relocations. +COMMENT + ENUM BFD_RELOC_XC16X_PAG ENUMX @@ -4670,10 +5003,13 @@ CODE_FRAGMENT /* FUNCTION bfd_reloc_type_lookup + bfd_reloc_name_lookup SYNOPSIS reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); + reloc_howto_type *bfd_reloc_name_lookup + (bfd *abfd, const char *reloc_name); DESCRIPTION Return a pointer to a howto structure which, when @@ -4688,6 +5024,12 @@ bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) return BFD_SEND (abfd, reloc_type_lookup, (abfd, code)); } +reloc_howto_type * +bfd_reloc_name_lookup (bfd *abfd, const char *reloc_name) +{ + return BFD_SEND (abfd, reloc_name_lookup, (abfd, reloc_name)); +} + static reloc_howto_type bfd_howto_32 = HOWTO (0, 00, 2, 32, FALSE, 0, complain_overflow_dont, 0, "VRT32", FALSE, 0xffffffff, 0xffffffff, TRUE); @@ -4876,13 +5218,31 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, for (parent = reloc_vector; *parent != NULL; parent++) { char *error_message = NULL; - bfd_reloc_status_type r = - bfd_perform_relocation (input_bfd, - *parent, - data, - input_section, - relocatable ? abfd : NULL, - &error_message); + asymbol *symbol; + bfd_reloc_status_type r; + + symbol = *(*parent)->sym_ptr_ptr; + if (symbol->section && elf_discarded_section (symbol->section)) + { + bfd_byte *p; + static reloc_howto_type none_howto + = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, + "unused", FALSE, 0, 0, FALSE); + + p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); + _bfd_clear_contents ((*parent)->howto, input_bfd, p); + (*parent)->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr; + (*parent)->addend = 0; + (*parent)->howto = &none_howto; + r = bfd_reloc_ok; + } + else + r = bfd_perform_relocation (input_bfd, + *parent, + data, + input_section, + relocatable ? abfd : NULL, + &error_message); if (relocatable) { diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c index 3adbbc75cd1..f5c78b2c73b 100644 --- a/contrib/binutils/bfd/reloc16.c +++ b/contrib/binutils/bfd/reloc16.c @@ -1,6 +1,6 @@ /* 8 and 16 bit COFF relocation functions, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -32,8 +32,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. file) (unless info->keep_memory is FALSE, in which case they should free up the relocs after dealing with them). */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" diff --git a/contrib/binutils/bfd/rs6000-core.c b/contrib/binutils/bfd/rs6000-core.c index 280a020a754..4a2e107d3d7 100644 --- a/contrib/binutils/bfd/rs6000-core.c +++ b/contrib/binutils/bfd/rs6000-core.c @@ -1,13 +1,8 @@ /* IBM RS/6000 "XCOFF" back-end for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2004 + 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. - FIXME: Can someone provide a transliteration of this name into ASCII? - Using the following chars caused a compiler warning on HIUX (so I replaced - them with octal escapes), and isn't useful without an understanding of what - character set it is. - Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, - and John Gilmore. + Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -44,8 +39,8 @@ #define _LONG_LONG #endif -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #ifdef AIX_CORE @@ -294,11 +289,10 @@ make_bfd_asection (bfd *abfd, const char *name, flagword flags, { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c index 9a06b8839f5..21631cf5b84 100644 --- a/contrib/binutils/bfd/sco5-core.c +++ b/contrib/binutils/bfd/sco5-core.c @@ -1,5 +1,5 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Jouke Numan @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" /* BFD a.out internal data structures */ @@ -63,10 +63,9 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos) { asection *asect; - asect = bfd_make_section_anyway (abfd, name); + asect = bfd_make_section_anyway_with_flags (abfd, name, flags); if (!asect) return NULL; - asect->flags = flags; asect->size = size; asect->vma = vma; asect->filepos = filepos; diff --git a/contrib/binutils/bfd/section.c b/contrib/binutils/bfd/section.c index f870e6bfc08..135f44c0780 100644 --- a/contrib/binutils/bfd/section.c +++ b/contrib/binutils/bfd/section.c @@ -1,6 +1,6 @@ /* Object file "section" support for the BFD library. 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. Written by Cygnus Support. @@ -133,8 +133,8 @@ SUBSECTION */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" @@ -294,7 +294,9 @@ CODE_FRAGMENT . else up the line will take care of it later. *} .#define SEC_LINKER_CREATED 0x200000 . -. {* This section should not be subject to garbage collection. *} +. {* This section should not be subject to garbage collection. +. Also set to inform the linker that this section should not be +. listed in the link map as discarded. *} .#define SEC_KEEP 0x400000 . . {* This section contains "short" data, and should be placed @@ -540,11 +542,6 @@ CODE_FRAGMENT . || ((SEC) == bfd_com_section_ptr) \ . || ((SEC) == bfd_ind_section_ptr)) . -.extern const struct bfd_symbol * const bfd_abs_symbol; -.extern const struct bfd_symbol * const bfd_com_symbol; -.extern const struct bfd_symbol * const bfd_und_symbol; -.extern const struct bfd_symbol * const bfd_ind_symbol; -. .{* Macros to handle insertion and deletion of a bfd's sections. These . only handle the list pointers, ie. do not adjust section_count, . target_index etc. *} @@ -635,7 +632,7 @@ CODE_FRAGMENT .#define bfd_section_removed_from_list(ABFD, S) \ . ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) . -.#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, SYM_PTR, NAME, IDX) \ +.#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ . {* name, id, index, next, prev, flags, user_set_vma, *} \ . { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ . \ @@ -666,11 +663,8 @@ CODE_FRAGMENT . {* target_index, used_by_bfd, constructor_chain, owner, *} \ . 0, NULL, NULL, NULL, \ . \ -. {* symbol, *} \ -. (struct bfd_symbol *) SYM, \ -. \ -. {* symbol_ptr_ptr, *} \ -. (struct bfd_symbol **) SYM_PTR, \ +. {* symbol, symbol_ptr_ptr, *} \ +. (struct bfd_symbol *) SYM, &SEC.symbol, \ . \ . {* map_head, map_tail *} \ . { NULL }, { NULL } \ @@ -701,16 +695,14 @@ static const asymbol global_syms[] = GLOBAL_SYM_INIT (BFD_IND_SECTION_NAME, &bfd_ind_section) }; -#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ - const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ - asection SEC = BFD_FAKE_SECTION(SEC, FLAGS, &global_syms[IDX], &SYM, \ +#define STD_SECTION(SEC, FLAGS, NAME, IDX) \ + asection SEC = BFD_FAKE_SECTION(SEC, FLAGS, &global_syms[IDX], \ NAME, IDX) -STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol, - BFD_COM_SECTION_NAME, 0); -STD_SECTION (bfd_und_section, 0, bfd_und_symbol, BFD_UND_SECTION_NAME, 1); -STD_SECTION (bfd_abs_section, 0, bfd_abs_symbol, BFD_ABS_SECTION_NAME, 2); -STD_SECTION (bfd_ind_section, 0, bfd_ind_symbol, BFD_IND_SECTION_NAME, 3); +STD_SECTION (bfd_com_section, SEC_IS_COMMON, BFD_COM_SECTION_NAME, 0); +STD_SECTION (bfd_und_section, 0, BFD_UND_SECTION_NAME, 1); +STD_SECTION (bfd_abs_section, 0, BFD_ABS_SECTION_NAME, 2); +STD_SECTION (bfd_ind_section, 0, BFD_IND_SECTION_NAME, 3); #undef STD_SECTION /* Initialize an entry in the section hash table. */ @@ -743,6 +735,26 @@ bfd_section_hash_newfunc (struct bfd_hash_entry *entry, ((struct section_hash_entry *) \ bfd_hash_lookup ((table), (string), (create), (copy))) +/* Create a symbol whose only job is to point to this section. This + is useful for things like relocs which are relative to the base + of a section. */ + +bfd_boolean +_bfd_generic_new_section_hook (bfd *abfd, asection *newsect) +{ + newsect->symbol = bfd_make_empty_symbol (abfd); + if (newsect->symbol == NULL) + return FALSE; + + newsect->symbol->name = newsect->name; + newsect->symbol->value = 0; + newsect->symbol->section = newsect; + newsect->symbol->flags = BSF_SECTION_SYM; + + newsect->symbol_ptr_ptr = &newsect->symbol; + return TRUE; +} + /* Initializes a new section. NEWSECT->NAME is already set. */ static asection * @@ -754,20 +766,6 @@ bfd_section_init (bfd *abfd, asection *newsect) newsect->index = abfd->section_count; newsect->owner = abfd; - /* Create a symbol whose only job is to point to this section. This - is useful for things like relocs which are relative to the base - of a section. */ - newsect->symbol = bfd_make_empty_symbol (abfd); - if (newsect->symbol == NULL) - return NULL; - - newsect->symbol->name = newsect->name; - newsect->symbol->value = 0; - newsect->symbol->section = newsect; - newsect->symbol->flags = BSF_SECTION_SYM; - - newsect->symbol_ptr_ptr = &newsect->symbol; - if (! BFD_SEND (abfd, _new_section_hook, (abfd, newsect))) return NULL; @@ -964,7 +962,6 @@ DESCRIPTION asection * bfd_make_section_old_way (bfd *abfd, const char *name) { - struct section_hash_entry *sh; asection *newsect; if (abfd->output_has_begun) @@ -974,30 +971,38 @@ bfd_make_section_old_way (bfd *abfd, const char *name) } if (strcmp (name, BFD_ABS_SECTION_NAME) == 0) - return bfd_abs_section_ptr; - - if (strcmp (name, BFD_COM_SECTION_NAME) == 0) - return bfd_com_section_ptr; - - if (strcmp (name, BFD_UND_SECTION_NAME) == 0) - return bfd_und_section_ptr; - - if (strcmp (name, BFD_IND_SECTION_NAME) == 0) - return bfd_ind_section_ptr; - - sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); - if (sh == NULL) - return NULL; - - newsect = &sh->section; - if (newsect->name != NULL) + newsect = bfd_abs_section_ptr; + else if (strcmp (name, BFD_COM_SECTION_NAME) == 0) + newsect = bfd_com_section_ptr; + else if (strcmp (name, BFD_UND_SECTION_NAME) == 0) + newsect = bfd_und_section_ptr; + else if (strcmp (name, BFD_IND_SECTION_NAME) == 0) + newsect = bfd_ind_section_ptr; + else { - /* Section already exists. */ - return newsect; + struct section_hash_entry *sh; + + sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); + if (sh == NULL) + return NULL; + + newsect = &sh->section; + if (newsect->name != NULL) + { + /* Section already exists. */ + return newsect; + } + + newsect->name = name; + return bfd_section_init (abfd, newsect); } - newsect->name = name; - return bfd_section_init (abfd, newsect); + /* Call new_section_hook when "creating" the standard abs, com, und + and ind sections to tack on format specific section data. + Also, create a proper section symbol. */ + if (! BFD_SEND (abfd, _new_section_hook, (abfd, newsect))) + return NULL; + return newsect; } /* diff --git a/contrib/binutils/bfd/simple.c b/contrib/binutils/bfd/simple.c index d06ce2a96e1..8ebc47e0597 100644 --- a/contrib/binutils/bfd/simple.c +++ b/contrib/binutils/bfd/simple.c @@ -1,5 +1,5 @@ /* simple.c -- BFD simple client routines - Copyright 2002, 2003, 2004, 2005 + Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by MontaVista Software, Inc. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" @@ -183,6 +183,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd, /* Fill in the bare minimum number of fields for our purposes. */ memset (&link_info, 0, sizeof (link_info)); link_info.input_bfds = abfd; + link_info.input_bfds_tail = &abfd->link_next; link_info.hash = _bfd_generic_link_hash_table_create (abfd); link_info.callbacks = &callbacks; diff --git a/contrib/binutils/bfd/sparclinux.c b/contrib/binutils/bfd/sparclinux.c index d8659eec16b..445a66c0e10 100644 --- a/contrib/binutils/bfd/sparclinux.c +++ b/contrib/binutils/bfd/sparclinux.c @@ -1,23 +1,23 @@ /* BFD back-end for linux flavored sparc a.out binaries. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2006 Free Software Foundation, Inc. + 2003, 2004, 2006, 2007 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -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 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. + 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. */ + 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. */ #define TARGET_PAGE_SIZE 4096 #define ZMAGIC_DISK_BLOCK_SIZE 1024 @@ -27,8 +27,8 @@ USA. */ #define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_UNKNOWN) -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -94,8 +94,7 @@ sparclinux_write_object_contents (abfd) #define GOT_REF_PREFIX "__GOT_" #endif -#define IS_GOT_SYM(name) \ - (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) +#define IS_GOT_SYM(name) (CONST_STRNEQ (name, GOT_REF_PREFIX)) /* See if a symbol name is a reference to the procedure linkage table. */ @@ -103,8 +102,7 @@ sparclinux_write_object_contents (abfd) #define PLT_REF_PREFIX "__PLT_" #endif -#define IS_PLT_SYM(name) \ - (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0) +#define IS_PLT_SYM(name) (CONST_STRNEQ (name, PLT_REF_PREFIX)) /* This string is used to generate specialized error messages. */ @@ -313,9 +311,8 @@ linux_link_create_dynamic_sections (abfd, info) /* We choose to use the name ".linux-dynamic" for the fixup table. Why not? */ - s = bfd_make_section (abfd, ".linux-dynamic"); + s = bfd_make_section_with_flags (abfd, ".linux-dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; s->size = 0; @@ -429,9 +426,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, This function is called via linux_link_hash_traverse. */ static bfd_boolean -linux_tally_symbols (h, data) - struct linux_link_hash_entry *h; - PTR data; +linux_tally_symbols (struct linux_link_hash_entry *h, void * data) { struct bfd_link_info *info = (struct bfd_link_info *) data; struct fixup *f, *f1; @@ -443,8 +438,7 @@ linux_tally_symbols (h, data) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_undefined - && strncmp (h->root.root.root.string, NEEDS_SHRLIB, - sizeof NEEDS_SHRLIB - 1) == 0) + && CONST_STRNEQ (h->root.root.root.string, NEEDS_SHRLIB)) { const char *name; char *p; diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c index 2b24f46ffb6..354a6ee670f 100644 --- a/contrib/binutils/bfd/srec.c +++ b/contrib/binutils/bfd/srec.c @@ -1,6 +1,6 @@ /* BFD back-end for s-record objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -101,8 +101,8 @@ We allow symbols to be anywhere in the data stream - the module names are always ignored. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "safe-ctype.h" @@ -526,15 +526,16 @@ srec_scan (bfd *abfd) char secbuf[20]; char *secname; bfd_size_type amt; + flagword flags; sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1); amt = strlen (secbuf) + 1; secname = bfd_alloc (abfd, amt); strcpy (secname, secbuf); - sec = bfd_make_section (abfd, secname); + flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; + sec = bfd_make_section_with_flags (abfd, secname, flags); if (sec == NULL) goto error_return; - sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC; sec->vma = address; sec->lma = address; sec->size = bytes; @@ -1099,7 +1100,7 @@ symbolsrec_write_object_contents (bfd *abfd) static int srec_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } @@ -1193,9 +1194,6 @@ srec_print_symbol (bfd *abfd, #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define srec_read_minisymbols _bfd_generic_read_minisymbols #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define srec_get_reloc_upper_bound ((long (*) (bfd *, asection *)) bfd_0l) -#define srec_canonicalize_reloc ((long (*) (bfd *, asection *, arelent **, asymbol **)) bfd_0l) -#define srec_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define srec_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define srec_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define srec_bfd_relax_section bfd_generic_relax_section @@ -1256,7 +1254,7 @@ const bfd_target srec_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (srec), - BFD_JUMP_TABLE_RELOCS (srec), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (srec), BFD_JUMP_TABLE_LINK (srec), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), @@ -1311,7 +1309,7 @@ const bfd_target symbolsrec_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (srec), - BFD_JUMP_TABLE_RELOCS (srec), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (srec), BFD_JUMP_TABLE_LINK (srec), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c index ba3f9344619..1192cd165b9 100644 --- a/contrib/binutils/bfd/stabs.c +++ b/contrib/binutils/bfd/stabs.c @@ -1,6 +1,6 @@ /* Stabs in sections linking support. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -22,8 +22,8 @@ /* This file contains support for linking stabs in sections, as used on COFF and ELF. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "aout/stab_gnu.h" #include "safe-ctype.h" @@ -175,10 +175,8 @@ _bfd_link_section_stabs (bfd *abfd, prepared to handle them. */ return TRUE; - if ((stabsec->output_section != NULL - && bfd_is_abs_section (stabsec->output_section)) - || (stabstrsec->output_section != NULL - && bfd_is_abs_section (stabstrsec->output_section))) + if (bfd_is_abs_section (stabsec->output_section) + || bfd_is_abs_section (stabstrsec->output_section)) /* At least one of the sections is being discarded from the link, so we should just ignore them. */ return TRUE; @@ -187,6 +185,8 @@ _bfd_link_section_stabs (bfd *abfd, if (sinfo->stabstr == NULL) { + flagword flags; + /* Initialize the stabs information we need to keep track of. */ first = TRUE; sinfo->strings = _bfd_stringtab_init (); @@ -198,11 +198,12 @@ _bfd_link_section_stabs (bfd *abfd, stab_link_includes_newfunc, sizeof (struct stab_link_includes_entry))) goto error_return; - sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); + flags = (SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING + | SEC_LINKER_CREATED); + sinfo->stabstr = bfd_make_section_anyway_with_flags (abfd, ".stabstr", + flags); if (sinfo->stabstr == NULL) goto error_return; - sinfo->stabstr->flags |= (SEC_HAS_CONTENTS | SEC_READONLY - | SEC_DEBUGGING | SEC_LINKER_CREATED); } /* Initialize the information we are going to store for this .stab @@ -430,7 +431,7 @@ _bfd_link_section_stabs (bfd *abfd, ++nest; else if (incl_type == (int) N_EXCL) /* Keep existing exclusion marks. */ - continue; + continue; else if (nest == 0) { *incl_pstridx = (bfd_size_type) -1; @@ -455,8 +456,8 @@ _bfd_link_section_stabs (bfd *abfd, for that section. */ stabsec->size = (count - skip) * STABSIZE; if (stabsec->size == 0) - stabsec->flags |= SEC_EXCLUDE; - stabstrsec->flags |= SEC_EXCLUDE; + stabsec->flags |= SEC_EXCLUDE | SEC_KEEP; + stabstrsec->flags |= SEC_EXCLUDE | SEC_KEEP; sinfo->stabstr->size = _bfd_stringtab_size (sinfo->strings); /* Calculate the `cumulative_skips' array now that stabs have been @@ -608,7 +609,7 @@ _bfd_discard_section_stabs (bfd *abfd, /* Shrink the stabsec as needed. */ stabsec->size -= skip * STABSIZE; if (stabsec->size == 0) - stabsec->flags |= SEC_EXCLUDE; + stabsec->flags |= SEC_EXCLUDE | SEC_KEEP; /* Recalculate the `cumulative_skips' array now that stabs have been deleted for this section. */ diff --git a/contrib/binutils/bfd/sunos.c b/contrib/binutils/bfd/sunos.c index 024320fbfa1..a9117f47718 100644 --- a/contrib/binutils/bfd/sunos.c +++ b/contrib/binutils/bfd/sunos.c @@ -745,57 +745,50 @@ sunos_create_dynamic_sections (bfd *abfd, /* The .dynamic section holds the basic dynamic information: the sun4_dynamic structure, the dynamic debugger information, and the sun4_dynamic_link structure. */ - s = bfd_make_section (abfd, ".dynamic"); + s = bfd_make_section_with_flags (abfd, ".dynamic", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .got section holds the global offset table. The address is put in the ld_got field. */ - s = bfd_make_section (abfd, ".got"); + s = bfd_make_section_with_flags (abfd, ".got", flags); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .plt section holds the procedure linkage table. The address is put in the ld_plt field. */ - s = bfd_make_section (abfd, ".plt"); + s = bfd_make_section_with_flags (abfd, ".plt", flags | SEC_CODE); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .dynrel section holds the dynamic relocs. The address is put in the ld_rel field. */ - s = bfd_make_section (abfd, ".dynrel"); + s = bfd_make_section_with_flags (abfd, ".dynrel", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .hash section holds the dynamic hash table. The address is put in the ld_hash field. */ - s = bfd_make_section (abfd, ".hash"); + s = bfd_make_section_with_flags (abfd, ".hash", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .dynsym section holds the dynamic symbols. The address is put in the ld_stab field. */ - s = bfd_make_section (abfd, ".dynsym"); + s = bfd_make_section_with_flags (abfd, ".dynsym", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; /* The .dynstr section holds the dynamic symbol string table. The address is put in the ld_symbols field. */ - s = bfd_make_section (abfd, ".dynstr"); + s = bfd_make_section_with_flags (abfd, ".dynstr", flags | SEC_READONLY); if (s == NULL - || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; @@ -890,14 +883,10 @@ sunos_add_dynamic_symbols (bfd *abfd, /* The .need section holds the list of names of shared objets which must be included at runtime. The address of this section is put in the ld_need field. */ - asection *s = bfd_make_section (dynobj, ".need"); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_READONLY); + asection *s = bfd_make_section_with_flags (dynobj, ".need", flags); if (s == NULL - || ! bfd_set_section_flags (dynobj, s, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, s, 2)) return FALSE; } @@ -907,14 +896,10 @@ sunos_add_dynamic_symbols (bfd *abfd, /* The .rules section holds the path to search for shared objects. The address of this section is put in the ld_rules field. */ - asection *s = bfd_make_section (dynobj, ".rules"); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_READONLY); + asection *s = bfd_make_section_with_flags (dynobj, ".rules", flags); if (s == NULL - || ! bfd_set_section_flags (dynobj, s, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, s, 2)) return FALSE; } diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c index 0ff94164ed5..89c38692ed3 100644 --- a/contrib/binutils/bfd/syms.c +++ b/contrib/binutils/bfd/syms.c @@ -1,6 +1,6 @@ /* Generic symbol-table support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -288,6 +288,14 @@ CODE_FRAGMENT . {* This symbol is thread local. Used in ELF. *} .#define BSF_THREAD_LOCAL 0x40000 . +. {* This symbol represents a complex relocation expression, +. with the expression tree serialized in the symbol name. *} +.#define BSF_RELC 0x80000 +. +. {* This symbol represents a signed complex relocation expression, +. with the expression tree serialized in the symbol name. *} +.#define BSF_SRELC 0x100000 +. . flagword flags; . . {* A pointer to the section to which this symbol is @@ -307,8 +315,8 @@ CODE_FRAGMENT . */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "safe-ctype.h" #include "bfdlink.h" diff --git a/contrib/binutils/bfd/sysdep.h b/contrib/binutils/bfd/sysdep.h index f6313d3905c..e1b070b4a89 100644 --- a/contrib/binutils/bfd/sysdep.h +++ b/contrib/binutils/bfd/sysdep.h @@ -1,5 +1,5 @@ /* sysdep.h -- handle host dependencies for the BFD library - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -22,10 +22,10 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #ifndef BFD_SYSDEP_H #define BFD_SYSDEP_H -#include "ansidecl.h" - #include "config.h" +#include "ansidecl.h" + #ifdef HAVE_STDDEF_H #include #endif diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c index 3b04f60a4bf..04b52df057c 100644 --- a/contrib/binutils/bfd/targets.c +++ b/contrib/binutils/bfd/targets.c @@ -1,6 +1,6 @@ /* Generic target-file-type support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "fnmatch.h" @@ -402,7 +402,8 @@ BFD_JUMP_TABLE macros. .#define BFD_JUMP_TABLE_RELOCS(NAME) \ . NAME##_get_reloc_upper_bound, \ . NAME##_canonicalize_reloc, \ -. NAME##_bfd_reloc_type_lookup +. NAME##_bfd_reloc_type_lookup, \ +. NAME##_bfd_reloc_name_lookup . . long (*_get_reloc_upper_bound) (bfd *, sec_ptr); . long (*_bfd_canonicalize_reloc) @@ -410,6 +411,9 @@ BFD_JUMP_TABLE macros. . {* See documentation on reloc types. *} . reloc_howto_type * . (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); +. reloc_howto_type * +. (*reloc_name_lookup) (bfd *, const char *); +. . . {* Routines used when writing an object file. *} .#define BFD_JUMP_TABLE_WRITE(NAME) \ @@ -438,7 +442,7 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_discard_group, \ . NAME##_section_already_linked \ . -. int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); +. int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); . bfd_byte * (*_bfd_get_relocated_section_contents) . (bfd *, struct bfd_link_info *, struct bfd_link_order *, . bfd_byte *, bfd_boolean, struct bfd_symbol **); @@ -481,7 +485,8 @@ BFD_JUMP_TABLE macros. . . {* Check if SEC has been already linked during a reloceatable or . final link. *} -. void (*_section_already_linked) (bfd *, struct bfd_section *); +. void (*_section_already_linked) (bfd *, struct bfd_section *, +. struct bfd_link_info *); . . {* Routines to handle dynamic symbols and relocs. *} .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ @@ -541,6 +546,10 @@ extern const bfd_target arm_epoc_pe_big_vec; extern const bfd_target arm_epoc_pe_little_vec; extern const bfd_target arm_epoc_pei_big_vec; extern const bfd_target arm_epoc_pei_little_vec; +extern const bfd_target arm_wince_pe_big_vec; +extern const bfd_target arm_wince_pe_little_vec; +extern const bfd_target arm_wince_pei_big_vec; +extern const bfd_target arm_wince_pei_little_vec; extern const bfd_target armcoff_big_vec; extern const bfd_target armcoff_little_vec; extern const bfd_target armnetbsd_vec; @@ -563,6 +572,7 @@ extern const bfd_target bfd_elf32_bigarm_symbian_vec; extern const bfd_target bfd_elf32_bigarm_vxworks_vec; extern const bfd_target bfd_elf32_bigmips_vec; extern const bfd_target bfd_elf32_bigmips_vxworks_vec; +extern const bfd_target bfd_elf32_cr16_vec; extern const bfd_target bfd_elf32_cr16c_vec; extern const bfd_target bfd_elf32_cris_vec; extern const bfd_target bfd_elf32_crx_vec; @@ -605,6 +615,8 @@ extern const bfd_target bfd_elf32_m68k_vec; extern const bfd_target bfd_elf32_m88k_vec; extern const bfd_target bfd_elf32_mcore_big_vec; extern const bfd_target bfd_elf32_mcore_little_vec; +extern const bfd_target bfd_elf32_mep_vec; +extern const bfd_target bfd_elf32_mep_little_vec; extern const bfd_target bfd_elf32_mn10200_vec; extern const bfd_target bfd_elf32_mn10300_vec; extern const bfd_target bfd_elf32_mt_vec; @@ -621,6 +633,8 @@ extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; extern const bfd_target bfd_elf32_powerpc_vxworks_vec; extern const bfd_target bfd_elf32_s390_vec; +extern const bfd_target bfd_elf32_bigscore_vec; +extern const bfd_target bfd_elf32_littlescore_vec; extern const bfd_target bfd_elf32_sh64_vec; extern const bfd_target bfd_elf32_sh64l_vec; extern const bfd_target bfd_elf32_sh64lin_vec; @@ -633,9 +647,12 @@ extern const bfd_target bfd_elf32_shl_vec; extern const bfd_target bfd_elf32_shl_symbian_vec; extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_shlnbsd_vec; +extern const bfd_target bfd_elf32_shlvxworks_vec; extern const bfd_target bfd_elf32_shnbsd_vec; +extern const bfd_target bfd_elf32_shvxworks_vec; extern const bfd_target bfd_elf32_sparc_vec; extern const bfd_target bfd_elf32_sparc_vxworks_vec; +extern const bfd_target bfd_elf32_spu_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; extern const bfd_target bfd_elf32_us_cris_vec; @@ -667,8 +684,10 @@ extern const bfd_target bfd_elf64_sh64blin_vec; extern const bfd_target bfd_elf64_sh64lnbsd_vec; extern const bfd_target bfd_elf64_sh64nbsd_vec; extern const bfd_target bfd_elf64_sparc_vec; +extern const bfd_target bfd_elf64_sparc_freebsd_vec; extern const bfd_target bfd_elf64_tradbigmips_vec; extern const bfd_target bfd_elf64_tradlittlemips_vec; +extern const bfd_target bfd_elf64_x86_64_freebsd_vec; extern const bfd_target bfd_elf64_x86_64_vec; extern const bfd_target bfd_mmo_vec; extern const bfd_target bfd_powerpc_pe_vec; @@ -781,6 +800,9 @@ extern const bfd_target vms_alpha_vec; extern const bfd_target vms_vax_vec; extern const bfd_target w65_vec; extern const bfd_target we32kcoff_vec; +extern const bfd_target x86_64pe_vec; +extern const bfd_target x86_64pei_vec; +extern const bfd_target x86_64coff_vec; extern const bfd_target z80coff_vec; extern const bfd_target z8kcoff_vec; @@ -805,8 +827,8 @@ extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; extern const bfd_target bfd_elf32_am33lin_vec; -static const bfd_target * const _bfd_target_vector[] = { - +static const bfd_target * const _bfd_target_vector[] = +{ #ifdef SELECT_VECS SELECT_VECS, @@ -842,6 +864,10 @@ static const bfd_target * const _bfd_target_vector[] = { &arm_epoc_pe_little_vec, &arm_epoc_pei_big_vec, &arm_epoc_pei_little_vec, + &arm_wince_pe_big_vec, + &arm_wince_pe_little_vec, + &arm_wince_pei_big_vec, + &arm_wince_pei_little_vec, &armcoff_big_vec, &armcoff_little_vec, &armnetbsd_vec, @@ -854,6 +880,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_efi_app_ia32_vec, &bfd_efi_app_x86_64_vec, #ifdef BFD64 + &bfd_efi_app_x86_64_vec, &bfd_efi_app_ia64_vec, #endif &bfd_elf32_avr_vec, @@ -871,6 +898,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_bigarm_vxworks_vec, &bfd_elf32_bigmips_vec, &bfd_elf32_bigmips_vxworks_vec, + &bfd_elf32_cr16_vec, &bfd_elf32_cr16c_vec, &bfd_elf32_cris_vec, &bfd_elf32_crx_vec, @@ -917,6 +945,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_m88k_vec, &bfd_elf32_mcore_big_vec, &bfd_elf32_mcore_little_vec, + &bfd_elf32_mep_vec, &bfd_elf32_mn10200_vec, &bfd_elf32_mn10300_vec, &bfd_elf32_mt_vec, @@ -935,13 +964,17 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_powerpc_vxworks_vec, &bfd_elf32_powerpcle_vec, &bfd_elf32_s390_vec, + &bfd_elf32_bigscore_vec, + &bfd_elf32_littlescore_vec, &bfd_elf32_sh_vec, &bfd_elf32_shblin_vec, &bfd_elf32_shl_vec, &bfd_elf32_shl_symbian_vec, &bfd_elf32_shlin_vec, &bfd_elf32_shlnbsd_vec, + &bfd_elf32_shlvxworks_vec, &bfd_elf32_shnbsd_vec, + &bfd_elf32_shvxworks_vec, #ifdef BFD64 &bfd_elf32_sh64_vec, &bfd_elf32_sh64l_vec, @@ -952,6 +985,7 @@ static const bfd_target * const _bfd_target_vector[] = { #endif &bfd_elf32_sparc_vec, &bfd_elf32_sparc_vxworks_vec, + &bfd_elf32_spu_vec, &bfd_elf32_tradbigmips_vec, &bfd_elf32_tradlittlemips_vec, &bfd_elf32_us_cris_vec, @@ -984,8 +1018,10 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_sh64lin_vec, &bfd_elf64_sh64blin_vec, &bfd_elf64_sparc_vec, + &bfd_elf64_sparc_freebsd_vec, &bfd_elf64_tradbigmips_vec, &bfd_elf64_tradlittlemips_vec, + &bfd_elf64_x86_64_freebsd_vec, &bfd_elf64_x86_64_vec, &bfd_mmo_vec, #endif @@ -1038,6 +1074,11 @@ static const bfd_target * const _bfd_target_vector[] = { &i386os9k_vec, &i386pe_vec, &i386pei_vec, +#ifdef BFD64 + &x86_64coff_vec, + &x86_64pe_vec, + &x86_64pei_vec, +#endif &i860coff_vec, &icoff_big_vec, &icoff_little_vec, @@ -1262,7 +1303,6 @@ find_target (const char *name) while (match->vector == NULL) ++match; return match->vector; - break; } } @@ -1309,14 +1349,15 @@ SYNOPSIS DESCRIPTION Return a pointer to the transfer vector for the object target - named @var{target_name}. If @var{target_name} is <>, choose the - one in the environment variable <>; if that is null or not - defined, then choose the first entry in the target list. - Passing in the string "default" or setting the environment - variable to "default" will cause the first entry in the target - list to be returned, and "target_defaulted" will be set in the - BFD. This causes <> to loop over all the - targets to find the one that matches the file being read. + named @var{target_name}. If @var{target_name} is <>, + choose the one in the environment variable <>; if + that is null or not defined, then choose the first entry in the + target list. Passing in the string "default" or setting the + environment variable to "default" will cause the first entry in + the target list to be returned, and "target_defaulted" will be + set in the BFD if @var{abfd} isn't <>. This causes + <> to loop over all the targets to find the + one that matches the file being read. */ const bfd_target * @@ -1333,21 +1374,27 @@ bfd_find_target (const char *target_name, bfd *abfd) /* This is safe; the vector cannot be null. */ if (targname == NULL || strcmp (targname, "default") == 0) { - abfd->target_defaulted = TRUE; if (bfd_default_vector[0] != NULL) - abfd->xvec = bfd_default_vector[0]; + target = bfd_default_vector[0]; else - abfd->xvec = bfd_target_vector[0]; - return abfd->xvec; + target = bfd_target_vector[0]; + if (abfd) + { + abfd->xvec = target; + abfd->target_defaulted = TRUE; + } + return target; } - abfd->target_defaulted = FALSE; + if (abfd) + abfd->target_defaulted = FALSE; target = find_target (targname); if (target == NULL) return NULL; - abfd->xvec = target; + if (abfd) + abfd->xvec = target; return target; } diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c index afe42cc948a..78deaf99ae1 100644 --- a/contrib/binutils/bfd/tekhex.c +++ b/contrib/binutils/bfd/tekhex.c @@ -1,6 +1,6 @@ /* BFD backend for Extended Tektronix Hex Format objects. Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -65,8 +65,8 @@ The data can come out of order, and may be discontigous. This is a serial protocol, so big files are unlikely, so we keep a list of 8k chunks. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libiberty.h" @@ -436,6 +436,7 @@ first_phase (bfd *abfd, int type, char *src) if (!getvalue (&src, &val)) return FALSE; new->symbol.value = val - section->vma; + break; } default: return FALSE; @@ -457,11 +458,10 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *)) /* To the front of the file. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - abort (); + return FALSE; while (! eof) { - char buffer[MAXCHUNK]; - char *src = buffer; + char src[MAXCHUNK]; char type; /* Find first '%'. */ @@ -471,22 +471,24 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *)) if (eof) break; - src++; /* Fetch the type and the length and the checksum. */ if (bfd_bread (src, (bfd_size_type) 5, abfd) != 5) - abort (); /* FIXME. */ + return FALSE; type = src[2]; if (!ISHEX (src[0]) || !ISHEX (src[1])) break; - /* Already read five char. */ + /* Already read five chars. */ chars_on_line = HEX (src) - 5; + if (chars_on_line >= MAXCHUNK) + return FALSE; + if (bfd_bread (src, (bfd_size_type) chars_on_line, abfd) != chars_on_line) - abort (); /* FIXME. */ + return FALSE; /* Put a null at the end. */ src[chars_on_line] = 0; @@ -751,7 +753,6 @@ out (bfd *abfd, int type, char *start, char *end) static bfd_boolean tekhex_write_object_contents (bfd *abfd) { - int bytes_written; char buffer[100]; asymbol **p; asection *s; @@ -759,8 +760,6 @@ tekhex_write_object_contents (bfd *abfd) tekhex_init (); - bytes_written = 0; - /* And the raw data. */ for (d = abfd->tdata.tekhex_data->data; d != NULL; @@ -868,7 +867,7 @@ tekhex_write_object_contents (bfd *abfd) static int tekhex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, - bfd_boolean exec ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return 0; } diff --git a/contrib/binutils/bfd/trad-core.c b/contrib/binutils/bfd/trad-core.c index cb4111fb941..79b869cb37a 100644 --- a/contrib/binutils/bfd/trad-core.c +++ b/contrib/binutils/bfd/trad-core.c @@ -1,6 +1,6 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. @@ -20,8 +20,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "libaout.h" /* BFD a.out internal data structures */ @@ -79,6 +79,7 @@ trad_unix_core_file_p (abfd) struct user u; struct trad_core_struct *rawptr; bfd_size_type amt; + flagword flags; #ifdef TRAD_CORE_USER_OFFSET /* If defined, this macro is the file position of the user struct. */ @@ -113,24 +114,24 @@ trad_unix_core_file_p (abfd) if (bfd_stat (abfd, &statbuf) < 0) return 0; - if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + if ((ufile_ptr) NBPG * (UPAGES + u.u_dsize #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE - - u.u_tsize + - u.u_tsize #endif - + u.u_ssize)) - > (unsigned long) statbuf.st_size) + + u.u_ssize) + > (ufile_ptr) statbuf.st_size) { bfd_set_error (bfd_error_wrong_format); return 0; } #ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE - if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + u.u_ssize) + if (((ufile_ptr) NBPG * (UPAGES + u.u_dsize + u.u_ssize) #ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED /* Some systems write the file too big. */ - + TRAD_CORE_EXTRA_SIZE_ALLOWED + + TRAD_CORE_EXTRA_SIZE_ALLOWED #endif - ) - < (unsigned long) statbuf.st_size) + ) + < (ufile_ptr) statbuf.st_size) { /* The file is too big. Maybe it's not a core file or we otherwise have bad values for u_dsize and u_ssize). */ @@ -155,20 +156,20 @@ trad_unix_core_file_p (abfd) /* Create the sections. */ - core_stacksec(abfd) = bfd_make_section_anyway (abfd, ".stack"); + flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; + core_stacksec(abfd) = bfd_make_section_anyway_with_flags (abfd, ".stack", + flags); if (core_stacksec (abfd) == NULL) goto fail; - core_datasec (abfd) = bfd_make_section_anyway (abfd, ".data"); + core_datasec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".data", + flags); if (core_datasec (abfd) == NULL) goto fail; - core_regsec (abfd) = bfd_make_section_anyway (abfd, ".reg"); + core_regsec (abfd) = bfd_make_section_anyway_with_flags (abfd, ".reg", + SEC_HAS_CONTENTS); if (core_regsec (abfd) == NULL) goto fail; - core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; - core_regsec (abfd)->flags = SEC_HAS_CONTENTS; - core_datasec (abfd)->size = NBPG * u.u_dsize #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE - NBPG * u.u_tsize diff --git a/contrib/binutils/bfd/version.h b/contrib/binutils/bfd/version.h index f0ad1a88909..88dbbce9fc8 100644 --- a/contrib/binutils/bfd/version.h +++ b/contrib/binutils/bfd/version.h @@ -1,3 +1,4 @@ -#define BFD_VERSION_DATE 20070807 +#define BFD_VERSION_DATE 20070703 #define BFD_VERSION @bfd_version@ -#define BFD_VERSION_STRING @bfd_version_string@ +#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ +#define REPORT_BUGS_TO @report_bugs_to@ diff --git a/contrib/binutils/bfd/xcoff-target.h b/contrib/binutils/bfd/xcoff-target.h index 7e73cf26a59..b912fdf35e6 100644 --- a/contrib/binutils/bfd/xcoff-target.h +++ b/contrib/binutils/bfd/xcoff-target.h @@ -1,5 +1,5 @@ /* Common definitions for backends based on IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002, 2004, 2005 + Copyright 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -125,7 +125,7 @@ extern bfd * _bfd_xcoff_openr_next_archived_file (bfd *, bfd *); extern int _bfd_xcoff_generic_stat_arch_elt (bfd *, struct stat *); extern bfd_boolean _bfd_xcoff_write_armap (bfd *, unsigned int, struct orl *, unsigned int, int); extern bfd_boolean _bfd_xcoff_write_archive_contents (bfd *); -extern int _bfd_xcoff_sizeof_headers (bfd *, bfd_boolean); +extern int _bfd_xcoff_sizeof_headers (bfd *, struct bfd_link_info *); extern void _bfd_xcoff_swap_sym_in (bfd *, void *, void *); extern unsigned int _bfd_xcoff_swap_sym_out (bfd *, void *, void *); extern void _bfd_xcoff_swap_aux_in (bfd *, void *, int, int, int, int, void *); diff --git a/contrib/binutils/bfd/xcofflink.c b/contrib/binutils/bfd/xcofflink.c index 47c330b6c15..b02886a416b 100644 --- a/contrib/binutils/bfd/xcofflink.c +++ b/contrib/binutils/bfd/xcofflink.c @@ -1,6 +1,6 @@ /* POWER/PowerPC XCOFF linker support. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor , Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -19,8 +19,8 @@ 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 "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "coff/internal.h" @@ -794,27 +794,27 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) if (xcoff_hash_table (info)->loader_section == NULL) { asection *lsec; + flagword flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; - lsec = bfd_make_section_anyway (abfd, ".loader"); + lsec = bfd_make_section_anyway_with_flags (abfd, ".loader", flags); if (lsec == NULL) goto end_return; xcoff_hash_table (info)->loader_section = lsec; - lsec->flags |= SEC_HAS_CONTENTS | SEC_IN_MEMORY; } /* Likewise for the linkage section. */ if (xcoff_hash_table (info)->linkage_section == NULL) { asection *lsec; + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); - lsec = bfd_make_section_anyway (abfd, ".gl"); + lsec = bfd_make_section_anyway_with_flags (abfd, ".gl", flags); if (lsec == NULL) goto end_return; xcoff_hash_table (info)->linkage_section = lsec; - lsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); lsec->alignment_power = 2; } @@ -822,14 +822,14 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) if (xcoff_hash_table (info)->toc_section == NULL) { asection *tsec; + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); - tsec = bfd_make_section_anyway (abfd, ".tc"); + tsec = bfd_make_section_anyway_with_flags (abfd, ".tc", flags); if (tsec == NULL) goto end_return; xcoff_hash_table (info)->toc_section = tsec; - tsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); tsec->alignment_power = 2; } @@ -837,14 +837,14 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) if (xcoff_hash_table (info)->descriptor_section == NULL) { asection *dsec; + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); - dsec = bfd_make_section_anyway (abfd, ".ds"); + dsec = bfd_make_section_anyway_with_flags (abfd, ".ds", flags); if (dsec == NULL) goto end_return; xcoff_hash_table (info)->descriptor_section = dsec; - dsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); dsec->alignment_power = 2; } @@ -853,13 +853,13 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info) && info->strip != strip_all) { asection *dsec; + flagword flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; - dsec = bfd_make_section_anyway (abfd, ".debug"); + dsec = bfd_make_section_anyway_with_flags (abfd, ".debug", flags); if (dsec == NULL) goto end_return; xcoff_hash_table (info)->debug_section = dsec; - dsec->flags |= SEC_HAS_CONTENTS | SEC_IN_MEMORY; } } @@ -1552,16 +1552,17 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { /* The linker script puts the .td section in the data section after the .tc section. */ - csect = bfd_make_section_anyway (abfd, ".td"); + csect = bfd_make_section_anyway_with_flags (abfd, ".td", + SEC_ALLOC); } else - csect = bfd_make_section_anyway (abfd, ".bss"); + csect = bfd_make_section_anyway_with_flags (abfd, ".bss", + SEC_ALLOC); if (csect == NULL) goto error_return; csect->vma = sym.n_value; csect->size = aux.x_csect.x_scnlen.l; - csect->flags |= SEC_ALLOC; csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp); /* There are a number of other fields and section flags which we do not bother to set. */ @@ -5460,8 +5461,8 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info) that needs padding. This requires unlinking and relinking the bfd's section list. */ - n = bfd_make_section_anyway (abfd, ".pad"); - n->flags = SEC_HAS_CONTENTS; + n = bfd_make_section_anyway_with_flags (abfd, ".pad", + SEC_HAS_CONTENTS); n->alignment_power = 0; bfd_section_list_remove (abfd, n); diff --git a/contrib/binutils/binutils/ChangeLog b/contrib/binutils/binutils/ChangeLog index 2f6520f4420..574f1839e37 100644 --- a/contrib/binutils/binutils/ChangeLog +++ b/contrib/binutils/binutils/ChangeLog @@ -1,267 +1,696 @@ -2006-08-15 Nick Clifton +2007-07-02 Alan Modra - 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 +2007-07-02 Alan Modra - * 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 +2007-06-30 H.J. Lu - * doc/Makefile.am (TEXI2DVI): Define. + * aclocal.m4: Regenerated. + * doc/Makefile.in: Likewise. + * Makefile.in: Likewise. + +2007-06-29 Joseph Myers + + * readelf.c (display_power_gnu_attribute, process_power_specific): + New. + (process_arch_specific): Call process_power_specific. + +2007-06-29 Joseph Myers + + * readelf.c (display_mips_gnu_attribute): New. + (process_mips_specific): Call process_attributes. + +2007-06-29 Joseph Myers + + * 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 + + * 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 + + * 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 + + 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 + + * embedspu.sh (relas): Correct sh_info parsing. + +2007-06-19 Danny Smith + + * objdump.c: Include sys/stat.h. + +2007-06-19 Kai Tietz + + * 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 + + * 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 + + * resres.c (probe_binary): Fix test for badly formatted headers. + +2007-06-18 Kai Tietz + + * 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 + + * embedspu.sh: Parse _SPUEAR_ symbol values as hex. + +2007-06-14 H.J. Lu + + * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd. + + * acinclude.m4: Removed. + + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. + +2007-06-11 Nathan Sidwell + + * dwarf.c (decode_location_expression): Add DW_OP_form_tls_address. + +2007-06-06 Kai Tietz + + 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. + +2007-06-06 Ben Elliston + + * doc/binutils.texi (objdump): Fix capitalisation of "PowerPC". + +2007-06-05 Kai Tietz + + * 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 + + * embedspu.sh: Handle R_SPU_PPU* relocs with no symbol. + +2007-05-30 Alan Modra + + * 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. + +2007-05-29 Alan Modra + + * embedspu.sh: Emit SPU ELF image to .data.rel.ro.speelf if + pic or pie and image needs relocs. + +2007-05-24 Steve Ellcey + + * Makefile.in: Regenerate. + * configure: Regenerate. + * aclocal.m4: Regenerate. * doc/Makefile.in: Regenerate. -2006-06-01 Daniel Jacobowitz +2007-05-24 Kai Tietz - Backport: - 2006-05-19 Andreas Schwab - * 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. + * rcparse.y: Join strings for elements having no side-effects in + "rc"-grammar. + +2007-05-23 Kai Tietz + + * 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. + +2007-05-22 Paul Brook + + * objdump.c (find_symbol_for_address): Merge section and target + specific filtering code. + +2007-05-22 Nick Clifton + + * doc/binutils.texi: Use @copying around the copyright notice. + +2007-05-21 Richard Sandiford + + * objdump.c (disassemble_bytes): Ignore disassembler_needs_relocs + for executables and shared libraries. + +2007-05-18 Nathan Sidwell + + * objcopy.c (strip_main): Detect identical input and output file + names. + (copy_main): Refactor tempname detection and use. + +2007-05-17 Nick Clifton + + * objdump.c (load_debug_section): Select bias for DWARF debug + addresses based on the flavour of the bfd. + +2007-05-11 Alan Modra + + PR 4479 + * objcopy.c (copy_object): Don't copy ELF program headers for + --only-keep-debug. + +2007-05-11 Alan Modra + + * 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. + +2007-04-28 Alan Modra + + * prdbg.c (tg_variable): Adjust for changed demangler. + (tg_start_function): Likewise. + +2007-04-27 Alan Modra + + * 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. + +2007-04-24 Nick Clifton + + * srconv.c (walk_tree_type_1): Initialise dpt.dunno. + +2007-04-24 Nathan Froyd + Phil Edwards + + * objcopy.c (filter_symbols): Explicitly stripping a symbol + used in relocations is an error. + Retype 'keep' to bfd_boolean. + +2007-04-24 Alan Modra + + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2007-04-20 Nathan Froyd + Phil Edwards + Thomas de Lellis + + * 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. + +2007-04-20 Nick Clifton + + * rclex.l: Allow underscores at the start of identifiers. + +2007-04-19 Alan Modra + + * 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 ): 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. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * configure.in: Change macro call order. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-04-13 Nathan Sidwell + + * Makefile.am (TOOL_PROGS): Add objcopy. + * Makefile.in: Rebuilt. + +2007-04-12 H.J. Lu + + PR binutils/4348 + * objcopy.c (copy_object): Don't stop when there are no + sections to be copied. + +2007-04-10 Vladimir Prus + + * NEWS: Mention disjoint histograms support in + gprof. + +2007-04-09 Daniel Jacobowitz + + * dwarf.c (process_debug_info): Do not require DW_AT_frame_base for + DW_TAG_inlined_subroutine. + +2007-04-06 Matt Thomas + + * MAINTAINERS: Add myself as VAX and NetBSD support maintainer. + +2007-04-05 Alan Modra + + PR binutils/4292 + * nm.c (print_value): Cast bfd_vma to unsigned long to suit + value_format_32bit. + +2007-04-02 Nick Clifton + + 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 + Phil Edwards + + * doc/binutils.texi: Put the contents after the title page rather + than at the end of the document. + +2007-03-28 Nick Clifton + + * 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 + + * MAINTAINERS: Update mailing list addresses. Add myself + as PPC maintainer. + +2007-03-27 Alan Modra + + * embedspu.sh: Correct toe_addr quoting. + +2007-03-27 Alan Modra + + * 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 + + PR gas/3811 + * readelf.c (debug_apply_rela_addends): Do nothing for SH. + +2007-03-22 Joseph Myers + + * doc/binutils.texi: Include VERSION_PACKAGE when reporting + version. + +2007-03-16 Kai Tietz + + * dlltool.c (make_one_lib_file): Use pc-relative relocation + instead of an absolute relocation for x86_64-pc-mingw32 target. + +2007-03-15 H.J. Lu + + * Makefile.am (REPORT_BUGS_TO): Removed. + (INCLUDES): Remove -DREPORT_BUGS_TO. + * Makefile.in: Regenerated. + + * bucomm.c: Don't include bfdver.h. + * objdump.c: Likewise. + * version.c: Likewise. + + * bucomm.h: Include bfdver.h. + + * configure.in (--with-bugurl): Removed. + * configure: Regenerated. + + * 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. -2006-05-30 Nick Clifton + * doc/binutils.texi: Include bfdver.texi instead of + config.texi. - * po/es.po: Updated Spanish translation. +2007-03-13 Nick Clifton -2006-05-24 Nick Clifton + * readelf.c (dump_section): Also test for SHT_REL sections when + producing the warning about unapplied relocs. - * po/fr.po: Updated French translation. +2007-03-07 Joseph Myers -2006-05-23 Nick Clifton + * 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. - * po/vi.po: Updated Vietnamese translation. +2007-03-01 Phil Edwards + Richard Sandiford -2006-05-22 Daniel Jacobowitz + * 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. - * po/ru.po: Updated translation. +2007-03-01 Paul Brook -2006-05-02 Daniel Jacobowitz + * MAINTAINERS: Update my entry. - * 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-03-01 Joseph Myers -2006-04-12 Nick Clifton + * version.c: Update copyright date. - * objdump.c (objdump_symbol_at_address): Fix typo in comment. +2007-03-01 Daniel Jacobowitz -2006-04-10 Ben Elliston + * Makefile.am (install-exec-local): Depend on $(noinst_PROGRAMS). + Adjust $(EXEEXT) handling for $(RENAMED_PROGS). + * Makefile.in, doc/Makefile.in: Regenerate. - * MAINTAINERS (CGEN Maintainers): Remove myself. +2007-03-01 Alan Modra -2006-04-06 Carlos O'Donell + * embedspu.sh: Set type and size of global program handle symbol. - * po/Make-in: Add install-html target. - * Makefile.am: Add install-html and install-html-recursive targets. +2007-02-28 Alan Modra + + * 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 + + * 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.in: AC_SUBST datarootdir, docdir and htmldir. * configure: Regenerate. - * doc/Makefile.am: Add install-html and install-html-am targets. + +2007-02-27 Alan Modra + + * 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. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * 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. -2006-04-05 Eric Botcazou +2007-02-13 Alan Modra - * 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. + * embedspu.sh: Add -W to readelf invocation. -2006-03-29 Ben Elliston +2007-02-06 Dave Brolley - * resbin.c: Avoid duplicating constants in calls to reswr_alloc. + * MAINTAINERS: Add myself as the maintainer of the MeP port. -2006-03-20 Nathan Sidwell +2007-02-06 Nick Clifton - * BRANCHES: Remove binutils-csl-arm-2006q1-branch. Document - binutils-csl-2_17-branch instead. + 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. -2006-03-20 Paul Brook +2007-02-05 Dave Brolley - * BRANCHES: Mention binutils-csl-arm-2006q1-branch. + * readelf.c (dump_relocations): Don't check for + (rtype == NULL && type == R_RELC). -2006-03-16 Alan Modra +2007-02-05 Dave Brolley - PR 2434 - * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. - * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. + * Makefile.am (readelf.o): Depends on $(INCDIR)/elf/mep.h. + * Makefile.in: Regenerated. + * Contribute the following changes: + 2003-10-29 Dave Brolley -2006-03-13 Ben Elliston + * configure.in: Define SKIP_ZEROES and SKIP_ZEROES_AT_END for mep. + * configure: Regenerated. - * 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. + 2001-04-03 Ben Elliston -2006-03-10 Paul Brook + * readelf.c: Include "elf/mep.h". + (guess_is_rela): Handle EM_CYGNUS_MEP. + (get_machine_name): Ditto. + (dump_relocations): Ditto. - * readelf.c (decode_ARM_machine_flags): Handle EABIv5. +2007-02-02 H.J. Lu -2006-03-10 Alan Modra + * MAINTAINERS: Add a space between H.J. and Lu. - * 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. +2007-02-02 H.J. Lu -2006-03-09 Danny Smith + * doc/binutils.texi (objdump): Document the new addr64 option + for i386 disassembler. - * dlltool.c: Update copyright year. - * doc/binutils.texi: Likewise. +2007-02-02 H.J. Lu -2006-03-09 Danny Smith + PR binutils/3945 + * configure.in (DLLTOOL_DEFAULT): New. Defined for the first PE + target. + (DLLTOOL_DEFS): Add $DLLTOOL_DEFAULT. + * configure: Regenerated. - * 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. + * dlltool.c (mname): Defined with DLLTOOL_DEFAULT_XXX. -2006-03-06 Nathan Sidwell +2007-02-02 Nick Clifton - * readelf.c (get_machine_flags): Adjust. + * doc/binutils.texi (objdump): Document support for disassembling + the 440 PowerPC architecture. -2006-03-03 Jakub Jelinek +2007-01-31 Nathan Sidwell - * dwarf.c (frame_display_row, display_debug_frames): Handle - DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression. + * dwarf.c (process_debug_info): Protect against bogus length and + abbrev offsets. -2006-02-28 Nick Clifton +2007-01-25 Kazu Hirata - * 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. + * ar.c (print_contents, extract_file): Cast the return value + of fwrite to size_t. -2006-02-27 Carlos O'Donell +2007-01-12 Alan Modra - * po/Make-in: Add html target. + * 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. -2006-02-17 Nick Hudson +2007-01-11 H.J. Lu - * readelf.c (get_machine_flags): Add logic for missing EF_SH flags. + * bucomm.c (template_in_dir): Fix typo. -2006-02-14 Jakub Jelinek +2007-01-11 Alan Modra - * config.in: Rebuilt. - -2006-02-10 H.J. Lu - - PR binutils/2258 - * readelf.c (process_program_headers): Use - ELF_IS_SECTION_IN_SEGMENT_MEMORY. - -2006-02-09 Eric Botcazou - - * 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 - - * readelf.c (process_program_headers): Match PT_TLS segment - only with SHT_TLS sections. - -2006-02-07 Nathan Sidwell - - * readelf.c (get_machine_flags): Add logic for EF_M68K flags. - -2006-02-02 H.J. Lu - - * readelf.c (process_program_headers): Undo the last change. - -2006-02-02 H.J. Lu - - * 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 - - * 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 - - * po/vi.po: New Vietnamese translation. - * configure.in (ALL_LINGUAS): Add vi. - * configure: Regenerate. - -2006-01-18 Alexandre Oliva - - 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 - - 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. + * embedspu.sh: New file. + * Makefile.am (embedspu): Add rule. + * configure.in (BUILD_MISC): Add embedspu for powerpc-linux. * Makefile.in: Regenerate. - -2006-01-17 Andreas Schwab - - 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 +2007-01-11 Alan Modra - * objcopy.c (copy_object): Fix thinko. + * 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. - * objcopy.c (copy_object): Set isympp and osympp to NULL after free. +2007-01-08 Kazu Hirata -2006-01-09 Mike Frysinger : + * readelf.c (get_machine_flags): Treat Fido as an architecture + by itself. - * readelf.c (guess_is_rela): Add case for Nios/Nios II. - (get_machine_name): Likewise. +2007-01-08 Kai Tietz -For older changes see ChangeLog-2005 + * configure.in: Renamed target x86_64-*-mingw64 to + x86_64-*-mingw*. + * configure: Regenerated. + +2007-01-05 Alan Modra + + * 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-2006 Local Variables: mode: change-log diff --git a/contrib/binutils/binutils/ChangeLog-2006 b/contrib/binutils/binutils/ChangeLog-2006 new file mode 100644 index 00000000000..9961063afd2 --- /dev/null +++ b/contrib/binutils/binutils/ChangeLog-2006 @@ -0,0 +1,599 @@ +2006-12-25 Kazu Hirata + + * readelf.c (get_machine_flags): Handle EF_M68K_CPU32_FIDO_A. + +2006-12-11 J"orn Rennecke + + MAINTAINERS (SH): Remove my entry. + +2006-12-11 Daniel Jacobowitz + + * 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 + + * readelf.c: Update uses of EF_M68K_*. + +2006-10-30 Paul Brook + + * objdump.c (disassemble_section): Set info->symtab_pos. + (disassemble_data): Set info->symtab and info->symtab_size. + +2006-10-29 H.J. Lu + + PR binutils/3384 + * configure.in (AC_CHECK_HEADERS): Add limits.h and sys/param.h. + * configure: Regenerated. + * config.in: Likewise. + + * readelf.c: Include and 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 + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + Alan Modra + + * readelf.c: Add SPU support. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-10-13 Robert Connolly + + 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 + + * 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 + + * readelf.c (debug_apply_rela_addends): Don't ignore relocation + against symbols without type. + +2006-09-25 Pedro Alves + + * nlmconv.c (main) : Use LITMEMCPY. + * prdbg.c (tg_class_static_member) : Use LITSTRCPY. + +2006-09-26 H.J. Lu + + PR binutils/3257 + * strings.c (main): Handle "-T format". + +2006-09-26 Nick Clifton + + * MAINTAINERS: Add Mei Ligang as maintainer of the Score port. + +2006-09-26 Thiemo Seufer + + * configure.in: Remove broken changequote lines. + +2006-09-20 Kai Tietz + + * 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 + + * readelf.c: Add support for Score binaries. + * Makefile.am: Update readelf's dependencies. + * Makefile.in: Regenerate. + +2006-09-16 Nick Clifton + Pedro Alves + + * 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 + + PR binutils/3181 + * objcopy.c (group_signature): Return proper group signature. + +2006-09-14 Alan Modra + + 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 + + PR 3181 + * objcopy.c (copy_object): Load symbols earlier. + (setup_section): Mark group signature symbols with BSF_KEEP. + +2006-09-09 Nick Clifton + + 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 + + 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 + + PR binutils/3146 + * readelf.c (dump_relocations): Check for a NULL value in rtype + before using it. + +2006-08-21 Pedro Alves + + * 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 + + PR binutils/3039 + * wrstabs.c (stab_tag_type): Initialize 'size'. + +2006-08-10 J"orn Rennecke + + 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 + + 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 + + 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 + Nigel Stephens + + * readelf.c (dump_relocations): Handle MIPS-specific + SHN_MIPS_SCOMMON and SHN_MIPS_SUNDEFINED. + (get_symbol_index_type): Similarly. + +2006-07-24 Ralk Wildenhues + + * doc/binutils.texinfo: Fix spelling mistakes. + +2006-07-10 Jakub Jelinek + + * 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 + + 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 + + * 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 + + * readelf.c (process_section_headers): Add H8/300 support. + +2006-06-23 Richard Sandiford + + * 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 + + * Makefile.am (ar_DEPENDENCIES, ranlib_DEPENDENCIES) + (dlltool_DEPENDENCIES, windres_DEPENDENCIES): Remove @LEXLIB@. + * Makefile.in: Regenerate. + +2006-06-23 Alan Modra + + * Makefile.am (*_DEPENDENCIES): Add missing dependencies. + * Makefile.in: Regenerate. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-05 Alan Modra + + * config.in: Regenerate. + +2006-06-02 Joseph S. Myers + + * doc/Makefile.am (TEXI2DVI): Define. + * doc/Makefile.in: Regenerate. + +2006-05-31 Daniel Jacobowitz + + * 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 + + * po/es.po: Updated Spanish translation. + +2006-05-25 J"orn Rennecke + + * MAINTAINERS: Update my email address. + +2006-05-24 Nick Clifton + + * po/fr.po: Updated French translation. + +2006-05-23 Nick Clifton + + * po/vi.po: Updated Vietnamese translation. + +2006-05-22 Daniel Jacobowitz + + * po/ru.po: Updated translation. + +2006-05-19 Andreas Schwab + + * 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 + + * doc/binutils.texi: Use "Binutils Index" for index name. + +2006-05-15 H.J. Lu + + * dwarf.c (display_debug_frames): Don't return on ZERO + terminator. + +2006-05-02 Daniel Jacobowitz + + * 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 + + * readelf.c (arm_attr_tag_VFP_arch): Add VFPv3. + +2006-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * configure: Regenerate. + +2006-04-18 Nick Clifton + + 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 + + * objdump.c (objdump_symbol_at_address): Fix typo in comment. + +2006-04-10 Ben Elliston + + * MAINTAINERS (CGEN Maintainers): Remove myself. + +2006-04-06 Carlos O'Donell + + * 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 + + * 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 + + * resbin.c: Avoid duplicating constants in calls to reswr_alloc. + +2006-03-20 Nathan Sidwell + + * BRANCHES: Remove binutils-csl-arm-2006q1-branch. Document + binutils-csl-2_17-branch instead. + +2006-03-20 Paul Brook + + * BRANCHES: Mention binutils-csl-arm-2006q1-branch. + +2006-03-16 Alan Modra + + 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 + + * 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 + + * readelf.c (decode_ARM_machine_flags): Handle EABIv5. + +2006-03-10 Alan Modra + + * 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 + + * dlltool.c: Update copyright year. + * doc/binutils.texi: Likewise. + +2006-03-09 Danny Smith + + * 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 + + * readelf.c (get_machine_flags): Adjust. + +2006-03-03 Jakub Jelinek + + * 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 + + * 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 + + * po/Make-in: Add html target. + +2006-02-17 Nick Hudson + + * readelf.c (get_machine_flags): Add logic for missing EF_SH flags. + +2006-02-14 Jakub Jelinek + + * config.in: Rebuilt. + +2006-02-10 H.J. Lu + + PR binutils/2258 + * readelf.c (process_program_headers): Use + ELF_IS_SECTION_IN_SEGMENT_MEMORY. + +2006-02-09 Eric Botcazou + + * 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 + + * readelf.c (process_program_headers): Match PT_TLS segment + only with SHT_TLS sections. + +2006-02-07 Nathan Sidwell + + * readelf.c (get_machine_flags): Add logic for EF_M68K flags. + +2006-02-02 H.J. Lu + + * readelf.c (process_program_headers): Undo the last change. + +2006-02-02 H.J. Lu + + * 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 + + * 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 + + * po/vi.po: New Vietnamese translation. + * configure.in (ALL_LINGUAS): Add vi. + * configure: Regenerate. + +2006-01-18 Alexandre Oliva + + 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 + + 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 + + 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 + + * objcopy.c (copy_object): Fix thinko. + + * objcopy.c (copy_object): Set isympp and osympp to NULL after free. + +2006-01-09 Mike Frysinger : + + * 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/contrib/binutils/binutils/MAINTAINERS b/contrib/binutils/binutils/MAINTAINERS index f5beb0343b4..a3fdce30605 100644 --- a/contrib/binutils/binutils/MAINTAINERS +++ b/contrib/binutils/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 (head maintainer) Richard Henderson Ian Lance Taylor @@ -58,7 +58,7 @@ responsibility among the other maintainers. ALPHA Richard Henderson ARM Nick Clifton ARM Richard Earnshaw - ARM (Symbian) Paul Brook + ARM Paul Brook ARM (Symbian) Mark Mitchell AVR Denis Chertykov AVR Marek Michalkiewicz @@ -73,7 +73,7 @@ responsibility among the other maintainers. FR30 Dave Brolley FRV Dave Brolley FRV Alexandre Oliva - H8300 Anil Paranjpe + H8300 Anil Paranjpe HPPA Dave Anglin HPPA elf32 Alan Modra HPPA elf64 Jeff Law [Basic maintainance only] @@ -83,33 +83,36 @@ responsibility among the other maintainers. ix86 Alan Modra ix86 PE Christopher Faylor ix86 COFF DJ Delorie - ix86 H.J.Lu + ix86 H.J. Lu ix86 INTEL MODE Jan Beulich M68HC11 M68HC12 Stephane Carrez M68k Ben Elliston M88k Mark Kettenis MAXQ Inderpreet Singh + MEP Dave Brolley MIPS Eric Christopher MIPS Thiemo Seufer MMIX Hans-Peter Nilsson MN10300 Eric Christopher MN10300 Alexandre Oliva MSP430 Dmitry Diky + NetBSD support Matt Thomas PPC Geoff Keating + PPC Alan Modra PPC vector ext Aldy Hernandez s390, s390x Martin Schwidefsky - SH Jörn Rennecke + SCORE Mei Ligang SH Alexandre Oliva SH Kaz Kojima SPARC Jakub Jelinek TESTSUITES Ben Elliston TIC4X Svein Seldal TIC54X Timothy Wall - VAX Jason R Thorpe + VAX Matt Thomas VAX Jan-Benedict Glaw x86_64 Jan Hubicka x86_64 Andreas Jaeger - x86_64 H.J.Lu + x86_64 H.J. Lu Xtensa Bob Wilson z80 Arnold Metselaar z8k Christian Groessler @@ -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-- + binutils-- 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---branchpoint \ - binutils---branch + binutils---branch 4. Document the branch: diff --git a/contrib/binutils/binutils/Makefile.am b/contrib/binutils/binutils/Makefile.am index 1b4e85adb8a..34c03ce6831 100644 --- a/contrib/binutils/binutils/Makefile.am +++ b/contrib/binutils/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) +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@ - -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/contrib/binutils/binutils/Makefile.in b/contrib/binutils/binutils/Makefile.in index 8b5ab820548..9cf28fdc779 100644 --- a/contrib/binutils/binutils/Makefile.in +++ b/contrib/binutils/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/contrib/binutils/binutils/NEWS b/contrib/binutils/binutils/NEWS index d12450e3892..ad6058f75b2 100644 --- a/contrib/binutils/binutils/NEWS +++ b/contrib/binutils/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 " and "--globalize-symbols " 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/contrib/binutils/binutils/acinclude.m4 b/contrib/binutils/binutils/acinclude.m4 deleted file mode 100644 index 71b09b9f6ac..00000000000 --- a/contrib/binutils/binutils/acinclude.m4 +++ /dev/null @@ -1 +0,0 @@ -sinclude(../bfd/acinclude.m4) diff --git a/contrib/binutils/binutils/aclocal.m4 b/contrib/binutils/binutils/aclocal.m4 index cd4267338b7..29676eafab9 100644 --- a/contrib/binutils/binutils/aclocal.m4 +++ b/contrib/binutils/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/contrib/binutils/binutils/addr2line.c b/contrib/binutils/binutils/addr2line.c index 7cd67bc0a1b..a7c365ae741 100644 --- a/contrib/binutils/binutils/addr2line.c +++ b/contrib/binutils/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 @@ -29,15 +29,12 @@ both forms write results to stdout, the second form reads addresses to be converted from stdin. */ -#include "config.h" -#include - +#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/contrib/binutils/binutils/ar.c b/contrib/binutils/binutils/ar.c index fe1c6402222..8313df5bf39 100644 --- a/contrib/binutils/binutils/ar.c +++ b/contrib/binutils/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/contrib/binutils/binutils/arparse.y b/contrib/binutils/binutils/arparse.y index a7ea0157f41..2453b65a02e 100644 --- a/contrib/binutils/binutils/arparse.y +++ b/contrib/binutils/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/contrib/binutils/binutils/arsup.c b/contrib/binutils/binutils/arsup.c index 189490b307b..98f93a637e5 100644 --- a/contrib/binutils/binutils/arsup.c +++ b/contrib/binutils/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/contrib/binutils/binutils/bin2c.c b/contrib/binutils/binutils/bin2c.c new file mode 100644 index 00000000000..b83f02d3c98 --- /dev/null +++ b/contrib/binutils/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/contrib/binutils/binutils/binemul.c b/contrib/binutils/binutils/binemul.c index 7dac32dd115..83740d0d6ac 100644 --- a/contrib/binutils/binutils/binemul.c +++ b/contrib/binutils/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/contrib/binutils/binutils/binemul.h b/contrib/binutils/binutils/binemul.h index 53bbbd2de20..c5d8c78f7fb 100644 --- a/contrib/binutils/binutils/binemul.h +++ b/contrib/binutils/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/contrib/binutils/binutils/bucomm.c b/contrib/binutils/binutils/bucomm.c index 03a4d2873e2..a4c11f0cfa0 100644 --- a/contrib/binutils/binutils/bucomm.c +++ b/contrib/binutils/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 #include /* ctime, maybe time_t */ #include +#include "bucomm.h" #ifndef HAVE_TIME_T_IN_TIME_H #ifndef HAVE_TIME_T_IN_TYPES_H @@ -386,53 +387,101 @@ 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 diff --git a/contrib/binutils/binutils/bucomm.h b/contrib/binutils/binutils/bucomm.h index 9f914adeb58..95ed2ec2c3a 100644 --- a/contrib/binutils/binutils/bucomm.h +++ b/contrib/binutils/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 -#include - -#include "config.h" -#include "bin-bugs.h" - -#include - -#ifdef USE_BINARY_FOPEN -#include "fopen-bin.h" -#else -#include "fopen-same.h" -#endif - -#include -#ifndef errno -extern int errno; -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#else -extern char *strchr (); -extern char *strrchr (); -#endif -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#else -#ifdef HAVE_SYS_FILE_H -#include -#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 -# 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 -#endif - -#ifdef ENABLE_NLS -# include -# 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/contrib/binutils/binutils/budemang.c b/contrib/binutils/binutils/budemang.c deleted file mode 100644 index 55f10b785da..00000000000 --- a/contrib/binutils/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 -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#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/contrib/binutils/binutils/coffdump.c b/contrib/binutils/binutils/coffdump.c index 5ec23b43f62..7b6ead4af38 100644 --- a/contrib/binutils/binutils/coffdump.c +++ b/contrib/binutils/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/contrib/binutils/binutils/coffgrok.c b/contrib/binutils/binutils/coffgrok.c index a6c05b14d2a..a1e89e1298c 100644 --- a/contrib/binutils/binutils/coffgrok.c +++ b/contrib/binutils/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/contrib/binutils/binutils/config.in b/contrib/binutils/binutils/config.in index 93d8e952837..6183c3782e1 100644 --- a/contrib/binutils/binutils/config.in +++ b/contrib/binutils/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 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 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 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 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 header file. */ #undef HAVE_LIMITS_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the 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 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 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 header file. */ -#undef HAVE_VALUES_H +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST -/* 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 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 does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/contrib/binutils/binutils/configure b/contrib/binutils/binutils/configure index 2d8e0cb970c..a10a8adcc05 100755 --- a/contrib/binutils/binutils/configure +++ b/contrib/binutils/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 #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 &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 <&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 <&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,6 +3964,6400 @@ _ACEOF + +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 + 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 &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 &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_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_DUMPBIN="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +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 "$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_ac_ct_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_DUMPBIN="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +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 "$ac_ct_DUMPBIN" && break +done +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + 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 + 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 + (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:$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 + +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 +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 + 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 + 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 + + + + + + + + + + +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 + 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 + +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 +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 +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 + + 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 + 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 + +test -z "$STRIP" && STRIP=: + + + + + + +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 + +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' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 + + +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 + 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 +#include +#include +#include + +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 + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (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 + : +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_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +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 + 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 + 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 + 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 +fi +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 + +fi + +done + + + +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 +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 + 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 + 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 + 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 +fi +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 + +fi + +done + + + +# 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 + 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 + + + + + + + + + + + + + + + + + +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 + 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 + +*** 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 + +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_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 + +*** 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 + +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 + 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 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 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. */ + +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_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 + +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 + + 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. */ + +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_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 + +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 + + 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 + ;; + + 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 + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + 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 + 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 + + 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 + (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 + 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 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + 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 + ;; + + 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 + ;; + + 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 + ;; + + *nto* | *qnx*) + ;; + + 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 + ;; + + 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=: + ;; + + 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' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + 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.so + # instead of lib.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. */ + +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 + 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 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + 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 + + # 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' + ;; + +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 + ;; + +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 + ;; + +*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 + shlibpath_overrides_runpath=yes + fi + ;; + +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 + ;; + +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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + 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 +else + 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. */ + +/* 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 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_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + 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_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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 + 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. */ + +/* 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 () +{ +shl_load (); + ; + 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_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=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_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:$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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + 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_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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. */ + +/* 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 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_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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. */ + +/* 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 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_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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 +else + 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. */ + +/* 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 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_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + 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 + 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 +#endif + +#include + +#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 +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 + 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" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#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 -fr conftest* + + +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" + ;; + 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 +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. @@ -5300,2479 +10678,138 @@ if test "$LEX" = :; then 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 -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 - -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 -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_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 - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_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 - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_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 - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_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 - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -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 - 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 -#include -#include -#include - -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 - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (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 - : -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_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_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. */ - -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 - 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 - -_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_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -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 -_ACEOF - ;; -esac - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -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 - 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 - 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 - 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 -fi -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 - -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 - 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; -} -_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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -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 - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -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 - 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 ((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 - 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_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 -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 - -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - 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_working_alloca_h=yes -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 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -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 - 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 -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - 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_alloca_works=yes -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 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -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. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -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 - -_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* - -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 - 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -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 (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -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 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -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_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 - 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 - 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 $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 -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 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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -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 -/* 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 -#include - -#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 -# 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 */ - -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); -} -_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_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 - 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 $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 -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 $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 -int -main () -{ -return LC_MESSAGES - ; - 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_val_LC_MESSAGES=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -am_cv_val_LC_MESSAGES=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -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 +# 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 - # Check whether --enable-nls or --disable-nls was given. +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + 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 + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +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 "$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 -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 $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 -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 -_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 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 -_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 + 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_cpp_err=yes + ac_executable_p="test -f" 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 +rm -f conf$$.file - 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: 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 - ;; - 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 -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 $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 - -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 - 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 -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -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 - - 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 - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $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 bindtextdomain (); -int -main () -{ -bindtextdomain (); - ; - 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_intl_bindtextdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_bindtextdomain=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 $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. */ - -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_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libintl=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_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - # Extract the first word of "msgfmt", so it can be a program name with args. +# 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 @@ -7780,308 +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. - ;; - *) - 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 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test "$MSGFMT" != "no"; then - -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 - - # 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. - ;; + ac_cv_path_MSGFMT="$MSGFMT" # 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 -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - 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 - 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 - - 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 - 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 - - - - - 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 + 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 - 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. -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 - 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="msgfmt" - ;; + 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,284 +10959,105 @@ else echo "${ECHO_T}no" >&6 fi - - 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 + rm -f messages.po - - - - - - - - - - - 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 " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . 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 -_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 -_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 + +# 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + 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 +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&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 -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 "$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 - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi + ac_config_commands="$ac_config_commands default-1" - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - 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 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. @@ -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 declares mkstemp. + For example, HP-UX 11i declares gettimeofday. */ +#define mkstemp innocuous_mkstemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 declares mkdtemp. + For example, HP-UX 11i declares gettimeofday. */ +#define mkdtemp innocuous_mkdtemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkdtemp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 +_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 +_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 &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 +#include +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 +#include +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 +#include +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-*-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)' ;; 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,@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,@GMSGFMT@,$GMSGFMT,;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,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;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 , 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/contrib/binutils/binutils/configure.in b/contrib/binutils/binutils/configure.in index 10afc537441..19aaabc8678 100644 --- a/contrib/binutils/binutils/configure.in +++ b/contrib/binutils/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/contrib/binutils/binutils/cxxfilt.c b/contrib/binutils/binutils/cxxfilt.c index a8ec43ba118..bed0537e477 100644 --- a/contrib/binutils/binutils/cxxfilt.c +++ b/contrib/binutils/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/contrib/binutils/binutils/debug.c b/contrib/binutils/binutils/debug.c index 07d38acfe40..1cc518e6295 100644 --- a/contrib/binutils/binutils/debug.c +++ b/contrib/binutils/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 . @@ -26,11 +26,9 @@ this was writing a converter from stabs to HP IEEE-695 debugging format. */ -#include +#include "sysdep.h" #include - #include "bfd.h" -#include "bucomm.h" #include "libiberty.h" #include "debug.h" diff --git a/contrib/binutils/binutils/defparse.c b/contrib/binutils/binutils/defparse.c deleted file mode 100644 index de34ae0cfc1..00000000000 --- a/contrib/binutils/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 /* 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 /* 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 /* 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 /* 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/contrib/binutils/binutils/defparse.h b/contrib/binutils/binutils/defparse.h deleted file mode 100644 index 0eea9b9dcf4..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/defparse.y b/contrib/binutils/binutils/defparse.y index 81b4c61ce90..8b870d7c6be 100644 --- a/contrib/binutils/binutils/defparse.y +++ b/contrib/binutils/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/contrib/binutils/binutils/dlltool.c b/contrib/binutils/binutils/dlltool.c index 6c231f69a44..568ad689efa 100644 --- a/contrib/binutils/binutils/dlltool.c +++ b/contrib/binutils/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_I386 +#ifdef DLLTOOL_DEFAULT_ARM_WINCE +static const char *mname = "arm-wince"; +#endif + +#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 Use as the linker.\n")); fprintf (file, _(" -F --linker-flags Pass 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/contrib/binutils/binutils/dllwrap.c b/contrib/binutils/binutils/dllwrap.c index f93c75d6fb3..9828a958a73 100644 --- a/contrib/binutils/binutils/dllwrap.c +++ b/contrib/binutils/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 #include -#include #ifdef HAVE_SYS_WAIT_H #include @@ -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/contrib/binutils/binutils/doc/Makefile.am b/contrib/binutils/binutils/doc/Makefile.am index 1d043e7d3f8..ceeda41b004 100644 --- a/contrib/binutils/binutils/doc/Makefile.am +++ b/contrib/binutils/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/contrib/binutils/binutils/doc/Makefile.in b/contrib/binutils/binutils/doc/Makefile.in index ef28ceff8df..338c9bad74e 100644 --- a/contrib/binutils/binutils/doc/Makefile.in +++ b/contrib/binutils/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/contrib/binutils/binutils/doc/addr2line.1 b/contrib/binutils/binutils/doc/addr2line.1 deleted file mode 100644 index 71d1ea76398..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/ar.1 b/contrib/binutils/binutils/doc/ar.1 deleted file mode 100644 index 5985ca15e44..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/binutils.texi b/contrib/binutils/binutils/doc/binutils.texi index be571d2a7cc..9499634458d 100644 --- a/contrib/binutils/binutils/doc/binutils.texi +++ b/contrib/binutils/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/contrib/binutils/binutils/doc/cxxfilt.man b/contrib/binutils/binutils/doc/cxxfilt.man deleted file mode 100644 index 08e77f18ed9..00000000000 --- a/contrib/binutils/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 -.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/contrib/binutils/binutils/doc/dlltool.1 b/contrib/binutils/binutils/doc/dlltool.1 deleted file mode 100644 index 44c5a4e01dd..00000000000 --- a/contrib/binutils/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:\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@ \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@ \fR -in addition to the symbols with \fB@ \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/contrib/binutils/binutils/doc/nm.1 b/contrib/binutils/binutils/doc/nm.1 deleted file mode 100644 index 9f2271c7cbd..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/objcopy.1 b/contrib/binutils/binutils/doc/objcopy.1 deleted file mode 100644 index 828cddef56e..00000000000 --- a/contrib/binutils/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 \-B \e -\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e -\& -.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." 4 -.IX Item "1." -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -create a file containing the debugging info. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -stripped executable. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -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." 4 -.IX Item "1." -.PD 0 -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.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/contrib/binutils/binutils/doc/objdump.1 b/contrib/binutils/binutils/doc/objdump.1 deleted file mode 100644 index a27423c21ba..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/ranlib.1 b/contrib/binutils/binutils/doc/ranlib.1 deleted file mode 100644 index fd03dd02c72..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/readelf.1 b/contrib/binutils/binutils/doc/readelf.1 deleted file mode 100644 index 14480c7938e..00000000000 --- a/contrib/binutils/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 |\fB\-\-hex\-dump=\fR] - [\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 \fR" 4 -.IX Item "-x " -.PD 0 -.IP "\fB\-\-hex\-dump=\fR" 4 -.IX Item "--hex-dump=" -.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/contrib/binutils/binutils/doc/size.1 b/contrib/binutils/binutils/doc/size.1 deleted file mode 100644 index 1cf72ac7fe2..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/strings.1 b/contrib/binutils/binutils/doc/strings.1 deleted file mode 100644 index 5cffee121bf..00000000000 --- a/contrib/binutils/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/contrib/binutils/binutils/doc/strip.1 b/contrib/binutils/binutils/doc/strip.1 deleted file mode 100644 index 982255ef754..00000000000 --- a/contrib/binutils/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." 4 -.IX Item "1." -\&\f(CW\*(C`foo\*(C'\fR then... -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -create a file containing the debugging info. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -stripped executable. -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -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." 4 -.IX Item "1." -.PD 0 -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.ie n .IP "1." 4 -.el .IP "1." 4 -.IX Item "1." -.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/contrib/binutils/binutils/dwarf.c b/contrib/binutils/binutils/dwarf.c index c69cab224b2..cc37b25b701 100644 --- a/contrib/binutils/binutils/dwarf.c +++ b/contrib/binutils/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 - -#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_plus_plus: printf ("(C++)"); 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_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_Pascal83: printf ("(ANSI Pascal)"); 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/contrib/binutils/binutils/dwarf.h b/contrib/binutils/binutils/dwarf.h index 907ac93ef71..6b4674268a9 100644 --- a/contrib/binutils/binutils/dwarf.h +++ b/contrib/binutils/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/contrib/binutils/binutils/embedspu.sh b/contrib/binutils/binutils/embedspu.sh new file mode 100644 index 00000000000..6611172814e --- /dev/null +++ b/contrib/binutils/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} - <. @@ -22,12 +22,10 @@ /* This file reads and writes IEEE-695 debugging information. */ -#include +#include "sysdep.h" #include - #include "bfd.h" #include "ieee.h" -#include "bucomm.h" #include "libiberty.h" #include "debug.h" #include "budbg.h" diff --git a/contrib/binutils/binutils/mclex.c b/contrib/binutils/binutils/mclex.c new file mode 100644 index 00000000000..f6cedd9efd7 --- /dev/null +++ b/contrib/binutils/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 + +/* 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/contrib/binutils/binutils/mcparse.y b/contrib/binutils/binutils/mcparse.y new file mode 100644 index 00000000000..9aaba9b8d41 --- /dev/null +++ b/contrib/binutils/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 . */ + +#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 MCIDENT MCFILENAME MCLINE MCCOMMENT +%token MCTOKEN +%token MCENDLINE +%token MCLANGUAGENAMES MCFACILITYNAMES MCSEVERITYNAMES MCOUTPUTBASE MCMESSAGEIDTYPEDEF +%token MCLANGUAGE MCMESSAGEID MCSEVERITY MCFACILITY MCSYMBOLICNAME +%token MCNUMBER + +%type id vid sefasy_def +%type alias_name token lines comments +%type 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/contrib/binutils/binutils/nm.c b/contrib/binutils/binutils/nm.c index c1fb4d803e8..62328a4d54e 100644 --- a/contrib/binutils/binutils/nm.c +++ b/contrib/binutils/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); @@ -1093,6 +1077,26 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) free (minisyms); } +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) { @@ -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/contrib/binutils/binutils/objcopy.c b/contrib/binutils/binutils/objcopy.c index 0e0cfaaccf5..06e2946ce34 100644 --- a/contrib/binutils/binutils/objcopy.c +++ b/contrib/binutils/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 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 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 Do not strip symbol \n\ --keep-file-symbols Do not strip file symbol(s)\n\ + --localize-hidden Turn all ELF hidden symbols into locals\n\ -L --localize-symbol Force symbol to be marked as a local\n\ --globalize-symbol Force symbol to be marked as a global\n\ -G --keep-global-symbol Localize all symbols except \n\ @@ -459,6 +479,7 @@ copy_usage (FILE *stream, int exit_status) --rename-section =[,] Rename section to \n\ --change-leading-char Force output format's leading character style\n\ --remove-leading-char Remove leading character from global symbols\n\ + --reverse-bytes= Reverse bytes at a time, in output sections with content\n\ --redefine-sym = Redefine symbol name to \n\ --redefine-syms --redefine-sym for all symbol pairs \n\ listed in \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); + tmpname = make_tempname (input_filename); + else + tmpname = output_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); + if (tmpname == NULL) + fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), + input_filename, strerror (errno)); + + 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 - { - copy_file (input_filename, output_filename, input_target, output_target); - - if (status == 0 && preserve_dates) - set_times (output_filename, &statbuf); - else if (status != 0) - unlink_if_ordinary (output_filename); - } + unlink_if_ordinary (tmpname); if (change_warn) { diff --git a/contrib/binutils/binutils/objdump.c b/contrib/binutils/binutils/objdump.c index 6e5eab56da2..38e7c028985 100644 --- a/contrib/binutils/binutils/objdump.c +++ b/contrib/binutils/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 +#endif + +#include + /* 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; - - if (print_files != NULL && print_files->f != NULL) - { - fclose (print_files->f); - print_files->f = NULL; - } p = xmalloc (sizeof (struct print_file_list)); + + p->map = slurp_file (modname, &p->mapsize); + if (p->map == NULL) + { + free (p); + return NULL; + } + + 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 +print_line (struct print_file_list *p, unsigned int line) +{ + const char *l; + + --line; + if (line >= p->maxline) + return; + l = p->linemap [line]; + fwrite (l, 1, strcspn (l, "\n\r"), stdout); + putchar ('\n'); +} + +/* Print a range of source code lines. */ static void -skip_to_line (struct print_file_list *p, unsigned int line, - bfd_boolean show) +dump_lines (struct print_file_list *p, unsigned int start, unsigned int end) { - while (p->line < line) + if (p->map == NULL) + return; + while (start <= end) { - char buf[100]; - - if (fgets (buf, sizeof buf, p->f) == NULL) - { - fclose (p->f); - p->f = NULL; - break; - } - - if (show) - printf ("%s", buf); - - if (strchr (buf, '\n') != NULL) - ++p->line; + 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/contrib/binutils/binutils/po/Make-in b/contrib/binutils/binutils/po/Make-in index be09b4cd788..86ff3143b98 100644 --- a/contrib/binutils/binutils/po/Make-in +++ b/contrib/binutils/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/contrib/binutils/binutils/po/POTFILES.in b/contrib/binutils/binutils/po/POTFILES.in index d3f6cb3fa7c..e96d8bf3ca1 100644 --- a/contrib/binutils/binutils/po/POTFILES.in +++ b/contrib/binutils/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/contrib/binutils/binutils/po/binutils.pot b/contrib/binutils/binutils/po/binutils.pot index 5e5a4dc7f22..f0801683f20 100644 --- a/contrib/binutils/binutils/po/binutils.pot +++ b/contrib/binutils/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 \n" "Language-Team: LANGUAGE \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" " @ Read options from \n" " -b --target= Set the binary file format\n" " -e --exe= 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= 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 [ - read options from \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 \n" msgstr "" #. xgetext:c-format -#: dlltool.c:3034 +#: dlltool.c:3137 #, c-format msgid "" " -m --machine Create as DLL for . [default: %s]\n" msgstr "" -#: dlltool.c:3035 +#: dlltool.c:3138 #, c-format msgid "" " possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, " "ppc, thumb\n" msgstr "" -#: dlltool.c:3036 +#: dlltool.c:3139 #, c-format msgid " -e --output-exp Generate an export file.\n" msgstr "" -#: dlltool.c:3037 +#: dlltool.c:3140 #, c-format msgid " -l --output-lib 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 of input dll to put into interface lib.\n" msgstr "" -#: dlltool.c:3040 +#: dlltool.c:3143 #, c-format msgid " -d --input-def Name of .def file to be read in.\n" msgstr "" -#: dlltool.c:3041 +#: dlltool.c:3144 #, c-format msgid " -z --output-def 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 Don't export \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 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 @ from exported names.\n" msgstr "" -#: dlltool.c:3051 +#: dlltool.c:3155 #, c-format msgid " -A --add-stdcall-alias Add aliases without @.\n" msgstr "" -#: dlltool.c:3052 +#: dlltool.c:3156 #, c-format msgid " -p --ext-prefix-alias Add aliases with .\n" msgstr "" -#: dlltool.c:3053 +#: dlltool.c:3157 #, c-format msgid " -S --as Use for assembler.\n" msgstr "" -#: dlltool.c:3054 +#: dlltool.c:3158 #, c-format msgid " -f --as-flags Pass 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 Use 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 " @ Read options from .\n" msgstr "" -#: dlltool.c:3063 +#: dlltool.c:3167 #, c-format msgid "" " -M --mcore-elf Process mcore-elf object files into .\n" msgstr "" -#: dlltool.c:3064 +#: dlltool.c:3168 #, c-format msgid " -L --linker Use as the linker.\n" msgstr "" -#: dlltool.c:3065 +#: dlltool.c:3169 #, c-format msgid " -F --linker-flags Pass 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 " @ Read options from \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 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 Defaults to \"gcc\"\n" msgstr "" -#: dllwrap.c:483 +#: dllwrap.c:480 #, c-format msgid " --driver-flags Override default ld flags\n" msgstr "" -#: dllwrap.c:484 +#: dllwrap.c:481 #, c-format msgid " --dlltool-name Defaults to \"dlltool\"\n" msgstr "" -#: dllwrap.c:485 +#: dllwrap.c:482 #, c-format msgid " --entry Specify alternate DLL entry point\n" msgstr "" -#: dllwrap.c:486 +#: dllwrap.c:483 #, c-format msgid " --image-base Specify image base address\n" msgstr "" -#: dllwrap.c:487 +#: dllwrap.c:484 #, c-format msgid " --target 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 \n" msgstr "" -#: dllwrap.c:492 +#: dllwrap.c:489 #, c-format msgid " --output-exp Generate export file.\n" msgstr "" -#: dllwrap.c:493 +#: dllwrap.c:490 #, c-format msgid " --output-lib 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 of input dll to put into output lib.\n" msgstr "" -#: dllwrap.c:496 +#: dllwrap.c:493 #, c-format msgid " --def Name input .def file\n" msgstr "" -#: dllwrap.c:497 +#: dllwrap.c:494 #, c-format msgid " --output-def 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 Exclude 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 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 @ from exported names\n" msgstr "" -#: dllwrap.c:507 +#: dllwrap.c:504 #, c-format msgid " --add-stdcall-alias Add aliases without @\n" msgstr "" -#: dllwrap.c:508 +#: dllwrap.c:505 #, c-format msgid " --as Use 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 +#: dwarf.c:1656 +#, c-format +msgid "Debug info is corrupted, length is invalid (section is %lu bytes)\n" +msgstr "" + +#: dwarf.c:1665 msgid "Only version 2 and 3 DWARF debug information is currently supported.\n" msgstr "" -#: dwarf.c:1685 +#: dwarf.c:1674 +#, c-format +msgid "" +"Debug info is corrupted, abbrev offset is invalid (section is %lu bytes)\n" +msgstr "" + +#: dwarf.c:1702 +#, c-format +msgid " <%d><%lx>: Abbrev Number: %lu" +msgstr "" + +#: dwarf.c:1722 #, c-format msgid "Unable to locate entry %lu in the abbreviation table\n" msgstr "" -#: dwarf.c:1691 +#: dwarf.c:1728 #, c-format -msgid " <%d><%lx>: Abbrev Number: %lu (%s)\n" +msgid " (%s)\n" msgstr "" -#: dwarf.c:1785 -#, c-format -msgid "%s section needs a populated .debug_info section\n" -msgstr "" - -#: dwarf.c:1792 -#, c-format -msgid "%s section has more comp units than .debug_info section\n" -msgstr "" - -#: dwarf.c:1794 -#, c-format -msgid "" -"assuming that the pointer size is %d, from the last comp unit in ." -"debug_info\n" -"\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 \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 "unsupported or unknown DW_CFA_%d\n" +msgid " DW_CFA_??? (User defined call frame op: %#x)\n" msgstr "" -#: dwarf.c:3632 +#: dwarf.c:3652 +#, c-format +msgid "unsupported or unknown Dwarf Call Frame Instruction number: %#x\n" +msgstr "" + +#: 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 -#, c-format -msgid "warning: START procedure %s not defined" -msgstr "" - #: nlmconv.c:695 #, c-format -msgid "warning: EXIT procedure %s not defined" +msgid "warning: START procedure %s not defined" msgstr "" #: nlmconv.c:697 #, c-format +msgid "warning: EXIT procedure %s not defined" +msgstr "" + +#: 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 ": %d" msgstr "" -#: nm.c:342 readelf.c:6626 readelf.c:6671 +#: nm.c:323 readelf.c:6856 readelf.c:6903 #, c-format msgid ": %d" msgstr "" -#: nm.c:344 readelf.c:6628 readelf.c:6674 +#: nm.c:325 readelf.c:6858 readelf.c:6906 #, c-format msgid ": %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 Assume input file is in format \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 Do not strip symbol \n" +" --keep-file-symbols Do not strip file symbol(s)\n" +" --localize-hidden Turn all ELF hidden symbols into locals\n" " -L --localize-symbol Force symbol to be marked as a " "local\n" " --globalize-symbol Force symbol to be marked as a " @@ -2525,6 +2560,8 @@ msgid "" "style\n" " --remove-leading-char Remove leading character from global " "symbols\n" +" --reverse-bytes= Reverse bytes at a time, in output " +"sections with content\n" " --redefine-sym = Redefine symbol name to \n" " --redefine-syms --redefine-sym for all symbol pairs \n" " listed in \n" @@ -2542,7 +2579,8 @@ msgid "" " --globalize-symbols --globalize-symbol for all in \n" " --keep-global-symbols -G for all symbols listed in \n" " --weaken-symbols -W for all symbols listed in \n" -" --alt-machine-code Use alternate machine code for output\n" +" --alt-machine-code Use the target's '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 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= Assume input file is in format \n" @@ -2593,6 +2631,7 @@ msgid "" "information\n" " -N --strip-symbol= Do not copy symbol \n" " -K --keep-symbol= Do not strip symbol \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 Place stripped output into \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 add section '%s' - it already exists!" +msgstr "" + +#: objcopy.c:1457 #, c-format msgid "can't create section `%s': %s" msgstr "" -#: objcopy.c:1356 -msgid "there are no sections to be copied!" -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" -msgstr "" - -#: objcopy.c:1635 objcopy.c:1665 +#: objcopy.c:1784 #, c-format -msgid "cannot mkdir %s for archive copying (error: %s)" +msgid "this target does not support %lu alternative machine codes" msgstr "" -#: objcopy.c:1787 +#: 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: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:3058 +#: 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: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 \n" msgstr "" -#: objdump.c:179 +#: objdump.c:177 #, c-format msgid " Display information from object .\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 "" msgstr "" -#: readelf.c:1210 +#: readelf.c:1288 #, c-format msgid "" msgstr "" -#: readelf.c:1212 +#: readelf.c:1290 #, c-format msgid "" 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 ": %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 ": %x" msgstr "" -#: readelf.c:1584 +#: readelf.c:1687 msgid "None" msgstr "" -#: readelf.c:2186 +#: readelf.c:1791 +#, c-format +msgid ": 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 "" msgstr "" -#: readelf.c:2586 +#: readelf.c:2759 #, c-format msgid "Usage: readelf 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=\n" " Disassemble the contents of section \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 "[: 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 ": %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:7157 +#: readelf.c:7537 +#, c-format +msgid "" +"\n" +"Histogram for `.gnu.hash' bucket list length (total of %lu buckets):\n" +msgstr "" + +#: 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= Set codepage when reading mc text file\n" +" -d --decimal_values Print values to text files decimal\n" +" -e --extension= Set header extension used on export header " +"file\n" +" -F --target Specify output target for endianess.\n" +" -h --headerdir= 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= 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= Set codepage used for writing text file\n" +" -r --rcdir= Set the export directory for rc files\n" +" -x --xdbg= Where to create the .dbg C include file\n" +" that maps message ID's to their symbolic " +"name.\n" msgstr "" -#: windres.c:391 +#: 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 "" + +#: 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 [=] Define SYM when preprocessing rc file\n" " -U --undefine Undefine SYM when preprocessing rc file\n" " -v --verbose Verbose - tells you what it's doing\n" +" -c --codepage= Specify default codepage\n" " -l --language= 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/contrib/binutils/binutils/prdbg.c b/contrib/binutils/binutils/prdbg.c index 87a49341b01..529903d790c 100644 --- a/contrib/binutils/binutils/prdbg.c +++ b/contrib/binutils/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 . Tags style generation written by Salvador E. Tropea . @@ -24,12 +24,11 @@ /* This file prints out the generic debugging information, by supplying a set of routines to debug_write. */ -#include +#include "sysdep.h" #include - #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/contrib/binutils/binutils/rclex.c b/contrib/binutils/binutils/rclex.c index b546335b1ab..ef0961b61ca 100644 --- a/contrib/binutils/binutils/rclex.c +++ b/contrib/binutils/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 -#include - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#ifndef _WIN32 -#include -#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 -#include -#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 -#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 -#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" +struct rclex_keywords { - char *s, *send; + const char *name; + int tok; +}; - /* This is a hack to let us parse version - information easily. */ +#define K(KEY) { #KEY, KEY } +#define KRT(KEY) { #KEY, RT_##KEY } - 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" +static const struct rclex_keywords keywds[] = { - cpp_line (yytext); - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 190 "rclex.l" + 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 }, +}; + +/* External input stream from resrc */ +extern FILE *cpp_pipe; + +/* 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; + +static int +rclex_translatekeyword (const char *key) { - 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 -#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 239 "rclex.l" - -#ifndef yywrap -/* This is needed for some versions of lex. */ -int yywrap (void) -{ - 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 | ). */ + 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/contrib/binutils/binutils/rclex.l b/contrib/binutils/binutils/rclex.l deleted file mode 100644 index 92b1ec73852..00000000000 --- a/contrib/binutils/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 - -#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/contrib/binutils/binutils/rcparse.y b/contrib/binutils/binutils/rcparse.y index fbc5bef6f8a..ac72ee77778 100644 --- a/contrib/binutils/binutils/rcparse.y +++ b/contrib/binutils/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 . */ +#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 BLOCK %token MOVEABLE FIXED PURE IMPURE PRELOAD LOADONCALL DISCARDABLE %token NOT +%token QUOTEDUNISTRING %token QUOTEDSTRING STRING %token NUMBER +%token SIZEDUNISTRING %token SIZEDSTRING %token IGNORED_TOKEN @@ -140,13 +151,17 @@ static const struct res_id res_null_text = { 1, {{0, &null_unichar}}}; %type verblocks %type vervals %type vertrans +%type toolbar_data %type suboptions memflags_move_discard memflags_move %type memflag -%type id optresidc resref +%type id rcdata_id optresidc resref resid cresid %type exstyle parennumber %type numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr %type acc_options acc_option menuitem_flags menuitem_flag -%type file_name resname +%type file_name +%type res_unicode_string resname res_unicode_string_concat +%type sizedstring +%type sizedunistring %type 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_unicode_string { - res_string_to_id (&$$, $1); - } - | QUOTEDSTRING ',' - { - 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 + res_unicode_string { $$ = $1; } - | QUOTEDSTRING ',' + | STRING { - $$ = $1; - } - | 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/contrib/binutils/binutils/rdcoff.c b/contrib/binutils/binutils/rdcoff.c index 1eda3af195d..70bf8425a1b 100644 --- a/contrib/binutils/binutils/rdcoff.c +++ b/contrib/binutils/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 . 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/contrib/binutils/binutils/rddbg.c b/contrib/binutils/binutils/rddbg.c index e977d8b5ef1..b9953d43f37 100644 --- a/contrib/binutils/binutils/rddbg.c +++ b/contrib/binutils/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 . @@ -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/contrib/binutils/binutils/readelf.c b/contrib/binutils/binutils/readelf.c index d8bd54f440f..ab41e28828b 100644 --- a/contrib/binutils/binutils/readelf.c +++ b/contrib/binutils/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 @@ -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 -#include #include -#include #include +/* for PATH_MAX */ +#ifdef HAVE_LIMITS_H +#include +#endif + +#ifndef PATH_MAX +/* for MAXPATHLEN */ +# ifdef HAVE_SYS_PARAM_H +# include +# 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 ? "" : \ - ((X)->sh_name >= string_table_length \ - ? "" : string_table + (X)->sh_name)) +#define SECTION_NAME(X) \ + ((X) == NULL ? "" \ + : string_table == NULL ? "" \ + : ((X)->sh_name >= string_table_length ? "" \ + : 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_FR30: + case EM_CYGNUS_FR30: + case EM_CYGNUS_FRV: + case EM_H8S: + case EM_H8_300: + case EM_H8_300H: + case EM_IA_64: + case EM_IP2K: + case EM_IP2K_OLD: + case EM_IQ2000: + 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_FR30: - case EM_CYGNUS_FR30: - case EM_CYGNUS_FRV: - case EM_SH: - case EM_ALPHA: - case EM_MCORE: - 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_MT: + case EM_NIOS32: + 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_IP2K: - case EM_IP2K_OLD: - case EM_IQ2000: + case EM_X86_64: + case EM_XSTORMY16: case EM_XTENSA: case EM_XTENSA_OLD: - case EM_M32R: - case EM_M32C: - case EM_MT: - case EM_BLACKFIN: - case EM_NIOS32: - case EM_ALTERA_NIOS2: 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_ST7: - case EM_68HC16: - case EM_68HC11: - case EM_68HC08: - case EM_68HC05: - case EM_SVX: case EM_ST19: + case EM_ST7: + case EM_ST9PLUS: + case EM_STARCORE: + case EM_SVX: + 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'); @@ -1419,6 +1486,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) { @@ -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), _(": %x"), e_machine); + snprintf (buff, sizeof (buff), _(": 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 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 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=\n\ Disassemble the contents of section \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\ @ Read options from \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 (" "); 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 < 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 & 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 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 { @@ -8046,6 +8583,20 @@ process_arm_specific (FILE *file) return 1; } +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) { @@ -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/contrib/binutils/binutils/rename.c b/contrib/binutils/binutils/rename.c index 7d21cb34c04..25329d14050 100644 --- a/contrib/binutils/binutils/rename.c +++ b/contrib/binutils/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/contrib/binutils/binutils/resbin.c b/contrib/binutils/binutils/resbin.c index 80c2596a70b..7c8f5019641 100644 --- a/contrib/binutils/binutils/resbin.c +++ b/contrib/binutils/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) + len = unichar_len (str); + + if (wrbfd) { - const unichar *s; - - for (s = str; *s != 0; s++) - ++len; + 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 = (struct bindata *) reswr_alloc (sizeof *d); - d->length = len * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); - - if (str == NULL) - put_16 (big_endian, 0, d->data); - else - { - 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); - } - - 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; + if (wrbfd) + { + struct bin_accelerator ba; - 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; + 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); } - - return first; + 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; + if (wrbfd) + { + struct bin_cursor bc; - 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; - - 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; + 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 = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); + off += BIN_GROUP_CURSOR_SIZE; - put_16 (big_endian, 0, first->data); - put_16 (big_endian, 2, first->data + 2); - - first->next = NULL; - pp = &first->next; - - 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); + off += (dialogex != 0 ? BIN_DIALOGEX_SIZE : BIN_DIALOG_SIZE); - 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; - - *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; - } + struct bin_dialogex_control bdc; - 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); + 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); - if (dialogex) - put_32 (big_endian, dc->id, d->data + dcoff + 8); - else - put_16 (big_endian, dc->id, d->data + dcoff + 8); + off = resid_to_bin (wrbfd, off, dc->class); + off = resid_to_bin (wrbfd, off, dc->text); - *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); - - length += 2; - - 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; + rc_uint_type saved_off = off; + rc_uint_type old_off; + off += (4 - ((off - off_delta) & 3)) & 3; - 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; + 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); } - } - put_16 (big_endian, c, first->data + off); - return first; + 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); + } + + 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; + const rc_group_icon *gi; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); + start = off; + off += BIN_GROUP_ICON_SIZE; - put_16 (big_endian, 0, first->data); - put_16 (big_endian, 1, first->data + 2); - - 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; + struct bin_group_icon_item bgii; - ++c; - - 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); + 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 = d; - pp = &d->next; - - *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); + bfd_byte help[4]; - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = 4; - d->data = (unsigned char *) reswr_alloc (d->length); + off += (4 - ((off - off_delta) & 3)) & 3; - put_32 (big_endian, mi->help, d->data); - - *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: - { - unsigned long i; - - d->length = ri->u.wstring.length * 2; - d->data = (unsigned char *) reswr_alloc (d->length); - for (i = 0; i < ri->u.wstring.length; i++) - put_16 (big_endian, ri->u.wstring.w[i], d->data + i * 2); - break; - } - + len = ri->u.wstring.length * sizeof (unichar); + break; case RCDATA_BUFFER: - d->length = ri->u.buffer.length; - d->data = (unsigned char *) ri->u.buffer.data; + 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: + { + rc_uint_type i; - d->next = NULL; - *pp = d; - pp = &d->next; + hp = (bfd_byte *) reswr_alloc (len); + for (i = 0; i < ri->u.wstring.length; i++) + windres_put_16 (wrbfd, hp + i * sizeof (unichar), ri->u.wstring.w[i]); + } + break; + case RCDATA_BUFFER: + hp = (bfd_byte *) ri->u.buffer.data; + break; + } + 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; + rc_uint_type len; - len = strlen (s); + len = (rc_uint_type) strlen (s); - d = (struct bindata *) reswr_alloc (sizeof *d); - d->length = len * 2 + 2; - d->data = (unsigned char *) reswr_alloc (d->length); + if (wrbfd) + { + rc_uint_type i; + bfd_byte *hp; - 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); + hp = (bfd_byte *) reswr_alloc ((len + 1) * sizeof (unichar)); - d->next = NULL; + 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; +} - return d; +static rc_uint_type +res_to_bin_toolbar (windres_bfd *wrbfd, rc_uint_type off, rc_toolbar *tb) +{ + 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; + + 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; + + 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_versioninfo (windres_bfd *wrbfd, rc_uint_type off, + const rc_versioninfo *versioninfo) { - struct bindata *first, **pp; - unsigned long length; - struct ver_info *vi; + rc_uint_type off_delta = off; + rc_uint_type start; + struct bin_versioninfo bvi; + rc_ver_info *vi; - first = (struct bindata *) reswr_alloc (sizeof *first); - first->length = 6; - first->data = (unsigned char *) reswr_alloc (first->length); - - length = 6; - - if (versioninfo->fixed == NULL) - put_16 (big_endian, 0, first->data + 2); - else - put_16 (big_endian, 52, first->data + 2); - - put_16 (big_endian, 0, first->data + 4); - - pp = &first->next; - - *pp = string_to_unicode_bin ("VS_VERSION_INFO", big_endian); - length += (*pp)->length; - pp = &(*pp)->next; - - 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; + struct bin_ver_info bv; + rc_uint_type bv_off; - dword_align_bin (&pp, &length); + off += (4 - ((off - off_delta) & 3)) & 3; - vid = (struct bindata *) reswr_alloc (sizeof *vid); - vid->length = 6; - vid->data = (unsigned char *) reswr_alloc (vid->length); + bv_off = off; - length += 6; - vilen = 6; - - put_16 (big_endian, 0, vid->data + 2); - put_16 (big_endian, 0, vid->data + 4); - - *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; - - put_16 (big_endian, 0, vsd->data + 2); - put_16 (big_endian, 0, vsd->data + 4); - - *pp = vsd; - pp = &vsd->next; - - *pp = unicode_to_bin (vi->u.string.language, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vslen += (*pp)->length; - pp = &(*pp)->next; + off = unicode_to_bin (wrbfd, off, vi->u.string.language); for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) { - struct bindata *vssd; - unsigned long vsslen; + struct bin_ver_info bvss; + rc_uint_type vss_off,str_off; - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vslen += length - hold; + off += (4 - ((off - off_delta) & 3)) & 3; - vssd = (struct bindata *) reswr_alloc (sizeof *vssd); - vssd->length = 6; - vssd->data = (unsigned char *) reswr_alloc (vssd->length); + vss_off = off; + off += BIN_VER_INFO_SIZE; - length += 6; - vilen += 6; - vslen += 6; - vsslen = 6; + off = unicode_to_bin (wrbfd, off, vs->key); - put_16 (big_endian, 1, vssd->data + 4); + off += (4 - ((off - off_delta) & 3)) & 3; - *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); + 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); } - - put_16 (big_endian, vslen, vsd->data); - break; } case VERINFO_VAR: { - unsigned long hold, vvlen, vvvlen; - struct bindata *vvd; - const struct ver_varinfo *vv; + rc_uint_type vvd_off, vvvd_off; + struct bin_ver_info bvvd; + const rc_ver_varinfo *vv; - *pp = string_to_unicode_bin ("VarFileInfo", big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - pp = &(*pp)->next; + off = string_to_unicode_bin (wrbfd, off, "VarFileInfo"); - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; + off += (4 - ((off - off_delta) & 3)) & 3; - vvd = (struct bindata *) reswr_alloc (sizeof *vvd); - vvd->length = 6; - vvd->data = (unsigned char *) reswr_alloc (vvd->length); + vvd_off = off; + off += BIN_VER_INFO_SIZE; - length += 6; - vilen += 6; - vvlen = 6; + off = unicode_to_bin (wrbfd, off, vi->u.var.key); - put_16 (big_endian, 0, vvd->data + 4); + off += (4 - ((off - off_delta) & 3)) & 3; - *pp = vvd; - pp = &vvd->next; - - *pp = unicode_to_bin (vi->u.var.key, big_endian); - length += (*pp)->length; - vilen += (*pp)->length; - vvlen += (*pp)->length; - pp = &(*pp)->next; - - hold = length; - dword_align_bin (&pp, &length); - vilen += length - hold; - vvlen += length - hold; - - vvvlen = 0; + vvvd_off = off; for (vv = vi->u.var.var; vv != NULL; vv = vv->next) { - struct bindata *vvsd; + if (wrbfd) + { + bfd_byte vvsd[4]; - 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; + 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/contrib/binutils/binutils/rescoff.c b/contrib/binutils/binutils/rescoff.c index fdd9aad9982..737eb4f0ba9 100644 --- a/contrib/binutils/binutils/rescoff.c +++ b/contrib/binutils/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. */ - struct bindata *last; + 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. */ + 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/contrib/binutils/binutils/resrc.c b/contrib/binutils/binutils/resrc.c index 73b482cd04a..ebed255157d 100644 --- a/contrib/binutils/binutils/resrc.c +++ b/contrib/binutils/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<res_info.language >> SUBLANG_SHIFT) & 0xff); + (int) res->res_info.language & ((1<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,13 +2798,289 @@ write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, fprintf (e, "END\n"); } +static int +test_rc_datablock_unicode (rc_uint_type length, const bfd_byte *data) +{ + rc_uint_type i; + if ((length & 1) != 0) + return 0; + + 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; +} + +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 (! 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; +} + +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"); + + write_rc_datablock (e, length, data, 0, 0, 0); + + 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; + + 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"); +} + +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, "\""); + if (i < length) + fprintf (e, "\n"); + } + + if (i == 0) + { + indent (e, 2); + fprintf (e, "\"\""); + } + 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; + + u = (const unichar *) &data[i]; + indent (e, 2); + fprintf (e, "L\""); + + 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, "\""); + if (i < length) + fprintf (e, "\n"); + } + + if (i == 0) + { + indent (e, 2); + fprintf (e, "L\"\""); + } + if (has_next) + fprintf (e, ","); + fprintf (e, "\n"); + if (hasblock) + fprintf (e, "END\n"); + return; + } + + show_comment = 0; + } + + if (length != 0) + { + rc_uint_type i, max_row; + int first = 1; + + max_row = (show_comment ? 4 : 8); + indent (e, 2); + for (i = 0; i + 3 < length;) + { + 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 (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 (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 < length) + { + if (! first) + indent (e, 2); + plen = fprintf (e, "0x%x", + (int) windres_get_16 (&wrtarget, data + i, length - i)); + if (has_next || i + 2 < length) + { + 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 < length) + { + if (! first) + 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 struct rcdata_item *rcdata, int ind) +write_rc_rcdata (FILE *e, const rc_rcdata_item *rcdata, int ind) { - const struct rcdata_item *ri; + const rc_rcdata_item *ri; indent (e, ind); fprintf (e, "BEGIN\n"); @@ -2292,142 +3090,40 @@ write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) if (ri->type == RCDATA_BUFFER && ri->u.buffer.length == 0) continue; - indent (e, ind + 2); - switch (ri->type) { default: abort (); case RCDATA_WORD: - fprintf (e, "%d", ri->u.word); + indent (e, ind + 2); + fprintf (e, "%ld", (long) (ri->u.word & 0xffff)); break; case RCDATA_DWORD: - fprintf (e, "%luL", ri->u.dword); + indent (e, ind + 2); + fprintf (e, "%luL", (unsigned long) ri->u.dword); break; case RCDATA_STRING: - { - const char *s; - unsigned long i; - - fprintf (e, "\""); - s = ri->u.string.s; - for (i = 0; i < ri->u.string.length; i++) - { - if (ISPRINT (*s)) - putc (*s, e); - else - fprintf (e, "\\%03o", *s); - } - fprintf (e, "\""); - break; - } + 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: - { - unsigned long i; - int first; - - /* Assume little endian data. */ - - first = 1; - for (i = 0; i + 3 < ri->u.buffer.length; i += 4) - { - unsigned long l; - int j; - - 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) - { - fprintf (e, "\t// "); - for (j = 0; j < 4; ++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]); - } - } - } - fprintf (e, "\n"); - first = 0; - } - - if (i + 1 < ri->u.buffer.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) - { - 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]); - } - } - } - fprintf (e, "\n"); - i += 2; - first = 0; - } - - if (i < ri->u.buffer.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) - fprintf (e, ","); - fprintf (e, "\n"); - first = 0; - } - + 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/contrib/binutils/binutils/resres.c b/contrib/binutils/binutils/resres.c index 1489d5eeda4..f345da3e5de 100644 --- a/contrib/binutils/binutils/resres.c +++ b/contrib/binutils/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 . + 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 #include -struct res_hdr - { - unsigned long data_size; - unsigned long header_size; - }; +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 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 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 *); -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 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 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 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 PARAMS ((const struct res_id *)); -static void res_align_file PARAMS ((void)); +static unsigned long get_id_size (const rc_res_id *); -static void - res_add_resource - PARAMS ((struct res_resource *, const struct res_id *, - const struct res_id *, int, int)); +static void res_add_resource (rc_res_resource *, const rc_res_id *, + const rc_res_id *, rc_uint_type, int); -void - res_append_resource - PARAMS ((struct res_directory **, struct res_resource *, - int, const struct res_id *, int)); +static void res_append_resource (rc_res_directory **, rc_res_resource *, + int, const rc_res_id *, int); -static struct res_directory *resources = NULL; +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; - while (read_resource_entry ()) + if (! probe_binary (&wrbfd, flen)) + set_windres_bfd_endianess (&wrbfd, ! target_is_bigendian); + + 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)); + 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; - /* Write 32 bit resource signature */ - write_res_data (sign, sizeof (sign), 1); - - /* write resources */ + 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); + 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); - /* end file on DWORD boundary */ - fpos = ftell (fres); - if (fpos % 4) - write_res_data (sign, fpos % 4, 1); - - fclose (fres); + 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; - res_align_file (); + off = write_res_data_hdr (wrbfd, off, &reshdr); + off = write_res_id (wrbfd, off, type); + off = write_res_id (wrbfd, off, name); - write_res_info (resinfo); - res_align_file (); + off = (off + 3) & ~3; + + off = write_res_info (wrbfd, off, resinfo); + off = (off + 3) & ~3; + return off; } - -/* Write data to file, abort on failure */ -static void -write_res_data (data, size, count) - const void *data; - size_t size; - int count; +static rc_uint_type +write_res_data_hdr (windres_bfd *wrbfd, rc_uint_type off, res_hdr *hdr) { - if ((size_t) fwrite (data, size, count, fres) != (size_t) count) - fatal ("%s: could not write to file", filename); + 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; +} + +static void +read_res_data_hdr (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, + res_hdr *reshdr) +{ + 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; - - /* there are hardly any names longer than 256 characters */ - p = s = (unichar *) xmalloc (sizeof (unichar) * 256); do { - read_res_data (&c, sizeof (c), 1); - *p++ = c; - if (c != 0) - l++; + read_res_data (wrbfd, &soff, omax, d, sizeof (unichar)); + c = windres_get_16 (wrbfd, d, 2); } while (c != 0); - *len = l; + l = ((soff - off[0]) / sizeof (unichar)); + + /* there are hardly any names longer than 256 characters, but anyway. */ + p = s = (unichar *) xmalloc (sizeof (unichar) * l); + do + { + read_res_data (wrbfd, off, omax, d, sizeof (unichar)); + c = windres_get_16 (wrbfd, d, 2); + *p++ = c; + } + while (c != 0); + *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/contrib/binutils/binutils/size.c b/contrib/binutils/binutils/size.c index b78cba02ba0..f83b050506b 100644 --- a/contrib/binutils/binutils/size.c +++ b/contrib/binutils/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/contrib/binutils/binutils/srconv.c b/contrib/binutils/binutils/srconv.c index d1f3efdb9e0..906432f6dba 100644 --- a/contrib/binutils/binutils/srconv.c +++ b/contrib/binutils/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/contrib/binutils/binutils/stabs.c b/contrib/binutils/binutils/stabs.c index 879a3e2c7a7..c8fc77dab2f 100644 --- a/contrib/binutils/binutils/stabs.c +++ b/contrib/binutils/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 . 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 - +#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/contrib/binutils/binutils/strings.c b/contrib/binutils/binutils/strings.c index a04cb581eae..2238574bac0 100644 --- a/contrib/binutils/binutils/strings.c +++ b/contrib/binutils/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 and David MacKenzie . */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "sysdep.h" #include "bfd.h" -#include #include "getopt.h" -#include -#include "bucomm.h" #include "libiberty.h" #include "safe-ctype.h" #include +#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/contrib/binutils/binutils/sysdep.h b/contrib/binutils/binutils/sysdep.h new file mode 100644 index 00000000000..9627b46d459 --- /dev/null +++ b/contrib/binutils/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 +#include + +#include "bfdver.h" +#include "config.h" + +#include + +#ifdef USE_BINARY_FOPEN +#include "fopen-bin.h" +#else +#include "fopen-same.h" +#endif + +#include +#ifndef errno +extern int errno; +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#else +extern char *strchr (); +extern char *strrchr (); +#endif +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef HAVE_FCNTL_H +#include +#else +#ifdef HAVE_SYS_FILE_H +#include +#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 +# 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 +#endif + +#ifdef ENABLE_NLS +# include +# 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/contrib/binutils/binutils/sysdump.c b/contrib/binutils/binutils/sysdump.c index ec19472558f..2f924692064 100644 --- a/contrib/binutils/binutils/sysdump.c +++ b/contrib/binutils/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 #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/contrib/binutils/binutils/version.c b/contrib/binutils/binutils/version.c index 2843e69f06b..b4a4c3d3e7e 100644 --- a/contrib/binutils/binutils/version.c +++ b/contrib/binutils/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 +#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/contrib/binutils/binutils/windint.h b/contrib/binutils/binutils/windint.h new file mode 100644 index 00000000000..b46f857a7a8 --- /dev/null +++ b/contrib/binutils/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/contrib/binutils/binutils/windmc.c b/contrib/binutils/binutils/windmc.c new file mode 100644 index 00000000000..5465b351cd7 --- /dev/null +++ b/contrib/binutils/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 +#include +#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 . Specify the extension for the header file. */ +static const char *mcset_header_ext = ".h"; + +/* Set by -h . Gives the path of where to create the C include file. */ +static const char *mcset_header_dir = "./"; + +/* Set by -r . 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 . 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= Set codepage when reading mc text file\n\ + -d --decimal_values Print values to text files decimal\n\ + -e --extension= Set header extension used on export header file\n\ + -F --target Specify output target for endianess.\n\ + -h --headerdir= 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= 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= Set codepage used for writing text file\n\ + -r --rcdir= Set the export directory for rc files\n\ + -x --xdbg= 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/contrib/binutils/binutils/windmc.h b/contrib/binutils/binutils/windmc.h new file mode 100644 index 00000000000..08a77062609 --- /dev/null +++ b/contrib/binutils/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/contrib/binutils/binutils/wrstabs.c b/contrib/binutils/binutils/wrstabs.c index 13f01dac725..325047ea71e 100644 --- a/contrib/binutils/binutils/wrstabs.c +++ b/contrib/binutils/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 . @@ -23,13 +23,12 @@ /* This file contains code which writes out stabs debugging information. */ -#include +#include "sysdep.h" #include - #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" diff --git a/contrib/binutils/config-ml.in b/contrib/binutils/config-ml.in index 937273173c0..cc9cf66cebc 100644 --- a/contrib/binutils/config-ml.in +++ b/contrib/binutils/config-ml.in @@ -108,6 +108,11 @@ ml_realsrcdir=${srcdir} ml_verbose=--verbose for option in ${ac_configure_args} do + # strip single quotes surrounding individual options + case $option in + \'*\') eval option=$option ;; + esac + case $option in --*) ;; -*) option=-$option ;; @@ -546,6 +551,7 @@ multi-do: flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ CFLAGS="$(CFLAGS) $${flags}" \ + CCASFLAGS="$(CCASFLAGS) $${flags}" \ FCFLAGS="$(FCFLAGS) $${flags}" \ FFLAGS="$(FFLAGS) $${flags}" \ ADAFLAGS="$(ADAFLAGS) $${flags}" \ @@ -889,7 +895,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ - ${ac_configure_args} ${ml_srcdiroption} ; then + ${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then true else exit 1 diff --git a/contrib/binutils/config.guess b/contrib/binutils/config.guess index 17690aea342..951383e3554 100755 --- a/contrib/binutils/config.guess +++ b/contrib/binutils/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2006-01-02' +timestamp='2007-05-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -106,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -210,7 +212,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -328,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -770,6 +772,8 @@ EOF case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac @@ -777,7 +781,7 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - i*:MINGW*:*) + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -787,9 +791,15 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[345]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -825,6 +835,9 @@ EOF arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; @@ -859,7 +872,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) @@ -878,7 +895,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) @@ -933,6 +954,9 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -975,7 +999,7 @@ EOF LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout @@ -985,7 +1009,11 @@ EOF LIBC=dietlibc #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit @@ -1187,6 +1215,15 @@ EOF SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; diff --git a/contrib/binutils/config.rpath b/contrib/binutils/config.rpath new file mode 100755 index 00000000000..937edf5ecb5 --- /dev/null +++ b/contrib/binutils/config.rpath @@ -0,0 +1,548 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2003 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 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, write 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 first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux*) + case $CC in + icc|ecc) + wl='-Wl,' + ;; + ccc) + wl='-Wl,' + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + sco3.2v5*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +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 + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + 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 + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II 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 use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = yes; then + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; 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 + else + 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 + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi4*) + ;; + 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=' ' + libext=lib + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + hardcode_direct=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + 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 + ;; + hpux10* | hpux11*) + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + 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 + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + sco3.2v5*) + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4.2uw2*) + hardcode_direct=yes + hardcode_minus_L=no + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + ;; + sysv5*) + hardcode_libdir_flag_spec= + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +libname_spec='lib$name' +case "$host_os" in + aix3*) + ;; + aix4* | aix5*) + ;; + amigaos*) + ;; + beos*) + ;; + bsdi4*) + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + ;; + darwin* | rhapsody*) + shrext=.dylib + ;; + dgux*) + ;; + freebsd1*) + ;; + freebsd*) + ;; + gnu*) + ;; + hpux9* | hpux10* | hpux11*) + case "$host_cpu" in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux*) + ;; + netbsd*) + ;; + newsos6) + ;; + nto-qnx) + ;; + openbsd*) + ;; + os2*) + libname_spec='$name' + shrext=.dll + ;; + osf3* | osf4* | osf5*) + ;; + sco3.2v5*) + ;; + solaris*) + ;; + sunos4*) + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ;; + sysv4*MP*) + ;; + uts4*) + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < - Andreas Schwab +2007-06-27 Mike Stump - * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Use correct program name. + * acx.m4 (ACX_CHECK_INSTALLED_TARGET_TOOL): Fixup logic for cross + builds. + +2007-06-20 Mike Stump + + * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Fix incremental builds. + (ACX_HAVE_GCC_FOR_TARGET): Likewise. + +2007-06-14 Paolo Bonzini + + * acx.m4 (ACX_CHECK_PROG_VER): Remove duplicate lines. + +2007-06-04 Olivier Hainque + + * mh-ppc-aix: Add default ADAFLAGS to BOOT_ADAFLAGS. + +2007-05-27 Paolo Bonzini + + * confsubdir.m4: Move here from newlib. + +2007-05-23 Paolo Bonzini + + PR bootstrap/32009 + * mh-ppc-darwin: Temporarily disable. + +2007-04-11 Kai Tietz + + * stdint.m4: Make template compatible with older cygwin + types.h, wrapping each type in a __XXX_t_defined #ifdef. + +2007-03-26 H.J. Lu + + * acx.m4 (ACX_BUGURL): Set BUGURL first. Quote $BUGURL first + when setting REPORT_BUGS_TEXI. + +2007-03-23 H.J. Lu + + * acx.m4 (ACX_BUGURL): Replace "@" with "@@" for + REPORT_BUGS_TEXI. + +2007-03-23 Joseph Myers + + * acx.m4 (ACX_PKGVERSION, ACX_BUGURL): Define. + +2007-03-07 Andreas Schwab + + * acx.m4 (GCC_TARGET_TOOL): Expand backquotes outside + AC_MSG_RESULT. + +2007-02-27 Alan Modra + + * mt-spu (all-ld): Depend on all-binutils. + +2007-02-18 Alexandre Oliva + + * acx.m4 (NCN_STRICT_CHECK_TOOLS): Mark environment variable as + precious. Prefer it over a cached value. Use cached value + verbosely. + (NCN_STRICT_CHECK_TARGET_TOOLS): Likewise. Don't override + environment variable with build-time tools. + +2006-12-11 Alan Modra + + * mt-spu: New file. + +2007-02-09 Daniel Jacobowitz + + * acx.m4 (ACX_CHECK_INSTALLED_TARGET_TOOL): Avoid AC_PATH_PROG + with an empty path. + +2007-02-07 Bruno Haible + + PR libgomp/28468 + * config/tls.m4 (GCC_CHECK_TLS): Also check whether the libc supports + TLS via __thread. + +2007-01-31 Daniel Franke + + PR libgomp/30546 + * acx.m4 (ACX_PROG_CHECK_VER): Locate a program and check that its + version is acceptable. + +2007-01-27 Paolo Bonzini + + * depstand.m4 (ZW_CREATE_DEPDIR): Use mkinstalldirs to make + directory. + +2007-01-23 Richard Guenther + + PR bootstrap/30541 + * config/acx.m4 (ACX_PROG_GNAT): Check for gnatmake. + +2007-01-14 H.J. Lu + + * ld-symbolic.m4: New. + +2007-01-11 Paolo Bonzini + + * warnings.m4: Use m4_expand_once to clear the AC_SUBST'ed variable. + (ACX_PROG_CC_WARNINGS_ARE_ERRORS): Fix typo. Add optional 2nd argument. + +2007-01-11 Paolo Bonzini + + * warnings.m4: Add second parameter with name of variable. + Always append to the variable if it exists. + +2007-01-01 Mike Stump + + * mh-ppc-darwin: Remove support for building with Apple's gcc-3.1. + +2006-12-04 Eric Botcazou + + * tls.m4 (GCC_CHECK_TLS): Do not test TLS with static linking + if static linking doesn't even work. + +2006-11-13 Daniel Jacobowitz + + * tls.m4 (GCC_CHECK_TLS): Fall back to a link test. + +2006-10-14 Geoffrey Keating + + * multi.m4: New file, from automake version 2 branch. + +2006-09-18 Tom Tromey + + * tls.m4 (GCC_CHECK_TLS): Pass empty argument as "help arg" to + GCC_ENABLE. + +2006-07-25 Paolo Bonzini + + PR build/26188 + * stdint.m4: Test for uintptr_t even on systems with uint64_t or uint32_t. + +2006-07-21 Steve Ellcey + + PR target/26792 + * unwind_ipinfo.m4: New. + +2006-07-21 David Daney + + PR libgcj/28426 + * gxx-include-dir.m4: Use target_alias in path for cross build. + +2006-07-18 Paolo Bonzini + + * acx.m4: Support --with-build-libsubdir and AC_SUBST + build_libsubdir. + +2006-06-13 Richard Earnshaw + Alexandre Oliva + + * gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Add optional + argument for where to search for NLS config file. + +2006-05-31 Daniel Jacobowitz + + * gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Provide some + defines otherwise gotten from AM_GNU_GETTEXT. Remove the + po/ prefix from CATALOGS. + +2006-02-14 Paolo Bonzini + Andreas Schwab + + * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Use correct program name. (ACX_CHECK_INSTALLED_TARGET_TOOL): Likewise, and always set $1. 2006-01-26 Paolo Bonzini @@ -15,19 +177,19 @@ 2006-01-02 Paolo Bonzini - PR target/25259 - * stdint.m4: New. + PR target/25259 + * stdint.m4: New. 2005-12-20 Paolo Bonzini - Revert Ada-related part of the previous change. + Revert Ada-related part of the previous change. - * mt-ppc-aix: Delete. + * mt-ppc-aix: Delete. 2005-12-19 Paolo Bonzini - - * mt-ppc-aix, mh-ppc-aix: New. - + + * mt-ppc-aix, mh-ppc-aix: New. + 2005-12-05 Paolo Bonzini * acx.m4 (GCC_TARGET_TOOL): New. diff --git a/contrib/binutils/config/confsubdir.m4 b/contrib/binutils/config/confsubdir.m4 new file mode 100644 index 00000000000..4e1e8c4641c --- /dev/null +++ b/contrib/binutils/config/confsubdir.m4 @@ -0,0 +1,127 @@ +dnl Fix Autoconf-2.59 AC_CONFIG_SUBDIRS whitespace mangling, +dnl by overriding the broken internal Autoconf macro with a +dnl backport of the 2.60 fix. +dnl +dnl This file should be a no-op for Autoconf versions != 2.59. +dnl It can be removed once the complete tree has moved to a +dnl newer Autoconf version. + +dnl m4_PACKAGE_VERSION is an undocumented Autoconf macro. +dnl We use it because this fix is intended for 2.59 only. +dnl A feature test for the broken AC_CONFIG_SUBDIRS instead +dnl would be better but is tricky. +dnl +dnl Use ifdef/ifelse over m4_ifdef/m4_ifelse to be clean for 2.13. +dnl Redefine AC_CONFIG_SUBDIRS so aclocal pulls in this file +dnl when needed. + +ifdef([m4_PACKAGE_VERSION], +[ifelse(m4_PACKAGE_VERSION, [2.59], [ + +dnl Redefine AC_CONFIG_SUBDIRS so this file is picked up if needed. +AC_DEFUN([AC_CONFIG_SUBDIRS], defn([AC_CONFIG_SUBDIRS])) + +dnl Override the broken macro. +# _AC_OUTPUT_SUBDIRS +# ------------------ +# This is a subroutine of AC_OUTPUT, but it does not go into +# config.status, rather, it is called after running config.status. +m4_define([_AC_OUTPUT_SUBDIRS], +[ +# +# CONFIG_SUBDIRS section, as fixed in confsubdir.m4. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="$ac_arg $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + AC_MSG_NOTICE([configuring in $ac_dir]) + AS_MKDIR_P(["$ac_dir"]) + _AC_SRCPATHS(["$ac_dir"]) + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + AC_MSG_WARN([no configuration information is in $ac_dir]) + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file=$ac_top_builddir$cache_file ;; + esac + + AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir]) + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir]) + fi + + cd "$ac_popdir" + done +fi +])# _AC_OUTPUT_SUBDIRS +])]) diff --git a/contrib/binutils/config/ld-symbolic.m4 b/contrib/binutils/config/ld-symbolic.m4 new file mode 100644 index 00000000000..16d64f9ad38 --- /dev/null +++ b/contrib/binutils/config/ld-symbolic.m4 @@ -0,0 +1,45 @@ +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it +dnl is supported. +AC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC], +[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions], +acl_cv_prog_gnu_ld_symbolic, [ +acl_cv_prog_gnu_ld_symbolic=no +AC_REQUIRE([AC_LIB_PROG_LD_GNU]) +if test x"$with_gnu_ld" = x"yes"; then + if $LD --help 2>&1 &5; then + acl_cv_prog_gnu_ld_symbolic=yes + fi +fi]) +if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then + SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions" +else + SYMBOLIC_LDFLAGS='' +fi +]) + +dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU +dnl linker if it is supported. +AC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW], +[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new], +acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [ +acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no +AC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC]) +if test x"$with_gnu_ld" = x"yes" -a \ + x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then + if $LD --help 2>&1 &5; then + acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes + fi +fi]) +if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then + DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new" +else + DYNAMIC_LIST_CPP_NEW_LDFLAGS='' +fi +]) diff --git a/contrib/binutils/config/mt-mep b/contrib/binutils/config/mt-mep new file mode 100644 index 00000000000..849d128a3f5 --- /dev/null +++ b/contrib/binutils/config/mt-mep @@ -0,0 +1,8 @@ + +EXTRA_TARGET_HOST_ALL_MODULES:=$(EXTRA_TARGET_HOST_ALL_MODULES) all-utils +EXTRA_TARGET_HOST_INSTALL_MODULES:=$(EXTRA_TARGET_HOST_INSTALL_MODULES) install-utils + +all-utils : all-libiberty + +install-utils : all-libiberty + diff --git a/contrib/binutils/config/mt-spu b/contrib/binutils/config/mt-spu new file mode 100644 index 00000000000..c2dbc66e999 --- /dev/null +++ b/contrib/binutils/config/mt-spu @@ -0,0 +1,4 @@ +# spu ld makefile invokes as-new in maintainer mode. +all-ld: $(MAINT) all-gas +# spu ld makefile invokes bin2c +all-ld: all-binutils diff --git a/contrib/binutils/config/multi.m4 b/contrib/binutils/config/multi.m4 new file mode 100644 index 00000000000..98417679f51 --- /dev/null +++ b/contrib/binutils/config/multi.m4 @@ -0,0 +1,65 @@ +## -*- Autoconf -*- +# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 +# 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 6 + +# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) +# --------------------------------------------------- +# Add --enable-multilib to configure. +AC_DEFUN([AM_ENABLE_MULTILIB], +[# Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "$enableval" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; + esac], + [multilib=yes]) + +# We may get other options which we leave undocumented: +# --with-target-subdir, --with-multisrctop, --with-multisubdir +# See config-ml.in if you want the gory details. + +if test "$srcdir" = "."; then + if test "$with_target_subdir" != "."; then + multi_basedir="$srcdir/$with_multisrctop../$2" + else + multi_basedir="$srcdir/$with_multisrctop$2" + fi +else + multi_basedir="$srcdir/$2" +fi +AC_SUBST(multi_basedir) + +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling = no && test $multilib = yes \ + && test "x${with_multisubdir}" != x ; then + cross_compiling=maybe +fi + +AC_OUTPUT_COMMANDS([ +# Only add multilib support code if we just rebuilt the top-level +# Makefile. +case " $CONFIG_FILES " in + *" ]m4_default([$1],Makefile)[ "*) + ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in + ;; +esac], + [ +srcdir="$srcdir" +host="$host" +target="$target" +with_multisubdir="$with_multisubdir" +with_multisrctop="$with_multisrctop" +with_target_subdir="$with_target_subdir" +ac_configure_args="${multilib_arg} ${ac_configure_args}" +multi_basedir="$multi_basedir" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +CC="$CC"])])dnl diff --git a/contrib/binutils/config/unwind_ipinfo.m4 b/contrib/binutils/config/unwind_ipinfo.m4 new file mode 100644 index 00000000000..5587d9c3fb0 --- /dev/null +++ b/contrib/binutils/config/unwind_ipinfo.m4 @@ -0,0 +1,22 @@ +dnl +dnl Check whether _Unwind_GetIPInfo is available. +dnl +AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + AC_MSG_CHECKING([for _Unwind_GetIPInfo]) + AC_CACHE_VAL(gcc_cv_getipinfo, [ + AC_TRY_LINK([extern "C" { extern void _Unwind_GetIPInfo(); }], + [_Unwind_GetIPInfo();], + [gcc_cv_getipinfo=yes], + [gcc_cv_getipinfo=no]) + ]) + if test $gcc_cv_getipinfo = yes; then + AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) + fi + AC_MSG_RESULT($gcc_cv_getipinfo) + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) diff --git a/contrib/binutils/configure b/contrib/binutils/configure index dbcbdfef7d3..13f1960e4fd 100755 --- a/contrib/binutils/configure +++ b/contrib/binutils/configure @@ -1,64 +1,288 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Defaults: -ac_help= +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# 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 + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-libada Builds libada directory" -ac_help="$ac_help - --enable-libssp Builds libssp directory" -ac_help="$ac_help - --enable-libgcc-math Builds libgcc-math directory" -ac_help="$ac_help - --with-mpfr-dir=PATH Specify source directory for MPFR library" -ac_help="$ac_help - --with-mpfr=PATH Specify directory for installed MPFR library" -ac_help="$ac_help - --with-gmp-dir=PATH Specify source directory for GMP library" -ac_help="$ac_help - --with-gmp=PATH Specify directory for installed GMP library" -ac_help="$ac_help - --with-build-sysroot=sysroot - use sysroot as the system root during the build" -ac_help="$ac_help - --enable-bootstrap Enable bootstrapping [yes if native build]" -ac_help="$ac_help - --enable-serial-[{host,target,build}-]configure - Force sequential configuration of - sub-packages for the host, target or build - machine, or all sub-packages" -ac_help="$ac_help - --with-build-time-tools=path - use given path to find target tools during the build" -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" -ac_help="$ac_help - --enable-werror enable -Werror in bootstrap stage2 and later" -ac_help="$ac_help - --with-datarootdir Use datarootdir as the data root directory." -ac_help="$ac_help - --with-docdir Install documentation in this directory." -ac_help="$ac_help - --with-htmldir Install html in this directory." +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="move-if-change" +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 build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs CC_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES OBJCOPY OBJDUMP CFLAGS_FOR_BUILD CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -67,10 +291,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -84,17 +313,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -102,59 +323,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -163,95 +384,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -260,19 +433,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -286,26 +459,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -322,7 +495,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -332,7 +505,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -343,58 +516,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -405,99 +577,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=move-if-change # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -507,13 +690,660 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_AR_set=${AR+set} +ac_env_AR_value=$AR +ac_cv_env_AR_set=${AR+set} +ac_cv_env_AR_value=$AR +ac_env_AS_set=${AS+set} +ac_env_AS_value=$AS +ac_cv_env_AS_set=${AS+set} +ac_cv_env_AS_value=$AS +ac_env_DLLTOOL_set=${DLLTOOL+set} +ac_env_DLLTOOL_value=$DLLTOOL +ac_cv_env_DLLTOOL_set=${DLLTOOL+set} +ac_cv_env_DLLTOOL_value=$DLLTOOL +ac_env_LD_set=${LD+set} +ac_env_LD_value=$LD +ac_cv_env_LD_set=${LD+set} +ac_cv_env_LD_value=$LD +ac_env_LIPO_set=${LIPO+set} +ac_env_LIPO_value=$LIPO +ac_cv_env_LIPO_set=${LIPO+set} +ac_cv_env_LIPO_value=$LIPO +ac_env_NM_set=${NM+set} +ac_env_NM_value=$NM +ac_cv_env_NM_set=${NM+set} +ac_cv_env_NM_value=$NM +ac_env_RANLIB_set=${RANLIB+set} +ac_env_RANLIB_value=$RANLIB +ac_cv_env_RANLIB_set=${RANLIB+set} +ac_cv_env_RANLIB_value=$RANLIB +ac_env_STRIP_set=${STRIP+set} +ac_env_STRIP_value=$STRIP +ac_cv_env_STRIP_set=${STRIP+set} +ac_cv_env_STRIP_value=$STRIP +ac_env_WINDRES_set=${WINDRES+set} +ac_env_WINDRES_value=$WINDRES +ac_cv_env_WINDRES_set=${WINDRES+set} +ac_cv_env_WINDRES_value=$WINDRES +ac_env_OBJCOPY_set=${OBJCOPY+set} +ac_env_OBJCOPY_value=$OBJCOPY +ac_cv_env_OBJCOPY_set=${OBJCOPY+set} +ac_cv_env_OBJCOPY_value=$OBJCOPY +ac_env_OBJDUMP_set=${OBJDUMP+set} +ac_env_OBJDUMP_value=$OBJDUMP +ac_cv_env_OBJDUMP_set=${OBJDUMP+set} +ac_cv_env_OBJDUMP_value=$OBJDUMP +ac_env_CC_FOR_TARGET_set=${CC_FOR_TARGET+set} +ac_env_CC_FOR_TARGET_value=$CC_FOR_TARGET +ac_cv_env_CC_FOR_TARGET_set=${CC_FOR_TARGET+set} +ac_cv_env_CC_FOR_TARGET_value=$CC_FOR_TARGET +ac_env_CXX_FOR_TARGET_set=${CXX_FOR_TARGET+set} +ac_env_CXX_FOR_TARGET_value=$CXX_FOR_TARGET +ac_cv_env_CXX_FOR_TARGET_set=${CXX_FOR_TARGET+set} +ac_cv_env_CXX_FOR_TARGET_value=$CXX_FOR_TARGET +ac_env_GCC_FOR_TARGET_set=${GCC_FOR_TARGET+set} +ac_env_GCC_FOR_TARGET_value=$GCC_FOR_TARGET +ac_cv_env_GCC_FOR_TARGET_set=${GCC_FOR_TARGET+set} +ac_cv_env_GCC_FOR_TARGET_value=$GCC_FOR_TARGET +ac_env_GCJ_FOR_TARGET_set=${GCJ_FOR_TARGET+set} +ac_env_GCJ_FOR_TARGET_value=$GCJ_FOR_TARGET +ac_cv_env_GCJ_FOR_TARGET_set=${GCJ_FOR_TARGET+set} +ac_cv_env_GCJ_FOR_TARGET_value=$GCJ_FOR_TARGET +ac_env_GFORTRAN_FOR_TARGET_set=${GFORTRAN_FOR_TARGET+set} +ac_env_GFORTRAN_FOR_TARGET_value=$GFORTRAN_FOR_TARGET +ac_cv_env_GFORTRAN_FOR_TARGET_set=${GFORTRAN_FOR_TARGET+set} +ac_cv_env_GFORTRAN_FOR_TARGET_value=$GFORTRAN_FOR_TARGET +ac_env_AR_FOR_TARGET_set=${AR_FOR_TARGET+set} +ac_env_AR_FOR_TARGET_value=$AR_FOR_TARGET +ac_cv_env_AR_FOR_TARGET_set=${AR_FOR_TARGET+set} +ac_cv_env_AR_FOR_TARGET_value=$AR_FOR_TARGET +ac_env_AS_FOR_TARGET_set=${AS_FOR_TARGET+set} +ac_env_AS_FOR_TARGET_value=$AS_FOR_TARGET +ac_cv_env_AS_FOR_TARGET_set=${AS_FOR_TARGET+set} +ac_cv_env_AS_FOR_TARGET_value=$AS_FOR_TARGET +ac_env_DLLTOOL_FOR_TARGET_set=${DLLTOOL_FOR_TARGET+set} +ac_env_DLLTOOL_FOR_TARGET_value=$DLLTOOL_FOR_TARGET +ac_cv_env_DLLTOOL_FOR_TARGET_set=${DLLTOOL_FOR_TARGET+set} +ac_cv_env_DLLTOOL_FOR_TARGET_value=$DLLTOOL_FOR_TARGET +ac_env_LD_FOR_TARGET_set=${LD_FOR_TARGET+set} +ac_env_LD_FOR_TARGET_value=$LD_FOR_TARGET +ac_cv_env_LD_FOR_TARGET_set=${LD_FOR_TARGET+set} +ac_cv_env_LD_FOR_TARGET_value=$LD_FOR_TARGET +ac_env_LIPO_FOR_TARGET_set=${LIPO_FOR_TARGET+set} +ac_env_LIPO_FOR_TARGET_value=$LIPO_FOR_TARGET +ac_cv_env_LIPO_FOR_TARGET_set=${LIPO_FOR_TARGET+set} +ac_cv_env_LIPO_FOR_TARGET_value=$LIPO_FOR_TARGET +ac_env_NM_FOR_TARGET_set=${NM_FOR_TARGET+set} +ac_env_NM_FOR_TARGET_value=$NM_FOR_TARGET +ac_cv_env_NM_FOR_TARGET_set=${NM_FOR_TARGET+set} +ac_cv_env_NM_FOR_TARGET_value=$NM_FOR_TARGET +ac_env_OBJDUMP_FOR_TARGET_set=${OBJDUMP_FOR_TARGET+set} +ac_env_OBJDUMP_FOR_TARGET_value=$OBJDUMP_FOR_TARGET +ac_cv_env_OBJDUMP_FOR_TARGET_set=${OBJDUMP_FOR_TARGET+set} +ac_cv_env_OBJDUMP_FOR_TARGET_value=$OBJDUMP_FOR_TARGET +ac_env_RANLIB_FOR_TARGET_set=${RANLIB_FOR_TARGET+set} +ac_env_RANLIB_FOR_TARGET_value=$RANLIB_FOR_TARGET +ac_cv_env_RANLIB_FOR_TARGET_set=${RANLIB_FOR_TARGET+set} +ac_cv_env_RANLIB_FOR_TARGET_value=$RANLIB_FOR_TARGET +ac_env_STRIP_FOR_TARGET_set=${STRIP_FOR_TARGET+set} +ac_env_STRIP_FOR_TARGET_value=$STRIP_FOR_TARGET +ac_cv_env_STRIP_FOR_TARGET_set=${STRIP_FOR_TARGET+set} +ac_cv_env_STRIP_FOR_TARGET_value=$STRIP_FOR_TARGET +ac_env_WINDRES_FOR_TARGET_set=${WINDRES_FOR_TARGET+set} +ac_env_WINDRES_FOR_TARGET_value=$WINDRES_FOR_TARGET +ac_cv_env_WINDRES_FOR_TARGET_set=${WINDRES_FOR_TARGET+set} +ac_cv_env_WINDRES_FOR_TARGET_value=$WINDRES_FOR_TARGET +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-libada Builds libada directory + --enable-libssp Builds libssp directory + --enable-stage1-languages=all choose additional languages to build during + stage1. Mostly useful for compiler development. + --enable-objc-gc enable the use of Boehm's garbage collector with + the GNU Objective-C runtime. + --enable-bootstrap Enable bootstrapping yes if native build + --enable-serial-{host,target,build}-configure + Force sequential configuration of + sub-packages for the host, target or build + machine, or all sub-packages + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --enable-stage1-checking=all choose additional checking for stage1 + of the compiler. + --enable-werror enable -Werror in bootstrap stage2 and later + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-build-libsubdir=DIR Directory where to find libraries for build system + --with-mpfr-dir=PATH This option has been REMOVED + --with-mpfr=PATH Specify prefix directory for installed MPFR package + Equivalent to --with-mpfr-include=PATH/include + plus --with-mpfr-lib=PATH/lib + --with-mpfr-include=PATH + Specify directory for installed MPFR include files + --with-mpfr-lib=PATH Specify the directory for the installed MPFR library + --with-gmp-dir=PATH This option has been REMOVED + --with-gmp=PATH Specify prefix directory for the installed GMP package + Equivalent to --with-gmp-include=PATH/include + plus --with-gmp-lib=PATH/lib + --with-gmp-include=PATH Specify directory for installed GMP include files + --with-gmp-lib=PATH Specify the directory for the installed GMP library + --with-build-sysroot=sysroot + use sysroot as the system root during the build + --with-build-time-tools=path + use given path to find target tools during the build + --with-datarootdir Use datarootdir as the data root directory. + --with-docdir Install documentation in this directory. + --with-pdfdir Install pdf in this directory. + --with-htmldir Install html in this directory. + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + AR AR for the host + AS AS for the host + DLLTOOL DLLTOOL for the host + LD LD for the host + LIPO LIPO for the host + NM NM for the host + RANLIB RANLIB for the host + STRIP STRIP for the host + WINDRES WINDRES for the host + OBJCOPY OBJCOPY for the host + OBJDUMP OBJDUMP for the host + CC_FOR_TARGET + CC for the target + CXX_FOR_TARGET + CXX for the target + GCC_FOR_TARGET + GCC for the target + GCJ_FOR_TARGET + GCJ for the target + GFORTRAN_FOR_TARGET + GFORTRAN for the target + AR_FOR_TARGET + AR for the target + AS_FOR_TARGET + AS for the target + DLLTOOL_FOR_TARGET + DLLTOOL for the target + LD_FOR_TARGET + LD for the target + LIPO_FOR_TARGET + LIPO for the target + NM_FOR_TARGET + NM for the target + OBJDUMP_FOR_TARGET + OBJDUMP for the target + RANLIB_FOR_TARGET + RANLIB for the target + STRIP_FOR_TARGET + STRIP for the target + WINDRES_FOR_TARGET + WINDRES for the target + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -524,42 +1354,108 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # 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 "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +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 + + + + + + + + + + + + + + + + + + +# Find the build, host, and target systems. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -570,122 +1466,143 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + + + + +test "$host_noncanonical" = "$target_noncanonical" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_transform_name=s,y,y, + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + # The aliases save the names the user supplied, while $host etc. # will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:611: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:632: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:650: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && +test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," # Get 'install' or 'install-sh' and its variants. @@ -696,67 +1613,82 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:705: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether ln works""... $ac_c" 1>&6 -echo "configure:758: checking whether ln works" >&5 -if eval "test \"`echo '$''{'acx_cv_prog_LN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether ln works" >&5 +echo $ECHO_N "checking whether ln works... $ECHO_C" >&6 +if test "${acx_cv_prog_LN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftestdata_t echo >conftestdata_f @@ -771,31 +1703,23 @@ rm -f conftestdata_f conftestdata_t fi if test $acx_cv_prog_LN = no; then LN="cp" - echo "$ac_t""no, using $LN" 1>&6 + echo "$as_me:$LINENO: result: no, using $LN" >&5 +echo "${ECHO_T}no, using $LN" >&6 else LN="$acx_cv_prog_LN" - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:782: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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 - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 fi @@ -837,14 +1761,25 @@ progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi -# Export original configure arguments for use by sub-configures. These -# will be expanded by make, so quote '$'. -tmp="$progname $@" -sed -e 's,\$,$$,g' < conftestsed.out -$tmp -EOF_SED -TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` -rm -f conftestsed.out +# Export original configure arguments for use by sub-configures. +# Quote arguments with shell meta charatcers. +TOPLEVEL_CONFIGURE_ARGUMENTS= +set -- "$progname" "$@" +for ac_arg +do + case "$ac_arg" in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + # if the argument is of the form -foo=baz, quote the baz part only + ac_arg=`echo "'$ac_arg'" | sed "s/^'\([-a-zA-Z0-9]*=\)/\\1'/"` ;; + *) ;; + esac + # Add the quoted argument to the list. + TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg" +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'` moveifchange=${srcdir}/move-if-change @@ -872,11 +1807,11 @@ extra_host_args= ### or a host dependent tool. Then put it into the appropriate list ### (library or tools, host or target), doing a dependency sort. -# Subdirs will be configured in the order listed in build_configdirs, +# Subdirs will be configured in the order listed in build_configdirs, # configdirs, or target_configdirs; see the serialization section below. -# Dependency sorting is only needed when *configuration* must be done in -# a particular order. In all cases a dependency should be specified in +# Dependency sorting is only needed when *configuration* must be done in +# a particular order. In all cases a dependency should be specified in # the Makefile, whether or not it's implicitly specified here. # Double entries in build_configdirs, configdirs, or target_configdirs may @@ -892,7 +1827,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix # these libraries are used by various programs built for the host environment # -host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber" +host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -903,7 +1838,6 @@ host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ - target-boehm-gc \ target-zlib \ target-qthreads \ target-libjava" @@ -911,14 +1845,15 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libraries="target-libiberty \ +target_libraries="target-libgcc \ + target-libiberty \ target-libgloss \ target-newlib \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ - target-libgcc-math \ target-libgfortran \ + target-boehm-gc \ ${libgcj} \ target-libobjc \ target-libada \ @@ -957,26 +1892,29 @@ if test x"${host}" = x"${target}" ; then is_cross_compiler=no else is_cross_compiler=yes -fi +fi # Find the build and target subdir names. - case ${build_alias} in - "") build_noncanonical=${build} ;; - *) build_noncanonical=${build_alias} ;; -esac - case ${host_alias} in - "") host_noncanonical=${build_noncanonical} ;; - *) host_noncanonical=${host_alias} ;; -esac +# post-stage1 host modules use a different CC_FOR_BUILD so, in order to +# have matching libraries, they should use host libraries: Makefile.tpl +# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR). +# However, they still use the build modules, because the corresponding +# host modules (e.g. bison) are only built for the host when bootstrap +# finishes. So: +# - build_subdir is where we find build modules, and never changes. +# - build_libsubdir is where we find build libraries, and can be overridden. - case ${target_alias} in - "") target_noncanonical=${host_noncanonical} ;; - *) target_noncanonical=${target_alias} ;; -esac - - # Prefix 'build-' so this never conflicts with target_subdir. +# Prefix 'build-' so this never conflicts with target_subdir. build_subdir="build-${build_noncanonical}" + +# Check whether --with-build-libsubdir or --without-build-libsubdir was given. +if test "${with_build_libsubdir+set}" = set; then + withval="$with_build_libsubdir" + build_libsubdir="$withval" +else + build_libsubdir="$build_subdir" +fi; # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories if ( test $srcdir = . && test -d gcc ) \ || test -d $srcdir/../host-${host_noncanonical}; then @@ -986,7 +1924,7 @@ else fi # No prefix. target_subdir=${target_noncanonical} - + # Skipdirs are removed silently. skipdirs= @@ -1007,7 +1945,7 @@ if test x$with_gnu_as = xno ; then noconfigdirs="$noconfigdirs gas" fi -# some tools are so dependent upon X11 that if we're not building with X, +# some tools are so dependent upon X11 that if we're not building with X, # it's not even worth trying to configure, much less build, that tool. case ${with_x} in @@ -1015,14 +1953,14 @@ case ${with_x} in no) skipdirs="${skipdirs} tk itcl libgui" # We won't be able to build gdbtk without X. - enable_gdbtk=no + enable_gdbtk=no ;; *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;; esac # Some tools are only suitable for building in a "native" situation. -# Remove these if host!=target. -native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" +# Remove these if host!=target. +native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" # Similarly, some are only suitable for cross toolchains. # Remove these if host=target. @@ -1059,7 +1997,7 @@ esac # Only spaces may be used in this macro; not newlines or tabs. unsupported_languages= -# Remove more programs from consideration, based on the host or +# Remove more programs from consideration, based on the host or # target this usually means that a port of the program doesn't # exist yet. @@ -1073,9 +2011,12 @@ case "${host}" in i[3456789]86-*-go32* | i[3456789]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi" ;; + x86_64-*-mingw*) + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" + ;; i[3456789]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv" - noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" ;; i[3456789]86-*-beos*) noconfigdirs="$noconfigdirs tk itcl libgui gdb" @@ -1101,8 +2042,7 @@ if test "${enable_libada+set}" = set; then ENABLE_LIBADA=$enableval else ENABLE_LIBADA=yes -fi - +fi; if test "${ENABLE_LIBADA}" != "yes" ; then noconfigdirs="$noconfigdirs gnattools" fi @@ -1113,25 +2053,7 @@ if test "${enable_libssp+set}" = set; then ENABLE_LIBSSP=$enableval else ENABLE_LIBSSP=yes -fi - - -# Set the default so we build libgcc-math for ix86 and x86_64 -# Check whether --enable-libgcc-math or --disable-libgcc-math was given. -if test "${enable_libgcc_math+set}" = set; then - enableval="$enable_libgcc_math" - : -else - -case "${target}" in - i?86-* | x86_64-* ) - enable_libgcc_math=yes ;; - *) - enable_libgcc_math=no ;; -esac - -fi - +fi; # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. @@ -1153,7 +2075,7 @@ esac # Disable libmudflap on some systems. if test x$enable_libmudflap = x ; then case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc* | *-*-uclinux*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) @@ -1174,7 +2096,7 @@ if test x$enable_libgomp = x ; then ;; *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) ;; - *-*-solaris2* | *-*-sysv4* | *-*-irix* | *-*-osf* | *-*-hpux*) + *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) ;; *-*-darwin* | *-*-aix*) ;; @@ -1189,7 +2111,7 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin*) + powerpc-*-darwin* | i[3456789]86-*-darwin*) noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; @@ -1253,9 +2175,6 @@ case "${target}" in *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}" ;; - m32c-*-*) - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; alpha*-dec-osf*) # ld works, but does not support shared libraries. # newlib is not 64 bit ready. I'm not sure about fileutils. @@ -1278,7 +2197,7 @@ case "${target}" in ;; sh-*-linux*) noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; + ;; sh*-*-pe|mips*-*-pe|*arm-wince-pe) noconfigdirs="$noconfigdirs ${libgcj}" noconfigdirs="$noconfigdirs target-examples" @@ -1308,6 +2227,9 @@ case "${target}" in arm*-*-linux-gnueabi) noconfigdirs="$noconfigdirs target-libffi target-qthreads" noconfigdirs="$noconfigdirs target-libjava target-libobjc" + case ${with_newlib} in + no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" + esac ;; arm*-*-symbianelf*) noconfigdirs="$noconfigdirs ${libgcj} target-libiberty" @@ -1331,7 +2253,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; bfin-*-*) - noconfigdirs="$noconfigdirs target-libgloss gdb" + noconfigdirs="$noconfigdirs gdb" if test x${is_cross_compiler} != xno ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi @@ -1395,6 +2317,9 @@ case "${target}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + hppa*-hp-hpux11*) + noconfigdirs="$noconfigdirs ld shellutils" + ;; hppa*-*-*) # According to Alexandre Oliva , libjava won't # build on HP-UX 10.20. @@ -1436,33 +2361,23 @@ case "${target}" in # 'target-newlib' will appear in skipdirs. ;; i[3456789]86-*-mingw32*) - target_configdirs="$target_configdirs target-mingw" - noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" - - # Can't build gdb for mingw32 if not native. - case "${host}" in - i[3456789]86-*-mingw32) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl gnuserv" - ;; - esac - ;; + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" + ;; + x86_64-*-mingw*) + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" + ;; *-*-cygwin*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" # always build newlib if winsup directory is present. - if test -d "$srcdir/winsup"; then + if test -d "$srcdir/winsup/cygwin"; then skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` elif test -d "$srcdir/newlib"; then - echo "Warning: winsup is missing so newlib can't be built." + echo "Warning: winsup/cygwin is missing so newlib can't be built." fi - - # Can't build gdb for Cygwin if not native. - case "${host}" in - *-*-cygwin*) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl libgui gnuserv" - ;; - esac - ;; + ;; i[3456789]86-moss-msdos | i[3456789]86-*-moss* | \ i[3456789]86-*-uwin* | i[3456789]86-*-interix* ) ;; @@ -1563,17 +2478,11 @@ case "${target}" in # noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mips*-dec-bsd*) - noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" - ;; mips*-*-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mipstx39-*-*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; mips64*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib ${libgcj}" + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" @@ -1615,6 +2524,9 @@ case "${target}" in ;; sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; + spu-*-*) + skipdirs="target-libssp" + ;; v810-*-*) noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; @@ -1644,7 +2556,7 @@ case "${target}" in ;; *-*-lynxos*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" - ;; + ;; *-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -1771,6 +2683,8 @@ case "${host}" in ;; *-mingw32*) ;; + *-mingw64*) + ;; *-interix*) host_makefile_frag="config/mh-interix" ;; @@ -1841,233 +2755,664 @@ if test -z "${CC}" && test "${build}" = "${host}" ; then fi if test "${build}" != "${host}" ; then - # If we are doing a Canadian Cross, in which the host and build systems - # are not the same, we set reasonable default values for the tools. - - CC=${CC-${host_alias}-gcc} - CFLAGS=${CFLAGS-"-g -O2"} - CXX=${CXX-${host_alias}-c++} - CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - else - # Set reasonable default values for some tools even if not Canadian. - # Of course, these are different reasonable default values, originally - # specified directly in the Makefile. - # We don't export, so that autoconf can do its job. - # Note that all these settings are above the fragment inclusion point - # in Makefile.in, so can still be overridden by fragments. - # This is all going to change when we autoconfiscate... - CC_FOR_BUILD="\$(CC)" - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1867: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +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_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1897: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +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 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1948: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +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_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$ac_ct_CC" && break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + CC=$ac_ct_CC +fi -cat > conftest.$ac_ext << EOF +fi -#line 1991 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +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 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (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 + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2022: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2027: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +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); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - cat > conftest.c <&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+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. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +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 + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+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. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + 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_compiler_gnu=yes else - GCC= + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2055: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + 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 +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_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -2081,111 +3426,812 @@ else CFLAGS= fi fi - - - # We must set the default linker to the linker used by gcc for the correct - # operation of libtool. If LD is not defined and we are using gcc, try to - # set the LD default to the ld used by gcc. - if test -z "$LD"; then - if test "$GCC" = yes; then - case $build in - *-*-mingw*) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; - *) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; - esac - case $gcc_prog_ld in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - LD="$gcc_prog_ld" ;; - esac - fi - fi - - CXX=${CXX-"c++"} - CFLAGS=${CFLAGS-"-g"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} -fi - -if test $host != $build; then - ac_tool_prefix=${host_alias}- +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_tool_prefix= + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + 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_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_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 + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + 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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + 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 + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext 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 + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + 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_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +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_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+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. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#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_cxx_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_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+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. */ + +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_cxx_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_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + 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_cxx_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + 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_cxx_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 + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +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 + + +# We must set the default linker to the linker used by gcc for the correct +# operation of libtool. If LD is not defined and we are using gcc, try to +# set the LD default to the ld used by gcc. +if test -z "$LD"; then + if test "$GCC" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + LD="$gcc_prog_ld" ;; + esac + fi fi -# Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2122: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GNATBIND+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GNATBIND"; then ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind" - break - fi - done - IFS="$ac_save_ifs" +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_GNATBIND="${ac_tool_prefix}gnatbind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GNATBIND="$ac_cv_prog_GNATBIND" +GNATBIND=$ac_cv_prog_GNATBIND if test -n "$GNATBIND"; then - echo "$ac_t""$GNATBIND" 1>&6 + echo "$as_me:$LINENO: result: $GNATBIND" >&5 +echo "${ECHO_T}$GNATBIND" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_GNATBIND"; then -if test -n "$ac_tool_prefix"; then + ac_ct_GNATBIND=$GNATBIND # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2154: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_GNATBIND+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$GNATBIND"; then - ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test. + if test -n "$ac_ct_GNATBIND"; then + ac_cv_prog_ac_ct_GNATBIND="$ac_ct_GNATBIND" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GNATBIND="gnatbind" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_GNATBIND" && ac_cv_prog_GNATBIND="no" +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_GNATBIND="gnatbind" + 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_GNATBIND" && ac_cv_prog_ac_ct_GNATBIND="no" fi fi -GNATBIND="$ac_cv_prog_GNATBIND" -if test -n "$GNATBIND"; then - echo "$ac_t""$GNATBIND" 1>&6 +ac_ct_GNATBIND=$ac_cv_prog_ac_ct_GNATBIND +if test -n "$ac_ct_GNATBIND"; then + echo "$as_me:$LINENO: result: $ac_ct_GNATBIND" >&5 +echo "${ECHO_T}$ac_ct_GNATBIND" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + GNATBIND=$ac_ct_GNATBIND else - GNATBIND="no" -fi + GNATBIND="$ac_cv_prog_GNATBIND" fi -echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 -echo "configure:2187: checking whether compiler driver understands Ada" >&5 -if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gnatmake", so it can be a program name with args. +set dummy ${ac_tool_prefix}gnatmake; 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_GNATMAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GNATMAKE"; then + ac_cv_prog_GNATMAKE="$GNATMAKE" # 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_GNATMAKE="${ac_tool_prefix}gnatmake" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GNATMAKE=$ac_cv_prog_GNATMAKE +if test -n "$GNATMAKE"; then + echo "$as_me:$LINENO: result: $GNATMAKE" >&5 +echo "${ECHO_T}$GNATMAKE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_GNATMAKE"; then + ac_ct_GNATMAKE=$GNATMAKE + # Extract the first word of "gnatmake", so it can be a program name with args. +set dummy gnatmake; 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_GNATMAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_GNATMAKE"; then + ac_cv_prog_ac_ct_GNATMAKE="$ac_ct_GNATMAKE" # 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_GNATMAKE="gnatmake" + 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_GNATMAKE" && ac_cv_prog_ac_ct_GNATMAKE="no" +fi +fi +ac_ct_GNATMAKE=$ac_cv_prog_ac_ct_GNATMAKE +if test -n "$ac_ct_GNATMAKE"; then + echo "$as_me:$LINENO: result: $ac_ct_GNATMAKE" >&5 +echo "${ECHO_T}$ac_ct_GNATMAKE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + GNATMAKE=$ac_ct_GNATMAKE +else + GNATMAKE="$ac_cv_prog_GNATMAKE" +fi + +echo "$as_me:$LINENO: checking whether compiler driver understands Ada" >&5 +echo $ECHO_N "checking whether compiler driver understands Ada... $ECHO_C" >&6 +if test "${acx_cv_cc_gcc_supports_ada+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.adb <&5 +echo "${ECHO_T}$acx_cv_cc_gcc_supports_ada" >&6 -echo "$ac_t""$acx_cv_cc_gcc_supports_ada" 1>&6 - -if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then +if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then have_gnat=yes else have_gnat=no fi -echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6 -echo "configure:2219: checking how to compare bootstrapped objects" >&5 -if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking how to compare bootstrapped objects" >&5 +echo $ECHO_N "checking how to compare bootstrapped objects... $ECHO_C" >&6 +if test "${gcc_cv_prog_cmp_skip+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else echo abfoo >t1 echo cdfoo >t2 @@ -2239,131 +4285,322 @@ else rm t1 t2 fi - -echo "$ac_t""$gcc_cv_prog_cmp_skip" 1>&6 +echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5 +echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6 do_compare="$gcc_cv_prog_cmp_skip" # Check for GMP and MPFR -gmplibs= +gmplibs="-lmpfr -lgmp" gmpinc= -have_gmp=yes +have_gmp=no + # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. + # Check whether --with-mpfr-dir or --without-mpfr-dir was given. if test "${with_mpfr_dir+set}" = set; then withval="$with_mpfr_dir" - : -fi + { { echo "$as_me:$LINENO: error: The --with-mpfr-dir=PATH option has been removed. +Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" >&5 +echo "$as_me: error: The --with-mpfr-dir=PATH option has been removed. +Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" >&2;} + { (exit 1); exit 1; }; } +fi; -if test "x$with_mpfr_dir" != x; then - gmpinc="-I$with_mpfr_dir" - gmplibs="$with_mpfr_dir/libmpfr.a" -else - gmplibs="-lmpfr" -fi - # Check whether --with-mpfr or --without-mpfr was given. if test "${with_mpfr+set}" = set; then withval="$with_mpfr" - : -fi +fi; + +# Check whether --with-mpfr_include or --without-mpfr_include was given. +if test "${with_mpfr_include+set}" = set; then + withval="$with_mpfr_include" + +fi; + +# Check whether --with-mpfr_lib or --without-mpfr_lib was given. +if test "${with_mpfr_lib+set}" = set; then + withval="$with_mpfr_lib" + +fi; if test "x$with_mpfr" != x; then gmplibs="-L$with_mpfr/lib $gmplibs" gmpinc="-I$with_mpfr/include" fi +if test "x$with_mpfr_include" != x; then + gmpinc="-I$with_mpfr_include" +fi +if test "x$with_mpfr_lib" != x; then + gmplibs="-L$with_mpfr_lib $gmplibs" +fi +if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then + gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" + # Do not test the mpfr version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes +fi # Specify a location for gmp + # Check whether --with-gmp-dir or --without-gmp-dir was given. if test "${with_gmp_dir+set}" = set; then withval="$with_gmp_dir" - : -fi + { { echo "$as_me:$LINENO: error: The --with-gmp-dir=PATH option has been removed. +Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" >&5 +echo "$as_me: error: The --with-gmp-dir=PATH option has been removed. +Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" >&2;} + { (exit 1); exit 1; }; } +fi; -if test "x$with_gmp_dir" != x; then - gmpinc="$gmpinc -I$with_gmp_dir" - if test -f "$with_gmp_dir/.libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a" - elif test -f "$with_gmp_dir/_libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a" - fi - # One of the later tests will catch the error if neither library is present. -else - gmplibs="$gmplibs -lgmp" -fi - # Check whether --with-gmp or --without-gmp was given. if test "${with_gmp+set}" = set; then withval="$with_gmp" - : -fi + +fi; + +# Check whether --with-gmp_include or --without-gmp_include was given. +if test "${with_gmp_include+set}" = set; then + withval="$with_gmp_include" + +fi; + +# Check whether --with-gmp_lib or --without-gmp_lib was given. +if test "${with_gmp_lib+set}" = set; then + withval="$with_gmp_lib" + +fi; if test "x$with_gmp" != x; then gmplibs="-L$with_gmp/lib $gmplibs" gmpinc="-I$with_gmp/include $gmpinc" fi +if test "x$with_gmp_include" != x; then + gmpinc="-I$with_gmp_include $gmpinc" +fi +if test "x$with_gmp_lib" != x; then + gmplibs="-L$with_gmp_lib $gmplibs" +fi +if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes +fi -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $gmpinc" -# Check GMP actually works -echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 -echo "configure:2317: checking for correct version of gmp.h" >&5 -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for correct version of gmp.h... $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 "gmp.h" -int main() { +int +main () +{ -#if __GNU_MP_VERSION < 3 -choke me -#endif + #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) + choke me + #endif -; return 0; } -EOF -if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 + ; + 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 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - echo "$ac_t""no" 1>&6; have_gmp=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; have_gmp=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -if test x"$have_gmp" = xyes; then - echo $ac_n "checking for MPFR""... $ac_c" 1>&6 -echo "configure:2343: checking for MPFR" >&5 - - saved_LIBS="$LIBS" - LIBS="$LIBS $gmplibs" - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for correct version of mpfr.h... $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 -#include -int main() { -mpfr_t n; mpfr_init(n); -; return 0; } -EOF -if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 + #include +int +main () +{ + + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0) + choke me + #endif + mpfr_t n; + mpfr_t x; + int t; + mpfr_init (n); + mpfr_init (x); + mpfr_atan2 (n, n, x, GMP_RNDN); + mpfr_erfc (n, x, GMP_RNDN); + mpfr_subnormalize (x, t, GMP_RNDN); + + ; + 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include +int +main () +{ + + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1) + choke me + #endif + mpfr_t n; mpfr_init(n); + + ; + 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 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - echo "$ac_t""no" 1>&6; have_gmp=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: buggy but acceptable" >&5 +echo "${ECHO_T}buggy but acceptable" >&6 fi -rm -f conftest* - LIBS="$saved_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; have_gmp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$saved_LIBS" + fi CFLAGS="$saved_CFLAGS" + + if test x$have_gmp != xyes; then + { { echo "$as_me:$LINENO: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+. +Try the --with-gmp and/or --with-mpfr options to specify their locations. +Copies of these libraries' source code can be found at their respective +hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. +See also http://gcc.gnu.org/install/prerequisites.html for additional info. +If you obtained GMP and/or MPFR from a vendor distribution package, make +sure that you have installed both the libraries and the header files. +They may be located in separate packages." >&5 +echo "$as_me: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+. +Try the --with-gmp and/or --with-mpfr options to specify their locations. +Copies of these libraries' source code can be found at their respective +hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. +See also http://gcc.gnu.org/install/prerequisites.html for additional info. +If you obtained GMP and/or MPFR from a vendor distribution package, make +sure that you have installed both the libraries and the header files. +They may be located in separate packages." >&2;} + { (exit 1); exit 1; }; } + fi fi # Flags needed for both GMP and/or MPFR @@ -2371,8 +4608,7 @@ fi # By default, C is the only stage 1 language. -stage1_languages=c - +stage1_languages=,c, # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use @@ -2434,9 +4670,9 @@ if test -d ${srcdir}/gcc; then esac done - new_enable_languages=c + new_enable_languages=,c, missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` - potential_languages=c + potential_languages=,c, for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do case ${lang_frag} in @@ -2445,75 +4681,90 @@ if test -d ${srcdir}/gcc; then # an apparent bug in bash 1.12 on linux. ${srcdir}/gcc/[*]/config-lang.in) ;; *) - # From the config-lang.in, get $language, $target_libs, + # From the config-lang.in, get $language, $target_libs, # $lang_dirs, $boot_language, and $build_by_default language= target_libs= lang_dirs= - boot_language= - build_by_default= - need_gmp= + subdir_requires= + boot_language=no + build_by_default=yes . ${lang_frag} - potential_languages="${potential_languages},${language}" - # This is quite sensitive to the ordering of the case statement arms. - case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in - *::*:*) - echo "${lang_frag} doesn't set \$language." 1>&2 - exit 1 - ;; - *:ada:no:*) - # Ada was requested with no preexisting GNAT. Disable unconditionally. - add_this_lang=no - ;; - *,${language},*:*:*:*) + if test x${language} = x; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + + case ,${enable_languages}, in + *,${language},*) # Language was explicitly selected; include it. add_this_lang=yes ;; - *,all,*:*:*:no) - # 'all' was selected, but this is not a default language - # so do not include it. - add_this_lang=no - ;; - *,all,*:*:*:*) - # 'all' was selected and this is a default language; include it. - add_this_lang=yes + *,all,*) + # 'all' was selected, select it if it is a default language + add_this_lang=${build_by_default} ;; *) add_this_lang=no ;; esac - # Disable languages that need GMP if it isn't available. - case ,${enable_languages},:${have_gmp}:${need_gmp} in - *,${language},*:no:yes) + # Disable languages that need other directories if these aren't available. + for i in $subdir_requires; do + test -f "$srcdir/gcc/$i/config-lang.in" && continue + case ,${enable_languages}, in + *,${language},*) + # Specifically requested language; tell them. + { { echo "$as_me:$LINENO: error: The gcc/$i directory contains parts of $language but is missing" >&5 +echo "$as_me: error: The gcc/$i directory contains parts of $language but is missing" >&2;} + { (exit 1); exit 1; }; } + ;; + *) + # Silently disable. + add_this_lang=unsupported + ;; + esac + done + + # Disable Ada if no preexisting GNAT is available. + case ,${enable_languages},:${language}:${have_gnat} in + *,${language},*:ada:no) # Specifically requested language; tell them. - { echo "configure: error: GMP with MPFR support is required to build $language" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: GNAT is required to build $language" >&5 +echo "$as_me: error: GNAT is required to build $language" >&2;} + { (exit 1); exit 1; }; } ;; - *:no:yes) + *:ada:no) # Silently disable. - add_this_lang=no + add_this_lang=unsupported ;; esac # Disable a language that is unsupported by the target. case " $unsupported_languages " in *" $language "*) - add_this_lang=no + add_this_lang=unsupported ;; esac case $add_this_lang in - no) + unsupported) # Remove language-dependent dirs. eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" ;; - *) - new_enable_languages="$new_enable_languages,$language" + no) + # Remove language-dependent dirs; still show language as supported. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + potential_languages="${potential_languages}${language}," + ;; + yes) + new_enable_languages="${new_enable_languages}${language}," + potential_languages="${potential_languages}${language}," missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` case ${boot_language} in yes) # Add to (comma-separated) list of stage 1 languages. - stage1_languages="${stage1_languages},${language}" + stage1_languages="${stage1_languages}${language}," ;; esac ;; @@ -2522,18 +4773,61 @@ if test -d ${srcdir}/gcc; then esac done - missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` - if test "x$missing_languages" != x; then - { echo "configure: error: -The following requested languages could not be built: ${missing_languages} -Recognised languages are: ${potential_languages}" 1>&2; exit 1; } - fi + # Check whether --enable-stage1-languages or --disable-stage1-languages was given. +if test "${enable_stage1_languages+set}" = set; then + enableval="$enable_stage1_languages" + case ,${enable_stage1_languages}, in + ,no,|,,) + # Set it to something that will have no effect in the loop below + enable_stage1_languages=c ;; + ,yes,) + enable_stage1_languages=`echo $new_enable_languages | \ + sed -e "s/^,//" -e "s/,$//" ` ;; + *,all,*) + enable_stage1_languages=`echo ,$enable_stage1_languages, | \ + sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;; + esac + # Add "good" languages from enable_stage1_languages to stage1_languages, + # while "bad" languages go in missing_languages. Leave no duplicates. + for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do + case $potential_languages in + *,$i,*) + case $stage1_languages in + *,$i,*) ;; + *) stage1_languages="$stage1_languages$i," ;; + esac ;; + *) + case $missing_languages in + *,$i,*) ;; + *) missing_languages="$missing_languages$i," ;; + esac ;; + esac + done +fi; + + # Remove leading/trailing commas that were added for simplicity + potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"` + missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` + stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"` + new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"` + + if test "x$missing_languages" != x; then + { { echo "$as_me:$LINENO: error: +The following requested languages could not be built: ${missing_languages} +Supported languages are: ${potential_languages}" >&5 +echo "$as_me: error: +The following requested languages could not be built: ${missing_languages} +Supported languages are: ${potential_languages}" >&2;} + { (exit 1); exit 1; }; } + fi if test "x$new_enable_languages" != "x$enable_languages"; then echo The following languages will be built: ${new_enable_languages} + enable_languages="$new_enable_languages" fi - enable_languages="$new_enable_languages" - ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[^ ]*//' -e 's/$/ --enable-languages='"$enable_languages"/ ` + + + ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[^ ]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" ` fi # Handle --disable- generically. @@ -2544,6 +4838,32 @@ for dir in $configdirs $build_configdirs $target_configdirs ; do fi done +# Check for Boehm's garbage collector +# Check whether --enable-objc-gc or --disable-objc-gc was given. +if test "${enable_objc_gc+set}" = set; then + enableval="$enable_objc_gc" + case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in + *,objc,*:*:yes:*target-boehm-gc*) + { { echo "$as_me:$LINENO: error: Boehm's garbage collector was requested yet not supported in this configuration" >&5 +echo "$as_me: error: Boehm's garbage collector was requested yet not supported in this configuration" >&2;} + { (exit 1); exit 1; }; } + ;; +esac +fi; + +# Make sure we only build Boehm's garbage collector if required. +case ,${enable_languages},:${enable_objc_gc} in + *,objc,*:yes) + # Keep target-boehm-gc if requested for Objective-C. + ;; + *) + # Otherwise remove target-boehm-gc depending on target-libjava. + if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then + noconfigdirs="$noconfigdirs target-boehm-gc" + fi + ;; +esac + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. @@ -2585,10 +4905,14 @@ done # Sometimes the tools are distributed with libiberty but with no other # libraries. In that case, we don't want to build target-libiberty. +# Don't let libgcc imply libiberty either. if test -n "${target_configdirs}" ; then + libgcc= others= for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do - if test "$i" != "libiberty" ; then + if test "$i" = "libgcc"; then + libgcc=target-libgcc + elif test "$i" != "libiberty" ; then if test -r $srcdir/$i/configure ; then others=yes; break; @@ -2596,7 +4920,7 @@ if test -n "${target_configdirs}" ; then fi done if test -z "${others}" ; then - target_configdirs= + target_configdirs=$libgcc fi fi @@ -2606,7 +4930,7 @@ fi build_configdirs_all="$build_configdirs" build_configdirs= for i in ${build_configdirs_all} ; do - j=`echo $i | sed -e s/build-//g` + j=`echo $i | sed -e s/build-//g` if test -f ${srcdir}/$j/configure ; then build_configdirs="${build_configdirs} $i" fi @@ -2623,7 +4947,7 @@ done target_configdirs_all="$target_configdirs" target_configdirs= for i in ${target_configdirs_all} ; do - j=`echo $i | sed -e s/target-//g` + j=`echo $i | sed -e s/target-//g` if test -f ${srcdir}/$j/configure ; then target_configdirs="${target_configdirs} $i" fi @@ -2669,8 +4993,57 @@ case "$host" in enable_gdbtk=no ;; esac +# To find our prefix, in gcc_cv_tool_prefix. + +# 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 + + + +if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + gcc_cv_tool_prefix=$ac_default_prefix + else + gcc_cv_tool_prefix=$prefix + fi +else + gcc_cv_tool_prefix=$exec_prefix +fi + +# If there is no compiler in the tree, use the PATH only. In any +# case, if there is no compiler in the tree nobody should use +# AS_FOR_TARGET and LD_FOR_TARGET. +if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then + gcc_version=`cat $srcdir/gcc/BASE-VER` + gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR" + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR" +else + gcc_cv_tool_dirs= +fi + +if test x$build = x$target && test -n "$md_exec_prefix"; then + gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR" +fi + + + copy_dirs= + # Check whether --with-build-sysroot or --without-build-sysroot was given. if test "${with_build_sysroot+set}" = set; then withval="$with_build_sysroot" @@ -2679,8 +5052,7 @@ if test "${with_build_sysroot+set}" = set; then fi else SYSROOT_CFLAGS_FOR_TARGET= -fi - +fi; # Handle --with-headers=XXX. If the value is not "yes", the contents of @@ -2691,11 +5063,8 @@ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then exit 1 fi if test x"${with_headers}" != xyes ; then - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac - copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + x=${gcc_cv_tool_prefix} + copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include" fi fi @@ -2710,12 +5079,9 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then if test x"${with_libs}" != xyes ; then # Copy the libraries in reverse order, so that files in the first named # library override files in subsequent libraries. - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac + x=${gcc_cv_tool_prefix} for l in ${with_libs}; do - copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" + copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}" done fi fi @@ -2725,11 +5091,11 @@ fi # This is done by determining whether or not the appropriate directory # is available, and by checking whether or not specific configurations # have requested that this magic not happen. -# -# The command line options always override the explicit settings in +# +# The command line options always override the explicit settings in # configure.in, and the settings in configure.in override this magic. # -# If the default for a toolchain is to use GNU as and ld, and you don't +# If the default for a toolchain is to use GNU as and ld, and you don't # want to do that, then you should use the --without-gnu-as and # --without-gnu-ld options for the configure script. @@ -2838,6 +5204,12 @@ extra_nmflags_for_target= extra_ranlibflags_for_target= target_makefile_frag=/dev/null case "${target}" in + mep*-*-*) + target_makefile_frag="config/mt-mep" + ;; + spu-*-*) + target_makefile_frag="config/mt-spu" + ;; *-*-netware*) target_makefile_frag="config/mt-netware" ;; @@ -2845,7 +5217,7 @@ case "${target}" in target_makefile_frag="config/mt-gnu" ;; *-*-aix4.[3456789]* | *-*-aix[56789].*) - # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm + # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm # commands to handle both 32-bit and 64-bit objects. These flags are # harmless if we're using GNU nm or ar. extra_arflags_for_target=" -X32_64" @@ -2905,14 +5277,14 @@ fi # hpux11 in 64bit mode has libraries in a weird place. Arrange to find # them automatically. case "${host}" in - hppa*64*-*-hpux11*) + hppa*64*-*-hpux11*) extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include" ;; esac # Some systems (e.g., one of the i386-aix systems the gas testers are # using) don't handle "\$" correctly, so don't use it here. -tooldir='${exec_prefix}'/${target_alias} +tooldir='${exec_prefix}'/${target_noncanonical} build_tooldir=${tooldir} # Create a .gdbinit file which runs the one in srcdir @@ -2942,7 +5314,7 @@ if test $? = 0 ; then if test -s conftest || test -s conftest.exe ; then we_are_ok=yes fi -fi +fi case $we_are_ok in no) echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed." @@ -3036,11 +5408,10 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g` # Check whether --enable-bootstrap or --disable-bootstrap was given. if test "${enable_bootstrap+set}" = set; then enableval="$enable_bootstrap" - : + else enable_bootstrap=default -fi - +fi; # Issue errors and warnings for invalid/strange bootstrap combinations. case "$configdirs" in @@ -3066,16 +5437,21 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in # Other configurations, but we have a compiler. Assume the user knows # what he's doing. yes:*:*:yes) - echo "configure: warning: trying to bootstrap a cross compiler" 1>&2 + { echo "$as_me:$LINENO: WARNING: trying to bootstrap a cross compiler" >&5 +echo "$as_me: WARNING: trying to bootstrap a cross compiler" >&2;} ;; # No compiler: if they passed --enable-bootstrap explicitly, fail no:*:*:yes) - { echo "configure: error: cannot bootstrap without a compiler" 1>&2; exit 1; } ;; + { { echo "$as_me:$LINENO: error: cannot bootstrap without a compiler" >&5 +echo "$as_me: error: cannot bootstrap without a compiler" >&2;} + { (exit 1); exit 1; }; } ;; # Fail if wrong command line *) - { echo "configure: error: invalid option for --enable-bootstrap" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: invalid option for --enable-bootstrap" >&5 +echo "$as_me: error: invalid option for --enable-bootstrap" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -3101,7 +5477,7 @@ for module in ${build_configdirs} ; do done for module in ${configdirs} ; do if test -z "${no_recursion}"; then - for file in stage*-${module}/Makefile ${module}/Makefile; do + for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do if test -f ${file}; then echo 1>&2 "*** removing ${file} to force reconfigure" rm -f ${file} @@ -3135,9 +5511,8 @@ extrasub="$extrasub # Check whether --enable-serial-configure or --disable-serial-configure was given. if test "${enable_serial_configure+set}" = set; then enableval="$enable_serial_configure" - : -fi +fi; case ${enable_serial_configure} in yes) @@ -3182,46 +5557,93 @@ serialization_dependencies=serdep.tmp # Base args. Strip norecursion, cache-file, srcdir, host, build, -# target and nonopt. These are the ones we might not want to pass -# down to subconfigures. Also strip program-prefix, program-suffix, -# and program-transform-name, so that we can pass down a consistent -# program-transform-name. If autoconf has put single quotes around -# any of these arguments (because they contain shell metacharacters) -# then this will fail; in practice this only happens for -# --program-transform-name, so be sure to override --program-transform-name -# at the end of the argument list. -# These will be expanded by make, so quote '$'. -cat <<\EOF_SED > conftestsed -s/ --no[^ ]*/ /g -s/ --c[a-z-]*[= ][^ ]*//g -s/ --sr[a-z-]*[= ][^ ]*//g -s/ --ho[a-z-]*[= ][^ ]*//g -s/ --bu[a-z-]*[= ][^ ]*//g -s/ --t[a-z-]*[= ][^ ]*//g -s/ --program-[pst][a-z-]*[= ][^ ]*//g -s/ -cache-file[= ][^ ]*//g -s/ -srcdir[= ][^ ]*//g -s/ -host[= ][^ ]*//g -s/ -build[= ][^ ]*//g -s/ -target[= ][^ ]*//g -s/ -program-prefix[= ][^ ]*//g -s/ -program-suffix[= ][^ ]*//g -s/ -program-transform-name[= ][^ ]*//g -s/ [^' -][^ ]* / / -s/^ *//;s/ *$// -s,\$,$$,g -EOF_SED -sed -f conftestsed < conftestsed.out - ${ac_configure_args} -EOF_SED -baseargs=`cat conftestsed.out` -rm -f conftestsed conftestsed.out +# target, nonopt, and variable assignments. These are the ones we +# might not want to pass down to subconfigures. Also strip +# program-prefix, program-suffix, and program-transform-name, so that +# we can pass down a consistent program-transform-name. +baseargs= +keep_next=no +skip_next=no +eval "set -- $ac_configure_args" +for ac_arg +do + if test X"$skip_next" = X"yes"; then + skip_next=no + continue + fi + if test X"$keep_next" = X"yes"; then + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=no + continue + fi + + # Handle separated arguments. Based on the logic generated by + # autoconf 2.59. + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + separate_arg=no + ;; + -*) + separate_arg=yes + ;; + *) + separate_arg=no + ;; + esac + + case "$ac_arg" in + --no*) + continue + ;; + --c* | \ + --sr* | \ + --ho* | \ + --bu* | \ + --t* | \ + --program-* | \ + -cache_file* | \ + -srcdir* | \ + -host* | \ + -build* | \ + -target* | \ + -program-prefix* | \ + -program-suffix* | \ + -program-transform-name* ) + skip_next=$separate_arg + continue + ;; + -*) + # An option. Add it. + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=$separate_arg + ;; + *) + # Either a variable assignment, or a nonopt (triplet). Don't + # pass it down; let the Makefile handle this. + continue + ;; + esac +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # Add in --program-transform-name, after --program-prefix and # --program-suffix have been applied to it. Autoconf has already # doubled dollar signs and backslashes in program_transform_name; we want # the backslashes un-doubled, and then the entire thing wrapped in single -# quotes, because this will be expanded first by make and then by the shell. +# quotes, because this will be expanded first by make and then by the shell. # Also, because we want to override the logic in subdir configure scripts to # choose program_transform_name, replace any s,x,x, with s,y,y,. sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" < conftestsed.out @@ -3234,7 +5656,7 @@ baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" # For the build-side libraries, we just need to pretend we're native, # and not use the same cache file. Multilibs are neither needed nor # desired. -build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} --target=${target_alias} ${baseargs}" +build_configargs="--cache-file=../config.cache ${baseargs}" # For host modules, accept cache file option, or specification as blank. case "${cache_file}" in @@ -3248,7 +5670,7 @@ esac # Host dirs don't like to share a cache file either, horribly enough. # This seems to be due to autoconf 2.5x stupidity. -host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" +host_configargs="--cache-file=./config.cache ${extra_host_args} ${baseargs}" target_configargs=${baseargs} @@ -3258,7 +5680,7 @@ target_configargs=${baseargs} # sorts of decisions they want to make on this basis. Please consider # this option to be deprecated. FIXME. if test x${is_cross_compiler} = xyes ; then - target_configargs="--with-cross-host=${host_alias} ${target_configargs}" + target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}" fi # Default to --enable-multilib. @@ -3284,7 +5706,7 @@ fi # Pass the appropriate --build, --host, --target and --cache-file arguments. # We need to pass --target, as newer autoconf's requires consistency # for target_alias and gcc doesn't manage it consistently. -target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}" +target_configargs="--cache-file=./config.cache ${target_configargs}" FLAGS_FOR_TARGET= case " $target_configdirs " in @@ -3336,6 +5758,11 @@ case " $target_configdirs " in esac ;; esac +case "$target" in +*-mingw*) + # Can't be handled as Cygwin above since Mingw does not use newlib. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;; +esac # Allow the user to override the flags for # our build compiler if desired. @@ -3356,6 +5783,23 @@ if test "x${use_gnu_ld}" = x && FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld' fi +# Search for other target-specific linker scripts and such. +case "${target}" in + m32c-*-* ) + if test -d ${srcdir}/libgloss/m32c; then + # This is for crt0.o + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for r8c.ld + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for libnosys.a + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys' + fi + ;; + mep*) + FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary" + ;; +esac + # Makefile fragments. for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag; do @@ -3400,36 +5844,42 @@ MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing for ac_prog in 'bison -y' byacc yacc do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3407: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_YACC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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 fi -YACC="$ac_cv_prog_YACC" +YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$YACC" && break + test -n "$YACC" && break done test -n "$YACC" || YACC="$MISSING bison -y" @@ -3440,36 +5890,42 @@ esac for ac_prog in bison do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3447: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_BISON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$BISON"; then ac_cv_prog_BISON="$BISON" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_BISON="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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_BISON="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -BISON="$ac_cv_prog_BISON" +BISON=$ac_cv_prog_BISON if test -n "$BISON"; then - echo "$ac_t""$BISON" 1>&6 + echo "$as_me:$LINENO: result: $BISON" >&5 +echo "${ECHO_T}$BISON" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$BISON" && break + test -n "$BISON" && break done test -n "$BISON" || BISON="$MISSING bison" @@ -3479,36 +5935,42 @@ esac for ac_prog in gm4 gnum4 m4 do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3486: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_M4'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_M4+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$M4"; then ac_cv_prog_M4="$M4" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_M4="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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_M4="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -M4="$ac_cv_prog_M4" +M4=$ac_cv_prog_M4 if test -n "$M4"; then - echo "$ac_t""$M4" 1>&6 + echo "$as_me:$LINENO: result: $M4" >&5 +echo "${ECHO_T}$M4" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$M4" && break + test -n "$M4" && break done test -n "$M4" || M4="$MISSING m4" @@ -3518,36 +5980,42 @@ esac for ac_prog in flex lex do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3525: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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 if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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 + fi fi -LEX="$ac_cv_prog_LEX" +LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$LEX" && break + test -n "$LEX" && break done test -n "$LEX" || LEX="$MISSING flex" @@ -3558,36 +6026,42 @@ esac for ac_prog in flex do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3565: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_FLEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$FLEX"; then ac_cv_prog_FLEX="$FLEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_FLEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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_FLEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -FLEX="$ac_cv_prog_FLEX" +FLEX=$ac_cv_prog_FLEX if test -n "$FLEX"; then - echo "$ac_t""$FLEX" 1>&6 + echo "$as_me:$LINENO: result: $FLEX" >&5 +echo "${ECHO_T}$FLEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$FLEX" && break + test -n "$FLEX" && break done test -n "$FLEX" || FLEX="$MISSING flex" @@ -3597,36 +6071,42 @@ esac for ac_prog in makeinfo do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3604: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKEINFO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKEINFO"; then ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MAKEINFO="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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_MAKEINFO="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -MAKEINFO="$ac_cv_prog_MAKEINFO" +MAKEINFO=$ac_cv_prog_MAKEINFO if test -n "$MAKEINFO"; then - echo "$ac_t""$MAKEINFO" 1>&6 + echo "$as_me:$LINENO: result: $MAKEINFO" >&5 +echo "${ECHO_T}$MAKEINFO" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$MAKEINFO" && break + test -n "$MAKEINFO" && break done test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo" @@ -3650,36 +6130,42 @@ esac for ac_prog in expect do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3657: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_EXPECT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_EXPECT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$EXPECT"; then ac_cv_prog_EXPECT="$EXPECT" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_EXPECT="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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_EXPECT="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -EXPECT="$ac_cv_prog_EXPECT" +EXPECT=$ac_cv_prog_EXPECT if test -n "$EXPECT"; then - echo "$ac_t""$EXPECT" 1>&6 + echo "$as_me:$LINENO: result: $EXPECT" >&5 +echo "${ECHO_T}$EXPECT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$EXPECT" && break + test -n "$EXPECT" && break done test -n "$EXPECT" || EXPECT="expect" @@ -3691,42 +6177,48 @@ esac for ac_prog in runtest do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3698: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RUNTEST'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RUNTEST+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RUNTEST"; then ac_cv_prog_RUNTEST="$RUNTEST" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RUNTEST="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +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_RUNTEST="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RUNTEST="$ac_cv_prog_RUNTEST" +RUNTEST=$ac_cv_prog_RUNTEST if test -n "$RUNTEST"; then - echo "$ac_t""$RUNTEST" 1>&6 + echo "$as_me:$LINENO: result: $RUNTEST" >&5 +echo "${ECHO_T}$RUNTEST" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$RUNTEST" && break + test -n "$RUNTEST" && break done test -n "$RUNTEST" || RUNTEST="runtest" case " $configdirs " in *" dejagnu "*) - test $host = $build && RUNTEST='$$r/$(HOST_SUBDIR)/dejagnu/runtest' + test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest' ;; esac @@ -3737,68 +6229,128 @@ test -n "$host_alias" && ncn_tool_prefix=$host_alias- ncn_target_tool_prefix= test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- - for ncn_progname in ar; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3746: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$AR"; then + ac_cv_prog_AR=$AR +elif test -n "$ac_cv_prog_AR"; then + AR=$ac_cv_prog_AR +fi + +if test -n "$ac_cv_prog_AR"; then + for ncn_progname in ar; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR="$ac_cv_prog_AR" +AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in ar; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +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" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3777: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR="$ac_cv_prog_AR" +AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AR" && break done @@ -3812,68 +6364,128 @@ if test -z "$ac_cv_prog_AR" ; then fi fi - for ncn_progname in as; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3821: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$AS"; then + ac_cv_prog_AS=$AS +elif test -n "$ac_cv_prog_AS"; then + AS=$ac_cv_prog_AS +fi + +if test -n "$ac_cv_prog_AS"; then + for ncn_progname in as; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_AS="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS="$ac_cv_prog_AS" +AS=$ac_cv_prog_AS if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in as; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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_AS="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AS" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3852: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_AS="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS="$ac_cv_prog_AS" +AS=$ac_cv_prog_AS if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AS" && break done @@ -3887,68 +6499,128 @@ if test -z "$ac_cv_prog_AS" ; then fi fi - for ncn_progname in dlltool; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3896: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL=$DLLTOOL +elif test -n "$ac_cv_prog_DLLTOOL"; then + DLLTOOL=$ac_cv_prog_DLLTOOL +fi + +if test -n "$ac_cv_prog_DLLTOOL"; then + for ncn_progname in dlltool; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_DLLTOOL="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL="$ac_cv_prog_DLLTOOL" +DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - echo "$ac_t""$DLLTOOL" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in dlltool; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_DLLTOOL" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3927: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_DLLTOOL="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL="$ac_cv_prog_DLLTOOL" +DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - echo "$ac_t""$DLLTOOL" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_DLLTOOL" && break done @@ -3962,68 +6634,128 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then fi fi - for ncn_progname in ld; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3971: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$LD"; then + ac_cv_prog_LD=$LD +elif test -n "$ac_cv_prog_LD"; then + LD=$ac_cv_prog_LD +fi + +if test -n "$ac_cv_prog_LD"; then + for ncn_progname in ld; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LD="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD="$ac_cv_prog_LD" +LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in ld; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # 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_LD="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LD=$ac_cv_prog_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 fi if test -z "$ac_cv_prog_LD" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4002: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LD="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD="$ac_cv_prog_LD" +LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LD" && break done @@ -4037,68 +6769,128 @@ if test -z "$ac_cv_prog_LD" ; then fi fi - for ncn_progname in lipo; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4046: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$LIPO"; then + ac_cv_prog_LIPO=$LIPO +elif test -n "$ac_cv_prog_LIPO"; then + LIPO=$ac_cv_prog_LIPO +fi + +if test -n "$ac_cv_prog_LIPO"; then + for ncn_progname in lipo; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_LIPO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LIPO="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO="$ac_cv_prog_LIPO" +LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - echo "$ac_t""$LIPO" 1>&6 + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in lipo; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_LIPO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LIPO" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4077: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LIPO="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO="$ac_cv_prog_LIPO" +LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - echo "$ac_t""$LIPO" 1>&6 + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LIPO" && break done @@ -4112,68 +6904,128 @@ if test -z "$ac_cv_prog_LIPO" ; then fi fi - for ncn_progname in nm; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4121: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$NM"; then + ac_cv_prog_NM=$NM +elif test -n "$ac_cv_prog_NM"; then + NM=$ac_cv_prog_NM +fi + +if test -n "$ac_cv_prog_NM"; then + for ncn_progname in nm; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_NM="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM="$ac_cv_prog_NM" +NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$ac_t""$NM" 1>&6 + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in nm; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # 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_NM="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_NM" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4152: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_NM="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM="$ac_cv_prog_NM" +NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$ac_t""$NM" 1>&6 + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_NM" && break done @@ -4187,68 +7039,128 @@ if test -z "$ac_cv_prog_NM" ; then fi fi - for ncn_progname in ranlib; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4196: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$RANLIB"; then + ac_cv_prog_RANLIB=$RANLIB +elif test -n "$ac_cv_prog_RANLIB"; then + RANLIB=$ac_cv_prog_RANLIB +fi + +if test -n "$ac_cv_prog_RANLIB"; then + for ncn_progname in ranlib; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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="${ncn_progname}" + 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" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in ranlib; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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="${ncn_tool_prefix}${ncn_progname}" + 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" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4227: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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="${ncn_progname}" + 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" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_RANLIB" && break done @@ -4257,68 +7169,128 @@ if test -z "$ac_cv_prog_RANLIB" ; then RANLIB=":" fi - for ncn_progname in strip; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4266: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$STRIP"; then + ac_cv_prog_STRIP=$STRIP +elif test -n "$ac_cv_prog_STRIP"; then + STRIP=$ac_cv_prog_STRIP +fi + +if test -n "$ac_cv_prog_STRIP"; then + for ncn_progname in strip; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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="${ncn_progname}" + 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" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in strip; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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="${ncn_tool_prefix}${ncn_progname}" + 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" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4297: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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="${ncn_progname}" + 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" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_STRIP" && break done @@ -4327,68 +7299,128 @@ if test -z "$ac_cv_prog_STRIP" ; then STRIP=":" fi - for ncn_progname in windres; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4336: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$WINDRES"; then + ac_cv_prog_WINDRES=$WINDRES +elif test -n "$ac_cv_prog_WINDRES"; then + WINDRES=$ac_cv_prog_WINDRES +fi + +if test -n "$ac_cv_prog_WINDRES"; then + for ncn_progname in windres; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_WINDRES="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES="$ac_cv_prog_WINDRES" +WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then - echo "$ac_t""$WINDRES" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in windres; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # 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_WINDRES="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_WINDRES" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4367: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_WINDRES="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES="$ac_cv_prog_WINDRES" +WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then - echo "$ac_t""$WINDRES" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_WINDRES" && break done @@ -4402,68 +7434,128 @@ if test -z "$ac_cv_prog_WINDRES" ; then fi fi - for ncn_progname in objcopy; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4411: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY=$OBJCOPY +elif test -n "$ac_cv_prog_OBJCOPY"; then + OBJCOPY=$ac_cv_prog_OBJCOPY +fi + +if test -n "$ac_cv_prog_OBJCOPY"; then + for ncn_progname in objcopy; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_OBJCOPY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJCOPY="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_OBJCOPY="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJCOPY="$ac_cv_prog_OBJCOPY" +OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$ac_t""$OBJCOPY" 1>&6 + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in objcopy; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_OBJCOPY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # 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_OBJCOPY="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJCOPY=$ac_cv_prog_OBJCOPY +if test -n "$OBJCOPY"; then + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_OBJCOPY" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4442: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJCOPY+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJCOPY="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_OBJCOPY="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJCOPY="$ac_cv_prog_OBJCOPY" +OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$ac_t""$OBJCOPY" 1>&6 + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_OBJCOPY" && break done @@ -4477,68 +7569,128 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then fi fi - for ncn_progname in objdump; do - if test -n "$ncn_tool_prefix"; then - # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. -set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4486: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP=$OBJDUMP +elif test -n "$ac_cv_prog_OBJDUMP"; then + OBJDUMP=$ac_cv_prog_OBJDUMP +fi + +if test -n "$ac_cv_prog_OBJDUMP"; then + for ncn_progname in objdump; do + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP="${ncn_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_OBJDUMP="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP="$ac_cv_prog_OBJDUMP" +OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - echo "$ac_t""$OBJDUMP" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +for ncn_progname in objdump; do + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_tool_prefix}${ncn_progname}; 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_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ncn_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_OBJDUMP" && test $build = $host ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4517: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_OBJDUMP="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP="$ac_cv_prog_OBJDUMP" +OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - echo "$ac_t""$OBJDUMP" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_OBJDUMP" && break done @@ -4559,6 +7711,7 @@ fi # Target tools. + # Check whether --with-build-time-tools or --without-build-time-tools was given. if test "${with_build_time_tools+set}" = set; then withval="$with_build_time_tools" @@ -4566,24 +7719,74 @@ if test "${with_build_time_tools+set}" = set; then x/*) ;; *) with_build_time_tools= - echo "configure: warning: argument to --with-build-time-tools must be an absolute path" 1>&2 + { echo "$as_me:$LINENO: WARNING: argument to --with-build-time-tools must be an absolute path" >&5 +echo "$as_me: WARNING: argument to --with-build-time-tools must be an absolute path" >&2;} ;; esac else with_build_time_tools= +fi; + + + +if test -n "$CC_FOR_TARGET"; then + ac_cv_prog_CC_FOR_TARGET=$CC_FOR_TARGET +elif test -n "$ac_cv_prog_CC_FOR_TARGET"; then + CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET fi - - if test -n "$with_build_time_tools"; then +if test -n "$ac_cv_prog_CC_FOR_TARGET"; then for ncn_progname in cc gcc; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4581: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_CC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC_FOR_TARGET"; then + ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # 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_CC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET +if test -n "$CC_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5 +echo "${ECHO_T}$CC_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_CC_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in cc gcc; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_CC_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4593,69 +7796,81 @@ if test -z "$ac_cv_prog_CC_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4598: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC_FOR_TARGET"; then ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_CC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET" +CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET if test -n "$CC_FOR_TARGET"; then - echo "$ac_t""$CC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5 +echo "${ECHO_T}$CC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4629: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC_FOR_TARGET"; then ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_CC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET" +CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET if test -n "$CC_FOR_TARGET"; then - echo "$ac_t""$CC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5 +echo "${ECHO_T}$CC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_CC_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_CC_FOR_TARGET" ; then set dummy cc gcc if test $build = $target ; then @@ -4663,18 +7878,70 @@ if test -z "$ac_cv_prog_CC_FOR_TARGET" ; then else CC_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$CXX_FOR_TARGET"; then + ac_cv_prog_CXX_FOR_TARGET=$CXX_FOR_TARGET +elif test -n "$ac_cv_prog_CXX_FOR_TARGET"; then + CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET +fi + +if test -n "$ac_cv_prog_CXX_FOR_TARGET"; then for ncn_progname in c++ g++ cxx gxx; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4672: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_CXX_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX_FOR_TARGET"; then + ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # 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_CXX_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET +if test -n "$CXX_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5 +echo "${ECHO_T}$CXX_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in c++ g++ cxx gxx; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_CXX_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4684,69 +7951,81 @@ if test -z "$ac_cv_prog_CXX_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4689: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX_FOR_TARGET"; then ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_CXX_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET" +CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET if test -n "$CXX_FOR_TARGET"; then - echo "$ac_t""$CXX_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5 +echo "${ECHO_T}$CXX_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4720: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX_FOR_TARGET"; then ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_CXX_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET" +CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET if test -n "$CXX_FOR_TARGET"; then - echo "$ac_t""$CXX_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5 +echo "${ECHO_T}$CXX_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_CXX_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_CXX_FOR_TARGET" ; then set dummy c++ g++ cxx gxx if test $build = $target ; then @@ -4754,18 +8033,70 @@ if test -z "$ac_cv_prog_CXX_FOR_TARGET" ; then else CXX_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$GCC_FOR_TARGET"; then + ac_cv_prog_GCC_FOR_TARGET=$GCC_FOR_TARGET +elif test -n "$ac_cv_prog_GCC_FOR_TARGET"; then + GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GCC_FOR_TARGET"; then for ncn_progname in gcc; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4763: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_GCC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GCC_FOR_TARGET"; then + ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # 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_GCC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET +if test -n "$GCC_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5 +echo "${ECHO_T}$GCC_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_GCC_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gcc; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_GCC_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4775,83 +8106,147 @@ if test -z "$ac_cv_prog_GCC_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4780: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCC_FOR_TARGET"; then ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_GCC_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET" +GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET if test -n "$GCC_FOR_TARGET"; then - echo "$ac_t""$GCC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5 +echo "${ECHO_T}$GCC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_GCC_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4811: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCC_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCC_FOR_TARGET"; then ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCC_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_GCC_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET" +GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET if test -n "$GCC_FOR_TARGET"; then - echo "$ac_t""$GCC_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5 +echo "${ECHO_T}$GCC_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_GCC_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_GCC_FOR_TARGET" ; then GCC_FOR_TARGET="${CC_FOR_TARGET}" +else + GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$GCJ_FOR_TARGET"; then + ac_cv_prog_GCJ_FOR_TARGET=$GCJ_FOR_TARGET +elif test -n "$ac_cv_prog_GCJ_FOR_TARGET"; then + GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GCJ_FOR_TARGET"; then for ncn_progname in gcj; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4849: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_GCJ_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GCJ_FOR_TARGET"; then + ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # 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_GCJ_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET +if test -n "$GCJ_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5 +echo "${ECHO_T}$GCJ_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_GCJ_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gcj; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_GCJ_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4861,69 +8256,81 @@ if test -z "$ac_cv_prog_GCJ_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4866: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCJ_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCJ_FOR_TARGET"; then ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCJ_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_GCJ_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET" +GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET if test -n "$GCJ_FOR_TARGET"; then - echo "$ac_t""$GCJ_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5 +echo "${ECHO_T}$GCJ_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_GCJ_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4897: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GCJ_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GCJ_FOR_TARGET"; then ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GCJ_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_GCJ_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET" +GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET if test -n "$GCJ_FOR_TARGET"; then - echo "$ac_t""$GCJ_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5 +echo "${ECHO_T}$GCJ_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_GCJ_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_GCJ_FOR_TARGET" ; then set dummy gcj if test $build = $target ; then @@ -4931,18 +8338,70 @@ if test -z "$ac_cv_prog_GCJ_FOR_TARGET" ; then else GCJ_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET" fi - if test -n "$with_build_time_tools"; then + + +if test -n "$GFORTRAN_FOR_TARGET"; then + ac_cv_prog_GFORTRAN_FOR_TARGET=$GFORTRAN_FOR_TARGET +elif test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then + GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET +fi + +if test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then for ncn_progname in gfortran; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:4940: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_GFORTRAN_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GFORTRAN_FOR_TARGET"; then + ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # 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_GFORTRAN_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET +if test -n "$GFORTRAN_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5 +echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in gfortran; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_GFORTRAN_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -4952,69 +8411,81 @@ if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4957: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GFORTRAN_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GFORTRAN_FOR_TARGET"; then ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" +GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET if test -n "$GFORTRAN_FOR_TARGET"; then - echo "$ac_t""$GFORTRAN_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5 +echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4988: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GFORTRAN_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GFORTRAN_FOR_TARGET"; then ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_GFORTRAN_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" +GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET if test -n "$GFORTRAN_FOR_TARGET"; then - echo "$ac_t""$GFORTRAN_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5 +echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" ; then set dummy gfortran if test $build = $target ; then @@ -5022,52 +8493,8 @@ if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" ; then else GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}$2" fi -fi - - - -# 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 - - - -if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - gcc_cv_tool_prefix=$ac_default_prefix - else - gcc_cv_tool_prefix=$prefix - fi else - gcc_cv_tool_prefix=$exec_prefix -fi - -# If there is no compiler in the tree, use the PATH only. In any -# case, if there is no compiler in the tree nobody should use -# AS_FOR_TARGET and LD_FOR_TARGET. -if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then - gcc_version=`cat $srcdir/gcc/BASE-VER` - gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR" - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR" -else - gcc_cv_tool_dirs= -fi - -if test x$build = x$target && test -n "$md_exec_prefix"; then - gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR" + GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET" fi @@ -5090,69 +8517,125 @@ rm conftest.c if test -z "$ac_cv_path_AR_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for ar in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5095: checking for ar in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for ar in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ar in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/ar; then AR_FOR_TARGET=`cd $with_build_time_tools && pwd`/ar ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET - echo "$ac_t""$ac_cv_path_AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_AR_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then AR_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ar` - test $AR_FOR_TARGET=ar && AR_FOR_TARGET= - ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET + test $AR_FOR_TARGET = ar && AR_FOR_TARGET= + test -n "$AR_FOR_TARGET" && ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET fi fi -if test -z "$ac_cv_path_AR_FOR_TARGET" ; then +if test -z "$ac_cv_path_AR_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5113: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AR_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$AR_FOR_TARGET" in - /*) + case $AR_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_AR_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_AR_FOR_TARGET="$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 + ;; esac fi -AR_FOR_TARGET="$ac_cv_path_AR_FOR_TARGET" +AR_FOR_TARGET=$ac_cv_path_AR_FOR_TARGET + if test -n "$AR_FOR_TARGET"; then - echo "$ac_t""$AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_AR_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$AR_FOR_TARGET"; then + ac_cv_prog_AR_FOR_TARGET=$AR_FOR_TARGET +elif test -n "$ac_cv_prog_AR_FOR_TARGET"; then + AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET +fi + +if test -n "$ac_cv_prog_AR_FOR_TARGET"; then for ncn_progname in ar; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5150: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR_FOR_TARGET"; then + ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # 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_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET +if test -n "$AR_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_AR_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in ar; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_AR_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5162,69 +8645,81 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5167: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR_FOR_TARGET"; then ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" +AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET if test -n "$AR_FOR_TARGET"; then - echo "$ac_t""$AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5198: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR_FOR_TARGET"; then ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" +AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET if test -n "$AR_FOR_TARGET"; then - echo "$ac_t""$AR_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5 +echo "${ECHO_T}$AR_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AR_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then set dummy ar if test $build = $target ; then @@ -5232,6 +8727,8 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then else AR_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" fi else @@ -5243,69 +8740,125 @@ fi if test -z "$ac_cv_path_AS_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for as in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5248: checking for as in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for as in $with_build_time_tools" >&5 +echo $ECHO_N "checking for as in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/as; then AS_FOR_TARGET=`cd $with_build_time_tools && pwd`/as ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET - echo "$ac_t""$ac_cv_path_AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_AS_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then AS_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=as` - test $AS_FOR_TARGET=as && AS_FOR_TARGET= - ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET + test $AS_FOR_TARGET = as && AS_FOR_TARGET= + test -n "$AS_FOR_TARGET" && ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET fi fi -if test -z "$ac_cv_path_AS_FOR_TARGET" ; then +if test -z "$ac_cv_path_AS_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5266: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$AS_FOR_TARGET" in - /*) + case $AS_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_AS_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_AS_FOR_TARGET="$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 + ;; esac fi -AS_FOR_TARGET="$ac_cv_path_AS_FOR_TARGET" +AS_FOR_TARGET=$ac_cv_path_AS_FOR_TARGET + if test -n "$AS_FOR_TARGET"; then - echo "$ac_t""$AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_AS_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$AS_FOR_TARGET"; then + ac_cv_prog_AS_FOR_TARGET=$AS_FOR_TARGET +elif test -n "$ac_cv_prog_AS_FOR_TARGET"; then + AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET +fi + +if test -n "$ac_cv_prog_AS_FOR_TARGET"; then for ncn_progname in as; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5303: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS_FOR_TARGET"; then + ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # 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_AS_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET +if test -n "$AS_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_AS_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in as; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_AS_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5315,69 +8868,81 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5320: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS_FOR_TARGET"; then ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_AS_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" +AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET if test -n "$AS_FOR_TARGET"; then - echo "$ac_t""$AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AS_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5351: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS_FOR_TARGET"; then ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_AS_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" +AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET if test -n "$AS_FOR_TARGET"; then - echo "$ac_t""$AS_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5 +echo "${ECHO_T}$AS_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_AS_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then set dummy as if test $build = $target ; then @@ -5385,6 +8950,8 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then else AS_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" fi else @@ -5396,69 +8963,125 @@ fi if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for dlltool in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5401: checking for dlltool in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for dlltool in $with_build_time_tools" >&5 +echo $ECHO_N "checking for dlltool in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/dlltool; then DLLTOOL_FOR_TARGET=`cd $with_build_time_tools && pwd`/dlltool ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET - echo "$ac_t""$ac_cv_path_DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then DLLTOOL_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=dlltool` - test $DLLTOOL_FOR_TARGET=dlltool && DLLTOOL_FOR_TARGET= - ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET + test $DLLTOOL_FOR_TARGET = dlltool && DLLTOOL_FOR_TARGET= + test -n "$DLLTOOL_FOR_TARGET" && ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET fi fi -if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then +if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5419: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$DLLTOOL_FOR_TARGET" in - /*) + case $DLLTOOL_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_DLLTOOL_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_DLLTOOL_FOR_TARGET="$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 + ;; esac fi -DLLTOOL_FOR_TARGET="$ac_cv_path_DLLTOOL_FOR_TARGET" +DLLTOOL_FOR_TARGET=$ac_cv_path_DLLTOOL_FOR_TARGET + if test -n "$DLLTOOL_FOR_TARGET"; then - echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$DLLTOOL_FOR_TARGET"; then + ac_cv_prog_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET +elif test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then + DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET +fi + +if test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then for ncn_progname in dlltool; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5456: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL_FOR_TARGET"; then + ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # 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_DLLTOOL_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET +if test -n "$DLLTOOL_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in dlltool; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_DLLTOOL_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5468,69 +9091,81 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5473: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL_FOR_TARGET"; then ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" +DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET if test -n "$DLLTOOL_FOR_TARGET"; then - echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5504: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL_FOR_TARGET"; then ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_DLLTOOL_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" +DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET if test -n "$DLLTOOL_FOR_TARGET"; then - echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5 +echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then set dummy dlltool if test $build = $target ; then @@ -5538,6 +9173,8 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then else DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" fi else @@ -5549,69 +9186,125 @@ fi if test -z "$ac_cv_path_LD_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for ld in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5554: checking for ld in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for ld in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ld in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/ld; then LD_FOR_TARGET=`cd $with_build_time_tools && pwd`/ld ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET - echo "$ac_t""$ac_cv_path_LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_LD_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then LD_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ld` - test $LD_FOR_TARGET=ld && LD_FOR_TARGET= - ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET + test $LD_FOR_TARGET = ld && LD_FOR_TARGET= + test -n "$LD_FOR_TARGET" && ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET fi fi -if test -z "$ac_cv_path_LD_FOR_TARGET" ; then +if test -z "$ac_cv_path_LD_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5572: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$LD_FOR_TARGET" in - /*) + case $LD_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_LD_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_LD_FOR_TARGET="$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 + ;; esac fi -LD_FOR_TARGET="$ac_cv_path_LD_FOR_TARGET" +LD_FOR_TARGET=$ac_cv_path_LD_FOR_TARGET + if test -n "$LD_FOR_TARGET"; then - echo "$ac_t""$LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_LD_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$LD_FOR_TARGET"; then + ac_cv_prog_LD_FOR_TARGET=$LD_FOR_TARGET +elif test -n "$ac_cv_prog_LD_FOR_TARGET"; then + LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET +fi + +if test -n "$ac_cv_prog_LD_FOR_TARGET"; then for ncn_progname in ld; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5609: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LD_FOR_TARGET"; then + ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # 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_LD_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET +if test -n "$LD_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_LD_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in ld; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_LD_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5621,69 +9314,81 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5626: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD_FOR_TARGET"; then ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LD_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" +LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET if test -n "$LD_FOR_TARGET"; then - echo "$ac_t""$LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LD_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5657: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD_FOR_TARGET"; then ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LD_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LD_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" +LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET if test -n "$LD_FOR_TARGET"; then - echo "$ac_t""$LD_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5 +echo "${ECHO_T}$LD_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LD_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then set dummy ld if test $build = $target ; then @@ -5691,6 +9396,8 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then else LD_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" fi else @@ -5702,69 +9409,125 @@ fi if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for lipo in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5707: checking for lipo in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for lipo in $with_build_time_tools" >&5 +echo $ECHO_N "checking for lipo in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/lipo; then LIPO_FOR_TARGET=`cd $with_build_time_tools && pwd`/lipo ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET - echo "$ac_t""$ac_cv_path_LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then LIPO_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=lipo` - test $LIPO_FOR_TARGET=lipo && LIPO_FOR_TARGET= - ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET + test $LIPO_FOR_TARGET = lipo && LIPO_FOR_TARGET= + test -n "$LIPO_FOR_TARGET" && ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET fi fi -if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then +if test -z "$ac_cv_path_LIPO_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5725: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_LIPO_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$LIPO_FOR_TARGET" in - /*) + case $LIPO_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_LIPO_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_LIPO_FOR_TARGET="$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 + ;; esac fi -LIPO_FOR_TARGET="$ac_cv_path_LIPO_FOR_TARGET" +LIPO_FOR_TARGET=$ac_cv_path_LIPO_FOR_TARGET + if test -n "$LIPO_FOR_TARGET"; then - echo "$ac_t""$LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$LIPO_FOR_TARGET"; then + ac_cv_prog_LIPO_FOR_TARGET=$LIPO_FOR_TARGET +elif test -n "$ac_cv_prog_LIPO_FOR_TARGET"; then + LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET +fi + +if test -n "$ac_cv_prog_LIPO_FOR_TARGET"; then for ncn_progname in lipo; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5762: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LIPO_FOR_TARGET"; then + ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # 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_LIPO_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET +if test -n "$LIPO_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_LIPO_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in lipo; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_LIPO_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5774,69 +9537,81 @@ if test -z "$ac_cv_prog_LIPO_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5779: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO_FOR_TARGET"; then ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LIPO_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET" +LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET if test -n "$LIPO_FOR_TARGET"; then - echo "$ac_t""$LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LIPO_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5810: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LIPO_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO_FOR_TARGET"; then ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LIPO_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_LIPO_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET" +LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET if test -n "$LIPO_FOR_TARGET"; then - echo "$ac_t""$LIPO_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5 +echo "${ECHO_T}$LIPO_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_LIPO_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_LIPO_FOR_TARGET" ; then set dummy lipo if test $build = $target ; then @@ -5844,6 +9619,8 @@ if test -z "$ac_cv_prog_LIPO_FOR_TARGET" ; then else LIPO_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET" fi else @@ -5855,69 +9632,125 @@ fi if test -z "$ac_cv_path_NM_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for nm in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5860: checking for nm in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for nm in $with_build_time_tools" >&5 +echo $ECHO_N "checking for nm in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/nm; then NM_FOR_TARGET=`cd $with_build_time_tools && pwd`/nm ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET - echo "$ac_t""$ac_cv_path_NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_NM_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then NM_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=nm` - test $NM_FOR_TARGET=nm && NM_FOR_TARGET= - ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET + test $NM_FOR_TARGET = nm && NM_FOR_TARGET= + test -n "$NM_FOR_TARGET" && ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET fi fi -if test -z "$ac_cv_path_NM_FOR_TARGET" ; then +if test -z "$ac_cv_path_NM_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5878: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$NM_FOR_TARGET" in - /*) + case $NM_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_NM_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_NM_FOR_TARGET="$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 + ;; esac fi -NM_FOR_TARGET="$ac_cv_path_NM_FOR_TARGET" +NM_FOR_TARGET=$ac_cv_path_NM_FOR_TARGET + if test -n "$NM_FOR_TARGET"; then - echo "$ac_t""$NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_NM_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$NM_FOR_TARGET"; then + ac_cv_prog_NM_FOR_TARGET=$NM_FOR_TARGET +elif test -n "$ac_cv_prog_NM_FOR_TARGET"; then + NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET +fi + +if test -n "$ac_cv_prog_NM_FOR_TARGET"; then for ncn_progname in nm; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:5915: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM_FOR_TARGET"; then + ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # 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_NM_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET +if test -n "$NM_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_NM_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in nm; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_NM_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -5927,69 +9760,81 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5932: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM_FOR_TARGET"; then ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_NM_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" +NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET if test -n "$NM_FOR_TARGET"; then - echo "$ac_t""$NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_NM_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5963: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM_FOR_TARGET"; then ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_NM_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_NM_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" +NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET if test -n "$NM_FOR_TARGET"; then - echo "$ac_t""$NM_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5 +echo "${ECHO_T}$NM_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_NM_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then set dummy nm if test $build = $target ; then @@ -5997,6 +9842,8 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then else NM_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" fi else @@ -6008,69 +9855,125 @@ fi if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for objdump in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6013: checking for objdump in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for objdump in $with_build_time_tools" >&5 +echo $ECHO_N "checking for objdump in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/objdump; then OBJDUMP_FOR_TARGET=`cd $with_build_time_tools && pwd`/objdump ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET - echo "$ac_t""$ac_cv_path_OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then OBJDUMP_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=objdump` - test $OBJDUMP_FOR_TARGET=objdump && OBJDUMP_FOR_TARGET= - ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET + test $OBJDUMP_FOR_TARGET = objdump && OBJDUMP_FOR_TARGET= + test -n "$OBJDUMP_FOR_TARGET" && ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET fi fi -if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then +if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6031: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$OBJDUMP_FOR_TARGET" in - /*) + case $OBJDUMP_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_OBJDUMP_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_OBJDUMP_FOR_TARGET="$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 + ;; esac fi -OBJDUMP_FOR_TARGET="$ac_cv_path_OBJDUMP_FOR_TARGET" +OBJDUMP_FOR_TARGET=$ac_cv_path_OBJDUMP_FOR_TARGET + if test -n "$OBJDUMP_FOR_TARGET"; then - echo "$ac_t""$OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$OBJDUMP_FOR_TARGET"; then + ac_cv_prog_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET +elif test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then + OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET +fi + +if test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then for ncn_progname in objdump; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6068: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP_FOR_TARGET"; then + ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # 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_OBJDUMP_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET +if test -n "$OBJDUMP_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in objdump; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_OBJDUMP_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6080,69 +9983,81 @@ if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6085: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP_FOR_TARGET"; then ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET" +OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET if test -n "$OBJDUMP_FOR_TARGET"; then - echo "$ac_t""$OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6116: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP_FOR_TARGET"; then ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_OBJDUMP_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET" +OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET if test -n "$OBJDUMP_FOR_TARGET"; then - echo "$ac_t""$OBJDUMP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5 +echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" ; then set dummy objdump if test $build = $target ; then @@ -6150,6 +10065,8 @@ if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" ; then else OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET" fi else @@ -6161,69 +10078,125 @@ fi if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for ranlib in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6166: checking for ranlib in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for ranlib in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ranlib in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/ranlib; then RANLIB_FOR_TARGET=`cd $with_build_time_tools && pwd`/ranlib ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET - echo "$ac_t""$ac_cv_path_RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then RANLIB_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ranlib` - test $RANLIB_FOR_TARGET=ranlib && RANLIB_FOR_TARGET= - ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET + test $RANLIB_FOR_TARGET = ranlib && RANLIB_FOR_TARGET= + test -n "$RANLIB_FOR_TARGET" && ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET fi fi -if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then +if test -z "$ac_cv_path_RANLIB_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6184: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_RANLIB_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$RANLIB_FOR_TARGET" in - /*) + case $RANLIB_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_RANLIB_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_RANLIB_FOR_TARGET="$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 + ;; esac fi -RANLIB_FOR_TARGET="$ac_cv_path_RANLIB_FOR_TARGET" +RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET + if test -n "$RANLIB_FOR_TARGET"; then - echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$RANLIB_FOR_TARGET"; then + ac_cv_prog_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET +elif test -n "$ac_cv_prog_RANLIB_FOR_TARGET"; then + RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET +fi + +if test -n "$ac_cv_prog_RANLIB_FOR_TARGET"; then for ncn_progname in ranlib; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6221: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB_FOR_TARGET"; then + ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # 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_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET +if test -n "$RANLIB_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in ranlib; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_RANLIB_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6233,69 +10206,81 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6238: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB_FOR_TARGET"; then ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" +RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET if test -n "$RANLIB_FOR_TARGET"; then - echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6269: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB_FOR_TARGET"; then ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" +RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET if test -n "$RANLIB_FOR_TARGET"; then - echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5 +echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_RANLIB_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then set dummy ranlib if test $build = $target ; then @@ -6303,6 +10288,8 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then else RANLIB_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" fi else @@ -6314,69 +10301,125 @@ fi if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for strip in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6319: checking for strip in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for strip in $with_build_time_tools" >&5 +echo $ECHO_N "checking for strip in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/strip; then STRIP_FOR_TARGET=`cd $with_build_time_tools && pwd`/strip ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET - echo "$ac_t""$ac_cv_path_STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then STRIP_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=strip` - test $STRIP_FOR_TARGET=strip && STRIP_FOR_TARGET= - ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET + test $STRIP_FOR_TARGET = strip && STRIP_FOR_TARGET= + test -n "$STRIP_FOR_TARGET" && ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET fi fi -if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then +if test -z "$ac_cv_path_STRIP_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6337: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_STRIP_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$STRIP_FOR_TARGET" in - /*) + case $STRIP_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_STRIP_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_STRIP_FOR_TARGET="$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 + ;; esac fi -STRIP_FOR_TARGET="$ac_cv_path_STRIP_FOR_TARGET" +STRIP_FOR_TARGET=$ac_cv_path_STRIP_FOR_TARGET + if test -n "$STRIP_FOR_TARGET"; then - echo "$ac_t""$STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$STRIP_FOR_TARGET"; then + ac_cv_prog_STRIP_FOR_TARGET=$STRIP_FOR_TARGET +elif test -n "$ac_cv_prog_STRIP_FOR_TARGET"; then + STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET +fi + +if test -n "$ac_cv_prog_STRIP_FOR_TARGET"; then for ncn_progname in strip; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6374: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP_FOR_TARGET"; then + ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # 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_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET +if test -n "$STRIP_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_STRIP_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in strip; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_STRIP_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6386,69 +10429,81 @@ if test -z "$ac_cv_prog_STRIP_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6391: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP_FOR_TARGET"; then ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET" +STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET if test -n "$STRIP_FOR_TARGET"; then - echo "$ac_t""$STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6422: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +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_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP_FOR_TARGET"; then ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET" +STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET if test -n "$STRIP_FOR_TARGET"; then - echo "$ac_t""$STRIP_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5 +echo "${ECHO_T}$STRIP_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_STRIP_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_STRIP_FOR_TARGET" ; then set dummy strip if test $build = $target ; then @@ -6456,6 +10511,8 @@ if test -z "$ac_cv_prog_STRIP_FOR_TARGET" ; then else STRIP_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET" fi else @@ -6467,69 +10524,125 @@ fi if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then if test -n "$with_build_time_tools"; then - echo $ac_n "checking for windres in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6472: checking for windres in $with_build_time_tools" >&5 + echo "$as_me:$LINENO: checking for windres in $with_build_time_tools" >&5 +echo $ECHO_N "checking for windres in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/windres; then WINDRES_FOR_TARGET=`cd $with_build_time_tools && pwd`/windres ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET - echo "$ac_t""$ac_cv_path_WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $ac_cv_path_WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$ac_cv_path_WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi elif test $build != $host && test $have_gcc_for_target = yes; then WINDRES_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=windres` - test $WINDRES_FOR_TARGET=windres && WINDRES_FOR_TARGET= - ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET + test $WINDRES_FOR_TARGET = windres && WINDRES_FOR_TARGET= + test -n "$WINDRES_FOR_TARGET" && ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET fi fi -if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then +if test -z "$ac_cv_path_WINDRES_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6490: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_WINDRES_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$WINDRES_FOR_TARGET" in - /*) + case $WINDRES_FOR_TARGET in + [\\/]* | ?:[\\/]*) ac_cv_path_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$gcc_cv_tool_dirs" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_WINDRES_FOR_TARGET="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $gcc_cv_tool_dirs +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_WINDRES_FOR_TARGET="$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 + ;; esac fi -WINDRES_FOR_TARGET="$ac_cv_path_WINDRES_FOR_TARGET" +WINDRES_FOR_TARGET=$ac_cv_path_WINDRES_FOR_TARGET + if test -n "$WINDRES_FOR_TARGET"; then - echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then - if test -n "$with_build_time_tools"; then + + +if test -n "$WINDRES_FOR_TARGET"; then + ac_cv_prog_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET +elif test -n "$ac_cv_prog_WINDRES_FOR_TARGET"; then + WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET +fi + +if test -n "$ac_cv_prog_WINDRES_FOR_TARGET"; then for ncn_progname in windres; do - echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6 -echo "configure:6527: checking for ${ncn_progname} in $with_build_time_tools" >&5 + # Extract the first word of "${ncn_progname}", so it can be a program name with args. +set dummy ${ncn_progname}; 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_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$WINDRES_FOR_TARGET"; then + ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # 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_WINDRES_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET +if test -n "$WINDRES_FOR_TARGET"; then + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + done +fi + +if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" && test -n "$with_build_time_tools"; then + for ncn_progname in windres; do + echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5 +echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6 if test -x $with_build_time_tools/${ncn_progname}; then ac_cv_prog_WINDRES_FOR_TARGET=$with_build_time_tools/${ncn_progname} - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 break else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi done fi @@ -6539,69 +10652,81 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET"; then if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6544: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES_FOR_TARGET"; then ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" +WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET if test -n "$WINDRES_FOR_TARGET"; then - echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" && test $build = $target ; then # Extract the first word of "${ncn_progname}", so it can be a program name with args. set dummy ${ncn_progname}; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6575: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES_FOR_TARGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES_FOR_TARGET"; then ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_WINDRES_FOR_TARGET="${ncn_progname}" - break - fi - done - IFS="$ac_save_ifs" +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_WINDRES_FOR_TARGET="${ncn_progname}" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" +WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET if test -n "$WINDRES_FOR_TARGET"; then - echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 + echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5 +echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + fi test -n "$ac_cv_prog_WINDRES_FOR_TARGET" && break done fi - + if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then set dummy windres if test $build = $target ; then @@ -6609,6 +10734,8 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then else WINDRES_FOR_TARGET="${ncn_target_tool_prefix}$2" fi +else + WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" fi else @@ -6618,15 +10745,18 @@ fi RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET" -echo $ac_n "checking where to find the target ar""... $ac_c" 1>&6 -echo "configure:6623: checking where to find the target ar" >&5 +echo "$as_me:$LINENO: checking where to find the target ar" >&5 +echo $ECHO_N "checking where to find the target ar... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AR_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AR_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6634,32 +10764,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it AR_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/ar' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AR_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AR_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool AR_FOR_TARGET='$(AR)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target as""... $ac_c" 1>&6 -echo "configure:6656: checking where to find the target as" >&5 + +echo "$as_me:$LINENO: checking where to find the target as" >&5 +echo $ECHO_N "checking where to find the target as... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AS_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AS_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6667,32 +10806,41 @@ else *" gas "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gas/as-new' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $AS_FOR_TARGET`" 1>&6 + ac_dir=`dirname $AS_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool AS_FOR_TARGET='$(AS)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target cc""... $ac_c" 1>&6 -echo "configure:6689: checking where to find the target cc" >&5 + +echo "$as_me:$LINENO: checking where to find the target cc" >&5 +echo $ECHO_N "checking where to find the target cc... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6700,32 +10848,41 @@ else *" gcc "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool CC_FOR_TARGET='$(CC)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target c++""... $ac_c" 1>&6 -echo "configure:6722: checking where to find the target c++" >&5 + +echo "$as_me:$LINENO: checking where to find the target c++" >&5 +echo $ECHO_N "checking where to find the target c++... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6740,28 +10897,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool CXX_FOR_TARGET='$(CXX)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target c++ for libstdc++""... $ac_c" 1>&6 -echo "configure:6758: checking where to find the target c++ for libstdc++" >&5 + +echo "$as_me:$LINENO: checking where to find the target c++ for libstdc++" >&5 +echo $ECHO_N "checking where to find the target c++ for libstdc++... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RAW_CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RAW_CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6776,28 +10942,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RAW_CXX_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RAW_CXX_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool RAW_CXX_FOR_TARGET='$(CXX)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target dlltool""... $ac_c" 1>&6 -echo "configure:6794: checking where to find the target dlltool" >&5 + +echo "$as_me:$LINENO: checking where to find the target dlltool" >&5 +echo $ECHO_N "checking where to find the target dlltool... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $DLLTOOL_FOR_TARGET`" 1>&6 + ac_dir=`dirname $DLLTOOL_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6805,32 +10980,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it DLLTOOL_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/dlltool' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $DLLTOOL_FOR_TARGET`" 1>&6 + ac_dir=`dirname $DLLTOOL_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool DLLTOOL_FOR_TARGET='$(DLLTOOL)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target gcc""... $ac_c" 1>&6 -echo "configure:6827: checking where to find the target gcc" >&5 + +echo "$as_me:$LINENO: checking where to find the target gcc" >&5 +echo $ECHO_N "checking where to find the target gcc... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6838,32 +11022,41 @@ else *" gcc "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCC_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCC_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool GCC_FOR_TARGET='$()' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target gcj""... $ac_c" 1>&6 -echo "configure:6860: checking where to find the target gcj" >&5 + +echo "$as_me:$LINENO: checking where to find the target gcj" >&5 +echo $ECHO_N "checking where to find the target gcj... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCJ_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCJ_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6878,28 +11071,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it GCJ_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GCJ_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GCJ_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool GCJ_FOR_TARGET='$(GCJ)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target gfortran""... $ac_c" 1>&6 -echo "configure:6896: checking where to find the target gfortran" >&5 + +echo "$as_me:$LINENO: checking where to find the target gfortran" >&5 +echo $ECHO_N "checking where to find the target gfortran... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GFORTRAN_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GFORTRAN_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6914,28 +11116,37 @@ else if test $ok = yes; then # An in-tree tool is available and we can use it GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $GFORTRAN_FOR_TARGET`" 1>&6 + ac_dir=`dirname $GFORTRAN_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool GFORTRAN_FOR_TARGET='$(GFORTRAN)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target ld""... $ac_c" 1>&6 -echo "configure:6932: checking where to find the target ld" >&5 + +echo "$as_me:$LINENO: checking where to find the target ld" >&5 +echo $ECHO_N "checking where to find the target ld... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LD_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LD_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6943,55 +11154,72 @@ else *" ld "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/ld/ld-new' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LD_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LD_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool LD_FOR_TARGET='$(LD)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target lipo""... $ac_c" 1>&6 -echo "configure:6965: checking where to find the target lipo" >&5 + +echo "$as_me:$LINENO: checking where to find the target lipo" >&5 +echo $ECHO_N "checking where to find the target lipo... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LIPO_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LIPO_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $LIPO_FOR_TARGET`" 1>&6 + ac_dir=`dirname $LIPO_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool LIPO_FOR_TARGET='$(LIPO)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target nm""... $ac_c" 1>&6 -echo "configure:6988: checking where to find the target nm" >&5 + +echo "$as_me:$LINENO: checking where to find the target nm" >&5 +echo $ECHO_N "checking where to find the target nm... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $NM_FOR_TARGET`" 1>&6 + ac_dir=`dirname $NM_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -6999,32 +11227,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/nm-new' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $NM_FOR_TARGET`" 1>&6 + ac_dir=`dirname $NM_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool NM_FOR_TARGET='$(NM)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target objdump""... $ac_c" 1>&6 -echo "configure:7021: checking where to find the target objdump" >&5 + +echo "$as_me:$LINENO: checking where to find the target objdump" >&5 +echo $ECHO_N "checking where to find the target objdump... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $OBJDUMP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $OBJDUMP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7032,32 +11269,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it OBJDUMP_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/objdump' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $OBJDUMP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $OBJDUMP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool OBJDUMP_FOR_TARGET='$(OBJDUMP)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target ranlib""... $ac_c" 1>&6 -echo "configure:7054: checking where to find the target ranlib" >&5 + +echo "$as_me:$LINENO: checking where to find the target ranlib" >&5 +echo $ECHO_N "checking where to find the target ranlib... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RANLIB_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RANLIB_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7065,32 +11311,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it RANLIB_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/ranlib' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $RANLIB_FOR_TARGET`" 1>&6 + ac_dir=`dirname $RANLIB_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool RANLIB_FOR_TARGET='$(RANLIB)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target strip""... $ac_c" 1>&6 -echo "configure:7087: checking where to find the target strip" >&5 + +echo "$as_me:$LINENO: checking where to find the target strip" >&5 +echo $ECHO_N "checking where to find the target strip... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $STRIP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $STRIP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7098,32 +11353,41 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it STRIP_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/strip' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $STRIP_FOR_TARGET`" 1>&6 + ac_dir=`dirname $STRIP_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool STRIP_FOR_TARGET='$(STRIP)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi -echo $ac_n "checking where to find the target windres""... $ac_c" 1>&6 -echo "configure:7120: checking where to find the target windres" >&5 + +echo "$as_me:$LINENO: checking where to find the target windres" >&5 +echo $ECHO_N "checking where to find the target windres... $ECHO_C" >&6 if test "x${build}" != "x${host}" ; then if expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $WINDRES_FOR_TARGET`" 1>&6 + ac_dir=`dirname $WINDRES_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 else # Canadian cross, just use what we found - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi else ok=yes @@ -7131,27 +11395,33 @@ else *" binutils "*) ;; *) ok=no ;; esac - + if test $ok = yes; then # An in-tree tool is available and we can use it WINDRES_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/windres' - echo "$ac_t""just compiled" 1>&6 + echo "$as_me:$LINENO: result: just compiled" >&5 +echo "${ECHO_T}just compiled" >&6 elif expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then # We already found the complete path - echo "$ac_t""pre-installed in `dirname $WINDRES_FOR_TARGET`" 1>&6 + ac_dir=`dirname $WINDRES_FOR_TARGET` + echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5 +echo "${ECHO_T}pre-installed in $ac_dir" >&6 elif test "x$target" = "x$host"; then # We can use an host tool WINDRES_FOR_TARGET='$(WINDRES)' - echo "$ac_t""host tool" 1>&6 + echo "$as_me:$LINENO: result: host tool" >&5 +echo "${ECHO_T}host tool" >&6 else # We need a cross tool - echo "$ac_t""pre-installed" 1>&6 + echo "$as_me:$LINENO: result: pre-installed" >&5 +echo "${ECHO_T}pre-installed" >&6 fi fi + # Certain tools may need extra flags. AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} @@ -7176,17 +11446,17 @@ fi -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:7181: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi - -echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 +fi; +echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test "$USE_MAINTAINER_MODE" = yes; then @@ -7195,7 +11465,7 @@ if test "$USE_MAINTAINER_MODE" = yes; then else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= -fi +fi MAINT=$MAINTAINER_MODE_TRUE # --------------------- @@ -7210,26 +11480,101 @@ case $build in yes) stage1_cflags="-g -Wa,-J" ;; *) stage1_cflags="-g -J" ;; esac ;; - powerpc-*-darwin*) - # The spiffy cpp-precomp chokes on some legitimate constructs in GCC - # sources; use -no-cpp-precomp to get to GNU cpp. - # Apple's GCC has bugs in designated initializer handling, so disable - # that too. - stage1_cflags="-g -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" - ;; esac +# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. +if test "$GCC" = yes; then + saved_CFLAGS="$CFLAGS" + + # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it. + CFLAGS="$CFLAGS -fkeep-inline-functions" + echo "$as_me:$LINENO: checking whether -fkeep-inline-functions is supported" >&5 +echo $ECHO_N "checking whether -fkeep-inline-functions is supported... $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. */ + +#if (__GNUC__ < 3) \ + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \ + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1))) +#error http://gcc.gnu.org/PR29382 +#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 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; stage1_cflags="$stage1_cflags -fkeep-inline-functions" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + CFLAGS="$saved_CFLAGS" +fi + + + +# Enable --enable-checking in stage1 of the compiler. +# Check whether --enable-stage1-checking or --disable-stage1-checking was given. +if test "${enable_stage1_checking+set}" = set; then + enableval="$enable_stage1_checking" + stage1_checking=--enable-checking=${enable_stage1_checking} +else + if test "x$enable_checking" = xno; then + stage1_checking=--enable-checking +else + stage1_checking=--enable-checking${enable_checking+=}$enable_checking +fi +fi; + # Enable -Werror in bootstrap stage2 and later. -# Change the default to "no" on release branches. # Check whether --enable-werror or --disable-werror was given. if test "${enable_werror+set}" = set; then enableval="$enable_werror" - : -else - enable_werror=yes -fi +else + if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then + enable_werror=yes +else + enable_werror=no +fi +fi; case ${enable_werror} in yes) stage2_werror_flag="--enable-werror-always" ;; *) stage2_werror_flag="" ;; @@ -7237,13 +11582,14 @@ esac # Flags needed to enable html installing and building + # Check whether --with-datarootdir or --without-datarootdir was given. if test "${with_datarootdir+set}" = set; then withval="$with_datarootdir" datarootdir="\${prefix}/${withval}" else datarootdir="\${prefix}/share" -fi +fi; # Check whether --with-docdir or --without-docdir was given. @@ -7252,7 +11598,16 @@ if test "${with_docdir+set}" = set; then docdir="\${prefix}/${withval}" else docdir="\${datarootdir}/doc" -fi +fi; + + +# Check whether --with-pdfdir or --without-pdfdir was given. +if test "${with_pdfdir+set}" = set; then + withval="$with_pdfdir" + pdfdir="\${prefix}/${withval}" +else + pdfdir="\${docdir}" +fi; # Check whether --with-htmldir or --without-htmldir was given. @@ -7261,76 +11616,88 @@ if test "${with_htmldir+set}" = set; then htmldir="\${prefix}/${withval}" else htmldir="\${docdir}" -fi +fi; -trap '' 1 2 15 -cat > confcache <<\EOF + ac_config_files="$ac_config_files Makefile" +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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# 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. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `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 \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (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 - echo "updating cache $cache_file" - cat confcache > $cache_file + 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 -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. @@ -7341,13 +11708,13 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -7364,286 +11731,918 @@ DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed -# Without the "./", some shells look in PATH for config.status. +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + : ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@LN@%$LN%g -s%@LN_S@%$LN_S%g -s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g -s%@build_subdir@%$build_subdir%g -s%@host_subdir@%$host_subdir%g -s%@target_subdir@%$target_subdir%g -s%@CC@%$CC%g -s%@GNATBIND@%$GNATBIND%g -s%@do_compare@%$do_compare%g -s%@gmplibs@%$gmplibs%g -s%@gmpinc@%$gmpinc%g -s%@stage1_languages@%$stage1_languages%g -s%@SYSROOT_CFLAGS_FOR_TARGET@%$SYSROOT_CFLAGS_FOR_TARGET%g -/@serialization_dependencies@/r $serialization_dependencies -s%@serialization_dependencies@%%g -/@host_makefile_frag@/r $host_makefile_frag -s%@host_makefile_frag@%%g -/@target_makefile_frag@/r $target_makefile_frag -s%@target_makefile_frag@%%g -/@alphaieee_frag@/r $alphaieee_frag -s%@alphaieee_frag@%%g -/@ospace_frag@/r $ospace_frag -s%@ospace_frag@%%g -s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g -s%@tooldir@%$tooldir%g -s%@build_tooldir@%$build_tooldir%g -s%@CONFIGURE_GDB_TK@%$CONFIGURE_GDB_TK%g -s%@GDB_TK@%$GDB_TK%g -s%@INSTALL_GDB_TK@%$INSTALL_GDB_TK%g -s%@build_configargs@%$build_configargs%g -s%@build_configdirs@%$build_configdirs%g -s%@host_configargs@%$host_configargs%g -s%@configdirs@%$configdirs%g -s%@target_configargs@%$target_configargs%g -s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g -s%@config_shell@%$config_shell%g -s%@YACC@%$YACC%g -s%@BISON@%$BISON%g -s%@M4@%$M4%g -s%@LEX@%$LEX%g -s%@FLEX@%$FLEX%g -s%@MAKEINFO@%$MAKEINFO%g -s%@EXPECT@%$EXPECT%g -s%@RUNTEST@%$RUNTEST%g -s%@AR@%$AR%g -s%@AS@%$AS%g -s%@DLLTOOL@%$DLLTOOL%g -s%@LD@%$LD%g -s%@LIPO@%$LIPO%g -s%@NM@%$NM%g -s%@RANLIB@%$RANLIB%g -s%@STRIP@%$STRIP%g -s%@WINDRES@%$WINDRES%g -s%@OBJCOPY@%$OBJCOPY%g -s%@OBJDUMP@%$OBJDUMP%g -s%@CXX@%$CXX%g -s%@CFLAGS_FOR_BUILD@%$CFLAGS_FOR_BUILD%g -s%@CC_FOR_TARGET@%$CC_FOR_TARGET%g -s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g -s%@GCC_FOR_TARGET@%$GCC_FOR_TARGET%g -s%@GCJ_FOR_TARGET@%$GCJ_FOR_TARGET%g -s%@GFORTRAN_FOR_TARGET@%$GFORTRAN_FOR_TARGET%g -s%@AR_FOR_TARGET@%$AR_FOR_TARGET%g -s%@AS_FOR_TARGET@%$AS_FOR_TARGET%g -s%@DLLTOOL_FOR_TARGET@%$DLLTOOL_FOR_TARGET%g -s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g -s%@LIPO_FOR_TARGET@%$LIPO_FOR_TARGET%g -s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g -s%@OBJDUMP_FOR_TARGET@%$OBJDUMP_FOR_TARGET%g -s%@RANLIB_FOR_TARGET@%$RANLIB_FOR_TARGET%g -s%@STRIP_FOR_TARGET@%$STRIP_FOR_TARGET%g -s%@WINDRES_FOR_TARGET@%$WINDRES_FOR_TARGET%g -s%@FLAGS_FOR_TARGET@%$FLAGS_FOR_TARGET%g -s%@RAW_CXX_FOR_TARGET@%$RAW_CXX_FOR_TARGET%g -s%@COMPILER_AS_FOR_TARGET@%$COMPILER_AS_FOR_TARGET%g -s%@COMPILER_LD_FOR_TARGET@%$COMPILER_LD_FOR_TARGET%g -s%@COMPILER_NM_FOR_TARGET@%$COMPILER_NM_FOR_TARGET%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@stage1_cflags@%$stage1_cflags%g -s%@stage2_werror_flag@%$stage2_werror_flag%g -s%@datarootdir@%$datarootdir%g -s%@docdir@%$docdir%g -s%@htmldir@%$htmldir%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi -EOF +DUALCASE=1; export DUALCASE # for MKS sh -cat >> $CONFIG_STATUS </dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# 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 + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - ac_dir_suffix= ac_dots= + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@build_noncanonical@,$build_noncanonical,;t t +s,@host_noncanonical@,$host_noncanonical,;t t +s,@target_noncanonical@,$target_noncanonical,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@LN@,$LN,;t t +s,@LN_S@,$LN_S,;t t +s,@TOPLEVEL_CONFIGURE_ARGUMENTS@,$TOPLEVEL_CONFIGURE_ARGUMENTS,;t t +s,@build_libsubdir@,$build_libsubdir,;t t +s,@build_subdir@,$build_subdir,;t t +s,@host_subdir@,$host_subdir,;t t +s,@target_subdir@,$target_subdir,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@GNATBIND@,$GNATBIND,;t t +s,@ac_ct_GNATBIND@,$ac_ct_GNATBIND,;t t +s,@GNATMAKE@,$GNATMAKE,;t t +s,@ac_ct_GNATMAKE@,$ac_ct_GNATMAKE,;t t +s,@do_compare@,$do_compare,;t t +s,@gmplibs@,$gmplibs,;t t +s,@gmpinc@,$gmpinc,;t t +s,@stage1_languages@,$stage1_languages,;t t +s,@SYSROOT_CFLAGS_FOR_TARGET@,$SYSROOT_CFLAGS_FOR_TARGET,;t t +s,@RPATH_ENVVAR@,$RPATH_ENVVAR,;t t +s,@tooldir@,$tooldir,;t t +s,@build_tooldir@,$build_tooldir,;t t +s,@CONFIGURE_GDB_TK@,$CONFIGURE_GDB_TK,;t t +s,@GDB_TK@,$GDB_TK,;t t +s,@INSTALL_GDB_TK@,$INSTALL_GDB_TK,;t t +s,@build_configargs@,$build_configargs,;t t +s,@build_configdirs@,$build_configdirs,;t t +s,@host_configargs@,$host_configargs,;t t +s,@configdirs@,$configdirs,;t t +s,@target_configargs@,$target_configargs,;t t +s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t +s,@config_shell@,$config_shell,;t t +s,@YACC@,$YACC,;t t +s,@BISON@,$BISON,;t t +s,@M4@,$M4,;t t +s,@LEX@,$LEX,;t t +s,@FLEX@,$FLEX,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@EXPECT@,$EXPECT,;t t +s,@RUNTEST@,$RUNTEST,;t t +s,@AR@,$AR,;t t +s,@AS@,$AS,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@LD@,$LD,;t t +s,@LIPO@,$LIPO,;t t +s,@NM@,$NM,;t t +s,@RANLIB@,$RANLIB,;t t +s,@STRIP@,$STRIP,;t t +s,@WINDRES@,$WINDRES,;t t +s,@OBJCOPY@,$OBJCOPY,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@CFLAGS_FOR_BUILD@,$CFLAGS_FOR_BUILD,;t t +s,@CC_FOR_TARGET@,$CC_FOR_TARGET,;t t +s,@CXX_FOR_TARGET@,$CXX_FOR_TARGET,;t t +s,@GCC_FOR_TARGET@,$GCC_FOR_TARGET,;t t +s,@GCJ_FOR_TARGET@,$GCJ_FOR_TARGET,;t t +s,@GFORTRAN_FOR_TARGET@,$GFORTRAN_FOR_TARGET,;t t +s,@AR_FOR_TARGET@,$AR_FOR_TARGET,;t t +s,@AS_FOR_TARGET@,$AS_FOR_TARGET,;t t +s,@DLLTOOL_FOR_TARGET@,$DLLTOOL_FOR_TARGET,;t t +s,@LD_FOR_TARGET@,$LD_FOR_TARGET,;t t +s,@LIPO_FOR_TARGET@,$LIPO_FOR_TARGET,;t t +s,@NM_FOR_TARGET@,$NM_FOR_TARGET,;t t +s,@OBJDUMP_FOR_TARGET@,$OBJDUMP_FOR_TARGET,;t t +s,@RANLIB_FOR_TARGET@,$RANLIB_FOR_TARGET,;t t +s,@STRIP_FOR_TARGET@,$STRIP_FOR_TARGET,;t t +s,@WINDRES_FOR_TARGET@,$WINDRES_FOR_TARGET,;t t +s,@RAW_CXX_FOR_TARGET@,$RAW_CXX_FOR_TARGET,;t t +s,@FLAGS_FOR_TARGET@,$FLAGS_FOR_TARGET,;t t +s,@COMPILER_AS_FOR_TARGET@,$COMPILER_AS_FOR_TARGET,;t t +s,@COMPILER_LD_FOR_TARGET@,$COMPILER_LD_FOR_TARGET,;t t +s,@COMPILER_NM_FOR_TARGET@,$COMPILER_NM_FOR_TARGET,;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,@stage1_cflags@,$stage1_cflags,;t t +s,@stage1_checking@,$stage1_checking,;t t +s,@stage2_werror_flag@,$stage2_werror_flag,;t t +s,@datarootdir@,$datarootdir,;t t +s,@docdir@,$docdir,;t t +s,@pdfdir@,$pdfdir,;t t +s,@htmldir@,$htmldir,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +/@serialization_dependencies@/r $serialization_dependencies +s,@serialization_dependencies@,,;t t +/@host_makefile_frag@/r $host_makefile_frag +s,@host_makefile_frag@,,;t t +/@target_makefile_frag@/r $target_makefile_frag +s,@target_makefile_frag@,,;t t +/@alphaieee_frag@/r $alphaieee_frag +s,@alphaieee_frag@,,;t t +/@ospace_frag@/r $ospace_frag +s,@ospace_frag@,,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out fi - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac +done +_ACEOF - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac +cat >>$CONFIG_STATUS <<\_ACEOF - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff --git a/contrib/binutils/configure.in b/contrib/binutils/configure.ac similarity index 80% rename from contrib/binutils/configure.in rename to contrib/binutils/configure.ac index b6ef515e01d..0b4fc3333f8 100644 --- a/contrib/binutils/configure.in +++ b/contrib/binutils/configure.ac @@ -1,5 +1,5 @@ -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +# 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -21,10 +21,27 @@ sinclude(config/acx.m4) AC_INIT(move-if-change) -AC_PREREQ(2.13) +AC_PREREQ(2.59) + +# Find the build, host, and target systems. +ACX_NONCANONICAL_BUILD +ACX_NONCANONICAL_HOST +ACX_NONCANONICAL_TARGET + +dnl Autoconf 2.5x and later will set a default program prefix if +dnl --target was used, even if it was the same as --host. Disable +dnl that behavior. This must be done before AC_CANONICAL_SYSTEM +dnl to take effect. +test "$host_noncanonical" = "$target_noncanonical" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_transform_name=s,y,y, + AC_CANONICAL_SYSTEM AC_ARG_PROGRAM +m4_pattern_allow([^AS_FOR_TARGET$])dnl + # Get 'install' or 'install-sh' and its variants. AC_PROG_INSTALL ACX_PROG_LN @@ -68,14 +85,25 @@ progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi -# Export original configure arguments for use by sub-configures. These -# will be expanded by make, so quote '$'. -tmp="$progname $@" -sed -e 's,\$,$$,g' < conftestsed.out -$tmp -EOF_SED -TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` -rm -f conftestsed.out +# Export original configure arguments for use by sub-configures. +# Quote arguments with shell meta charatcers. +TOPLEVEL_CONFIGURE_ARGUMENTS= +set -- "$progname" "$@" +for ac_arg +do + case "$ac_arg" in + *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + # if the argument is of the form -foo=baz, quote the baz part only + ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;; + *) ;; + esac + # Add the quoted argument to the list. + TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg" +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'` AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) moveifchange=${srcdir}/move-if-change @@ -123,7 +151,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix # these libraries are used by various programs built for the host environment # -host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber" +host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -134,7 +162,6 @@ host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ - target-boehm-gc \ target-zlib \ target-qthreads \ target-libjava" @@ -142,14 +169,15 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libraries="target-libiberty \ +target_libraries="target-libgcc \ + target-libiberty \ target-libgloss \ target-newlib \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ - target-libgcc-math \ target-libgfortran \ + target-boehm-gc \ ${libgcj} \ target-libobjc \ target-libada \ @@ -227,7 +255,7 @@ esac # Some tools are only suitable for building in a "native" situation. # Remove these if host!=target. -native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" +native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" # Similarly, some are only suitable for cross toolchains. # Remove these if host=target. @@ -278,9 +306,12 @@ case "${host}" in i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi" ;; + x86_64-*-mingw*) + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" + ;; i[[3456789]]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv" - noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib" ;; i[[3456789]]86-*-beos*) noconfigdirs="$noconfigdirs tk itcl libgui gdb" @@ -313,18 +344,6 @@ AC_ARG_ENABLE(libssp, ENABLE_LIBSSP=$enableval, ENABLE_LIBSSP=yes) -# Set the default so we build libgcc-math for ix86 and x86_64 -AC_ARG_ENABLE(libgcc-math, -[ --enable-libgcc-math Builds libgcc-math directory],, -[ -case "${target}" in - i?86-* | x86_64-* ) - enable_libgcc_math=yes ;; - *) - enable_libgcc_math=no ;; -esac -]) - # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. libgcj_saved=$libgcj @@ -345,7 +364,7 @@ esac # Disable libmudflap on some systems. if test x$enable_libmudflap = x ; then case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc* | *-*-uclinux*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) @@ -366,7 +385,7 @@ if test x$enable_libgomp = x ; then ;; *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) ;; - *-*-solaris2* | *-*-sysv4* | *-*-irix* | *-*-osf* | *-*-hpux*) + *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) ;; *-*-darwin* | *-*-aix*) ;; @@ -381,7 +400,7 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin*) + powerpc-*-darwin* | i[[3456789]]86-*-darwin*) noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; @@ -445,9 +464,6 @@ case "${target}" in *-*-vxworks*) noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}" ;; - m32c-*-*) - noconfigdirs="$noconfigdirs target-libstdc++-v3" - ;; alpha*-dec-osf*) # ld works, but does not support shared libraries. # newlib is not 64 bit ready. I'm not sure about fileutils. @@ -500,6 +516,9 @@ case "${target}" in arm*-*-linux-gnueabi) noconfigdirs="$noconfigdirs target-libffi target-qthreads" noconfigdirs="$noconfigdirs target-libjava target-libobjc" + case ${with_newlib} in + no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" + esac ;; arm*-*-symbianelf*) noconfigdirs="$noconfigdirs ${libgcj} target-libiberty" @@ -523,7 +542,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; bfin-*-*) - noconfigdirs="$noconfigdirs target-libgloss gdb" + noconfigdirs="$noconfigdirs gdb" if test x${is_cross_compiler} != xno ; then target_configdirs="${target_configdirs} target-bsp target-cygmon" fi @@ -587,6 +606,9 @@ case "${target}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + hppa*-hp-hpux11*) + noconfigdirs="$noconfigdirs ld shellutils" + ;; hppa*-*-*) # According to Alexandre Oliva , libjava won't # build on HP-UX 10.20. @@ -628,32 +650,22 @@ case "${target}" in # 'target-newlib' will appear in skipdirs. ;; i[[3456789]]86-*-mingw32*) - target_configdirs="$target_configdirs target-mingw" - noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" - - # Can't build gdb for mingw32 if not native. - case "${host}" in - i[[3456789]]86-*-mingw32) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl gnuserv" - ;; - esac + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" + ;; + x86_64-*-mingw*) + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}" ;; *-*-cygwin*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" # always build newlib if winsup directory is present. - if test -d "$srcdir/winsup"; then + if test -d "$srcdir/winsup/cygwin"; then skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` elif test -d "$srcdir/newlib"; then - echo "Warning: winsup is missing so newlib can't be built." + echo "Warning: winsup/cygwin is missing so newlib can't be built." fi - - # Can't build gdb for Cygwin if not native. - case "${host}" in - *-*-cygwin*) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl libgui gnuserv" - ;; - esac ;; i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \ i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* ) @@ -755,17 +767,11 @@ case "${target}" in # noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mips*-dec-bsd*) - noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" - ;; mips*-*-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mipstx39-*-*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; mips64*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib ${libgcj}" + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" @@ -807,6 +813,9 @@ case "${target}" in ;; sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; + spu-*-*) + skipdirs="target-libssp" + ;; v810-*-*) noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; @@ -963,6 +972,8 @@ case "${host}" in ;; *-mingw32*) ;; + *-mingw64*) + ;; *-interix*) host_makefile_frag="config/mh-interix" ;; @@ -1033,119 +1044,158 @@ if test -z "${CC}" && test "${build}" = "${host}" ; then fi if test "${build}" != "${host}" ; then - # If we are doing a Canadian Cross, in which the host and build systems - # are not the same, we set reasonable default values for the tools. - - CC=${CC-${host_alias}-gcc} - CFLAGS=${CFLAGS-"-g -O2"} - CXX=${CXX-${host_alias}-c++} - CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - else - # Set reasonable default values for some tools even if not Canadian. - # Of course, these are different reasonable default values, originally - # specified directly in the Makefile. - # We don't export, so that autoconf can do its job. - # Note that all these settings are above the fragment inclusion point - # in Makefile.in, so can still be overridden by fragments. - # This is all going to change when we autoconfiscate... - CC_FOR_BUILD="\$(CC)" - AC_PROG_CC +fi - # We must set the default linker to the linker used by gcc for the correct - # operation of libtool. If LD is not defined and we are using gcc, try to - # set the LD default to the ld used by gcc. - if test -z "$LD"; then - if test "$GCC" = yes; then - case $build in - *-*-mingw*) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; - *) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; - esac - case $gcc_prog_ld in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - LD="$gcc_prog_ld" ;; - esac - fi +AC_PROG_CC +AC_PROG_CXX + +# We must set the default linker to the linker used by gcc for the correct +# operation of libtool. If LD is not defined and we are using gcc, try to +# set the LD default to the ld used by gcc. +if test -z "$LD"; then + if test "$GCC" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + LD="$gcc_prog_ld" ;; + esac fi - - CXX=${CXX-"c++"} - CFLAGS=${CFLAGS-"-g"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} fi ACX_PROG_GNAT ACX_PROG_CMP_IGNORE_INITIAL # Check for GMP and MPFR -gmplibs= +gmplibs="-lmpfr -lgmp" gmpinc= -have_gmp=yes +have_gmp=no + # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. -AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH Specify source directory for MPFR library]) +AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH This option has been REMOVED], + AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed. +Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])) -if test "x$with_mpfr_dir" != x; then - gmpinc="-I$with_mpfr_dir" - gmplibs="$with_mpfr_dir/libmpfr.a" -else - gmplibs="-lmpfr" -fi - -AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify directory for installed MPFR library]) +AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify prefix directory for installed MPFR package + Equivalent to --with-mpfr-include=PATH/include + plus --with-mpfr-lib=PATH/lib]) +AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=PATH + Specify directory for installed MPFR include files]) +AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH Specify the directory for the installed MPFR library]) if test "x$with_mpfr" != x; then gmplibs="-L$with_mpfr/lib $gmplibs" gmpinc="-I$with_mpfr/include" fi - -# Specify a location for gmp -AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH Specify source directory for GMP library]) - -if test "x$with_gmp_dir" != x; then - gmpinc="$gmpinc -I$with_gmp_dir" - if test -f "$with_gmp_dir/.libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a" - elif test -f "$with_gmp_dir/_libs/libgmp.a"; then - gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a" - fi - # One of the later tests will catch the error if neither library is present. -else - gmplibs="$gmplibs -lgmp" +if test "x$with_mpfr_include" != x; then + gmpinc="-I$with_mpfr_include" +fi +if test "x$with_mpfr_lib" != x; then + gmplibs="-L$with_mpfr_lib $gmplibs" +fi +if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then + gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" + # Do not test the mpfr version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes fi -AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify directory for installed GMP library]) +# Specify a location for gmp +AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH This option has been REMOVED], + AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed. +Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])) + +AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify prefix directory for the installed GMP package + Equivalent to --with-gmp-include=PATH/include + plus --with-gmp-lib=PATH/lib]) +AC_ARG_WITH(gmp_include, [ --with-gmp-include=PATH Specify directory for installed GMP include files]) +AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=PATH Specify the directory for the installed GMP library]) + if test "x$with_gmp" != x; then gmplibs="-L$with_gmp/lib $gmplibs" gmpinc="-I$with_gmp/include $gmpinc" fi +if test "x$with_gmp_include" != x; then + gmpinc="-I$with_gmp_include $gmpinc" +fi +if test "x$with_gmp_lib" != x; then + gmplibs="-L$with_gmp_lib $gmplibs" +fi +if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet + # but it would be included on the link line in the version check below + # hence making the test fail. + have_gmp=yes +fi -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $gmpinc" -# Check GMP actually works -AC_MSG_CHECKING([for correct version of gmp.h]) -AC_TRY_COMPILE([#include "gmp.h"],[ -#if __GNU_MP_VERSION < 3 -choke me -#endif -], [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]); have_gmp=no]) +if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then + have_gmp=yes + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $gmpinc" + # Check GMP actually works + AC_MSG_CHECKING([for correct version of gmp.h]) + AC_TRY_COMPILE([#include "gmp.h"],[ + #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) -if test x"$have_gmp" = xyes; then - AC_MSG_CHECKING([for MPFR]) - - saved_LIBS="$LIBS" - LIBS="$LIBS $gmplibs" - AC_TRY_LINK([#include -#include ], [mpfr_t n; mpfr_init(n);], - [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) - LIBS="$saved_LIBS" + if test x"$have_gmp" = xyes; then + saved_LIBS="$LIBS" + LIBS="$LIBS $gmplibs" + dnl MPFR 2.2.0 is acceptable but buggy, MPFR 2.2.1 is better. + AC_MSG_CHECKING([for correct version of mpfr.h]) + AC_TRY_LINK([#include + #include ],[ + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0) + choke me + #endif + mpfr_t n; + mpfr_t x; + int t; + mpfr_init (n); + mpfr_init (x); + mpfr_atan2 (n, n, x, GMP_RNDN); + mpfr_erfc (n, x, GMP_RNDN); + mpfr_subnormalize (x, t, GMP_RNDN); + ], [AC_TRY_LINK([#include + #include ],[ + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1) + choke me + #endif + mpfr_t n; mpfr_init(n); + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], + [AC_MSG_RESULT([no]); have_gmp=no]) + LIBS="$saved_LIBS" + fi CFLAGS="$saved_CFLAGS" + + if test x$have_gmp != xyes; then + AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.2.1+. +Try the --with-gmp and/or --with-mpfr options to specify their locations. +Copies of these libraries' source code can be found at their respective +hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. +See also http://gcc.gnu.org/install/prerequisites.html for additional info. +If you obtained GMP and/or MPFR from a vendor distribution package, make +sure that you have installed both the libraries and the header files. +They may be located in separate packages.]) + fi fi # Flags needed for both GMP and/or MPFR @@ -1153,8 +1203,7 @@ AC_SUBST(gmplibs) AC_SUBST(gmpinc) # By default, C is the only stage 1 language. -stage1_languages=c -AC_SUBST(stage1_languages) +stage1_languages=,c, # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use @@ -1216,9 +1265,9 @@ if test -d ${srcdir}/gcc; then esac done - new_enable_languages=c + new_enable_languages=,c, missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` - potential_languages=c + potential_languages=,c, for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do case ${lang_frag} in @@ -1232,70 +1281,81 @@ if test -d ${srcdir}/gcc; then language= target_libs= lang_dirs= - boot_language= - build_by_default= - need_gmp= + subdir_requires= + boot_language=no + build_by_default=yes . ${lang_frag} - potential_languages="${potential_languages},${language}" - # This is quite sensitive to the ordering of the case statement arms. - case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in - *::*:*) - echo "${lang_frag} doesn't set \$language." 1>&2 - exit 1 - ;; - *:ada:no:*) - # Ada was requested with no preexisting GNAT. Disable unconditionally. - add_this_lang=no - ;; - *,${language},*:*:*:*) + if test x${language} = x; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + + case ,${enable_languages}, in + *,${language},*) # Language was explicitly selected; include it. add_this_lang=yes ;; - *,all,*:*:*:no) - # 'all' was selected, but this is not a default language - # so do not include it. - add_this_lang=no - ;; - *,all,*:*:*:*) - # 'all' was selected and this is a default language; include it. - add_this_lang=yes + *,all,*) + # 'all' was selected, select it if it is a default language + add_this_lang=${build_by_default} ;; *) add_this_lang=no ;; esac - # Disable languages that need GMP if it isn't available. - case ,${enable_languages},:${have_gmp}:${need_gmp} in - *,${language},*:no:yes) + # Disable languages that need other directories if these aren't available. + for i in $subdir_requires; do + test -f "$srcdir/gcc/$i/config-lang.in" && continue + case ,${enable_languages}, in + *,${language},*) + # Specifically requested language; tell them. + AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing]) + ;; + *) + # Silently disable. + add_this_lang=unsupported + ;; + esac + done + + # Disable Ada if no preexisting GNAT is available. + case ,${enable_languages},:${language}:${have_gnat} in + *,${language},*:ada:no) # Specifically requested language; tell them. - AC_MSG_ERROR([GMP with MPFR support is required to build $language]) + AC_MSG_ERROR([GNAT is required to build $language]) ;; - *:no:yes) + *:ada:no) # Silently disable. - add_this_lang=no + add_this_lang=unsupported ;; esac # Disable a language that is unsupported by the target. case " $unsupported_languages " in *" $language "*) - add_this_lang=no + add_this_lang=unsupported ;; esac case $add_this_lang in - no) + unsupported) # Remove language-dependent dirs. eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" ;; - *) - new_enable_languages="$new_enable_languages,$language" + no) + # Remove language-dependent dirs; still show language as supported. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + potential_languages="${potential_languages}${language}," + ;; + yes) + new_enable_languages="${new_enable_languages}${language}," + potential_languages="${potential_languages}${language}," missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"` case ${boot_language} in yes) # Add to (comma-separated) list of stage 1 languages. - stage1_languages="${stage1_languages},${language}" + stage1_languages="${stage1_languages}${language}," ;; esac ;; @@ -1304,18 +1364,56 @@ if test -d ${srcdir}/gcc; then esac done + AC_ARG_ENABLE(stage1-languages, +[ --enable-stage1-languages[=all] choose additional languages to build during + stage1. Mostly useful for compiler development.], + [case ,${enable_stage1_languages}, in + ,no,|,,) + # Set it to something that will have no effect in the loop below + enable_stage1_languages=c ;; + ,yes,) + enable_stage1_languages=`echo $new_enable_languages | \ + sed -e "s/^,//" -e "s/,$//" ` ;; + *,all,*) + enable_stage1_languages=`echo ,$enable_stage1_languages, | \ + sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;; + esac + + # Add "good" languages from enable_stage1_languages to stage1_languages, + # while "bad" languages go in missing_languages. Leave no duplicates. + for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do + case $potential_languages in + *,$i,*) + case $stage1_languages in + *,$i,*) ;; + *) stage1_languages="$stage1_languages$i," ;; + esac ;; + *) + case $missing_languages in + *,$i,*) ;; + *) missing_languages="$missing_languages$i," ;; + esac ;; + esac + done]) + + # Remove leading/trailing commas that were added for simplicity + potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"` missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` + stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"` + new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"` + if test "x$missing_languages" != x; then AC_MSG_ERROR([ The following requested languages could not be built: ${missing_languages} -Recognised languages are: ${potential_languages}]) +Supported languages are: ${potential_languages}]) fi - if test "x$new_enable_languages" != "x$enable_languages"; then echo The following languages will be built: ${new_enable_languages} + enable_languages="$new_enable_languages" fi - enable_languages="$new_enable_languages" - ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[[^ ]]*//' -e 's/$/ --enable-languages='"$enable_languages"/ ` + + AC_SUBST(stage1_languages) + ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" ` fi # Handle --disable- generically. @@ -1326,6 +1424,29 @@ for dir in $configdirs $build_configdirs $target_configdirs ; do fi done +# Check for Boehm's garbage collector +AC_ARG_ENABLE(objc-gc, +[ --enable-objc-gc enable the use of Boehm's garbage collector with + the GNU Objective-C runtime.], +[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in + *,objc,*:*:yes:*target-boehm-gc*) + AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration]) + ;; +esac]) + +# Make sure we only build Boehm's garbage collector if required. +case ,${enable_languages},:${enable_objc_gc} in + *,objc,*:yes) + # Keep target-boehm-gc if requested for Objective-C. + ;; + *) + # Otherwise remove target-boehm-gc depending on target-libjava. + if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then + noconfigdirs="$noconfigdirs target-boehm-gc" + fi + ;; +esac + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. @@ -1367,10 +1488,14 @@ done # Sometimes the tools are distributed with libiberty but with no other # libraries. In that case, we don't want to build target-libiberty. +# Don't let libgcc imply libiberty either. if test -n "${target_configdirs}" ; then + libgcc= others= for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do - if test "$i" != "libiberty" ; then + if test "$i" = "libgcc"; then + libgcc=target-libgcc + elif test "$i" != "libiberty" ; then if test -r $srcdir/$i/configure ; then others=yes; break; @@ -1378,7 +1503,7 @@ if test -n "${target_configdirs}" ; then fi done if test -z "${others}" ; then - target_configdirs= + target_configdirs=$libgcc fi fi @@ -1451,6 +1576,9 @@ case "$host" in enable_gdbtk=no ;; esac +# To find our prefix, in gcc_cv_tool_prefix. +ACX_TOOL_DIRS + copy_dirs= AC_ARG_WITH([build-sysroot], @@ -1470,11 +1598,8 @@ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then exit 1 fi if test x"${with_headers}" != xyes ; then - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac - copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + x=${gcc_cv_tool_prefix} + copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include" fi fi @@ -1489,12 +1614,9 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then if test x"${with_libs}" != xyes ; then # Copy the libraries in reverse order, so that files in the first named # library override files in subsequent libraries. - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac + x=${gcc_cv_tool_prefix} for l in ${with_libs}; do - copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" + copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}" done fi fi @@ -1617,6 +1739,12 @@ extra_nmflags_for_target= extra_ranlibflags_for_target= target_makefile_frag=/dev/null case "${target}" in + mep*-*-*) + target_makefile_frag="config/mt-mep" + ;; + spu-*-*) + target_makefile_frag="config/mt-spu" + ;; *-*-netware*) target_makefile_frag="config/mt-netware" ;; @@ -1691,7 +1819,7 @@ esac # Some systems (e.g., one of the i386-aix systems the gas testers are # using) don't handle "\$" correctly, so don't use it here. -tooldir='${exec_prefix}'/${target_alias} +tooldir='${exec_prefix}'/${target_noncanonical} build_tooldir=${tooldir} # Create a .gdbinit file which runs the one in srcdir @@ -1875,7 +2003,7 @@ for module in ${build_configdirs} ; do done for module in ${configdirs} ; do if test -z "${no_recursion}"; then - for file in stage*-${module}/Makefile ${module}/Makefile; do + for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do if test -f ${file}; then echo 1>&2 "*** removing ${file} to force reconfigure" rm -f ${file} @@ -1955,40 +2083,87 @@ serialization_dependencies=serdep.tmp AC_SUBST_FILE(serialization_dependencies) # Base args. Strip norecursion, cache-file, srcdir, host, build, -# target and nonopt. These are the ones we might not want to pass -# down to subconfigures. Also strip program-prefix, program-suffix, -# and program-transform-name, so that we can pass down a consistent -# program-transform-name. If autoconf has put single quotes around -# any of these arguments (because they contain shell metacharacters) -# then this will fail; in practice this only happens for -# --program-transform-name, so be sure to override --program-transform-name -# at the end of the argument list. -# These will be expanded by make, so quote '$'. -cat <<\EOF_SED > conftestsed -s/ --no[[^ ]]*/ /g -s/ --c[[a-z-]]*[[= ]][[^ ]]*//g -s/ --sr[[a-z-]]*[[= ]][[^ ]]*//g -s/ --ho[[a-z-]]*[[= ]][[^ ]]*//g -s/ --bu[[a-z-]]*[[= ]][[^ ]]*//g -s/ --t[[a-z-]]*[[= ]][[^ ]]*//g -s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]*//g -s/ -cache-file[[= ]][[^ ]]*//g -s/ -srcdir[[= ]][[^ ]]*//g -s/ -host[[= ]][[^ ]]*//g -s/ -build[[= ]][[^ ]]*//g -s/ -target[[= ]][[^ ]]*//g -s/ -program-prefix[[= ]][[^ ]]*//g -s/ -program-suffix[[= ]][[^ ]]*//g -s/ -program-transform-name[[= ]][[^ ]]*//g -s/ [[^' -][^ ]*] / / -s/^ *//;s/ *$// -s,\$,$$,g -EOF_SED -sed -f conftestsed < conftestsed.out - ${ac_configure_args} -EOF_SED -baseargs=`cat conftestsed.out` -rm -f conftestsed conftestsed.out +# target, nonopt, and variable assignments. These are the ones we +# might not want to pass down to subconfigures. Also strip +# program-prefix, program-suffix, and program-transform-name, so that +# we can pass down a consistent program-transform-name. +baseargs= +keep_next=no +skip_next=no +eval "set -- $ac_configure_args" +for ac_arg +do + if test X"$skip_next" = X"yes"; then + skip_next=no + continue + fi + if test X"$keep_next" = X"yes"; then + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=no + continue + fi + + # Handle separated arguments. Based on the logic generated by + # autoconf 2.59. + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + separate_arg=no + ;; + -*) + separate_arg=yes + ;; + *) + separate_arg=no + ;; + esac + + case "$ac_arg" in + --no*) + continue + ;; + --c* | \ + --sr* | \ + --ho* | \ + --bu* | \ + --t* | \ + --program-* | \ + -cache_file* | \ + -srcdir* | \ + -host* | \ + -build* | \ + -target* | \ + -program-prefix* | \ + -program-suffix* | \ + -program-transform-name* ) + skip_next=$separate_arg + continue + ;; + -*) + # An option. Add it. + case $ac_arg in + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + baseargs="$baseargs '$ac_arg'" + keep_next=$separate_arg + ;; + *) + # Either a variable assignment, or a nonopt (triplet). Don't + # pass it down; let the Makefile handle this. + continue + ;; + esac +done +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'` # Add in --program-transform-name, after --program-prefix and # --program-suffix have been applied to it. Autoconf has already @@ -2007,7 +2182,7 @@ baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" # For the build-side libraries, we just need to pretend we're native, # and not use the same cache file. Multilibs are neither needed nor # desired. -build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} --target=${target_alias} ${baseargs}" +build_configargs="--cache-file=../config.cache ${baseargs}" # For host modules, accept cache file option, or specification as blank. case "${cache_file}" in @@ -2021,7 +2196,7 @@ esac # Host dirs don't like to share a cache file either, horribly enough. # This seems to be due to autoconf 2.5x stupidity. -host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" +host_configargs="--cache-file=./config.cache ${extra_host_args} ${baseargs}" target_configargs=${baseargs} @@ -2031,7 +2206,7 @@ target_configargs=${baseargs} # sorts of decisions they want to make on this basis. Please consider # this option to be deprecated. FIXME. if test x${is_cross_compiler} = xyes ; then - target_configargs="--with-cross-host=${host_alias} ${target_configargs}" + target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}" fi # Default to --enable-multilib. @@ -2057,7 +2232,7 @@ fi # Pass the appropriate --build, --host, --target and --cache-file arguments. # We need to pass --target, as newer autoconf's requires consistency # for target_alias and gcc doesn't manage it consistently. -target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}" +target_configargs="--cache-file=./config.cache ${target_configargs}" FLAGS_FOR_TARGET= case " $target_configdirs " in @@ -2109,6 +2284,11 @@ case " $target_configdirs " in esac ;; esac +case "$target" in +*-mingw*) + # Can't be handled as Cygwin above since Mingw does not use newlib. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;; +esac # Allow the user to override the flags for # our build compiler if desired. @@ -2129,6 +2309,23 @@ if test "x${use_gnu_ld}" = x && FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld' fi +# Search for other target-specific linker scripts and such. +case "${target}" in + m32c-*-* ) + if test -d ${srcdir}/libgloss/m32c; then + # This is for crt0.o + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for r8c.ld + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c' + # This is for libnosys.a + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys' + fi + ;; + mep*) + FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary" + ;; +esac + # Makefile fragments. for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag; do @@ -2227,7 +2424,7 @@ esac AC_CHECK_PROGS(RUNTEST, runtest, runtest) case " $configdirs " in *" dejagnu "*) - test $host = $build && RUNTEST='$$r/$(HOST_SUBDIR)/dejagnu/runtest' + test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest' ;; esac @@ -2363,21 +2560,50 @@ case $build in yes) stage1_cflags="-g -Wa,-J" ;; *) stage1_cflags="-g -J" ;; esac ;; - powerpc-*-darwin*) - # The spiffy cpp-precomp chokes on some legitimate constructs in GCC - # sources; use -no-cpp-precomp to get to GNU cpp. - # Apple's GCC has bugs in designated initializer handling, so disable - # that too. - stage1_cflags="-g -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" - ;; esac + +# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. +if test "$GCC" = yes; then + saved_CFLAGS="$CFLAGS" + + # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it. + CFLAGS="$CFLAGS -fkeep-inline-functions" + AC_MSG_CHECKING([whether -fkeep-inline-functions is supported]) + AC_TRY_COMPILE([ +#if (__GNUC__ < 3) \ + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \ + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1))) +#error http://gcc.gnu.org/PR29382 +#endif + ],, + [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"], + [AC_MSG_RESULT([no])]) + + CFLAGS="$saved_CFLAGS" +fi + AC_SUBST(stage1_cflags) +# Enable --enable-checking in stage1 of the compiler. +AC_ARG_ENABLE(stage1-checking, +[ --enable-stage1-checking[=all] choose additional checking for stage1 + of the compiler.], +[stage1_checking=--enable-checking=${enable_stage1_checking}], +[if test "x$enable_checking" = xno; then + stage1_checking=--enable-checking +else + stage1_checking=--enable-checking${enable_checking+=}$enable_checking +fi]) +AC_SUBST(stage1_checking) + # Enable -Werror in bootstrap stage2 and later. -# Change the default to "no" on release branches. AC_ARG_ENABLE(werror, [ --enable-werror enable -Werror in bootstrap stage2 and later], [], -[enable_werror=yes]) +[if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then + enable_werror=yes +else + enable_werror=no +fi]) case ${enable_werror} in yes) stage2_werror_flag="--enable-werror-always" ;; *) stage2_werror_flag="" ;; @@ -2395,6 +2621,11 @@ AC_ARG_WITH(docdir, [docdir="\${prefix}/${withval}"], [docdir="\${datarootdir}/doc"]) +AC_ARG_WITH(pdfdir, +[ --with-pdfdir Install pdf in this directory.], +[pdfdir="\${prefix}/${withval}"], +[pdfdir="\${docdir}"]) + AC_ARG_WITH(htmldir, [ --with-htmldir Install html in this directory.], [htmldir="\${prefix}/${withval}"], @@ -2402,6 +2633,7 @@ AC_ARG_WITH(htmldir, AC_SUBST(datarootdir) AC_SUBST(docdir) +AC_SUBST(pdfdir) AC_SUBST(htmldir) AC_OUTPUT(Makefile) diff --git a/contrib/binutils/etc/ChangeLog b/contrib/binutils/etc/ChangeLog index a5959c70a70..42e16c1acd7 100644 --- a/contrib/binutils/etc/ChangeLog +++ b/contrib/binutils/etc/ChangeLog @@ -1,3 +1,26 @@ +2007-04-04 Eric Christopher + + Move from gcc: + 2007-04-04 Zack Weinberg + + * texi2pod.pl: Correct handling of @itemize with no argument. + + 2007-02-16 Matthias Klose + + * texi2pod.pl: Handle @subsubsection, ignore @anchor. + + 2007-02-06 Richard Sandiford + + * texi2pod.pl: Handle @multitable. + +2007-03-27 Brooks Moses + + * Makefile.in: Add support for "pdf" and "install-pdf" targets. + +2006-12-19 Paolo Bonzini + + * configure.texi: Fix botched commit. + 2006-05-31 Daniel Jacobowitz * texi2pod.pl: Correct handling of absolute @include. @@ -16,15 +39,15 @@ 2006-02-27 Carlos O'Donell - * Makefile.in: TEXI2HTML uses makeinfo. Define + * Makefile.in: TEXI2HTML uses makeinfo. Define HTMLFILES. Add html targets. - * configure.texi: Use ifnottex. Add alternative + * configure.texi: Use ifnottex. Add alternative image format specifier as jpg. * standards.texi: Use ifnottex. 2005-10-21 Mark Mitchell - * texi2pod.pl: Substitue for @value even when part of @include. + * texi2pod.pl: Substitue for @value even when part of @include. 2005-10-21 Bob Wilson @@ -594,4 +617,3 @@ Mon Nov 16 16:50:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) Sun Oct 11 16:05:48 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * intro.texi: added INFO-DIR-ENTRY - diff --git a/contrib/binutils/etc/Makefile.in b/contrib/binutils/etc/Makefile.in index 7d0607d960c..9642e076c1d 100644 --- a/contrib/binutils/etc/Makefile.in +++ b/contrib/binutils/etc/Makefile.in @@ -28,6 +28,7 @@ man9dir = $(mandir)/man9 datarootdir = @datarootdir@ docdir = @docdir@ infodir = @infodir@ +pdfdir = @docdir@ htmldir = @htmldir@ SHELL = /bin/sh @@ -42,6 +43,9 @@ MAKEINFO = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ TEXI2DVI = `if [ -f ../texinfo/util/texi2dvi ]; \ then echo ../texinfo/util/texi2dvi; \ else echo texi2dvi; fi` +TEXI2PDF = `if [ -f ../texinfo/util/texi2dvi ]; \ + then echo "../texinfo/util/texi2dvi --pdf"; \ + else echo "texi2dvi --pdf"; fi` TEXI2HTML = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ then echo "../texinfo/makeinfo/makeinfo --html"; \ else echo "makeinfo --html"; fi` @@ -56,6 +60,7 @@ TEXIDIR = $(srcdir)/../texinfo INFOFILES = standards.info configure.info DVIFILES = standards.dvi configure.dvi +PDFFILES = standards.pdf configure.pdf HTMLFILES = standards.html configure.html all: info @@ -126,6 +131,32 @@ dvi: fi; \ done +pdf: + for f in $(PDFFILES); do \ + if test -f $(srcdir)/`echo $$f | sed -e 's/.pdf$$/.texi/'`; then \ + if $(MAKE) "TEXI2PDF=$(TEXI2PDF)" $$f; then \ + true; \ + else \ + exit 1; \ + fi; \ + fi; \ + done + +install-pdf: pdf + $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(pdfdir)/etc + if test ! -f standards.pdf; then cd $(srcdir); fi; \ + if test -f standards.pdf; then \ + for i in standards.pdf*; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/etc/$$i; \ + done; \ + fi + if test ! -f configure.pdf; then cd $(srcdir); fi; \ + if test -f configure.pdf; then \ + for i in configure.pdf*; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/etc/$$i; \ + done; \ + fi + standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi $(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi @@ -138,6 +169,9 @@ standards.dvi: $(srcdir)/standards.texi standards.ps: standards.dvi $(DVIPS) standards.dvi -o standards.ps +standards.pdf: $(srcdir)/standards.texi + TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/standards.texi + # makeinfo requires images to be in the current directory. configure.info: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin rm -f configdev.txt configbuild.txt @@ -166,6 +200,13 @@ configure.ps: configure.dvi $(srcdir)/configdev.ein $(srcdir)/configbuild.ein $(DVIPS) configure.dvi -o configure.ps rm -f configdev.eps configbuild.eps +configure.pdf: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin $(srcdir)/configdev.ein $(srcdir)/configbuild.ein + rm -f configdev.pdf configbuild.pdf + epstopdf $(srcdir)/configdev.ein -outfile=configdev.pdf + epstopdf $(srcdir)/configbuild.ein -outfile=configbuild.pdf + TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/configure.texi + rm -f configdev.pdf configbuild.pdf + configure.html: $(srcdir)/configure.texi cp $(srcdir)/configdev.jin configdev.jpg cp $(srcdir)/configbuild.jin configbuild.jpg diff --git a/contrib/binutils/gas/ChangeLog b/contrib/binutils/gas/ChangeLog index 1723944a36e..704e6f90d4f 100644 --- a/contrib/binutils/gas/ChangeLog +++ b/contrib/binutils/gas/ChangeLog @@ -1,758 +1,1294 @@ -2006-07-19 Mat Hostetter +2007-07-03 Nathan Sidwell - * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where - when file and line unknown. + * config/tc-m68k.c (m68k_ip): Add j & K operand types. + (install_operand): Add E encoding. + (md_begin): Check and skip initial '.' arg character. + (get_num): Add 0..511 case. -2006-06-07 Joseph S. Myers +2007-07-03 Alan Modra - * po/Make-in (pdf, ps): New dummy targets. + PR 4713 + * config/obj-elf.c (elf_ecoff_set_ext): Make static when OBJ_MAYBE_ELF. + * config/obj-elf.h (obj_ecoff_set_ext): Comment. -2006-06-02 Joseph S. Myers +2007-07-03 Mikkel Lauritsen - * doc/Makefile.am (TEXI2DVI): Define. - * doc/Makefile.in: Regenerate. - * doc/c-arc.texi: Fix typo. + PR 4722 + * app.c (do_scrub_chars ): Check for output buffer full + after memcpy. -2006-05-30 Nick Clifton +2007-07-02 Joseph Myers - * po/es.po: Updated Spanish translation. + * config/tc-mips.c (s_dtprelword, s_dtpreldword, + s_dtprel_internal): New. + (mips_pseudo_table): Add .dtprelword and .dtpreldword. + (md_apply_fix): Handle BFD_RELOC_MIPS_TLS_DTPREL32 and + BFD_RELOC_MIPS_TLS_DTPREL64. -2006-05-25 Nathan Sidwell +2007-07-02 Alan Modra - * gas/config/tc-m68k.c (m68k_init_arch): Move checking of - cfloat/m68881 to correct architecture before using it. - -2006-05-16 Nick Clifton - - * Import these patches from the mainline: - - 2006-05-16 Bjoern Haase - - * config/tc-avr.h (TC_VALIDATE_FIX): Allow fixups for immediate - constant values. - - 2006-05-05 Bjoern Haase - - * gas/config/tc-avr.h (TC_VALIDATE_FIX): Define. Disable fixups - for PMEM related expressions. - -2006-05-11 Thiemo Seufer - - * config/tc-mips.c (append_insn): Don't check the range of j or - jal addresses. - -2006-05-10 Alan Modra - - * dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end - of list rather than beginning. - -2006-05-10 Alan Modra - - * write.c (relax_segment): Add pass count arg. Don't error on - negative org/space on first two passes. - (relax_seg_info): New struct. - (relax_seg, write_object_file): Adjust. - * write.h (relax_segment): Update prototype. - -2006-05-02 Joseph Myers - - * config/tc-arm.c (do_iwmmxt_wldstbh): Don't multiply offset by 4 - here. - (md_apply_fix3): Multiply offset by 4 here for - BFD_RELOC_ARM_CP_OFF_IMM_S2 and BFD_RELOC_ARM_T32_CP_OFF_IMM_S2. - -2006-05-02 Daniel Jacobowitz - - * doc/Makefile.am (AM_MAKEINFOFLAGS): New. - (TEXI2POD): Use AM_MAKEINFOFLAGS. - (asconfig.texi): Don't set top_srcdir. - * doc/as.texinfo: Don't use top_srcdir. - * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. - -2006-05-02 Paul Brook - - * config/tc-arm.c (arm_optimize_expr): New function. - * config/tc-arm.h (md_optimize_expr): Define - (arm_optimize_expr): Add prototype. - (TC_FORCE_RELOCATION_SUB_SAME): Define. - -2006-05-01 James Lemke - - * subsegs.c (subseg_set_rest): Always set seginfp->frchainP if NULL. - -2006-04-25 Bob Wilson - - * config/xtensa-relax.c (widen_spec_list): Use new "WIDE." - syntax instead of hardcoded opcodes with ".w18" suffixes. - (wide_branch_opcode): New. - (build_transition): Use it to check for wide branch opcodes with - either ".w18" or ".w15" suffixes. - -2006-04-25 Bob Wilson - - * config/tc-xtensa.c (xtensa_create_literal_symbol, - xg_assemble_literal, xg_assemble_literal_space): Do not set the - frag's is_literal flag. - -2006-04-25 Bob Wilson - - * config/xtensa-relax.c (XCHAL_HAVE_WIDE_BRANCHES): Provide default. - -2006-04-16 Daniel Jacobowitz - - * po/POTFILES.in: Regenerated. - -2006-04-14 Sterling Augustine - - * config/tc-xtensa.c (emit_single_op): Do not relax MOVI - instructions when such transformations have been disabled. - -2006-04-10 Sterling Augustine - - * config/tc-xtensa.c (xg_assemble_vliw_tokens): Record loop target - symbols in RELAX[_CHECK]_ALIGN_NEXT_OPCODE frags. - (xtensa_fix_close_loop_end_frags): Use the recorded values instead of - decoding the loop instructions. Remove current_offset variable. - (xtensa_fix_short_loop_frags): Likewise. - (min_bytes_to_other_loop_end): Remove current_offset argument. - -2006-04-09 Arnold Metselaar - - * config/tc-z80.c (z80_optimize_expr): Removed; redundant since 2006-04-04. - * config/tc-z80.h (z80_optimize_expr, md_optimize_expr): Removed. - -2006-04-07 Joerg Wunsch - - * gas/config/tc-avr.c (mcu_types): Add support for attiny261, - attiny461, attiny861, attiny25, attiny45, attiny85,attiny24, - attiny44, attiny84, at90pwm2, at90pwm3, atmega164, atmega324, - atmega644, atmega329, atmega3290, atmega649, atmega6490, - atmega406, atmega640, atmega1280, atmega1281, at90can32, - at90can64, at90usb646, at90usb647, at90usb1286 and - at90usb1287. - Move atmega48 and atmega88 from AVR_ISA_M8 to AVR_ISA_PWMx. - -2006-04-07 Paul Brook - - * config/tc-arm.c (parse_operands): Set default error message. - -2006-04-07 Paul Brook - - * config/tc-arm.c (parse_tb): Set inst.error before returning FAIL. - -2006-04-07 Paul Brook - - * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction. - -2006-04-07 Paul Brook - - * config/tc-arm.c (THUMB2_LOAD_BIT): Define. - (move_or_literal_pool): Handle Thumb-2 instructions. - (do_t_ldst): Call move_or_literal_pool for =N addressing modes. - -2006-04-07 Alan Modra - - PR 2512. - * config/tc-i386.c (match_template): Move 64-bit operand tests - inside loop. - -2006-04-06 Carlos O'Donell - - * po/Make-in: Add install-html target. - * Makefile.am: Add install-html and install-html-recursive targets. + * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. - * configure.in: AC_SUBST datarootdir, docdir, htmldir. - * configure: Regenerate. - * doc/Makefile.am: Add install-html and install-html-am targets. + * aclocal.m4: Regenerate. + * config.in: Regenerate. * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + * po/gas.pot: Regenerate. -2006-04-06 Alan Modra +2007-07-02 Alan Modra - * frags.c (frag_offset_fixed_p): Reinitialise offset before - second scan. + * config/tc-ppc.c (ppc_pe_section): Comment out code assigning + coff section flag values to bfd section flag. -2006-04-05 Richard Sandiford - Daniel Jacobowitz +2007-06-30 H.J. Lu - * config/tc-sparc.c (sparc_target_format): Handle TE_VXWORKS. - (GOTT_BASE, GOTT_INDEX): New. - (tc_gen_reloc): Don't alter relocations against GOTT_BASE and - GOTT_INDEX when generating VxWorks PIC. - * configure.tgt (sparc*-*-vxworks*): Remove this special case; - use the generic *-*-vxworks* stanza instead. + * aclocal.m4: Regenerated. + * doc/Makefile.in: Likewise. + * Makefile.in: Likewise. -2006-04-04 Alan Modra +2007-06-29 Joseph Myers - PR 997 - * frags.c (frag_offset_fixed_p): New function. - * frags.h (frag_offset_fixed_p): Declare. - * expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction. - (resolve_expression): Likewise. + * as.c (main): Only call create_obj_attrs_section if IS_ELF. -2006-04-03 Sterling Augustine +2007-06-29 Joseph Myers - * config/tc-xtensa.c (init_op_placement_info_table): Check for formats - of the same length but different numbers of slots. + * as.c (create_obj_attrs_section): New. + (main): Call create_obj_attrs_section for ELF. + * read.c (s_gnu_attribute, skip_whitespace, skip_past_char, + skip_past_comma, s_vendor_attribute): New. + (potable): Add gnu_attribute for ELF. + * read.h (s_vendor_attribute): Declare. + * config/tc-arm.c (s_arm_eabi_attribute): Replace by wrapper + round s_vendor_attribute. + (aeabi_set_public_attributes): Update for new attributes + interfaces. + (arm_md_end): Remove attributes contents setting now done + generically. -2006-03-30 Andreas Schwab +2007-06-29 M R Swami Reddy - * configure.in: Fix help string for --enable-targets option. - * configure: Regenerate. - -2006-03-28 Nathan Sidwell - - * gas/config/tc-m68k.c (find_cf_chip): Merge into ... - (m68k_ip): ... here. Use for all chips. Protect against buffer - overrun and avoid excessive copying. - - * config/tc-m68k.c (m68000_control_regs, m68010_control_regs, - m68020_control_regs, m68040_control_regs, m68060_control_regs, - mcf_control_regs, mcf5208_control_regs, mcf5213_control_regs, - mcf5329_control_regs, mcf5249_control_regs, mcf528x_control_regs, - mcfv4e_control_regs, m68010_control_regs): Rename and reorder to ... - (m68000_ctrl, m68010_ctrl, m68020_ctrl, m68040_ctrl, m68060_ctrl, - mcf_ctrl, mcf5208_ctrl, mcf5213_ctrl, mcf5235_ctrl, mcf5249_ctrl, - mcf5216_ctrl, mcf5250_ctrl, mcf5271_ctrl, mcf5272_ctrl, - mcf5282_ctrl, mcfv4e_ctrl): ... these. - (mcf5275_ctrl, mcf5329_ctrl, mcf5373_ctrl): New. - (struct m68k_cpu): Change chip field to control_regs. - (current_chip): Remove. - (control_regs): New. - (m68k_archs, m68k_extensions): Adjust. - (m68k_cpus): Reorder to be in cpu number order. Adjust. - (CPU_ALLOW_MC, CPU_ALLOW_NEGATION): Remove. - (find_cf_chip): Reimplement for new organization of cpu table. - (select_control_regs): Remove. - (mri_chip): Adjust. - (struct save_opts): Save control regs, not chip. - (s_save, s_restore): Adjust. - (m68k_lookup_cpu): Give deprecated warning when necessary. - (m68k_init_arch): Adjust. - (md_show_usage): Adjust for new cpu table organization. - -2006-03-25 Bernd Schmidt - - * config/bfin-defs.h (Expr_Node_Type enum): Add Expr_Node_GOT_Reloc. - * config/bfin-lex.l: Recognize GOT17M4 and FUNCDESC_GOT17M4. - * config/bfin-parse.y: Include "libbfd.h", "elf/common.h" and - "elf/bfin.h". - (GOT17M4, FUNCDESC_GOT17M4): New tokens of type . - (any_gotrel): New rule. - (got): Use it, and create Expr_Node_GOT_Reloc nodes. - * config/tc-bfin.c: Include "libbfd.h", "elf/common.h" and - "elf/bfin.h". - (DEFAULT_FLAGS, bfin_flags, bfin_pic_flag): New. - (bfin_pic_ptr): New function. - (md_pseudo_table): Add it for ".picptr". - (OPTION_FDPIC): New macro. - (md_longopts): Add -mfdpic. - (md_parse_option): Handle it. - (md_begin): Set BFD flags. - (md_apply_fix3, bfin_fix_adjustable): Handle new relocs. - (bfin_gen_ldstidxi): Adjust to match the trees that the parser gives - us for GOT relocs. - * Makefile.am (bfin-parse.o): Update dependencies. - (DEPTC_bfin_elf): Likewise. + * Makefile.am: Add CR16 related entry. * Makefile.in: Regenerate. - -2006-03-25 Richard Sandiford - - * config/tc-m68k.c (m68k_cpus): Change cpu_cf5208 entries to use - mcfemac instead of mcfmac. - -2006-03-22 Richard Sandiford - Daniel Jacobowitz - Phil Edwards - Zack Weinberg - Mark Mitchell - Nathan Sidwell - - * config/tc-mips.c (mips_target_format): Handle vxworks targets. - (md_begin): Complain about -G being used for PIC. Don't change - the text, data and bss alignments on VxWorks. - (reloc_needs_lo_p): Don't return true for R_MIPS_GOT16 when - generating VxWorks PIC. - (load_address): Extend SVR4_PIC handling to VXWORKS_PIC. - (macro): Likewise, but do not treat la $25 specially for - VxWorks PIC, and do not handle jal. - (OPTION_MVXWORKS_PIC): New macro. - (md_longopts): Add -mvxworks-pic. - (md_parse_option): Don't complain about using PIC and -G together here. - Handle OPTION_MVXWORKS_PIC. - (md_estimate_size_before_relax): Always use the first relaxation - sequence on VxWorks. - * config/tc-mips.h (VXWORKS_PIC): New. - -2006-03-21 Paul Brook - - * config/tc-arm.c (md_apply_fix): Fix typo in offset mask. - -2006-03-21 Sterling Augustine - - * config/tc-xtensa.c (enforce_three_byte_loop_align): New flag. - (xtensa_setup_hw_workarounds): Set this new flag for older hardware. - (get_loop_align_size): New. - (xtensa_end): Skip xtensa_mark_narrow_branches when not aligning. - (xtensa_mark_zcl_first_insns): Prevent widening of first loop frag. - (get_text_align_power): Rewrite to handle inputs in the range 2-8. - (get_noop_aligned_address): Use get_loop_align_size. - (get_aligned_diff): Likewise. - -2006-03-21 Paul Brook - - * config/tc-arm.c (insns): Correct opcodes for ldrbt and strbt. - -2006-03-20 Paul Brook - - * config/tc-arm.c (BAD_BRANCH, BAD_NOT_IT): Define. - (do_t_branch): Encode branches inside IT blocks as unconditional. - (do_t_cps): New function. - (do_t_blx, do_t_bkpt, do_t_branch23, do_t_bx, do_t_bxj, do_t_cpsi, - do_t_czb, do_t_it, do_t_setend, do_t_tb): Add IT constaints. - (opcode_lookup): Allow conditional suffixes on all instructions in - Thumb mode. - (md_assemble): Advance condexec state before checking for errors. - (insns): Use do_t_cps. - -2006-03-20 Paul Brook - - * config/tc-arm.c (output_relax_insn): Call dwarf2_emit_insn before - outputting the insn. - -2006-03-18 Jan-Benedict Glaw - - * config/tc-vax.c: Update copyright year. - * config/tc-vax.h: Likewise. - -2006-03-18 Jan-Benedict Glaw - - * config/tc-vax.c (md_chars_to_number): Used only locally, so - make it static. - * config/tc-vax.h (md_chars_to_number): Remove obsolete declaration. - -2006-03-17 Paul Brook - - * config/tc-arm.c (insns): Add ldm and stm. - -2006-03-17 Ben Elliston - - PR gas/2446 - * doc/as.texinfo (Ident): Document this directive more thoroughly. - -2006-03-16 Paul Brook - - * config/tc-arm.c (insns): Add "svc". - -2006-03-13 Bob Wilson - - * config/tc-xtensa.c (xg_translate_sysreg_op): Remove has_underbar - flag and avoid double underscore prefixes. - -2006-03-10 Paul Brook - - * config/tc-arm.c (md_begin): Handle EABIv5. - (arm_eabis): Add EF_ARM_EABI_VER5. - * doc/c-arm.texi: Document -meabi=5. - -2006-03-10 Ben Elliston - - * app.c (do_scrub_chars): Simplify string handling. - -2006-03-07 Richard Sandiford - Daniel Jacobowitz - Zack Weinberg - Nathan Sidwell - Paul Brook - Ricardo Anguiano - Phil Edwards - - * config/tc-arm.c (md_apply_fix): Install a value of zero into a - BFD_RELOC_ARM_OFFSET_IMM field if we're going to generate a RELA - R_ARM_ABS12 reloc. - (tc_gen_reloc): Keep the original fx_offset for RELA pc-relative - relocs, but adjust by md_pcrel_from_section. Create R_ARM_ABS12 - relocations for BFD_RELOC_ARM_OFFSET_IMM on RELA targets. - -2006-03-06 Bob Wilson - - * config/tc-xtensa.c (xtensa_post_relax_hook): Generate literal tables - even when using the text-section-literals option. - -2006-03-06 Nathan Sidwell - - * config/tc-m68k.c (m68k_extensions): Allow 'float' on both m68k - and cf. - (m68k_ip): Check we have some control regs. - (md_parse_option): Allow raw arch switch. - (m68k_init_arch): Better detection of arch/cpu mismatch. Detect - whether 68881 or cfloat was meant by -mfloat. - (md_show_usage): Adjust extension display. - (m68k_elf_final_processing): Adjust. - -2006-03-03 Bjoern Haase - - * config/tc-avr.c (avr_mod_hash_value): New function. - (md_apply_fix, exp_mod): Use BFD_RELOC_HH8_LDI and - BFD_RELOC_MS8_LDI for hlo8() and hhi8() - (md_begin): Set linkrelax variable to 1, use avr_mod_hash_value - instead of int avr_ldi_expression: use avr_mod_hash_value instead - of (int). - (tc_gen_reloc): Handle substractions of symbols, if possible do - fixups, abort otherwise. - * config/tc-avr.h (TC_LINKRELAX_FIXUP, TC_VALIDATE_FIX, - tc_fix_adjustable): Define. - -2006-03-02 James E Wilson - - * config/tc-ia64.c (emit_one_bundle): For IA64_OPCODE_LAST, if we - change the template, then clear md.slot[curr].end_of_insn_group. - -2006-02-28 Jan Beulich - - * macro.c (get_any_string): Don't insert quotes for <>-quoted input. - -2006-02-28 Jan Beulich - - PR/1070 - * macro.c (getstring): Don't treat parentheses special anymore. - (get_any_string): Don't consider '(' and ')' as quoting anymore. - Special-case '(', ')', '[', and ']' when dealing with non-quoting - characters. - -2006-02-28 Mat - - * dwarf2dbg.c (get_filenum): Don't inadvertently decrease files_in_use. - -2006-02-27 Jakub Jelinek - - * dw2gencfi.c (struct fde_entry, struct cie_entry): Add signal_frame - field. - (CFI_signal_frame): Define. - (cfi_pseudo_table): Add .cfi_signal_frame. - (dot_cfi): Handle CFI_signal_frame. - (output_cie): Handle cie->signal_frame. - (select_cie_for_fde): Don't share CIE if signal_frame flag is - different. Copy signal_frame from FDE to newly created CIE. - * doc/as.texinfo: Document .cfi_signal_frame. - -2006-02-27 Carlos O'Donell - - * doc/Makefile.am: Add html target. - * doc/Makefile.in: Regenerate. - * po/Make-in: Add html target. - -2006-02-27 H.J. Lu - - * config/tc-i386.c (output_insn): Support Intel Merom New - Instructions. - - * config/tc-i386.h (CpuMNI): New. - (CpuUnknownFlags): Add CpuMNI. - -2006-02-24 David S. Miller - - * config/tc-sparc.c (priv_reg_table): Add entry for "gl". - (hpriv_reg_table): New table for hyperprivileged registers. - (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged - register encoding. - -2006-02-24 DJ Delorie - - * config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix. - (tc_gen_reloc): Don't define. - * config/tc-m32c.c (rl_for, relaxable): New convenience macros. - (OPTION_LINKRELAX): New. - (md_longopts): Add it. - (m32c_relax): New. - (md_parse_options): Set it. - (md_assemble): Emit relaxation relocs as needed. - (md_convert_frag): Emit relaxation relocs as needed. - (md_cgen_lookup_reloc): Add LAB_8_8 and LAB_8_16. - (m32c_apply_fix): New. - (tc_gen_reloc): New. - (m32c_force_relocation): Force out jump relocs when relaxing. - (m32c_fix_adjustable): Return false if relaxing. - -2006-02-24 Paul Brook - - * config/arm/tc-arm.c (arm_ext_v6_notm, arm_ext_div, arm_ext_v7, - arm_ext_v7a, arm_ext_v7r, arm_ext_v7m): New variables. - (struct asm_barrier_opt): Define. - (arm_v7m_psr_hsh, arm_barrier_opt_hsh): New variables. - (parse_psr): Accept V7M psr names. - (parse_barrier): New function. - (enum operand_parse_code): Add OP_oBARRIER. - (parse_operands): Implement OP_oBARRIER. - (do_barrier): New function. - (do_dbg, do_pli, do_t_barrier, do_t_dbg, do_t_div): New functions. - (do_t_cpsi): Add V7M restrictions. - (do_t_mrs, do_t_msr): Validate V7M variants. - (md_assemble): Check for NULL variants. - (v7m_psrs, barrier_opt_names): New tables. - (insns): Add V7 instructions. Mark V6 instructions absent from V7M. - (md_begin): Initialize arm_v7m_psr_hsh and arm_barrier_opt_hsh. - (arm_cpu_option_table): Add Cortex-M3, R4 and A8. - (arm_arch_option_table): Add armv7, armv7a, armv7r and armv7m. - (struct cpu_arch_ver_table): Define. - (cpu_arch_ver): New. - (aeabi_set_public_attributes): Use cpu_arch_ver. Set - Tag_CPU_arch_profile. - * doc/c-arm.texi: Document new cpu and arch options. - -2006-02-23 H.J. Lu - - * config/tc-ia64.c (operand_match): Handle IA64_OPND_IMMU5b. - -2006-02-23 H.J. Lu - - * config/tc-ia64.c: Update copyright years. - -2006-02-22 H.J. Lu - - * config/tc-ia64.c (specify_resource): Add the rule 17 from - SDM 2.2. - -2005-02-22 Paul Brook - - * config/tc-arm.c (do_pld): Remove incorrect write to - inst.instruction. - (encode_thumb32_addr_mode): Use correct operand. - -2006-02-21 Paul Brook - - * config/tc-arm.c (md_apply_fix): Fix off-by-one errors. - -2006-02-17 Shrirang Khisti - Anil Paranjape - Shilin Shakti - - * Makefile.am: Add xc16x related entry. - * Makefile.in: Regenerate. - * configure.in: Added xc16x related entry. - * configure: Regenerate. - * config/tc-xc16x.h: New file - * config/tc-xc16x.c: New file - * doc/c-xc16x.texi: New file for xc16x - * doc/all.texi: Entry for xc16x - * doc/Makefile.texi: Added c-xc16x.texi + * config/tc-cr16.h: New file + * config/tc-cr16.c: New file + * doc/c-cr16.texi: New file for cr16 + * doc/all.texi: Entry for cr16 + * doc/Makefile.am: Added c-cr16.texi + * doc/Makefile.in: Regenerate + * doc/as.texinfo: Entry for CR16 target * NEWS: Announce the support for the new target. -2006-02-16 Nick Hudson +2007-06-26 Paul Brook - * configure.tgt: set emulation for mips-*-netbsd* + * config/tc-arm.c (parse_operands): Accept generic coprocessor regs + for OP_RVC. + (reg_names): Add fpinst, pfinst2, mvfr0 and mvfr1. -2006-02-14 Jakub Jelinek +2007-06-25 H.J. Lu - * config.in: Rebuilt. + * config/tc-i386.c (process_operands): Replace regKludge + with RegKludge. -2006-02-13 Bob Wilson +2007-06-25 Richard Sandiford - * config/tc-xtensa.c (xg_add_opcode_fix): Number operands starting - from 1, not 0, in error messages. - (md_assemble): Simplify special-case check for ENTRY instructions. - (tinsn_has_invalid_symbolic_operands): Do not include opcode and - operand in error message. + * config/tc-mips.h (TC_SYMFIELD_TYPE): New. + * config/tc-mips.c (append_insn): Record which symbols have + R_MIPS16_26 relocations against them. + (mips_fix_adjustable): Don't reduce relocations against such symbols. -2006-02-13 Joseph S. Myers +2007-06-22 Sterling Augustine - * configure.tgt (arm-*-linux-gnueabi*): Change to - arm-*-linux-*eabi*. - -2006-02-10 Nick Clifton - - * config/tc-crx.c (check_range): Ensure that the sign bit of a - 32-bit value is propagated into the upper bits of a 64-bit long. - - * config/tc-arc.c (init_opcode_tables): Fix cast. - (arc_extoper, md_operand): Likewise. - -2006-02-09 David Heine - - * config/tc-xtensa.c (xg_assembly_relax): Increment steps_taken for - each relaxation step. - -2006-02-09 Eric Botcazou + * config/tc-xtensa.c (xg_assembly_relax): Comment termination rules. + (frag_format_size): Handle RELAX_IMMED_STEP3. + (xtensa_relax_frag, md_convert_frag): Likewise. + * config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_IMMED_STEP3. + (RELAX_IMMED_MAXSTEPS): Adjust. + * config/xtensa-relax.c (widen_spec_list): Add transitions from + wide branches to branch-over-jumps. + (build_transition): Handle wide branches in transition patterns. - * configure.in (CHECK_DECLS): Add vsnprintf. +2007-06-22 H.J. Lu + + * config/tc-i386.c (disp_size): New. + (imm_size): Likewise. + (output_disp): Use disp_size and imm_size. + (output_imm): Use imm_size. + +2007-06-19 Sterling Augustine + + * config/tc-xtensa.h (struct xtensa_frag_type): Update comment about + use of literal_frag field. + * config/tc-xtensa.c (xtensa_mark_literal_pool_location): Record frag + in the literal_frag field. + (xtensa_move_literals): Use it here instead of searching. Update + literal_frag field with new value. + +2007-06-14 Paul Brook + + * config/tc-arm.c (do_t_mov_cmp): Handle shift by register and + narrow shift by immediate. + +2007-06-14 H.J. Lu + + * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd. + + * acinclude.m4: Don't include m4 files. + (BFD_BINARY_FOPEN): Removed. + Remove libtool kludge. + + * Makefile.in: Regenerated. + * doc/Makefile.in: Likewise. + * aclocal.m4: Likewise. + * configure: Likewise. + +2007-06-11 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to... + (XTENSA_PROP_NO_TRANSFORM): ...this. + (frag_flags_struct): Move is_no_transform out of the insn sub-struct. + (xtensa_mark_frags_for_org): New. + (xtensa_handle_align): Set RELAX_ORG frag subtype for rs_org. + (xtensa_post_relax_hook): Call xtensa_mark_frags_for_org. + (get_frag_property_flags): Adjust reference to is_no_transform flag. + (xtensa_frag_flags_combinable): Likewise. + (frag_flags_to_number): Likewise. Use XTENSA_PROP_NO_TRANSFORM. + * config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_ORG. + +2007-06-06 Paul Brook + + * config/tc-arm.c (s_align): Pad code sections appropriately. + +2007-06-05 Paul Brook + + * config/tc-arm.c (insns): Correct Thumb-2 ldrd/strd opcodes. + +2007-06-05 Nick Clifton + + PR gas/4587 + * config/tc-sparc.c (sparc_ip): Terminate tls_ops array. + +2007-06-05 Alan Modra + + * config/tc-spu.c (spu_cons): Use deferred_expression. Handle + number@ppu. + (tc_gen_reloc): Abort if neither addsy or subsy is set. + (md_apply_fix): Don't attempt to resolve SPU_PPU relocs. + * config/tc-spu.h (md_operand): Handle @ppu without sym. + +2007-05-31 Paul Brook + + * config/tc-arm.c (insns): Allow strex on M profile cores. + +2007-05-29 David S. Miller + Jakub Jelinek + + PR gas/4558 + * config/tc-sparc.c (md_apply_fix): Fix relocation overflow checks + for BFD_RELOC_SPARC_WDISP16 and BFD_RELOC_SPARC_WDISP19. + +2007-05-29 Alan Modra + + * config/tc-spu.h: Wrap in #ifndef/#endif. Delete coff macros. + +2007-05-29 Alan Modra + + * config/tc-ppc.c: Convert to ISO C. + * config/tc-ppc.c: Likewise. + +2007-05-29 Alan Modra + + * write.h (EXEC_MACHINE_TYPE): Delete. + (string_byte_count, section_alignment): Delete. + +2007-05-28 Nathan Sidwell + + * app.c (do_scrub_chars): Cope with \ at end of buffer. + +2007-05-26 Alan Modra + + * config/tc-ppc.c (ppc_insert_operand): Truncate sign bits in + top 32 bits of 64 bit value if so doing results in passing + range check. Rewrite sign extension fudges similarly. Enable + fudges for powerpc64 too. Report user value if range check + fails rather than fudged value. Negate PPC_OPERAND_NEGATIVE + range rather than value, also to report user value on failure. + +2007-03-25 Paul Brook + + * config/tc-arm.c (T2_SUBS_PC_LR): Define. + (do_t_add_sub): Correctly encode subs pc, lr, #const. + (do_t_mov_cmp): Correctly encode movs pc, lr. + +2007-05-24 Steve Ellcey + + * Makefile.in: Regnerate. * configure: Regenerate. - * messages.c (errno.h, stdarg.h, varargs.h, va_list): Do not - include/declare here, but... - * as.h: Move code detecting VARARGS idiom to the top. - (errno.h, stdarg.h, varargs.h, va_list): ...here. - (vsnprintf): Declare if not already declared. + * aclocal.m4: Regenerate. + * doc/Makefile.in: Regenerate. -2006-02-08 H.J. Lu - - * as.c (close_output_file): New. - (main): Register close_output_file with xatexit before - dump_statistics. Don't call output_file_close. - -2006-02-07 Nathan Sidwell - - * config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs, - mcf5329_control_regs): New. - (not_current_architecture, selected_arch, selected_cpu): New. - (m68k_archs, m68k_extensions): New. - (archs): Renamed to ... - (m68k_cpus): ... here. Adjust. - (n_arches): Remove. - (md_pseudo_table): Add arch and cpu directives. - (find_cf_chip, m68k_ip): Adjust table scanning. - (no_68851, no_68881): Remove. - (md_assemble): Lazily initialize. - (select_control_regs): Adjust cpu names. Add 5208, 5213, 5329. - (md_init_after_args): Move functionality to m68k_init_arch. - (mri_chip): Adjust table scanning. - (md_parse_option): Reimplement 'm' processing to add -march & -mcpu - options with saner parsing. - (m68k_lookup_cpu, m68k_set_arch, m68k_set_cpu, m68k_set_extension, - m68k_init_arch): New. - (s_m68k_cpu, s_m68k_arch): New. - (md_show_usage): Adjust. - (m68k_elf_final_processing): Set CF EF flags. - * config/tc-m68k.h (m68k_init_after_args): Remove. - (tc_init_after_args): Remove. - * doc/c-m68k.texi (M68K-Opts): Document -march, -mcpu options. - (M68k-Directives): Document .arch and .cpu directives. - -2006-02-05 Arnold Metselaar - - * config/tc-z80.c (z80_start_line_hook): allow .equ and .defl as - synonyms for equ and defl. - (z80_cons_fix_new): New function. - (emit_byte): Disallow relative jumps to absolute locations. - (emit_data): Only handle defb, prototype changed, because defb is - now handled as pseudo-op rather than an instruction. - (instab): Entries for defb,defw,db,dw moved from here... - (md_pseudo_table): ... to here, use generic cons() for defw,dw. - Add entries for def24,def32,d24,d32. - (md_assemble): Improved error handling. - (md_apply_fix): New case BFD_RELOC_24, set fixP->fx_no_overflow to one. - * config/tc-z80.h (TC_CONS_FIX_NEW): Define. - (z80_cons_fix_new): Declare. - * doc/c-z80.texi (defb, db): Mention warning on overflow. - (def24,d24,def32,d32): New pseudo-ops. +2007-05-22 Bob Wilson -2006-02-02 Paul Brook + * doc/c-xtensa.texi (Xtensa Automatic Alignment): Remove statements + and index entries about automatic alignment of ENTRY instructions. + +2007-05-22 Nick Clifton - * config/tc-arm.c (do_shift): Remove Thumb-1 constraint. + * doc/as.texinfo: Use @copying around the copyright notice. -2005-02-02 Paul Brook +2007-05-18 Joseph Myers - * config/tc-arm.c (T2_OPCODE_MASK, T2_DATA_OP_SHIFT, T2_OPCODE_AND, - T2_OPCODE_BIC, T2_OPCODE_ORR, T2_OPCODE_ORN, T2_OPCODE_EOR, - T2_OPCODE_ADD, T2_OPCODE_ADC, T2_OPCODE_SBC, T2_OPCODE_SUB, - T2_OPCODE_RSB): Define. - (thumb32_negate_data_op): New function. - (md_apply_fix): Use it. + * config/tc-mips.c (s_mipsset): Use generic s_set for directives + containing a comma. -2006-01-31 Bob Wilson +2007-05-17 H.J. Lu - * config/xtensa-istack.h (TInsn): Remove record_fix and sub_symbol - fields. - * config/tc-xtensa.h (xtensa_frag_type): Remove slot_sub_symbols field. - * config/tc-xtensa.c (md_apply_fix): Check for unexpected uses of - subtracted symbols. - (relaxation_requirements): Add pfinish_frag argument and use it to - replace setting tinsn->record_fix fields. - (xg_assemble_vliw_tokens): Adjust calls to relaxation_requirements - and vinsn_to_insnbuf. Remove references to record_fix and - slot_sub_symbols fields. - (xtensa_mark_narrow_branches): Delete unused code. - (is_narrow_branch_guaranteed_in_range): Handle expr that is not just - a symbol. - (convert_frag_immed): Adjust vinsn_to_insnbuf call and do not set - record_fix fields. - (tinsn_immed_from_frag): Remove code for handling slot_sub_symbols. - (vinsn_to_insnbuf): Change use of record_fixup argument, replacing use - of the record_fix field. Simplify error messages for unexpected - symbolic operands. - (set_expr_symbol_offset_diff): Delete. + PR gas/4517 + 2003-06-05 Michal Ludvig + * doc/as.texinfo: Document new directives: .cfi_restore, + .cfi_undefined, .cfi_same_value, .cfi_return_column, + .cfi_remember_state and .cfi_restore_state. -2006-01-31 Paul Brook +2007-05-17 Nathan Sidwell - * config/tc-arm.c (arm_reg_parse): Check if reg is non-NULL. + * config/tc-m68k.c (md_apply_fix): Show value of out of range + fixups in error message. + (md_conver_frag_1): Propagate the fix source location and use + as_bad_where rather than fatal, for better error messages. -2006-01-31 Paul Brook - Richard Earnshaw +2007-05-16 Paul Brook - * config/tc-arm.c: Use arm_feature_set. - (arm_ext_*, arm_arch_full, arm_arch_t2, arm_arch_none, - arm_cext_iwmmxt, arm_cext_xscale, arm_cext_maverick, fpu_fpa_ext_v1, - fpu_fpa_ext_v2, fpu_vfp_ext_v1xd, fpu_vfp_ext_v1, fpu_vfp_ext_v2): - New variables. - (insns): Use them. - (md_atof, opcode_select, opcode_select, md_assemble, md_assemble, - md_begin, arm_parse_extension, arm_parse_cpu, arm_parse_arch, - arm_parse_fpu, arm_parse_float_abi, aeabi_set_public_attributes, - s_arm_cpu, s_arm_arch, s_arm_fpu): Use macros for accessing CPU - feature flags. - (arm_legacy_option_table, arm_option_cpu_value_table): New types. - (arm_opts): Move old cpu/arch options from here... - (arm_legacy_opts): ... to here. - (md_parse_option): Search arm_legacy_opts. - (arm_cpus, arm_archs, arm_extensions, arm_fpus) - (arm_float_abis, arm_eabis): Make const. + * config/tc-arm.c (v7m_psrs): Add uppercase PSR names and xpsr. -2006-01-25 Bob Wilson +2007-05-15 Mark Shinwell - * config/tc-xtensa.c (md_apply_fix): Set value to zero for PLT relocs. + * app.c (do_scrub_chars): Don't damage \@ pseudo-variables. -2006-01-21 Jie Zhang +2007-05-15 Vincent Riviere - * config/bfin-parse.y (asm_1): Check value range for 16 bit immediate - in load immediate intruction. + PR gas/3041 + * config/tc-m68k.c (relaxable_symbol): Make sure that the correct + addend is stored for relocs against weak symbols. + (md_apply_fix): So not loose track of addend for relocs against + weak symbols. -2006-01-21 Jie Zhang +2007-05-14 Thiemo Seufer - * config/bfin-parse.y (value_match): Use correct conversion - specifications in template string for __FILE__ and __LINE__. - (binary): Ditto. - (unary): Ditto. + * config/tc-mips.c (md_parse_option): Fix parsing of -O option. -2006-01-18 Alexandre Oliva +2007-05-14 Mei Ligang - Introduce TLS descriptors for i386 and x86_64. - * config/tc-i386.c (tc_i386_fix_adjustable): Handle - BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC_CALL, - BFD_RELOC_X86_64_GOTPC32_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL. - (optimize_disp): Emit fix up for BFD_RELOC_386_TLS_DESC_CALL and - BFD_RELOC_X86_64_TLSDESC_CALL immediately, and clear the - displacement bits. - (build_modrm_byte): Set up zero modrm for TLS desc calls. - (lex_got): Handle @tlsdesc and @tlscall. - (md_apply_fix, tc_gen_reloc): Handle the new relocations. + * config/tc-score.c (data_op2, validate_immediate): Fix bug for + addri, addri.c, subi, and subi.c when immediate number is hex. + (score_insns): Remove subis and subis.c. + (do_sub_rdi16): Delete. + +2007-05-11 Alan Modra -2006-01-11 Nick Clifton + * config/tc-spu.c (md_pseudo_table): Add int, long, quad. Call + spu_cons for word. + (md_assemble): Tidy use of insn.flag. + (get_imm): Likewise. Handle uppercase input too. + (spu_cons): New function. + * config/tc-spu.h (tc_fix_adjustable): Don't adjust SPU_PPU relocs. + (TC_FORCE_RELOCATION): Don't resolve them either. - Fixes for building on 64-bit hosts: - * config/tc-avr.c (mod_index): New union to allow conversion - between pointers and integers. - (md_begin, avr_ldi_expression): Use it. - * config/tc-i370.c (md_assemble): Add cast for argument to print - statement. - * config/tc-tic54x.c (subsym_substitute): Likewise. - * config/tc-mn10200.c (md_assemble): Use a union to convert the - opindex field of fr_cgen structure into a pointer so that it can - be stored in a frag. - * config/tc-mn10300.c (md_assemble): Likewise. - * config/tc-frv.c (frv_debug_tomcat): Use %p to print pointer - types. - * config/tc-v850.c: Replace uses of (int) casts with correct - types. +2007-05-05 Mark Shinwell + + * config/tc-arm.c (md_apply_fix): Generate more accurate + diagnostic when 8-bit immediate range is exceeded for + BFD_RELOC_ARM_OFFSET_IMM8. -2006-01-09 H.J. Lu +2007-05-04 Alan Modra - PR gas/2117 - * symbols.c (snapshot_symbol): Don't change a defined symbol. + PR gas/4460 + * config/tc-i386.c (lex_got): Don't replace the reloc token with + a space if we already have a space. -2006-01-03 Hans-Peter Nilsson +2007-05-03 H.J. Lu - PR gas/2101 - * config/tc-mmix.c (mmix_handle_mmixal): Don't treat #[0-9][FB] as - a local-label reference. + * config/tc-i386.c (match_template): Don't explicitly check + suffix for crc32 in Intel mode. + (process_suffix): Issue an error for crc32 if the operand size + is ambiguous. -For older changes see ChangeLog-2005 +2007-05-03 Vincent Riviere + Nick Clifton + + PR gas/3041 + * config/tc-m68k.c (relaxable_symbol): Do not relax weak symbols. + (tc_gen_reloc): Adjust the addend of relocs against weak symbols. + (md_apply_fix): Put zero values into the frags referencing weak + symbols. + +2007-05-02 Alan Modra + + PR 4448 + * config/tc-ppc.c (ppc_insert_operand): Don't increase min for + PPC_OPERAND_PLUS1. + +2007-05-01 H.J. Lu + + * config/tc-i386.c (match_template): Check suffix for crc32 in + Intel mdoe. + (process_suffix): Default the suffix of 8bit crc32 to + BYTE_MNEM_SUFFIX. + (check_byte_reg): Skip check for 8bit crc32. + +2007-04-30 H.J. Lu + + * config/tc-i386.c (md_assemble): Use register_prefix in + error/warning message. + (check_byte_reg): Likewise. + (check_long_reg): Likewise. + (check_qword_reg): Likewise. + (check_word_reg): Likewise. + (process_operands): Likewise. + +2007-04-30 Alan Modra + + PR 4436 + * config/tc-ppc.c (ppc_insert_operand): Disable range check if + min > max. + +2007-04-28 Thiemo Seufer + + * config/tc-mips.c: Fix comment. + +2007-04-26 Anatoly Sokolov + + * config/tc-avr.c (mcu_types): Add support for atmega8hva and + atmega16hva devices. Move at90usb82 device to 'avr5' architecture. + * doc/c-avr.texi: Document new devices. + +2007-04-24 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-23 Nathan Sidwell + + * config/tc-m68k.c (mcf54455_ctrl): New. + (HAVE_LONG_DISP, HAVE_LONG_CALL, HAVE_LONG_COND): New. + (m68k_archs): Add isac. + (m68k_cpus): Add 54455 family. + (m68k_ip): Split Bg into Bb, Bs, Bg. + (m68k_elf_final_processing): Add ISA_C. + * doc/c-m68k.texi (M680x0 Options): Add isac. + +2007-04-22 Alan Modra + + * read.c (read_a_source_file): Skip multiple spaces to + cover hack in mmix md_start_line_hook which overwrites a + colon with a space. Delete sermon and needless assertion. + +2007-04-21 Alan Modra + + * config/atof-vax.c (atof_vax_sizeof): Change return type to unsigned. + (md_atof): Make number_of_chars unsigned. Revert last change. + * config/tc-or32.c (md_apply_fix): Delete bogus assertions. + * config/tc-sh.c (sh_optimize_expr): Only define for OBJ_ELF. + * config/tc-sh.h (md_optimize_expr): Likewise. + * config/tc-sh64.c (shmedia_md_pcrel_from_section): Delete bogus + assertion. + * config/tc-xtensa.c (convert_frag_immed_finish_loop): Likewise. + +2007-04-21 Nick Clifton + + * config/atof-vax.c (md_atof): Fix comparison inside know(). + + * config/tc-ia64.c (emit_one_bundle): Fix typo. + +2007-04-21 Alan Modra + + * expr.c (expr): Assert on rankarg, not rank which can be unsigned. + * read.c (read_a_source_file): Remove buffer_limit[-1] assertion. + Don't skip over NUL char. + (pseudo_set): Set X_op for registers to O_register. + * symbols.c (symbol_clone): Remove assertion that sym is defined. + (resolve_symbol_value): Resolve O_register symbols. + * config/tc-i386.c (parse_real_register): Don't use i386_float_regtab. + Instead find st(0) by hash lookup. + * config/tc-ppc.c (ppc_macro): Warning fix. + + * as.h (ENABLE_CHECKING): Default define to 0. + (know): Assert if ENABLE_CHECKING. + (struct relax_type): Remove superfluous declaration. + * configure.in (--enable-checking): New. + * configure: Regenerate. + * config.in: Regenerate. + * config/tc-ppc.c (ppc_setup_opcodes): Do checks when ENABLE_CHECKING. + Check for duplicate powerpc_operands entries. + +2007-04-20 Nathan Sidwell + + * config/tc-m68k.c (mcf5253_ctrl): New. + (mcf52223_ctrl): New. + (m68k_cpus): Add 5253, 52221, 52223. + + * config/m68k-parse.h (RAMBAR_ALT): New. + * config/tc-m68k.c (mcf5206_ctrl, mcf5307_ctrl): New. + (mcf_ctrl, mcf5208_ctrl, mcf5210a_ctrl, mcf5213_ctrl, mcf52235_ctrl, + mcf5225_ctrl, mcf5235_ctrl, mcf5271_ctrl, mcf5275_ctrl, + mcf5282_ctrl, mcf5329_ctrl, mcf5373_ctrl, mcfv4e_ctrl, + mcf5475_ctrl, mcf5485_ctrl): Add RAMBAR synonym for + RAMBAR1. + (mcf5272_ctrl): Add RAMBAR0, replace add RAMBAR with RAMBAR_ALT. + (m68k_cpus): Adjust 5206, 5206e & 5307 entries. + (m68k_ip) : Detect when RAMBAR_ALT should be used. Add it + to control register mapping. + +2007-04-20 Alan Modra + + * messages.c (as_internal_value_out_of_range): Fix typo in + error message. Return after printing domain error. + * config/tc-ppc.c (ppc_insert_operand): Preserve low zero bits + in max when shifting right. + +2007-04-20 Alan Modra + + * messages.c (as_internal_value_out_of_range): Extend to report + errors for values with invalid low bits set. + * config/tc-ppc.c (ppc_setup_opcodes): Check powerpc_operands bitm + fields. Check that operands and opcode fields are disjoint. + (ppc_insert_operand): Check operands using mask rather than bit + count. Check low bits too. Handle PPC_OPERAND_PLUS1. Adjust + insertion code. + (md_apply_fix): Adjust for struct powerpc_operand change. + +2007-04-19 Paul Brook + + * config/tc-arm.c (md_assemble): Only allow 16-bit instructions on + Thumb-1. Add sanity check for bogus relaxations. + +2007-04-19 Paul Brook + + * config/tc-arm.c (insns): Allow rsb and rsbs on Thumb-1. + +2007-04-19 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2007-04-19 Nathan Froyd + + * doc/c-ppc.texi (PowerPC-Opts): Document -me500, -me500x2, -mspe. + +2007-04-18 H.J. Lu + + * doc/c-i386.texi; Document .ssse3, .sse4.1, .sse4.2 and .sse4. + +2007-04-18 H.J. Lu + + * config/tc-i386.c (cpu_arch): Add .sse4.2 and .sse4. + (match_template): Handle operand size for crc32 in SSE4.2. + (process_suffix): Handle operand type for crc32 in SSE4.2. + (output_insn): Support SSE4.2. + +2007-04-18 H.J. Lu + + * config/tc-i386.c (cpu_arch): Add .sse4.1. + (process_operands): Adjust implicit operand for blendvpd, + blendvps and pblendvb in SSE4.1. + (output_insn): Support SSE4.1. + +2007-04-18 Paul Brook + + * config/tc-arm.c (do_t_rsb): Use 16-bit encoding when possible. + +2007-04-16 Kaz Kojima + + * config/tc-sh.c (sh_handle_align): Call as_bad_where instead + of as_warn_where for misaligned data. + +2007-04-15 Kaz Kojima + + * config/tc-sh.c (align_test_frag_offset_fixed_p): Handle + rs_fill frags. + +2007-04-14 Steve Ellcey + + * Makefile.am: Add ACLOCAL_AMFLAGS. + * Makefile.in: Regenerate. + +2007-04-14 Kaz Kojima + + * config/tc-sh.c (align_test_frag_offset_fixed_p): New. + (sh_optimize_expr): Likewise. + * config/tc-sh.h (md_optimize_expr): Define. + (sh_optimize_expr): Prototype. + +2007-04-06 Matt Thomas + + * config/tc-vax.c (vax_cons): Added to support %pcrel{8,16,32}(exp) + to emit pcrel relocations by DWARF2 in non-code sections. Borrowed + heavily from tc-sparc.c. (vax_cons_fix_new): Likewise. + +2007-04-04 Kazu Hirata + + * config/tc-m68k.c (HAVE_LONG_BRANCH): Add fido_a. + +2007-04-04 Paul Brook + + * config/tc-arm.c (do_neon_ext): Enforce immediate range. + (insns): Use I15 for vext. + +2007-04-04 Paul Brook + + * configure.tgt: Loosen checks for arm uclinux eabi targets. + +2007-04-02 Sterling Augustine + + * config/tc-xtensa.c (xtensa_flush_pending_output): Check + outputting_stabs_line_debug. + +2007-03-26 Anatoly Sokolov + + * config/tc-avr.c (mcu_types): Add support for at90pwm1, at90usb82, + at90usb162, atmega325p, atmega329p, atmega3250p and atmega3290p + devices. + * doc/c-avr.texi: Document new devices. + +2007-04-02 Richard Sandiford + + * doc/as.texinfo: Add -mvxworks-pic to the list of MIPS options. + * doc/c-mips.texi (-KPIC, -mvxworks-pic): Document. + * config/tc-mips.c (md_show_usage): Mention -mvxworks-pic. + +2007-03-30 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (xtensa_move_labels): Remove loops_ok argument. + Do not check is_loop_target flag. + (xtensa_frob_label): Adjust calls to xtensa_move_labels. + (xg_assemble_vliw_tokens): Likewise. Also avoid calling + xtensa_move_labels for alignment of loop opcodes. + +2007-03-30 H.J. Lu + + * config/tc-i386.c (process_suffix): Reindent a bit. + +2007-03-30 Paul Brook + + * config/tc-arm.c (encode_thumb2_ldmstm): New function. + (do_t_ldmstm): Generate 16-bit push/pop. Use encode_thumb2_ldmstm. + (do_t_push_pop): Use encode_thumb2_ldmstm. + +2007-03-29 DJ Delorie + + * config/tc-m32c.c (rl_for, relaxable): Protect argument. + (md_relax_table): Add entries for ADJNZ macros. + (M32C_Macros): Add ADJNZ macros. + (subtype_mappings): Add entries for ADJNZ macros. + (insn_to_subtype): Check for adjnz and sbjnz insns. + (md_estimate_size_before_relax): Pass insn to insn_to_subtype. + (md_convert_frag): Convert adjnz and sbjnz. + +2007-03-29 Nick Clifton + + * itbl-ops.c (itbl_entry): Remove unnecessary and excessively long + initialization. + * itbl-ops.h (enum e_processor): Initialise the e_nprocs field + using ITBL_NUMBER_OF_PROCESSORS. + * itbl-parse.y (yyerror): Remove use of redundant macro PARAMS. + +2007-03-28 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): For instructions with 2 + register operands, encode destination in i.rm.regmem if its + RegMem bit is set. + +2007-03-28 Richard Sandiford + Phil Edwards + + * doc/as.texinfo: Put the contents after the title page rather + than at the end of the document. + +2007-03-27 Alan Modra + + * NEWS: Mention ".reloc". + +2007-03-26 Sterling Augustine + + * config/tc-xtensa.c (xg_translate_idioms): Allow assembly idioms + in FLIX instructions. + +2007-03-26 Julian Brown + + * config/tc-arm.c (arm_it): Add immisfloat field. + (parse_qfloat_immediate): Disallow integer syntax for floating-point + immediates. Fix hex immediates, handle 0.0 and -0.0 specially. + (parse_neon_mov): Set immisfloat bit for operand if it parsed as a + float. + (neon_cmode_for_move_imm): Reject non-float immediates for float + operands. + (neon_move_immediate): Pass immisfloat bit to neon_cmode_for_move_imm. + +2007-03-26 Julian Brown + + * doc/c-arm.texi: Add documentation for .dn/.qn directives. + +2007-03-26 Alan Modra + + * doc/as.texinfo (Reloc): Document. + * read.c (potable): Add "reloc". + (s_reloc): New function. + * write.c (reloc_list): New global var. + (resolve_reloc_expr_symbols): New function. + (write_object_file): Call it. + (write_relocs): Process reloc_list. + * write.h (struct reloc_list): New. + (reloc_list): Declare. + +2007-03-24 Paul Brook + + * config/tc-arm.c (do_t_ldmstm): Error on Thumb-2 addressing modes. + +2007-03-24 Paul Brook + Mark Shinwell + + * config/tc-arm.c (operand_parse_code): Add OP_oRRw. + (parse_operands): Don't expect comma if first operand missing. + Handle OP_oRRw. + (do_srs): Encode register number, checking it is r13. Update comment. + (insns): Update SRS entries to take a register. + +2007-03-23 H.J. Lu + + * config/tc-i386.c (md_begin): Allow '.' in mnemonic. + +2007-03-23 Mark Shinwell + + * config/tc-arm.c (md_apply_fix): Turn CBZ instructions that + attempt to jump to the next instruction into NOPs. + +2007-03-23 Alan Modra + + * config/tc-spu.c: Don't include opcode/spu.h. + (md_assemble): Set tc_fix_data.insn_tag and arg_format. + (md_apply_fix): Adjust. + * config/tc-spu.h: Include opcode/spu.h. + (struct tc_fix_info): New. + (TC_FIX_TYPE, TC_INIT_FIX_DATA): Adjust. + (TC_FORCE_RELOCATION): Define. + +2007-03-22 Joseph Myers + + * doc/as.texinfo: Include VERSION_PACKAGE when reporting version. + +2007-03-21 H.J. Lu + + * config/tc-i386.c (process_suffix): Check 0x90 instead of + xchg for xchg %rax,%rax. + +2007-03-21 H.J. Lu + + * config/tc-i386.c: Replace REX_MODE64, REX_EXTX, REX_EXTY + and REX_EXTZ with REX_W, REX_R, REX_X and REX_B respectively. + +2007-03-21 H.J. Lu + + PR binutils/4218 + * config/tc-i386.c (match_template): Properly handle 64bit mode + "xchg %eax, %eax". + +2007-03-21 Anton Ertl + + PR gas/4124 + * config/tc-alpha.c (emit_ustX): Fix ustq code generation. + +2007-03-21 H.J. Lu + + * Makefile.am: Run dep-am. + * Makefile.in: Regenerated. + + * config/tc-i386.c: Don't include "opcodes/i386-opc.h". + + * config/tc-i386.h: Include "opcodes/i386-opc.h". + (NOP_OPCODE): Removed. + (template): Likewise. + +2007-03-21 Andreas Schwab + + * config/tc-i386.h (NOP_OPCODE): Restore. + +2007-03-18 Mark Shinwell + + * config/tc-arm.c (do_mul): Don't warn about overlapping + Rd and Rm operands when assembling for v6 or above. + Correctly capitalize register names in the messages. + (do_mlas): Likewise. Delete spurious blank line. + +2007-03-16 Kazu Hirata + + * config/tc-m68k.c (m68k_cpus): Add an entry for fidoa. + +2007-03-15 H.J. Lu + + * config/tc-i386.c (md_begin): Use i386_regtab_size to scan + i386_regtab. + (parse_register): Use i386_regtab_size instead of ARRAY_SIZE + on i386_regtab. + +2007-03-15 Alexandre Oliva + + PR gas/4184 + * app.c (do_scrub_chars): PUT after setting states. + +2007-03-15 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerated. + + * config/tc-i386.c: Include "opcodes/i386-opc.h" instead of + "opcode/i386.h". + (md_begin): Check reg_name != NULL for the last entry in + i386_regtab. + + * config/tc-i386.h: Move many entries to opcode/i386.h and + opcodes/i386-opc.h. + + * configure.in (need_opcodes): Set true for i386. + * configure: Regenerated. + +2007-03-15 H.J. Lu + + * Makefile.am (REPORT_BUGS_TO): Removed. + (INCLUDES): Remove -DREPORT_BUGS_TO. + * Makefile.in: Regenerated. + + * configure.in (--with-bugurl): Removed. + * configure: Regenerated. + + * doc/Makefile.am (as_TEXINFOS): Remove gasver.texi. + (AM_MAKEINFOFLAGS): Add -I ../../bfd/doc. + (TEXI2DVI): Likewise. + (gasver.texi): Removed. + (MOSTLYCLEANFILES): Remove gasver.texi. + (as.1): Don't depend on gasver.texi. + * doc/Makefile.in: Regenerated. + + * doc/as.texi: Include bfdver.texi instead of gasver.texi. + +2007-03-14 Daniel Jacobowitz + + * config/tc-arm.c (arm_copy_symbol_attributes): New. + * config/tc-arm.h (arm_copy_symbol_attributes): Declare. + (TC_COPY_SYMBOL_ATTRIBUTES): Define. + * gas/symbols.c (copy_symbol_attributes): Use + TC_COPY_SYMBOL_ATTRIBUTES. + +2007-03-14 Paul Brook + + * config/tc-arm.c (T16_32_TAB): Fix dec_sp encoding. + +2007-03-14 Alan Modra + + PR 4029 + * write.c (relax_segment): Insert extra alignment padding + to break infinite relax loop when given impossible + gcc_except_table assembly. + +2007-03-12 H.J. Lu + + * config/tc-i386.c (md_assemble): Use Opcode_XXX instead of XXX + on i.tm.base_opcode. + (match_template): Likewise. + (process_operands): Use ~0x3 mask to match MOV_AX_DISP32. + + * config/tc-i386.h (Opcode_D): New. + (Opcode_FloatR): Likewise. + (Opcode_FloatD): Likewise. + (D): Redefined. + (W): Likewise. + (FloatMF): Likewise. + (FloatR): Likewise. + (FloatD): Likewise. + +2007-03-09 Alexandre Oliva + + * app.c (do_scrub_chars): Recognize comments after # line "file". + * read.c (get_linefile_number): New. + (s_app_line): Accept ill-formed .linefile lines as comments. + +2007-03-09 Alan Modra + + * config/tc-i386.h (WORKING_DOT_WORD): Define. + +2007-03-09 Alexandre Oliva + + * app.c (do_scrub_chars): Turn #"file"flags into .linefile. + * as.h (new_logical_line_flags): New. + * input-scrub.c (new_logical_line): Turned into wrapper for... + (new_logical_line_flags): this. Handle flags. + * read.c (potable): Add linefile. Adjust appline argument. + (s_app_file): Fake .appfiles no more. + (s_app_line): For .linefile, accept file name and flags. + +2007-03-08 Alan Modra + + * symbols.c (symbol_relc_make_sym): Comment typo fixes. + +2007-03-08 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2007-03-07 Joseph Myers + + * configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of + bug-reporting URL. + * doc/Makefile.am (gasver.texi): Define BUGURL. + * doc/as.texinfo: Use BUGURL. + * Makefile.in, configure, doc/Makefile.in: Regenerate. + +2007-03-06 Andreas Krebbel + + * config/tc-s390.c (md_parse_option): z9-ec option added. + +2007-03-02 Paul Brook + + * config/tc-arm.c (relax_immediate): Always return positive values. + (relaxed_symbol_addr): New function. + (relax_adr, relax_branch): Use it. + (arm_relax_frag): Pass strect argument. Adjust infinite loop check. + +2007-03-01 Joseph Myers + + * as.c (parse_args): Update copyright date. + +2007-02-28 Nathan Sidwell + + * configure.tgt (sh-*-uclinux, sh[12]-*-uclinux): Specify as elf. + +2007-02-28 Nick Clifton + + PR gas/3797 + * config/tc-d10v.c (do_assemble): Do not generate error messages, + just return -1 whenever a problem is encountered. + (md_assemble): If do_assemble returns -1 generate a non-fatal + error message and return. + + PR gas/2623 + * config/tc-msp430.c (line_separator_char): Change to '{'. + +2007-02-27 Alan Modra + + * config/tc-m68hc11.c (fixup24): Correct fixup size. + (build_jump_insn): Likewise. + (build_insn): Likewise. + (s_m68hc11_relax): Likewise. + +2007-02-27 Alan Modra + + * config/obj-elf.c (elf_frob_file): frag_wane any new frags. + +2007-02-25 Mark Shinwell + + * config/tc-arm.c (do_vfp_nsyn_pop): Use fldmias/fldmiad. + +2007-02-23 Alan Modra + + * config/tc-mn10300.c (md_convert_frag): Correct fixup size. + (md_assemble): Likewise. + +2007-02-22 Alan Modra + + * write.c (size_seg): Always clear SEC_RELOC here. + (install_reloc): New function, extracted from.. + (write_relocs): ..here. Combine RELOC_EXPANSION_POSSIBLE code + with !RELOC_EXPANSION_POSSIBLE code. Don't add fr_offset when + testing frag size. Set SEC_RELOC here. + +2007-02-21 Alan Modra + + PR 4082 + * config/tc-avr.h (TC_FX_SIZE_SLACK): Define. + +2007-02-20 Thiemo Seufer + + * doc/c-mips.texi: Document 74kc, 74kf, 74kx. + +2007-02-20 Thiemo Seufer + + * config/tc-mips.c (mips_cpu_info_table): Add 74K configurations. + +2007-02-20 Thiemo Seufer + Chao-Ying Fu + + * config/tc-mips.c (mips_set_options, mips_opts, file_ase_dspr2, + ISA_SUPPORTS_DSPR2_ASE, MIPS_CPU_ASE_DSPR2): Add DSP R2 ASE support. + (macro_build): Add case '2'. + (macro): Expand M_BALIGN to nop, packrl.ph or balign. + (validate_mips_insn): Add support for balign instruction. + (mips_ip): Handle DSP R2 instructions. Support balign instruction. + (OPTION_DSPR2, OPTION_NO_DSPR2, OPTION_COMPAT_ARCH_BASE, + md_parse_option, mips_after_parse_args): Add -mdspr2 and -mno-dspr2 + command line options. + (s_mipsset): Add support for .set dspr2 and .set nodspr2 directives. + (md_show_usage): Add -mdspr2 and -mno-dspr2 help output. + * doc/c-mips.texi, doc/as.texinfo: Document -mdspr2, -mno-dspr2, + .set dspr2, .set nodspr2. + +2007-02-20 Nathan Sidwell + + * config/tc-m68k.c (mcf5210a_ctrl, mcf52235_ctrl, mcf5225_ctrl): New. + (m68k_cpus): Add 5210a..5211a, 52230..52235 5224..5225. + +2007-02-18 Alan Modra + + * write.c (TC_FX_SIZE_SLACK): Define. + (write_relocs): Reinstate check for fixup within frag. + * config/tc-bfin.h (TC_FX_SIZE_SLACK): Define. + * config/tc-h8300.h (TC_FX_SIZE_SLACK): Define. + * config/tc-mmix.h (TC_FX_SIZE_SLACK): Define. + * config/tc-sh.h (TC_FX_SIZE_SLACK): Define. + * config/tc-xstormy16.h (TC_FX_SIZE_SLACK): Define. + +2007-02-17 Mark Mitchell + Nathan Sidwell + Vladimir Prus + + * configure.in (--with-bugurl): New option. + * configure: Regenerate. + * dep-in.sed: Remove bin-bugs.h. + * Makefile.am (REPORT_BUGS_TO): Define. + (INCLUDES): Define REPORT_BUGS_TO. + (DEP_INCLUDES): Likewise. + ($(OBJS)): No longer depend on bin-bugs.h. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * as.c (show_usage): Don't print empty REPORT_BUGS_TO. + * as.h: Remove include of bin-bugs.h. + +2007-02-17 Alan Modra + + * write.c: White space fixes. + (fixup_segment): Move symbol_mri_common_p adjustments.. + (write_relocs): ..and symbol_equated_reloc_p adjustments.. + (adjust_reloc_syms): ..to here. + +2007-02-16 Alan Modra + + * subsegs.c (subseg_change, subseg_get): Use xcalloc rather than + xmalloc, memset. Don't bother assigning NULL to known zero mem. + (subseg_set_rest): Remove unnecessary cast. + * write.c: Include libbfd.h. Replace PTR with void * throughout. + Remove unnecessary forward declarations and casts. + (set_symtab): Delete extern bfd_alloc. + (fixup_segment): Move. + +2007-02-15 Nathan Sidwell + + * config/m68k-parse.h (m68k_register): Add ROMBAR0, ASID. + * config/tc-m68k.c (mcfv4e_ctrl): Add ColdFire specific names. + (mcf5475_ctrl, mcf5485_ctrl): New. + (m68k_cpus): Use mcf5485_ctrl and mcf5485_ctrl for those families. + (m68k_ip): Add ASID, MMUBAR, ROMBAR0 handling. + (init_table): Add asid, mmubar, adjust rombar0. + +2007-02-14 Alan Modra + + * config/tc-i386.h (Seg2ShortForm, Seg3ShortForm): Delete. + * config/tc-i386.c: Wrap overly long lines, whitespace fixes. + (process_operands): Move old Seg2ShortForm and Seg3ShortForm + code, and test for these insns using a combination of + opcode_modifier and operand_types. + +2007-02-07 Paul Brook + + * configure.tgt: Add arm*-*-uclinux-*eabi. + +2007-02-05 Dave Brolley + Richard Sandiford + DJ Delorie + Stan Cox + Jim Blandy + Nick Clifton + Jim Wilson + Frank Ch. Eigler + Graydon Hoare + Ben Elliston + John Healy + Richard Henderson + + * Makefile.am (CPU_TYPES): Add mep. + (TARGET_CPU_CFILES): Add tc-mep.c. + (TARGET_CPU_HFILES): Add tc-mep.h. + (DEPTC_mep_elf): New variable. + (DEPTC_mep_coff): Likewise. + (DEPOBJ_mep_coff, DEPOBJ_mep_elf, DEP_mep_coff, DEP_mep_elf): Likewise. + * configure.in: Support mep. + * configure.tgt: Likewise. + * config/tc-mep.c: New file. + * config/obj-elf.c: New file. + * config/tc-mep.c: New file. + * config/tc-mep.h: New file. + * testsuite/gas/mep: New testsuite with content. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2007-02-05 Dave Brolley + + * cgen.c (gas_cgen_install_complex_reloc): Removed. + (complex_reloc_installation_howto): Removed. + +2007-02-05 Dave Brolley + Graydon Hoare + DJ Delorie + Catherine Moore + Michael Chastain + Frank Ch. Eigler + + * symbols.c (use_complex_relocs_for): New, to decide + when to use complex relocs. Add signed RELC support. + (resolve_symbol_value): Call use_complex_relocs_for. Unconditionally + encode expression symbols as mangled complex relocation symbols (when + compiled with -DOBJ_COMPLEX_RELOC). + (symbol_relc_make_sym,value,expr): New traversal/conversion routines. + * cgen.c (gas_cgen_md_apply_fix3): Only set signed_p if RELC. Call + encode_addend with new args. Modify to get start, length from + ifield whenever it is set. Also change condition on which + self-describing relocs are encoded. Add hook into + gas_cgen_encode_addend. + (queue_fixup_recursively): Add signed RELC support. Change from masked + expr to trunc flag. Restore assignment of sub-field value to + temporary in fixups array. Reflect changed meaning of last arg to + queue_fixup_recursively. + (fixup): Add cgen_maybe_multi_ifield member. + (make_right_shifted_expr): New function. + (queue_fixup): Change to recursive function that fragments + fixups if operand has a multi-ifield. + (gas_cgen_parse_operand): Add RELC code to wrap expressions in + symbols, call weak_operand_overflow_check, and fragment call + queue_fixup with operand fields. + (gas_cgen_finish_insn) Modify to manage ifield pointer. + (weak_operand_overflow_check): New function to try to select + insns correctly. + (gas_cgen_encode_addend): New function for relc. + (gas_cgen_install_complex_reloc): Likewise. + (gas_cgen_tc_gen_reloc): Add hook into gas_cgen_install_complex_reloc. + * write.h (struct fix): Add msb_field_p to fx_cgen sub-struct. Add + cgen_maybe_multi_ifield field to fx_cgen substructure. + * cgen.h (GAS_CGEN_MAX_FIXUPS): Bump from 3 up to 32. + * symbols.h (symbol_relc_make_sym,value,expr): New prototypes. + +2007-02-03 DJ Delorie + + * config/tc-m32c.c (m32c_cons_fix_new): New. Added to support 3 + byte relocs. + * config/tc-m32c.h (TC_CONS_FIX_NEW): Define. + (m32c_cons_fix_new): Prototype. + +2007-02-02 Bob Wilson + + * config/tc-xtensa.c (xg_build_to_insn): Use tinsn_init. + (xg_expand_assembly_insn, istack_push_space, istack_pop): Likewise. + +2007-02-02 Bob Wilson + + * config/tc-xtensa.c (SUFFIX_MAP, suffix_relocs): New. + (xtensa_elf_suffix): Use suffix_relocs instead of local mapping table. + (map_suffix_reloc_to_operator): New. + (map_operator_to_reloc): New. + (expression_maybe_register): Fix incorrect test of return value from + xtensa_elf_suffix. Rearrange to use map_suffix_reloc_to_operator. + (xg_assemble_literal, convert_frag_immed): Use map_operator_to_reloc. + +2007-02-02 Bob Wilson + + * config/xtensa-istack.h (struct tinsn_struct): Delete fixup field. + (tinsn_get_tok): Delete prototype. + * config/tc-xtensa.c (tinsn_get_tok): Delete. + +2007-02-02 Bob Wilson + + * config/xtensa-relax.h (struct build_instr): Delete id field. + * config/xtensa-relax.c (widen_spec_list): Remove zeros from LITERAL + and LABEL tokens. + (append_literal_op, append_label_op): Remove litnum/labnum arguments; + set op_data fields to zero. + (parse_id_constant): Delete. + (build_transition): Remove code to handle numbered literals and labels. + +2007-02-02 Bob Wilson + + * config/xtensa-relax.c (build_transition): Remove code after as_fatal. + (build_transition_table): Likewise. + +2007-02-01 Bob Wilson + + * config/tc-xtensa.c (xg_add_opcode_fix, md_apply_fix): Delete use of + fx_tcbit. + * config/tc-xtensa.h (TC_FORCE_RELOCATION_LOCAL): Remove. + +2007-02-02 Alan Modra + + * write.h (struct fix ): Move. + (struct fix ): Rename to tcbit2. + * write.c (fix_new_internal): Adjust. + (TC_FORCE_RELOCATION_LOCAL): Don't test fx_plt. + * config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-cris.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-i386.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-i960.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-sh.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-sh64.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-sparc.h (TC_FORCE_RELOCATION_LOCAL): Likewise. + * config/tc-msp430.c (msp430_force_relocation_local): Likewise. + * config/tc-ia64.c (emit_one_bundle): Don't set fx_plt. + * config/tc-ia64.h (TC_FORCE_RELOCATION_LOCAL): Don't test fx_plt. + Instead, compare fx_r_type. + * config/tc-xtensa.c (xg_add_opcode_fix, md_apply_fix): Use + fx_tcbit in place of fx_plt. + * config/tc-xtensa.h (TC_FORCE_RELOCATION_LOCAL): Define. + * doc/internals.texi (TC_FORCE_RELOCATION_LOCAL): Remove reference + to fx_plt. + +2007-01-30 Nick Clifton + + * as.c (main): Mark symbols created via the --defsym command line + option as volatile so that they can be overridden later on by a + .set directive. This maintains compatibility with the behaviour + of earlier versions of the assembler. + * doc/as.texinfo (--defsym): Document that the defined symbol's + value can be overridden via a .set directive. + +2007-01-28 H.J. Lu + + * config/tc-i386.c (swap_imm_operands): Renamed to ... + (swap_2_operands): This. Take 2 ints. + (md_assemble): Updated. + (swap_operands): Call swap_2_operands to swap 2 operands. + +2007-01-24 DJ Delorie + + * config/tc-m32c.c (md_pseudo_table): Add .3byte. + +2007-01-22 Nick Clifton + + PR gas/3871 + * tc-score.c: Remove unnecessary uses of _(). + Make the err_msg[] a file level local array in order to save + storage space. + Remove unnecessary sprintf()s. + +2007-01-18 Mei Ligang + + PR gas/3871 + * config/tc-score.c : Using _() for const string. + Do not assign inst.error with a local string pointer. + (md_section_align): Pad section. + +2007-01-13 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Check number of operands + when procssing memory/register operand. + +2007-01-12 Nick Clifton + + PR gas/3856 + * macro.c (expand_irp): Do not ignore spaces inside quoted + strings. + +2007-01-12 Alan Modra + + * config/tc-spu.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. + * config/tc-m32r.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. + * config/tc-mn10300.h (TC_RELOC_RTSYM_LOC_FIXUP): Delete. + (TC_FORCE_RELOCATION): Define. + (TC_FORCE_RELOCATION_LOCAL): Define. + * config/tc-mn10300.c (mn10300_fix_adjustable): Adjust. + +2007-01-12 Alan Modra + + * input-file.c (input_file_open): Check fgets return. + +2007-01-11 Paul Brook + + * config/tc-arm.c (do_t_add_sub): Use Rd and Rs. + +2007-01-11 Nick Clifton + + PR gas/3707 + * config/tc-arm.c (md_begin): Cope with an NULL mcpu_fpu_opt + variable. + + * config/tc-mcore.c (md_number_to_chars): Use + number_to_chars_{big|little}endian. + +2007-01-08 Kazu Hirata + + * config/tc-m68k.c (m68k_archs, m68k_cpus): Treat Fido as an + architecture by itself. + (m68k_ip): Don't issue a warning for tbl instructions on fido. + (m68k_elf_final_processing): Treat Fido as an architecture by + itself. + +2007-01-08 Kai Tietz + + * configure.tgt: Renamed target x86_64-*-mingw64 to x86_64-*-mingw* + +2007-01-05 H.J. Lu + + * config/tc-i386.c (set_intel_syntax): Update set_intel_syntax + depending on allow_naked_reg. + +2007-01-04 Paul Brook + + * config/tc-arm.c (do_cpsi): Set mmod bit for 2 argument form. + +2007-01-04 H.J. Lu + + PR gas/3830 + * config/tc-i386.c (register_prefix): New. + (set_intel_syntax): Set set_intel_syntax to "" if register + prefix isn't needed. + (check_byte_reg): Use register_prefix for error message. + (check_long_reg): Likewise. + (check_qword_reg): Likewise. + (check_word_reg): Likewise. + +2006-01-04 Julian Brown + + * config/tc-arm.c (do_neon_shl_imm): Swap rN, rM. + (do_neon_qshl_imm): Likewise. + (do_neon_rshl): New function. Handle rounding variants of + v{q}shl-by-register. + (insns): Use do_neon_rshl for vrshl, vqrshl. + +2007-01-04 Paul Brook + + * config/tc-arm.c (NEON_ENC_TAB): Fix encoding of vclt, vcle, vaclt + and vacle. + +2007-01-03 H.J. Lu + + * config/tc-i386.c (swap_operands): Remove branches. + +2007-01-03 H.J. Lu + + * config/tc-i386.c: Update copyright year. + * config/tc-i386.h: Likewise. + +2007-01-03 H.J. Lu + + * config/tc-i386.c (smallest_imm_type): Return unsigned int + instead of int. + +2007-01-03 H.J. Lu + + * config/tc-i386.c: Convert to ISO C90 formatting + * config/tc-i386.h: Likewise. + +2007-01-03 David Daney + + * config/tc-mips.c (md_show_usage): Clean up -mno-shared + documentation. + +For older changes see ChangeLog-2006 Local Variables: mode: change-log diff --git a/contrib/binutils/gas/ChangeLog-2006 b/contrib/binutils/gas/ChangeLog-2006 new file mode 100644 index 00000000000..dc933e5b050 --- /dev/null +++ b/contrib/binutils/gas/ChangeLog-2006 @@ -0,0 +1,2756 @@ +2006-12-30 H.J. Lu + + * config/tc-i386.h (ShiftCount): Fix a comment typo. + +2006-12-30 H.J. Lu + + * config/tc-i386.c (md_show_usage): Mention --32/--64. + +2006-12-29 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Handle shift count + register with 3 operands. + +2006-12-28 H.J. Lu + + * config/tc-i386.c (process_operands): Check i.reg_operands + and increment i.operands when adding a register operand. + (build_modrm_byte): Fix 4 operand instruction handling. + +2006-12-27 H.J. Lu + + * config/tc-i386.c (disp_expressions): Use MAX_MEMORY_OPERANDS + for array size instead of 2. + (im_expressions): Use MAX_IMMEDIATE_OPERANDS for for array size + instead of 2. + (i386_immediate): Update immediate operand overflow error + message. + (i386_displacement): Check displacement operand overflow. + +2006-12-27 H.J. Lu + + * config/tc-i386.c: Document tc-i386.c, not i386.c. + +2006-12-27 Kazu Hirata + + * config/m68k-parse.h (m68k_register): Add CAC and MBB. + * config/tc-m68k.c (fido_ctrl): New. + (m68k_archs): Use fido_ctrl for -mfidoa. + (m68k_cpus): Use fido_ctrl on fido-*-*. + (m68k_ip): Add support for CAC and MBB. + (init_table): Add CAC and MBB. + +2006-12-26 H.J. Lu + + * config/tc-i386.c (i386_immediate): Remove prototype. + +2006-12-25 Kazu Hirata + + * config/tc-m68k.c (cpu_of_arch): Add fido. + (m68k_archs, m68k_cpu): Add entries for fido. + (m68k_elf_final_processing): Handle EF_M68K_CPU32_FIDO_A. + +2006-12-25 Mei Ligang + + * config/tc-score.c (build_lw_pic): Rename as build_lwst_pic. + Delete the code handling large constant for PIC. + Modify some comments. + (score_relax_frag): Decrease insn_addr in certain situation. + (s_score_cprestore): Change .cprestore syntax from ".cprestore offset" + to ".cprestore reg, offset". + +2006-12-23 Kazu Hirata + + * configure.tgt: Recognize fido. + +2006-12-15 H.J. Lu + + * config/tc-i386.c: Add a blank line bewteen function bodies. + +2006-12-15 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Reformat to 72 columns. + +2006-12-14 Daniel Jacobowitz + + * Makefile.am (YFLAGS): Define. + * Makefile.in: Regenerated. + +2006-12-14 H.J. Lu + + * config/tc-i386.c (match_template): Simplify 3 and 4 operand + match. + +2006-12-13 H.J. Lu + + * config/tc-i386.c (build_modrm_byte): Set the Operand_PCrel + bit only. + +2006-12-13 H.J. Lu + + * config/tc-i386.c (match_template): Use a for loop to set + operand_types array. + +2006-12-13 H.J. Lu + + PR gas/3712 + * config/tc-i386.c (match_template): Use MAX_OPERANDS for the + number of operands. Issue an error if MAX_OPERANDS != 4. Add + the 4th operand check. + +2006-12-13 Paul Brook + + * config/tc-arm.c (arm_arch_option_table): Add v7-{a,r,m}. + * doc/c-arm.texi: Fix spelling of ARMv7 profile variants. + +2006-12-12 H.J. Lu + + * config/tc-i386.h (WordMem): Document it for 64 bit memory + reference. + +2006-12-12 Daniel Jacobowitz + + * doc/Makefile.am (as_TEXINFOS): Set. + (as.info as.dvi as.html): Delete rule. + * doc/Makefile.in: Regenerated. + +2006-12-11 Daniel Jacobowitz + + * configure.in: Define GENINSRC_NEVER. + * doc/Makefile.am (as.info): Remove srcdir prefix. + (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-09 H.J. Lu + + * config/tc-i386.h (template): Use MAX_OPERANDS instead of 4 + for operand_types array. + +2006-12-08 Christian Groessler + + * config/tc-z8k.c (whatreg): Add comment describing function. + Return NULL if symbol name characters follow the register number. + (parse_reg): Use NULL instead of 0 for pointer values. Stop + processing if whatreg returned NULL. + +2006-12-07 Kazu Hirata + + * config/tc-m68k.c: Update uses of EF_M68K_*. + +2006-12-06 H.J. Lu + + * config/tc-i386.h: Change the prefix order to SEG_PREFIX, + ADDR_PREFIX, DATA_PREFIX, LOCKREP_PREFIX. + +2006-12-02 Jakub Jelinek + + PR gas/3607 + * subsegs.c (subseg_set_rest): Clear frch_cfi_data field. + +2006-12-01 Paul Brook + + * config/tc-arm.c (arm_force_relocation): Return 1 for relocs against + function symbols. + +2006-11-29 Paul Brook + + * config/tc-arm.c (arm_is_eabi): New function. + * config/tc-arm.h (arm_is_eabi): New prototype. + (THUMB_IS_FUNC): Use ELF function type for EABI objects. + * doc/c-arm.texi (.thumb_func): Update documentation. + +2006-11-29 Paul Brook + + * config/tc-arm.c (do_vfp_sp_const, do_vfp_dp_const): Fix operans + encoding. + +2006-11-27 Sterling Augustine + + * config/tc-xtensa.c (xtensa_sanity_check): Check for RELAX_IMMED + as the first slot_subtype, not the frag subtype. + +2006-11-27 Bob Wilson + + * config/tc-xtensa.c (XSHAL_ABI): Add default definition. + (directive_state): Disable scheduling by default. + (xtensa_add_config_info): New. + (xtensa_end): Call xtensa_add_config_info. + +2006-11-27 Eric Botcazou + + * config/tc-sparc.c (tc_gen_reloc): Turn aligned relocs into + their unaligned counterparts in debugging sections. + +2006-11-24 Alan Modra + + * config/tc-spu.c (md_pseudo_table): Add eqv and .eqv. + +2006-11-22 Daniel Jacobowitz + + * config/tc-arm.h (md_cons_align): Define. + (mapping_state): New prototype. + * config/tc-arm.c (mapping_state): Make global. + +2006-11-22 Alan Modra + + * config/obj-elf.c (obj_elf_version): Use memcpy rather than strcpy. + +2006-11-16 Mei ligang + + * config/tc-score.c (score_relax_frag): If next frag contains 32 bit + branch instruction, handle it specially. + (score_insns): Modify 32 bit branch instruction. + +2006-11-16 Alan Modra + + * symbols.c (resolve_symbol_value): Formatting. + +2006-11-15 Jan Beulich + + PR/3469 + * symbols.c (symbol_clone): Mark symbol ending up not on symbol + chain by linking it to itself. + (resolve_symbol_value): Also check symbol_shadow_p(). + (symbol_shadow_p): New. + * symbols.h (symbol_shadow_p): Declare. + +2006-11-12 Mark Shinwell + + * config/tc-arm.c (do_t_czb): Rename to do_t_cbz. + (insns): Adjust accordingly. + (md_apply_fix): Alter comments to use CBZ instead of CZB. + +2006-11-10 Pedro Alves + + * config/tc-arm.c (arm_fix_adjustable) [OBJ_COFF]: Delete. + (arm_fix_adjustable) [OBJ_ELF]: Use it on coff targets too. + +2006-11-10 Nick Clifton + + PR gas/3456: + * config/obj-elf.c (obj_elf_version): Do not include the name + field's padding in the namesz value. + +2006-11-09 Thiemo Seufer + + * config/tc-mips.c: Fix outdated comment. + +2006-11-08 H.J. Lu + + * config/tc-i386.h (CpuPNI): Removed. + (CpuUnknownFlags): Replace CpuPNI with CpuSSE3. + * config/tc-i386.c (md_assemble): Likewise. + +2006-11-08 Alan Modra + + * symbols.c (symbol_create, symbol_clone): Don't set udata.p. + +2006-11-06 David Daney + + * config/tc-mips.c (pic_need_relax): Return true for section symbols. + +2006-11-06 Thiemo Seufer + + * doc/c-mips.texi (-march): Document sb1a. + +2006-11-06 Thiemo Seufer + + * config/tc-mips.c (mips_cpu_info_table): Remove 24k/24ke aliases. + 34k always has DSP ASE. + +2006-11-03 Thiemo Seufer + + * config/tc-mips.c (md_pcrel_from_section): Disallow PC relative + MIPS16 instructions referencing other sections, unless they are + external branches. + +2006-11-03 Thiemo Seufer + + * config/tc-mips.c (mips_cpu_info_table): The 25Kf is a MIPS64 + release 1 CPU. + +2006-11-03 Jakub Jelinek + + * dw2gencfi.c (struct fde_entry): Add per_encoding, lsda_encoding, + personality and lsda. + (struct cie_entry): Add per_encoding, lsda_encoding and personality. + (alloc_fde_entry): Initialize per_encoding and lsda_encoding. + (cfi_pseudo_table): Handle .cfi_personality and .cfi_lsda. + (dot_cfi_personality, dot_cfi_lsda, encoding_size): New functions. + (output_cie): Output personality including its encoding and LSDA encoding. + (output_fde): Output LSDA. + (select_cie_for_fde): Don't share CIE if personality, its encoding or + LSDA encoding are different. Copy the 3 fields from fde_entry to + cie_entry. + * doc/as.texinfo (.cfi_personality, .cfi_lsda): Document. + + * subsegs.h (struct frchain): Add frch_cfi_data field. + * dw2gencfi.c: Include subsegs.h. + (cur_fde_data, last_address, cur_cfa_offset, cfa_save_stack): Removed. + (struct frch_cfi_data): New type. + (unused_cfi_data): New variable. + (alloc_fde_entry): Move cur_fde_data, last_address, cur_cfa_offset + and cfa_save_stack static vars into a structure pointed from + each frchain. + (alloc_cfi_insn_data, cfi_new_fde, cfi_end_fde, cfi_set_return_column, + cfi_add_advance_loc, cfi_add_CFA_def_cfa, cfi_add_CFA_def_cfa_offset, + cfi_add_CFA_remember_state, cfi_add_CFA_restore_state, dot_cfi, + dot_cfi_escape, dot_cfi_startproc, dot_cfi_endproc, cfi_finish): + Likewise. + +2006-11-02 Daniel Jacobowitz + + * config/tc-h8300.c (build_bytes): Fix const warning. + +2006-11-01 Mei Ligang + + * tc-score.c (do16_rdrs): Handle not! instruction especially. + +2006-10-31 Paul Brook + + * config/tc-arm.c (arm_adjust_symtab): Don't use STT_ARM_16BIT + for EABIv4. + +2006-10-31 Paul Brook + + gas/ + * config/tc-arm.c (object_arch): New variable. + (s_arm_object_arch): New function. + (md_pseudo_table): Add object_arch. + (aeabi_set_public_attributes): Obey object_arch. + * doc/c-arm.texi: Document .object_arch. + +2006-10-31 Mei Ligang + + * tc-score.c (data_op2): Check invalid operands. + (my_get_expression): Const operand of some instructions can not be + symbol in assembly. + (get_insn_class_from_type): Handle instruction type Insn_internal. + (do_macro_ldst_label): Modify inst.type. + (Insn_PIC): Delete. + (data_op2): The immediate value in lw is 15 bit signed. + +2006-10-29 Randolph Chung + + * config/tc-hppa.c (hppa_cfi_frame_initial_instructions) + (hppa_regname_to_dw2regnum): New funcions. + * config/tc-hppa.h [OBJ_ELF] (TARGET_USE_CFIPOP): Define. + (tc_cfi_frame_initial_instructions) + (tc_regname_to_dw2regnum): Define. + (hppa_cfi_frame_initial_instructions) + (hppa_regname_to_dw2regnum): Declare. + (DWARF2_LINE_MIN_INSN_LENGTH, DWARF2_DEFAULT_RETURN_COLUMN) + (DWARF2_CIE_DATA_ALIGNMENT): Define. + +2006-10-29 Nick Clifton + + * config/tc-spu.c (md_assemble): Cast printf string size parameter + to int in order to avoid a compiler warning. + +2006-10-27 Andrew Stubbs + + * config/tc-sh.c (md_assemble): Define size of branches. + +2006-10-26 Ben Elliston + + * dw2gencfi.c (cfi_add_CFA_offset): + Assert DWARF2_CIE_DATA_ALIGNMENT is non-zero. + + * write.c (chain_frchains_together_1): Assert that this function + never returns a pointer to the auto variable `dummy'. + +2006-10-25 Trevor Smigiel + Yukishige Shibata + Nobuhisa Fujinami + Takeaki Fukuoka + Alan Modra + + * config/tc-spu.c: New file. + * config/tc-spu.h: New file. + * configure.tgt: Add SPU support. + * Makefile.am: Likewise. Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2006-10-25 Ben Elliston + + * expr.c (expr): Replace O_add case in switch (op_left) explaining + why it can never occur. + +2006-10-24 Andrew Pinski + + * doc/c-ppc.texi (-mcell): Document. + * config/tc-ppc.c (parse_cpu): Parse -mcell. + (md_show_usage): Document -mcell. + +2006-10-23 Dwarakanath Rajagopal + + * doc/c-i386.texi : Document amdfam10,.sse4a and .abm in cpu_type. + +2006-10-23 Alan Modra + + * config/tc-m68hc11.c (md_assemble): Quiet warning. + +2006-10-19 Mike Frysinger + + * config/tc-i386.c (md_parse_option): Use CONST_STRNEQ. + (x86_64_section_letter): Likewise. + +2006-10-19 Mei Ligang + + * config/tc-score.c (build_relax_frag): Compute correct + tc_frag_data.fixp. + +2006-10-18 Roy Marples + + * config/tc-sparc.c (md_parse_option): Treat any target starting with + elf32-sparc as a viable target for the -32 switch and any target + starting with elf64-sparc as a viable target for the -64 switch. + (sparc_target_format): For 64-bit ELF flavoured output use + ELF_TARGET_FORMAT64 while for 32-bit ELF flavoured output use + ELF_TARGET_FORMAT. + * config/tc-sparc.h (ELF_TARGET_FORMAT, ELF_TARGET_FORMAT64): Define. + +2006-10-17 H.J. Lu + + * configure: Regenerated. + +2006-10-16 Bernd Schmidt + + * input-scrub.c (input_scrub_next_buffer): Use TC_EOL_IN_INSN + in addition to testing for '\n'. + (TC_EOL_IN_INSN): Provide a default definition if necessary. + +2006-10-13 Sterling Augstine + + * dwarf2dbg.c (out_debug_info): Use TC_DWARF2_EMIT_OFFSET to emit + a disjoint DW_AT range. + +2006-10-13 Mei Ligang + + * config/tc-score.c (md_show_usage): Print -KPIC option usage. + +2006-10-08 Paul Brook + + * config/tc-arm.c (parse_big_immediate): 64-bit host fix. + (parse_operands): Use parse_big_immediate for OP_NILO. + (neon_cmode_for_logic_imm): Try smaller element sizes. + (neon_cmode_for_move_imm): Ditto. + (do_neon_logic): Handle .i64 pseudo-op. + +2006-09-29 Alan Modra + + * po/POTFILES.in: Regenerate. + +2006-09-28 H.J. Lu + + * config/tc-i386.h (CpuMNI): Renamed to ... + (CpuSSSE3): This. + (CpuUnknownFlags): Updated. + (processor_type): Replace PROCESSOR_YONAH with PROCESSOR_CORE + and PROCESSOR_MEROM with PROCESSOR_CORE2. + * config/tc-i386.c: Updated. + * doc/c-i386.texi: Likewise. + + * config/tc-i386.c (cpu_arch): Add ".ssse3", "core" and "core2". + +2006-09-28 Bridge Wu + + * config/tc-arm.c (md_apply_fix): Do not clear write_back bit. + +2006-09-27 Nick Clifton + + * output-file.c (output_file_close): Prevent an infinite loop + reporting that stdoutput could not be closed. + +2006-09-26 Mark Shinwell + Joseph Myers + Ian Lance Taylor + Ben Elliston + + * config/tc-arm.c (arm_cext_iwmmxt2): New. + (enum operand_parse_code): New code OP_RIWR_I32z. + (parse_operands): Handle OP_RIWR_I32z. + (do_iwmmxt_wmerge): New function. + (do_iwmmxt_wldstd): Handle iwmmxt2 case where second operand is + a register. + (do_iwmmxt_wrwrwr_or_imm5): New function. + (insns): Mark instructions as RIWR_I32z as appropriate. + Also add torvsc, wabs, wabsdiff, + waddbhus, waddhc, waddwc, waddsubhx, wavg4{r}, wmaddu{x,n}, + wmadds{x,n}, wmerge, wmiaxy{n}, wmiawxy{n}, wmul{r}, + wmulw{r}, wqmiaxy{n}, wqmulm{r}, wqmulwm{r}, wsubaddhx. + (md_begin): Handle IWMMXT2. + (arm_cpus): Add iwmmxt2. + (arm_extensions): Likewise. + (arm_archs): Likewise. + +2006-09-25 Bob Wilson + + * doc/as.texinfo (Overview): Revise description of --keep-locals. + Add xref to "Symbol Names". + (L): Refer to "local symbols" instead of "local labels". Move + definition to "Symbol Names" section; add xref to that section. + (Symbol Names): Use "Local Symbol Names" section to define local + symbols. Add "Local Labels" heading for description of temporary + forward/backward labels, and refer to those as "local labels". + +2006-09-23 H.J. Lu + + PR binutils/3235 + * config/tc-i386.c (match_template): Check address size prefix + to turn Disp64/Disp32/Disp16 operand into Disp32/Disp16/Disp32 + operand. + +2006-09-22 Alan Modra + + * config/tc-ppc.c (ppc_symbol_chars): Remove '+' and '-'. + +2006-09-22 Alan Modra + + * as.h (as_perror): Delete declaration. + * gdbinit.in (as_perror): Delete breakpoint. + * messages.c (as_perror): Delete function. + * doc/internals.texi: Remove as_perror description. + * listing.c (listing_print: Don't use as_perror. + * output-file.c (output_file_create, output_file_close): Likewise. + * symbols.c (symbol_create, symbol_clone): Likewise. + * write.c (write_contents): Likewise. + * config/obj-som.c (obj_som_version, obj_som_copyright): Likewise. + * config/tc-tic54x.c (tic54x_mlib): Likewise. + +2006-09-22 Alan Modra + + * config/tc-ppc.c (md_section_align): Don't round up address for ELF. + (ppc_handle_align): New function. + * config/tc-ppc.h (HANDLE_ALIGN): Use ppc_handle_align. + (SUB_SEGMENT_ALIGN): Define as zero. + +2006-09-20 Bob Wilson + + * doc/as.texinfo: Fix cross reference usage, typos and grammar. + (Overview): Skip cross reference in man page. + +2006-09-20 Kai Tietz + + * configure.in: Add new target x86_64-pc-mingw64. + * configure: Regenerate. + * configure.tgt: Add new target x86_64-pc-mingw64. + * config/obj-coff.h: Add handling for TE_PEP target specific code + and definitions. + * config/tc-i386.c: Add new targets. + (md_parse_option): Add targets to OPTION_64. + (x86_64_target_format): Add new method for setup proper default + target cpu mode. + * config/te-pep.h: Add new target definition header. + (TE_PEP): New macro: Identifies new target architecture. + (COFF_WITH_pex64): Set proper includes in bfd. + * NEWS: Mention new target. + +2006-09-18 Bernd Schmidt + + * config/bfin-parse.y (binary): Change sub of const to add of negated + const. + +2006-09-17 Mei Ligang + + * config/tc-score.c: New file. + * config/tc-score.h: Newf file. + * configure.tgt: Add Score target. + * Makefile.am: Add Score files. + * Makefile.in: Regenerate. + * NEWS: Mention new target support. + +2006-09-16 Paul Brook + + * config/tc-arm.c (s_arm_unwind_movsp): Add offset argument. + * doc/c-arm.texi (movsp): Document offset argument. + +2006-09-16 Paul Brook + + * config/tc-arm.c (thumb32_negate_data_op): Consistently use + unsigned int to avoid 64-bit host problems. + +2006-09-15 Bernd Schmidt + + * config/bfin-parse.y (binary): Do some more constant folding for + additions. + +2006-09-13 Jan Beulich + + * input-file.c (input_file_give_next_buffer): Demote as_bad to + as_warn. + +2006-09-13 Alan Modra + + PR gas/3165 + * config/tc-sh (DWARF2_CIE_DATA_ALIGNMENT): Wrap negative number + in parens. + +2006-09-13 Alan Modra + + * input-file.c (input_file_open): Replace as_perror with as_bad + so that gas exits with error on file errors. Correct error + message. + (input_file_get, input_file_give_next_buffer): Likewise. + * input-file.h: Update comment. + +2006-09-11 Tomas Frydrych + + PR gas/3172 + * config/tc-arm.c (parse_typed_reg_or_scalar): Accept wCg class + registers as a sub-class of wC registers. + +2006-09-11 Alan Modra + + PR gas/3165 + * config/tc-mips.h (enum dwarf2_format): Forward declare. + (DWARF2_CIE_DATA_ALIGNMENT): Wrap negative number in parens. + * config/tc-alpha.h (DWARF2_CIE_DATA_ALIGNMENT): Likewise. + * config/tc-arm.h (DWARF2_CIE_DATA_ALIGNMENT): Likewise. + +2006-09-08 Nick Clifton + + PR gas/3129 + * doc/as.texinfo (Macro): Improve documentation about separating + macro arguments from following text. + +2006-09-08 Paul Brook + + * config/tc-arm.c (insns): Allow ARM IT pseudo-insn on all cores. + +2006-09-07 Paul Brook + + * config/tc-arm.c (parse_operands): Mark operand as present. + +2006-09-04 Paul Brook + + * config/tc-arm.c (do_neon_dyadic_if_i): Remove. + (do_neon_dyadic_if_i_d): Avoid setting U bit. + (do_neon_mac_maybe_scalar): Ditto. + (do_neon_dyadic_narrow): Force operand type to NT_integer. + (insns): Remove out of date comments. + +2006-08-29 Nick Clifton + + * read.c (s_align): Initialize the 'stopc' variable to prevent + compiler complaints about it being used without being + initialized. + (s_comm_internal, s_mri_common, s_fail, s_globl, s_space, + s_float_space, s_struct, cons_worker, equals): Likewise. + +2006-08-29 Malcolm Parsons + + * ecoff.c (ecoff_directive_val): Fix message typo. + * config/tc-ns32k.c (convert_iif): Likewise. + * config/tc-sh64.c (shmedia_check_limits): Likewise. + +2006-08-25 Sterling Augustine + Bob Wilson + + * config/tc-xtensa.c (xtensa_mark_literal_pool_location): Do not check + the state of the absolute_literals directive. Remove align frag at + the start of the literal pool position. + +2006-08-25 Bob Wilson + + * doc/c-xtensa.texi: Add @group commands in examples. + +2006-08-24 Bob Wilson + + * config/tc-xtensa.c (FINI_LITERAL_SECTION_NAME): Delete. + (INIT_LITERAL_SECTION_NAME): Delete. + (lit_state struct): Remove segment names, init_lit_seg, and + fini_lit_seg. Add lit_prefix and current_text_seg. + (init_literal_head_h, init_literal_head): Delete. + (fini_literal_head_h, fini_literal_head): Delete. + (xtensa_begin_directive): Move argument parsing to + xtensa_literal_prefix function. + (xtensa_end_directive): Deallocate lit_prefix field of lit_state. + (xtensa_literal_prefix): Parse the directive argument here and + record it in the lit_prefix field. Remove code to derive literal + section names. + (linkonce_len): New. + (get_is_linkonce_section): Use linkonce_len. Check for any + ".gnu.linkonce.*" section, not just text sections. + (md_begin): Remove initialization of deleted lit_state fields. + (xtensa_reorder_segments, xtensa_post_relax_hook): Remove references + to init_literal_head and fini_literal_head. + (xtensa_move_literals): Likewise. Skip literals for .init and .fini + when traversing literal_head list. + (match_section_group): New. + (cache_literal_section): Rewrite to determine the literal section + name on the fly, create the section and return it. + (xtensa_switch_to_literal_fragment): Adjust for cache_literal_section. + (xtensa_switch_to_non_abs_literal_fragment): Likewise. + (xtensa_create_property_segments, xtensa_create_xproperty_segments): + Use xtensa_get_property_section from bfd. + (retrieve_xtensa_section): Delete. + * doc/c-xtensa.texi (Xtensa Options): Fix --text-section-literals + description to refer to plural literal sections and add xref to + the Literal Directive section. + (Literal Directive): Describe new rules for deriving literal section + names. Add footnote for special case of .init/.fini with + --text-section-literals. + (Literal Prefix Directive): Replace old naming rules with xref to the + Literal Directive section. + +2006-08-21 Joseph Myers + + * config/tc-arm.c (s_arm_unwind_save_mmxwr): Correct condition for + merging with previous long opcode. + +2006-08-22 Pedro Alves + + * Makefile.am (TARG_ENV_HFILES): Add te-wince-pe.h. + * Makefile.in: Regenerate. + * config/tc-arm.h [TARGET_FORMAT]: ARM wince bfd names were + renamed. Adjust. + +2006-08-16 Julian Brown + + * config/tc-arm.c (md_assemble): Improve diagnostic when attempting + to use ARM instructions on non-ARM-supporting cores. + (autoselect_thumb_from_cpu_variant): New function. Switch on Thumb + mode automatically based on cpu variant. + (md_begin): Call above function. + +2006-08-16 Julian Brown + + * config/tc-arm.c (opcode_lookup): Allow Neon type suffixes to be + recognized in non-unified syntax mode. + +2006-08-15 Thiemo Seufer + Nigel Stephens + David Ung + + * configure.tgt: Handle mips*-sde-elf*. + +2006-08-12 Thiemo Seufer + + * config/tc-mips.c (mips16_ip): Fix argument register handling + for restore instruction. + +2006-08-08 Bob Wilson + + * dwarf2dbg.c (DWARF2_USE_FIXED_ADVANCE_PC): New. + (out_sleb128): New. + (out_fixed_inc_line_addr): New. + (process_entries): Use out_fixed_inc_line_addr when + DWARF2_USE_FIXED_ADVANCE_PC is set. + * config/tc-xtensa.h (DWARF2_USE_FIXED_ADVANCE_PC): Define. + +2006-08-08 DJ Delorie + + * config/tc-sh.c (sh_frob_section): Canonicalize pointers to local + vs full symbols so that we never have more than one pointer value + for any given symbol in our symbol table. + +2006-08-08 Sterling Augustine + + * dwarf2dbg.c (out_debug_info): Add new parameter ranges_seg + and emit DW_AT_ranges when code in compilation unit is not + contiguous. + (out_debug_abbrev): Emit DW_AT_ranges abbreviation if code in + is not contiguous. + (dwarf2_finish): Create and pass ranges_seg to out_debug_info. + (out_debug_ranges): New function to emit .debug_ranges section + when code is not contiguous. + +2006-08-08 Nick Clifton + + * config/tc-arm.c (WARN_DEPRECATED): Enable. + +2006-08-05 Pedro Alves + + * config/tc-arm.c: Move "dwarf2dbg.h" inclusion out of OBJ_ELF + only block. + (pe_directive_secrel) [TE_PE]: New function. + (md_pseudo_table) [!OBJ_ELF]: Handle 2byte, 4byte, 8byte, file, + loc, loc_mark_labels. + [TE_PE]: Handle secrel32. + (output_relax_insn): Remove OBJ_ELF around dwarf2_emit_insn + call. + (output_inst): Remove OBJ_ELF around dwarf2_emit_insn call. + (arm_frob_label): Remove OBJ_ELF around dwarf2_emit_label call. + (md_section_align): Only round section sizes here for AOUT + targets. + (tc_arm_regname_to_dw2regnum): Move out for OBJ_ELF only block. + (tc_pe_dwarf2_emit_offset): New function. + (md_apply_fix) [TE_PE]: Handle BFD_RELOC_32_SECREL. + (cons_fix_new_arm): Handle O_secrel. + * config/tc-arm.h : Move DWARF2_LINE_MIN_INSN_LENGTH, + DWARF2_DEFAULT_RETURN_COLUMN and DWARF2_CIE_DATA_ALIGNMENT out + of OBJ_ELF only block. + [TE_PE]: Define O_secrel, TC_DWARF2_EMIT_OFFSET, and declare + tc_pe_dwarf2_emit_offset. + +2006-08-04 Richard Sandiford + + * config/tc-sh.c (apply_full_field_fix): New function. + (md_apply_fix): Use it instead of md_number_to_chars. Do not fill + in fx_addnumber for BFD_RELOC_32_PLT_PCREL. + (tc_gen_reloc): Use fx_addnumber rather than 0 as the default case. + * config/tc-sh.h (TARGET_FORMAT): Override for TE_VXWORKS. + +2006-08-03 Nick Clifton + + PR gas/2991 + * config.in: Regenerate. + +2006-08-03 Joseph Myers + + * config/tc-arm.c (parse_operands): Handle invalid register name + for OP_RIWR_RIWC. + +2006-08-03 Joseph Myers + + * config/tc-arm.c (enum operand_parse_code): Add OP_RIWC_RIWG. + (parse_operands): Handle it. + (insns): Use it for tmcr and tmrc. + +2006-08-02 Petr Salinger + + PR binutils/2983 + * config/tc-i386.c (md_parse_option): Treat any target starting + with elf64_x86_64 as a viable target for the -64 switch. + (i386_target_format): For 64-bit ELF flavoured output use + ELF_TARGET_FORMAT64. + * config/tc-i386.h (ELF_TARGET_FORMAT64): Define. + +2006-08-02 Nick Clifton + + PR gas/2991 + * acinclude.m4 (BFD_BINARY_FOPEN): Import this function from + bfd/aclocal.m4. + * configure.in: Run BFD_BINARY_FOPEN. + * configure: Regenerate. + * as.h: Look at USE_BINARY_FOPEN to decide which fopen-*.h header + file to include. + +2006-08-01 H.J. Lu + + * config/tc-i386.c (md_assemble): Don't update + cpu_arch_isa_flags. + +2006-08-01 Thiemo Seufer + + * config/tc-mips.c (md_section_align): Check ELF-ness at runtime. + +2006-08-01 Thiemo Seufer + + * config/tc-mips.c (macro_build_lui): Fix comment formatting. + (md_apply_fix): Likewise. Unify handling of BFD_RELOC_RVA, + BFD_RELOC_32 and BFD_RELOC_16. + (s_align, s_cpload, s_cplocal, s_cprestore, s_mips_stab, + md_convert_frag, md_obj_end): Fix comment formatting. + +2006-07-31 Thiemo Seufer + + * config/tc-mips.c (md_apply_fix, tc_gen_reloc): Remove special + handling for BFD_RELOC_MIPS16_JMP. + +2006-07-24 Andreas Schwab + + PR/2756 + * read.c (read_a_source_file): Ignore unknown text after line + comment character. Fix misleading comment. + +2006-07-24 Ralk Wildenhues + + * doc/all.texi, doc/as.texinfo, doc/c-arc.texi, doc/c-arm.texi, + doc/c-avr.texi, doc/c-bfin.texi, doc/c-i386.texi, + doc/c-i960.texi, doc/c-m32r.texi, doc/c-m68k.texi, + doc/c-mmix.texi, doc/c-pdp11.texi, doc/c-ppc.texi, + doc/c-tic54x.texi, doc/c-v850.texi, doc/c-xtensa.texi, + doc/c-z80.texi, doc/internals.texi: Fix some typos. + +2006-07-21 Nick Clifton + + * config/tc-sh.c (md_longopts): Add -EL and -EB for use by the + linker testsuite. + +2006-07-20 Thiemo Seufer + Nigel Stephens + + * config/tc-mips.c (md_parse_option): Don't infer optimisation + options from debug options. + +2006-07-20 Thiemo Seufer + + * config/tc-mips.c (mips_fix_adjustable): Handle BFD_RELOC_MIPS16_JMP. + (tc_gen_reloc): Handle mips16 jumps to section symbol offsets. + +2006-07-19 Paul Brook + + * config/tc-arm.c (insns): Fix rbit Arm opcode. + +2006-07-18 Paul Brook + + * tc-arm.c (do_t_add_sub): Use addw/subw when source is PC. + (md_convert_frag): Use correct reloc for add_pc. Use + BFD_RELOC_ARM_T32_ADD_IMM for normal add/sum. + (md_apply_fix): Handle BFD_RELOC_ARM_T32_ADD_IMM. + (arm_force_relocation): Handle BFD_RELOC_ARM_T32_ADD_IMM. + +2006-07-17 Mat Hostetter + + * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where + when file and line unknown. + +2006-07-17 Thiemo Seufer + + * read.c (s_struct): Use IS_ELF. + * config/tc-mips.c (md_begin, mips16_mark_labels, mips_ip, + md_parse_option, s_change_sec, pic_need_relax, mips_fix_adjustable, + tc_gen_reloc, mips_frob_file_after_relocs, s_mips_end, s_mips_frame, + s_mips_mask): Likewise. + +2006-07-16 Thiemo Seufer + David Ung + + * read.c (s_struct): Handle ELF section changing. + * config/tc-mips.c (s_align): Leave enabling auto-align to the + generic code. + (s_change_sec): Try section changing only if we output ELF. + +2006-07-15 H.J. Lu + + * config/tc-i386.c (cpu_arch): Remove Cpu086, CpuAthlon and + CpuAmdFam10. + (smallest_imm_type): Remove Cpu086. + (i386_target_format): Likewise. + + * config/tc-i386.h: Remove Cpu086, CpuAthlon and CpuAmdFam10. + Update CpuXXX. + +2006-07-13 Dwarakanath Rajagopal + Michael Meissner + + * config/tc-i386.h (PROCESSOR_AMDFAM10): New processor_type. + (CpuSSE4a, CpuABM, CpuAmdFam10): New Cpu directives. + * config/tc-i386.c (cpu_arch): Add support for AmdFam10 + architecture. + (i386_align_code): Ditto. + (md_assemble_code): Add support for insertq/extrq instructions, + swapping as needed for intel syntax. + (swap_imm_operands): New function to swap immediate operands. + (swap_operands): Deal with 4 operand instructions. + (build_modrm_byte): Add support for insertq instruction. + +2006-07-13 H.J. Lu + + * config/tc-i386.h (Size64): Fix a typo in comment. + +2006-07-12 Nick Clifton + + * config/tc-sh.c (md_apply_fix): Do not allow the generic code in + fixup_segment() to repeat a range check on a value that has + already been checked here. + +2006-07-07 James E Wilson + + * config/tc-mips.c (mips_cpu_info_table): Add sb1a. + +2006-07-06 Mohammed Adnène Trojette + Nick Clifton + + PR binutils/2877 + * doc/as.texi: Fix spelling typo: branchs => branches. + * doc/c-m68hc11.texi: Likewise. + * config/tc-m68hc11.c: Likewise. + Support old spelling of command line switch for backwards + compatibility. + +2006-07-04 Thiemo Seufer + David Ung + + * config/tc-mips.c (s_is_linkonce): New function. + (mips16_mark_labels): Don't adjust mips16 symbol addresses for + weak, external, and linkonce symbols. + (pic_need_relax): Use s_is_linkonce. + +2006-06-24 H.J. Lu + + * doc/as.texinfo (Org): Remove space. + (P2align): Add "@var{abs-expr},". + +2006-06-23 H.J. Lu + + * config/tc-i386.c (cpu_arch_tune_set): New. + (cpu_arch_isa): Likewise. + (i386_align_code): Use xchg %ax,%ax for 2 byte nop. Optimize + nops with short or long nop sequences based on -march=/.arch + and -mtune=. + (set_cpu_arch): Set cpu_arch_isa. If cpu_arch_tune_set is 0, + set cpu_arch_tune and cpu_arch_tune_flags. + (md_parse_option): For -march=, set cpu_arch_isa and set + cpu_arch_tune and cpu_arch_tune_flags if cpu_arch_tune_set is + 0. Set cpu_arch_tune_set to 1 for -mtune=. + (i386_target_format): Don't set cpu_arch_tune. + +2006-06-23 Nigel Stephens + + * config/tc-mips.c (nopic_need_relax): Handle -fdata-sections + generated .sbss.* and .gnu.linkonce.sb.*. + +2006-06-23 Thiemo Seufer + David Ung + + * config/tc-mips.h (TC_SEGMENT_INFO_TYPE): Declare per-segment + label_list. + * config/tc-mips.c (label_list): Define per-segment label_list. + (mips_clear_insn_labels, mips_move_labels, mips16_mark_labels, + append_insn, s_align, s_cons, s_float_cons, s_gpword, s_gpdword, + mips_from_file_after_relocs, mips_define_label): Use per-segment + label_list. + +2006-06-22 Thiemo Seufer + + * config/tc-mips.c (ISA_SUPPORTS_MIPS16E): New macro. + (append_insn): Use it. + (md_apply_fix): Whitespace formatting. + (md_begin, append_insn, macro, macro2, mips16_immed, mips_align, + mips16_extended_frag): Remove register specifier. + (md_convert_frag): Likewise. Use TRUE ans FALSE instead of numeric + constants. + +2006-06-21 Mark Shinwell + + * config/tc-arm.c (s_arm_unwind_save_vfp_armv6): New. Parse + a directive saving VFP registers for ARMv6 or later. + (s_arm_unwind_save): Add parameter arch_v6 and call + s_arm_unwind_save_vfp or s_arm_unwind_save_vfp_armv6 as + appropriate. + (md_pseudo_table): Add entry for new "vsave" directive. + * doc/c-arm.texi: Correct error in example for "save" + directive (fstmdf -> fstmdx). Also document "vsave" directive. + +2006-06-18 Joerg Wunsch + Anatoly Sokolov + + * config/tc-avr.c (mcu_types): Add support for atmega165p, atmega169p + and atmega644p devices. Rename atmega164/atmega324 devices to + atmega164p/atmega324p. + * doc/c-avr.texi: Document new mcu and arch options. + +2006-06-17 Nick Clifton + + * config/tc-arm.c (enum parse_operand_result): Move outside of + #ifdef OBJ_ELF so that non-ELF targeted ARM ports can build. + +2006-06-16 H.J. Lu + + * config/tc-i386.h (processor_type): New. + (arch_entry): Add type. + + * config/tc-i386.c (cpu_arch_tune): New. + (cpu_arch_tune_flags): Likewise. + (cpu_arch_isa_flags): Likewise. + (cpu_arch): Updated. + (set_cpu_arch): Also update cpu_arch_isa_flags. + (md_assemble): Update cpu_arch_isa_flags. + (OPTION_MARCH): New. + (OPTION_MTUNE): Likewise. + (md_longopts): Add -march= and -mtune=. + (md_parse_option): Support -march= and -mtune=. + (md_show_usage): Add -march=CPU/-mtune=CPU. + (i386_target_format): Also update cpu_arch_isa_flags, + cpu_arch_tune and cpu_arch_tune_flags. + + * doc/as.texinfo: Add -march=CPU/-mtune=CPU. + + * doc/c-i386.texi: Document -march=CPU/-mtune=CPU. + +2006-06-15 Mark Shinwell + + * config/tc-arm.c (enum parse_operand_result): New. + (struct group_reloc_table_entry): New. + (enum group_reloc_type): New. + (group_reloc_table): New array. + (find_group_reloc_table_entry): New function. + (parse_shifter_operand_group_reloc): New function. + (parse_address_main): New function, incorporating code + from the old parse_address function. To be used via... + (parse_address): wrapper for parse_address_main; and + (parse_address_group_reloc): new function, likewise. + (enum operand_parse_code): New codes OP_SHG, OP_ADDRGLDR, + OP_ADDRGLDRS, OP_ADDRGLDC. + (parse_operands): Support for these new operand codes. + New macro po_misc_or_fail_no_backtrack. + (encode_arm_cp_address): Preserve group relocations. + (insns): Modify to use the above operand codes where group + relocations are permitted. + (md_apply_fix): Handle the group relocations + ALU_PC_G0_NC through LDC_SB_G2. + (tc_gen_reloc): Likewise. + (arm_force_relocation): Leave group relocations for the linker. + (arm_fix_adjustable): Likewise. + +2006-06-15 Julian Brown + + * config/tc-arm.c (do_vfp_nsyn_ldr_str): Remove, fold into... + (do_neon_ldr_str): Always defer to VFP encoding routines, which handle + relocs properly. + +2006-06-12 H.J. Lu + + * config/tc-i386.c (process_suffix): Don't add rex64 for + "xchg %rax,%rax". + +2006-06-09 Thiemo Seufer + + * config/tc-mips.c (mips_ip): Maintain argument count. + +2006-06-09 Alan Modra + + * config/tc-iq2000.c: Include sb.h. + +2006-06-08 Nigel Stephens + + * config/tc-mips.c (mips_pseudo_table): Add "origin" and "repeat" + aliases for better compatibility with SGI tools. + +2006-06-08 Alan Modra + + * configure.in (BFDLIB, BFDVER_H, ALL_OBJ_DEPS): Delete. + * Makefile.am (GASLIBS): Expand @BFDLIB@. + (BFDVER_H): Delete. + (OBJS): Expand @ALL_OBJ_DEPS@. Depend on all fopen-*.h variants. + (obj-aout.o): Depend on $(DEP_@target_get_type@_aout) + (obj-coff.o, obj-ecoff.o, obj-elf.o): Similarly. + Run "make dep-am". + * dep-in.sed: Don't substitute bfdver.h. Do remove symcat.h. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + +2006-06-07 Joseph S. Myers + + * po/Make-in (pdf, ps): New dummy targets. + +2006-06-07 Julian Brown + + * config/tc-arm.c (stdarg.h): include. + (arm_it): Add uncond_value field. Add isvec and issingle to operand + array. + (arm_reg_type): Add REG_TYPE_VFSD (single or double VFP reg) and + REG_TYPE_NSDQ (single, double or quad vector reg). + (reg_expected_msgs): Update. + (BAD_FPU): Add macro for unsupported FPU instruction error. + (parse_neon_type): Support 'd' as an alias for .f64. + (parse_typed_reg_or_scalar): Support REG_TYPE_VFSD, REG_TYPE_NSDQ + sets of registers. + (parse_vfp_reg_list): Don't update first arg on error. + (parse_neon_mov): Support extra syntax for VFP moves. + (operand_parse_code): Add OP_RVSD, OP_RNSDQ, OP_VRSDLST, OP_RVSD_IO, + OP_RNSDQ_RNSC, OP_RVC_PSR, OP_APSR_RR, OP_oRNSDQ. + (parse_operands): Support isvec, issingle operands fields, new parse + codes above. + (do_vfp_nsyn_mrs, do_vfp_nsyn_msr): New functions. Support VFP mrs, + msr variants. + (do_mrs, do_msr, do_t_mrs, do_t_msr): Add support for above. + (NEON_ENC_TAB): Add vnmul, vnmla, vnmls, vcmp, vcmpz, vcmpe, vcmpez. + (NEON_ENC_SINGLE, NEON_ENC_DOUBLE): Define macros. + (NEON_SHAPE_DEF): New macro. Define table of possible instruction + shapes. + (neon_shape): Redefine in terms of above. + (neon_shape_class): New enumeration, table of shape classes. + (neon_shape_el): New enumeration. One element of a shape. + (neon_shape_el_size): Register widths of above, where appropriate. + (neon_shape_info): New struct. Info for shape table. + (neon_shape_tab): New array. + (neon_type_mask): Add N_F64, N_VFP. Update N_MAX_NONSPECIAL. + (neon_check_shape): Rewrite as... + (neon_select_shape): New function to classify instruction shapes, + driven by new table neon_shape_tab array. + (neon_quad): New function. Return 1 if shape should set Q flag in + instructions (or equivalent), 0 otherwise. + (type_chk_of_el_type): Support F64. + (el_type_of_type_chk): Likewise. + (neon_check_type): Add support for VFP type checking (VFP data + elements fill their containing registers). + (do_vfp_cond_or_thumb): Fill in condition field in ARM mode, or 0xE + in thumb mode for VFP instructions. + (do_vfp_nsyn_opcode): New function. Look up the opcode in argument, + and encode the current instruction as if it were that opcode. + (try_vfp_nsyn): New. If this looks like a VFP instruction with ARGS + arguments, call function in PFN. + (do_vfp_nsyn_add_sub, do_vfp_nsyn_mla_mls, do_vfp_nsyn_mul) + (do_vfp_nsyn_abs_neg, do_vfp_nsyn_ldm_stm, do_vfp_nsyn_ldr_str) + (do_vfp_nsyn_sqrt, do_vfp_nsyn_div, do_vfp_nsyn_nmul) + (do_vfp_nsyn_cmp, nsyn_insert_sp, do_vfp_nsyn_push) + (do_vfp_nsyn_pop, do_vfp_nsyn_cvt, do_vfp_nsyn_cvtz): New functions. + Redirect Neon-syntax VFP instructions to VFP instruction handlers. + (do_neon_dyadic_i_su, do_neon_dyadic_i64_su, do_neon_shl_imm) + (do_neon_qshl_imm, do_neon_logic, do_neon_bitfield) + (neon_dyadic_misc, neon_compare, do_neon_tst, do_neon_qdmulh) + (do_neon_fcmp_absolute, do_neon_step, do_neon_sli, do_neon_sri) + (do_neon_qshlu_imm, neon_move_immediate, do_neon_mvn, do_neon_ext) + (do_neon_rev, do_neon_dup, do_neon_rshift_round_imm, do_neon_trn) + (do_neon_zip_uzp, do_neon_sat_abs_neg, do_neon_pair_long) + (do_neon_recip_est, do_neon_cls, do_neon_clz, do_neon_cnt) + (do_neon_swp): Use neon_select_shape not neon_check_shape. Use + neon_quad. + (vfp_or_neon_is_neon): New function. Call if a mnemonic shared + between VFP and Neon turns out to belong to Neon. Perform + architecture check and fill in condition field if appropriate. + (do_neon_addsub_if_i, do_neon_mac_maybe_scalar, do_neon_abs_neg) + (do_neon_cvt): Add support for VFP variants of instructions. + (neon_cvt_flavour): Extend to cover VFP conversions. + (do_neon_mov): Rewrite to use neon_select_shape. Add support for VFP + vmov variants. + (do_neon_ldr_str): Handle single-precision VFP load/store. + (do_neon_ld_st_interleave, do_neon_ld_st_lane, do_neon_ld_dup): Use + NS_NULL not NS_IGNORE. + (opcode_tag): Add OT_csuffixF for operands which either take a + conditional suffix, or have 0xF in the condition field. + (md_assemble): Add support for OT_csuffixF. + (NCE): Replace macro with... + (NCE_tag, NCE, NCEF): New macros. + (nCE): Replace macro with... + (nCE_tag, nCE, nCEF): New macros. + (insns): Add support for VFP insns or VFP versions of insns msr, + mrs, vsqrt, vdiv, vnmul, vnmla, vnmls, vcmp, vcmpe, vpush, vpop, + vcvtz, vmul, vmla, vmls, vadd, vsub, vabs, vneg, vldm, vldmia, + vldbdb, vstm, vstmia, vstmdb, vldr, vstr, vcvt, vmov. Group shared + VFP/Neon insns together. + +2006-06-07 Alan Modra + Ladislav Michl + + * app.c: Don't include headers already included by as.h. + * as.c: Likewise. + * atof-generic.c: Likewise. + * cgen.c: Likewise. + * dwarf2dbg.c: Likewise. + * expr.c: Likewise. + * input-file.c: Likewise. + * input-scrub.c: Likewise. + * macro.c: Likewise. + * output-file.c: Likewise. + * read.c: Likewise. + * sb.c: Likewise. + * config/bfin-lex.l: Likewise. + * config/obj-coff.h: Likewise. + * config/obj-elf.h: Likewise. + * config/obj-som.h: Likewise. + * config/tc-arc.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-avr.c: Likewise. + * config/tc-bfin.c: Likewise. + * config/tc-cris.c: Likewise. + * config/tc-d10v.c: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-dlx.h: Likewise. + * config/tc-fr30.c: Likewise. + * config/tc-frv.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-ip2k.c: Likewise. + * config/tc-iq2000.c: Likewise. + * config/tc-m32c.c: Likewise. + * config/tc-m32r.c: Likewise. + * config/tc-maxq.c: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-mmix.c: Likewise. + * config/tc-mn10200.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-msp430.c: Likewise. + * config/tc-mt.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-openrisc.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-s390.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tic30.c: Likewise. + * config/tc-tic4x.c: Likewise. + * config/tc-tic54x.c: Likewise. + * config/tc-v850.c: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-xc16x.c: Likewise. + * config/tc-xstormy16.c: Likewise. + * config/tc-xtensa.c: Likewise. + * config/tc-z80.c: Likewise. + * config/tc-z8k.c: Likewise. + * macro.h: Don't include sb.h or ansidecl.h. + * sb.h: Don't include stdio.h or ansidecl.h. + * cond.c: Include sb.h. + * itbl-lex.l: Include as.h instead of other system headers. + * itbl-parse.y: Likewise. + * itbl-ops.c: Similarly. + * itbl-ops.h: Don't include as.h or ansidecl.h. + * config/bfin-defs.h: Don't include bfd.h or as.h. + * config/bfin-parse.y: Include as.h instead of other system headers. + +2006-06-06 Ben Elliston + Anton Blanchard + + * config/tc-ppc.c (parse_cpu): Handle "-mpower6". + (md_show_usage): Document it. + (ppc_setup_opcodes): Test power6 opcode flag bits. + * doc/c-ppc.texi (PowerPC-Opts): Document "-mpower6". + +2006-06-06 Thiemo Seufer + Chao-ying Fu + + * config/tc-mips.c (ISA_SUPPORTS_DSP64): New macro. + (CPU_HAS_MIPS3D, CPU_HAS_MDMX, CPU_HAS_DSP, CPU_HAS_MT): Delete. + (macro_build): Update comment. + (mips_ip): Allow DSP64 instructions for MIPS64R2. + (mips_after_parse_args): Remove uses of CPU_HAS_MIPS3D and + CPU_HAS_MDMX. + (mips_cpu_info): Fix formatting. Add MIPS_CPU_ASE_MIPS3D and + MIPS_CPU_ASE_MDMX flags for sb1. + +2006-06-05 Thiemo Seufer + + * config/tc-mips.c (macro_build): Use INSERT_OPERAND wherew + appropriate. + (mips16_macro_build): Use MIPS16_INSERT_OPERAND where appropriate. + (mips_ip): Make overflowed/underflowed constant arguments in DSP + and MT instructions a fatal error. Use INSERT_OPERAND where + appropriate. Improve warnings for break and wait code overflows. + Use symbolic constant of OP_MASK_COPZ. + (mips16_ip): Use MIPS16_INSERT_OPERAND where appropriate. + +2006-06-05 Daniel Jacobowitz + + * po/Make-in (top_builddir): Define. + +2006-06-02 Joseph S. Myers + + * doc/Makefile.am (TEXI2DVI): Define. + * doc/Makefile.in: Regenerate. + * doc/c-arc.texi: Fix typo. + +2006-06-01 Alan Modra + + * config/obj-ieee.c: Delete. + * config/obj-ieee.h: Delete. + * Makefile.am (OBJ_FORMATS): Remove ieee. + (OBJ_FORMAT_CFILES, OBJ_FORMAT_HFILES): Similarly. + (obj-ieee.o): Remove rule. + * Makefile.in: Regenerate. + * configure.in (atof): Remove tahoe. + (OBJ_MAYBE_IEEE): Don't define. + * configure: Regenerate. + * config.in: Regenerate. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2006-05-31 Daniel Jacobowitz + + * Makefile.am: Replace INTLLIBS and INTLDEPS with LIBINTL + and LIBINTL_DEP everywhere. + (INTLLIBS): Remove. + (INCLUDES, DEP_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 + + * po/es.po: Updated Spanish translation. + +2006-05-06 Denis Chertykov + + * doc/c-avr.texi: New file. + * doc/Makefile.am (CPU_DOCS): Add c-avr.texi + * doc/all.texi: Set AVR + * doc/as.texinfo: Include c-avr.texi + +2006-05-28 Jie Zhang + + * config/bfin-parse.y (check_macfunc): Loose the condition of + calling check_multiply_halfregs (). + +2006-05-25 Jie Zhang + + * config/bfin-parse.y (asm_1): Better check and deal with + vector and scalar Multiply 16-Bit Operands instructions. + +2006-05-24 Nick Clifton + + * config/tc-hppa.c: Convert to ISO C90 format. + * config/tc-hppa.h: Likewise. + +2006-05-24 Carlos O'Donell + Randolph Chung + + * config/tc-hppa.c (is_tls_gdidx, is_tls_ldidx, is_tls_dtpoff, + is_tls_ieoff, is_tls_leoff): Define. + (fix_new_hppa): Handle TLS. + (cons_fix_new_hppa): Likewise. + (pa_ip): Likewise. + (md_apply_fix): Handle TLS relocs. + * config/tc-hppa.h (hppa_fix_adjustable): Handle TLS. + +2006-05-24 Bjoern Haase + + * config/tc-avr.c: Add new cpu targets avr6, avr2560 and avr2561. + +2006-05-23 Thiemo Seufer + David Ung + Nigel Stephens + + [ gas/ChangeLog ] + * config/tc-mips.c (ISA_SUPPORTS_SMARTMIPS): Rename. + (ISA_SUPPORTS_DSP_ASE, ISA_SUPPORTS_MT_ASE, ISA_HAS_64BIT_FPRS, + ISA_HAS_MXHC1): New macros. + (HAVE_32BIT_FPRS): Use ISA_HAS_64BIT_FPRS instead of + ISA_HAS_64BIT_REGS. Formatting fixes. Improved comments. + (mips_cpu_info): Change to use combined ASE/IS_ISA flag. + (MIPS_CPU_IS_ISA, MIPS_CPU_ASE_SMARTMIPS, MIPS_CPU_ASE_DSP, + MIPS_CPU_ASE_MT, MIPS_CPU_ASE_MIPS3D, MIPS_CPU_ASE_MDMX): New defines. + (mips_after_parse_args): Change default handling of float register + size to account for 32bit code with 64bit FP. Better sanity checking + of ISA/ASE/ABI option combinations. + (s_mipsset): Support switching of GPR and FPR sizes via + .set {g,f}p={32,64,default}. Better sanity checking for .set ASE + options. + (mips_elf_final_processing): We should record the use of 64bit FP + registers in 32bit code but we don't, because ELF header flags are + a scarce ressource. + (mips_cpu_info_table): Add ASE flags for CPUs with mandatory ASE + extensions. Add 4ksc, 4kec, 4kem, 4kep, 4ksd, m4kp, 24kec, 24kef, + 24kex, 34kc, 34kf, 34kx, 25kf CPU definitions. + (mips_cpu_info_from_isa): Use MIPS_CPU_IS_ISA. + * doc/c-mips.texi: Document .set {g,f}p={32,64,default}. Document + missing -march options. Document .set arch=CPU. Move .set smartmips + to ASE page. Use @code for .set FOO examples. + +2006-05-23 Jie Zhang + + * config/tc-bfin.c (bfin_start_line_hook): Bump line counters + if needed. + +2006-05-23 Jie Zhang + + * config/bfin-defs.h (bfin_equals): Remove declaration. + * config/bfin-parse.y (asm_1): Remove "expr ASSIGN expr". + * config/tc-bfin.c (bfin_name_is_register): Remove. + (bfin_equals): Remove. + * config/tc-bfin.h (TC_EQUAL_IN_INSN): Redefine as 1. + (bfin_name_is_register): Remove declaration. + +2006-05-19 Thiemo Seufer + Nigel Stephens + + * config/tc-mipc.c (ISA_HAS_ODD_SINGLE_FPR): New define. + (mips_oddfpreg_ok): New function. + (mips_ip): Use it. + +2006-05-19 Thiemo Seufer + David Ung + + * config/tc-mips.h (tc_mips_regname_to_dw2regnum): Declare. + * config/tc-mipc.c (ABI_NEEDS_64BIT_REGS, ISA_HAS_64BIT_REGS, + ISA_HAS_DROR, ISA_HAS_ROR): Reformat. + (regname, RTYPE_MASK, RTYPE_NUM, RTYPE_FPU, RTYPE_FCC, RTYPE_VEC, + RTYPE_GP, RTYPE_CP0, RTYPE_PC, RTYPE_ACC, RTYPE_CCC, RNUM_MASK, + RWARN, GENERIC_REGISTER_NUMBERS, FPU_REGISTER_NAMES, + FPU_CONDITION_CODE_NAMES, COPROC_CONDITION_CODE_NAMES, + N32N64_SYMBOLIC_REGISTER_NAMES, O32_SYMBOLIC_REGISTER_NAMES, + SYMBOLIC_REGISTER_NAMES, MIPS16_SPECIAL_REGISTER_NAMES, + MDMX_VECTOR_REGISTER_NAMES, MIPS_DSP_ACCUMULATOR_NAMES, reg_names, + reg_names_o32, reg_names_n32n64): Define register classes. + (reg_lookup): New function, use register classes. + (md_begin): Reserve register names in the symbol table. Simplify + OBJ_ELF defines. + (mips_ip): Fix comment formatting. Handle symbolic COP0 registers. + Use reg_lookup. + (mips16_ip): Use reg_lookup. + (tc_get_register): Likewise. + (tc_mips_regname_to_dw2regnum): New function. + +2006-05-19 Thiemo Seufer + + * config/tc-arm.c, config/tc-arm.h (tc_arm_regname_to_dw2regnum): + Un-constify string argument. + * config/tc-i386.c, config/tc-i386.h (tc_x86_regname_to_dw2regnum): + Likewise. + * config/tc-m68k.c, config/tc-m68k.h (tc_m68k_regname_to_dw2regnum): + Likewise. + * config/tc-ppc.c, config/tc-ppc.h (tc_ppc_regname_to_dw2regnum): + Likewise. + * config/tc-s390.c, config/tc-s390.h (tc_s390_regname_to_dw2regnum): + Likewise. + * config/tc-sh.c, config/tc-sh.h (sh_regname_to_dw2regnum): + Likewise. + * config/tc-sparc.c, config/tc-sparc.h (sparc_regname_to_dw2regnum): + Likewise. + +2006-05-19 Nathan Sidwell + + * gas/config/tc-m68k.c (m68k_init_arch): Move checking of + cfloat/m68881 to correct architecture before using it. + +2006-05-16 Bjoern Haase + + * config/tc-avr.h (TC_VALIDATE_FIX): Allow fixups for immediate + constant values. + +2006-05-15 Paul Brook + + * config/tc-arm.c (arm_adjust_symtab): Use + bfd_is_arm_special_symbol_name. + +2006-05-15 Bob Wilson + + * config/tc-xtensa.c (is_direct_call_opcode, is_branch_jmp_to_next, + xg_assemble_vliw_tokens, xtensa_mark_narrow_branches, + xtensa_fix_short_loop_frags, is_local_forward_loop, relax_frag_immed): + Handle errors from calls to xtensa_opcode_is_* functions. + +2006-05-14 Thiemo Seufer + + * config/tc-mips.c (macro_build): Test for currently active + mips16 option. + (mips16_ip): Reject invalid opcodes. + +2006-05-11 Carlos O'Donell + + * doc/as.texinfo: Rename "Index" to "AS Index", + and "ABORT" to "ABORT (COFF)". + +2006-05-11 Paul Brook + + * config/tc-arm.c (parse_half): New function. + (operand_parse_code): Remove OP_Iffff. Add OP_HALF. + (parse_operands): Ditto. + (do_mov16): Reject invalid relocations. + (do_t_mov16): Ditto. Use Thumb reloc numbers. + (insns): Replace Iffff with HALF. + (md_apply_fix): Add MOVW and MOVT relocs. + (tc_gen_reloc): Ditto. + * doc/c-arm.texi: Document relocation operators + +2006-05-11 Paul Brook + + * config/tc-arm.c (arm_fix_adjustable): Return 0 for function symbols. + +2006-05-11 Thiemo Seufer + + * config/tc-mips.c (append_insn): Don't check the range of j or + jal addresses. + +2006-05-11 Pedro Alves + + * config/tc-arm.c (md_pcrel_from_section): Force a bias for + relocs against external symbols for WinCE targets. + (md_apply_fix): Likewise. + +2006-05-09 David Ung + + * config/tc-mips.c (append_insn): Only warn about an out-of-range + j or jal address. + +2006-05-09 Nick Clifton + + * config/tc-arm.c (arm_fix_adjustable): For COFF, convert fixups + against symbols which are not going to be placed into the symbol + table. + +2006-05-09 Ben Elliston + + * expr.c (operand): Remove `if (0 && ..)' statement and + subsequently unused target_op label. Collapse `if (1 || ..)' + statement. + * app.c (do_scrub_chars): Remove unused case 0, as it is handled + separately above the switch. + +2006-05-08 Nick Clifton + + PR gas/2623 + * config/tc-msp430.c (line_separator_character): Define as |. + +2006-05-08 Thiemo Seufer + Nigel Stephens + David Ung + + * config/tc-mips.c (mips_set_options): Add ase_smartmips flag. + (mips_opts): Likewise. + (file_ase_smartmips): New variable. + (ISA_HAS_ROR): SmartMIPS implements rotate instructions. + (macro_build): Handle SmartMIPS instructions. + (mips_ip): Likewise. + (md_longopts): Add argument handling for smartmips. + (md_parse_options, mips_after_parse_args): Likewise. + (s_mipsset): Add .set smartmips support. + (md_show_usage): Document -msmartmips/-mno-smartmips. + * doc/as.texinfo: Document -msmartmips/-mno-smartmips and + .set smartmips. + * doc/c-mips.texi: Likewise. + +2006-05-08 Alan Modra + + * write.c (relax_segment): Add pass count arg. Don't error on + negative org/space on first two passes. + (relax_seg_info): New struct. + (relax_seg, write_object_file): Adjust. + * write.h (relax_segment): Update prototype. + +2006-05-05 Julian Brown + + * config/tc-arm.c (parse_vfp_reg_list): Improve register bounds + checking. + (do_neon_mov): Enable several VMOV variants for VFP. Add suitable + architecture version checks. + (insns): Allow overlapping instructions to be used in VFP mode. + +2006-05-05 H.J. Lu + + PR gas/2598 + * config/obj-elf.c (obj_elf_change_section): Allow user + specified SHF_ALPHA_GPREL. + +2006-05-05 Bjoern Haase + + * gas/config/tc-avr.h (TC_VALIDATE_FIX): Define. Disable fixups + for PMEM related expressions. + +2006-05-05 Nick Clifton + + PR gas/2582 + * dwarf2dbg.c (INSERT_DIR_SEPARATOR): New macro. Handles the + insertion of a directory separator character into a string at a + given offset. Uses heuristics to decide when to use a backslash + character rather than a forward-slash character. + (dwarf2_directive_loc): Use the macro. + (out_debug_info): Likewise. + +2006-05-05 Thiemo Seufer + David Ung + + * config/tc-mips.c (macro_build): Add case 'k' to handle cache + instruction. + (macro): Add new case M_CACHE_AB. + +2006-05-04 Kazu Hirata + + * config/tc-arm.c (opcode_tag): Add OT_cinfix3_deprecated. + (opcode_lookup): Issue a warning for opcode with + OT_cinfix3_deprecated. Otherwise treat OT_cinfix3_deprecated + identical to OT_cinfix3. + (TxC3w, TC3w, tC3w): New. + (insns): Use tC3w and TC3w for comparison instructions with + 's' suffix. + +2006-05-04 Alan Modra + + * subsegs.h (struct frchain): Delete frch_seg. + (frchain_root): Delete. + (seg_info): Define as macro. + * subsegs.c (frchain_root): Delete. + (abs_seg_info, und_seg_info, absolute_frchain): Delete. + (subsegs_begin, subseg_change): Adjust for above. + (subseg_set_rest): Likewise. Add new frchain structs to seginfo + rather than to one big list. + (subseg_get): Don't special case abs, und sections. + (subseg_new, subseg_force_new): Don't set frchainP here. + (seg_info): Delete. + (subsegs_print_statistics): Adjust frag chain control list traversal. + * debug.c (dmp_frags): Likewise. + * dwarf2dbg.c (first_frag_for_seg): Don't start looking for frag + at frchain_root. Make use of known frchain ordering. + (last_frag_for_seg): Likewise. + (get_frag_fix): Likewise. Add seg param. + (process_entries, out_debug_aranges): Adjust get_frag_fix calls. + * write.c (chain_frchains_together_1): Adjust for struct frchain. + (SUB_SEGMENT_ALIGN): Likewise. + (subsegs_finish): Adjust frchain list traversal. + * config/tc-xtensa.c (xtensa_cleanup_align_frags): Likewise. + (xtensa_fix_target_frags, xtensa_mark_narrow_branches): Likewise. + (xtensa_mark_zcl_first_insns, xtensa_fix_a0_b_retw_frags): Likewise. + (xtensa_fix_b_j_loop_end_frags): Likewise. + (xtensa_fix_close_loop_end_frags): Likewise. + (xtensa_fix_short_loop_frags, xtensa_sanity_check): Likewise. + (retrieve_segment_info): Delete frch_seg initialisation. + +2006-05-03 Alan Modra + + * subsegs.c (subseg_get): Don't call obj_sec_set_private_data. + * config/obj-elf.h (obj_sec_set_private_data): Delete. + * config/tc-hppa.c (tc_gen_reloc): Don't use bfd_abs_symbol. + * config/tc-mn10300.c (tc_gen_reloc): Likewise. + +2006-05-02 Joseph Myers + + * config/tc-arm.c (do_iwmmxt_wldstbh): Don't multiply offset by 4 + here. + (md_apply_fix3): Multiply offset by 4 here for + BFD_RELOC_ARM_CP_OFF_IMM_S2 and BFD_RELOC_ARM_T32_CP_OFF_IMM_S2. + +2006-05-02 H.J. Lu + Jan Beulich + + * config/tc-i386.c (output_invalid_buf): Change size for + unsigned char. + * config/tc-tic30.c (output_invalid_buf): Likewise. + + * config/tc-i386.c (output_invalid): Cast none-ascii char to + unsigned char. + * config/tc-tic30.c (output_invalid): Likewise. + +2006-05-02 Daniel Jacobowitz + + * doc/Makefile.am (AM_MAKEINFOFLAGS): New. + (TEXI2POD): Use AM_MAKEINFOFLAGS. + (asconfig.texi): Don't set top_srcdir. + * doc/as.texinfo: Don't use top_srcdir. + * aclocal.m4, Makefile.in, doc/Makefile.in: Regenerated. + +2006-05-02 H.J. Lu + + * config/tc-i386.c (output_invalid_buf): Change size to 16. + * config/tc-tic30.c (output_invalid_buf): Likewise. + + * config/tc-i386.c (output_invalid): Use snprintf instead of + sprintf. + * config/tc-ia64.c (declare_register_set): Likewise. + (emit_one_bundle): Likewise. + (check_dependencies): Likewise. + * config/tc-tic30.c (output_invalid): Likewise. + +2006-05-02 Paul Brook + + * config/tc-arm.c (arm_optimize_expr): New function. + * config/tc-arm.h (md_optimize_expr): Define + (arm_optimize_expr): Add prototype. + (TC_FORCE_RELOCATION_SUB_SAME): Define. + +2006-05-02 Ben Elliston + + * config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Make single bit + field unsigned. + + * sb.h (sb_list_vector): Move to sb.c. + * sb.c (free_list): Use type of sb_list_vector directly. + (sb_build): Fix off-by-one error in assertion about `size'. + +2006-05-01 Ben Elliston + + * listing.c (listing_listing): Remove useless loop. + * macro.c (macro_expand): Remove is_positional local variable. + * read.c (s_comm_internal): Simplify `if' condition 1 || x -> 1 + and simplify surrounding expressions, where possible. + (assign_symbol): Likewise. + (s_weakref): Likewise. + * symbols.c (colon): Likewise. + +2006-05-01 James Lemke + + * subsegs.c (subseg_set_rest): Always set seginfp->frchainP if NULL. + +2006-04-30 Thiemo Seufer + David Ung + + * config/tc-mips.c (validate_mips_insn): Handling of udi cases. + (mips_immed): New table that records various handling of udi + instruction patterns. + (mips_ip): Adds udi handling. + +2006-04-28 Alan Modra + + * dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end + of list rather than beginning. + +2006-04-26 Julian Brown + + * gas/config/tc-arm.c (neon_is_quarter_float): Move, and rename to... + (is_quarter_float): Rename from above. Simplify slightly. + (parse_qfloat_immediate): Parse a "quarter precision" floating-point + number. + (parse_neon_mov): Parse floating-point constants. + (neon_qfloat_bits): Fix encoding. + (neon_cmode_for_move_imm): Tweak to use floating-point encoding in + preference to integer encoding when using the F32 type. + +2006-04-26 Julian Brown + + * config/tc-arm.c (neon_el_type): Make NT_invtype be the zero (so + zero-initialising structures containing it will lead to invalid types). + (arm_it): Add vectype to each operand. + (NTA_HASTYPE, NTA_HASINDEX): Constants used in neon_typed_alias + defined field. + (neon_typed_alias): New structure. Extra information for typed + register aliases. + (reg_entry): Add neon type info field. + (arm_reg_parse): Remove RTYPE argument (revert to previous arguments). + Break out alternative syntax for coprocessor registers, etc. into... + (arm_reg_alt_syntax): New function. Alternate syntax handling broken + out from arm_reg_parse. + (parse_neon_type): Move. Return SUCCESS/FAIL. + (first_error): New function. Call to ensure first error which occurs is + reported. + (parse_neon_operand_type): Parse exactly one type. + (NEON_ALL_LANES, NEON_INTERLEAVE_LANES): Move. + (parse_typed_reg_or_scalar): New function. Handle core of both + arm_typed_reg_parse and parse_scalar. + (arm_typed_reg_parse): Parse a register with an optional type. + (NEON_SCALAR_REG, NEON_SCALAR_INDEX): Extract parts of parse_scalar + result. + (parse_scalar): Parse a Neon scalar with optional type. + (parse_reg_list): Use first_error. + (parse_vfp_reg_list): Use arm_typed_reg_parse instead of arm_reg_parse. + (neon_alias_types_same): New function. Return true if two (alias) types + are the same. + (parse_neon_el_struct_list): Use parse_typed_reg_or_scalar. Return type + of elements. + (insert_reg_alias): Return new reg_entry not void. + (insert_neon_reg_alias): New function. Insert type/index information as + well as register for alias. + (create_neon_reg_alias): New function. Parse .dn/.qn directives and + make typed register aliases accordingly. + (s_dn, s_qn): New functions. Handle incorrectly used .dn/.qn at start + of line. + (s_unreq): Delete type information if present. + (s_arm_unwind_save_mmxwr): Remove arg 3 from arm_reg_parse calls. + (s_arm_unwind_save_mmxwcg): Likewise. + (s_arm_unwind_movsp): Likewise. + (s_arm_unwind_setfp): Likewise. + (parse_shift): Likewise. + (parse_shifter_operand): Likewise. + (parse_address): Likewise. + (parse_tb): Likewise. + (tc_arm_regname_to_dw2regnum): Likewise. + (md_pseudo_table): Add dn, qn. + (parse_neon_mov): Handle typed operands. + (parse_operands): Likewise. + (neon_type_mask): Add N_SIZ. + (N_ALLMODS): New macro. + (neon_check_shape): Fix typo in NS_DDD_QQQ case. Use first_error. + (el_type_of_type_chk): Add some safeguards. + (modify_types_allowed): Fix logic bug. + (neon_check_type): Handle operands with types. + (neon_three_same): Remove redundant optional arg handling. + (do_neon_dyadic_i64_su, do_neon_shl_imm, do_neon_qshl_imm) + (do_neon_logic, do_neon_qdmulh, do_neon_fcmp_absolute) + (do_neon_step): Adjust accordingly. + (neon_cmode_for_logic_imm): Use first_error. + (do_neon_bitfield): Call neon_check_type. + (neon_dyadic): Rename to... + (neon_dyadic_misc): ...this. New name for neon_dyadic. Add bitfield + to allow modification of type of the destination. + (do_neon_dyadic_if_su, do_neon_dyadic_if_i, do_neon_dyadic_if_i_d) + (do_neon_addsub_if_i, do_neon_mul): Adjust accordingly. + (do_neon_compare): Make destination be an untyped bitfield. + (neon_scalar_for_mul): Use NEON_SCALAR_REG, NEON_SCALAR_INDEX. + (neon_mul_mac): Return early in case of errors. + (neon_move_immediate): Use first_error. + (neon_mac_reg_scalar_long): Fix type to include scalar. + (do_neon_dup): Likewise. + (do_neon_mov): Likewise (in several places). + (do_neon_tbl_tbx): Fix type. + (do_neon_ld_st_interleave, neon_alignment_bit, do_neon_ld_st_lane) + (do_neon_ld_dup): Exit early in case of errors and/or use + first_error. + (opcode_lookup): Update for parse_neon_type returning SUCCESS/FAIL. + Handle .dn/.qn directives. + (REGDEF): Add zero for reg_entry neon field. + +2006-04-26 Julian Brown + + * config/tc-arm.c (limits.h): Include. + (fpu_arch_vfp_v3, fpu_vfp_ext_v3, fpu_neon_ext_v1) + (fpu_vfp_v3_or_neon_ext): Declare constants. + (neon_el_type): New enumeration of types for Neon vector elements. + (neon_type_el): New struct. Define type and size of a vector element. + (NEON_MAX_TYPE_ELS): Define constant. The maximum number of types per + instruction. + (neon_type): Define struct. The type of an instruction. + (arm_it): Add 'vectype' for the current instruction. + (isscalar, immisalign, regisimm, isquad): New predicates for operands. + (vfp_sp_reg_pos): Rename to... + (vfp_reg_pos): ...this, and add VFP_REG_Dd, VFP_REG_Dm, VFP_REG_Dn + tags. + (arm_reg_type): Add REG_TYPE_NQ (Neon Q register) and REG_TYPE_NDQ + (Neon D or Q register). + (reg_expected_msgs): Sync with above. Allow VFD to mean VFP or Neon D + register. + (GE_OPT_PREFIX_BIG): Define constant, for use in... + (my_get_expression): Allow above constant as argument to accept + 64-bit constants with optional prefix. + (arm_reg_parse): Add extra argument to return the specific type of + register in when either a D or Q register (REG_TYPE_NDQ) is + requested. Can be NULL. + (parse_scalar): New function. Parse Neon scalar (vector reg and index). + (parse_reg_list): Update for new arm_reg_parse args. + (parse_vfp_reg_list): Allow parsing of Neon D/Q register lists. + (parse_neon_el_struct_list): New function. Parse element/structure + register lists for VLD/VST instructions. + (s_arm_unwind_save_vfp): Update for new parse_vfp_reg_list args. + (s_arm_unwind_save_mmxwr): Likewise. + (s_arm_unwind_save_mmxwcg): Likewise. + (s_arm_unwind_movsp): Likewise. + (s_arm_unwind_setfp): Likewise. + (parse_big_immediate): New function. Parse an immediate, which may be + 64 bits wide. Put results in inst.operands[i]. + (parse_shift): Update for new arm_reg_parse args. + (parse_address): Likewise. Add parsing of alignment specifiers. + (parse_neon_mov): Parse the operands of a VMOV instruction. + (operand_parse_code): Add OP_RND, OP_RNQ, OP_RNDQ, OP_RNSC, OP_NRDLST, + OP_NSTRLST, OP_NILO, OP_RNDQ_I0, OP_RR_RNSC, OP_RNDQ_RNSC, OP_RND_RNSC, + OP_VMOV, OP_RNDQ_IMVNb, OP_RNDQ_I63b, OP_I0, OP_I16z, OP_I32z, OP_I64, + OP_I64z, OP_oI32b, OP_oRND, OP_oRNQ, OP_oRNDQ. + (parse_operands): Handle new codes above. + (encode_arm_vfp_sp_reg): Rename to... + (encode_arm_vfp_reg): ...this. Handle D regs (0-31) too. Complain if + selected VFP version only supports D0-D15. + (do_vfp_sp_monadic, do_vfp_sp_dyadic, do_vfp_sp_compare_z) + (do_vfp_dp_sp_cvt, do_vfp_reg_from_sp, do_vfp_reg2_from_sp2) + (do_vfp_sp_from_reg, do_vfp_sp2_from_reg2, do_vfp_sp_ldst) + (do_vfp_dp_ldst, vfp_sp_ldstm, vfp_dp_ldstm): Update for new + encode_arm_vfp_reg name, and allow 32 D regs. + (do_vfp_dp_rd_rm, do_vfp_dp_rn_rd, do_vfp_dp_rd_rn, do_vfp_dp_rd_rn_rm) + (do_vfp_rm_rd_rn): New functions to encode VFP insns allowing 32 D + regs. + (do_vfp_sp_const, do_vfp_dp_const, vfp_conv, do_vfp_sp_conv_16) + (do_vfp_dp_conv_16, do_vfp_sp_conv_32, do_vfp_dp_conv_32): Handle + constant-load and conversion insns introduced with VFPv3. + (neon_tab_entry): New struct. + (NEON_ENC_TAB): Bit patterns for overloaded Neon instructions, and + those which are the targets of pseudo-instructions. + (neon_opc): Enumerate opcodes, use as indices into... + (neon_enc_tab): ...this. Hold data from NEON_ENC_TAB. + (NEON_ENC_INTEGER, NEON_ENC_ARMREG, NEON_ENC_POLY, NEON_ENC_FLOAT) + (NEON_ENC_SCALAR, NEON_ENC_IMMED, NEON_ENC_INTERLV, NEON_ENC_LANE) + (NEON_ENC_DUP): Define meaningful helper macros to look up values in + neon_enc_tab. + (neon_shape): Enumerate shapes (permitted register widths, etc.) for + Neon instructions. + (neon_type_mask): New. Compact type representation for type checking. + (N_SU_ALL, N_SU_32, N_SU_16_64, N_SUF_32, N_I_ALL, N_IF_32): Common + permitted type combinations. + (N_IGNORE_TYPE): New macro. + (neon_check_shape): New function. Check an instruction shape for + multiple alternatives. Return the specific shape for the current + instruction. + (neon_modify_type_size): New function. Modify a vector type and size, + depending on the bit mask in argument 1. + (neon_type_promote): New function. Convert a given "key" type (of an + operand) into the correct type for a different operand, based on a bit + mask. + (type_chk_of_el_type): New function. Convert a type and size into the + compact representation used for type checking. + (el_type_of_type_ckh): New function. Reverse of above (only when a + single bit is set in the bit mask). + (modify_types_allowed): New function. Alter a mask of allowed types + based on a bit mask of modifications. + (neon_check_type): New function. Check the type of the current + instruction against the variable argument list. The "key" type of the + instruction is returned. + (neon_dp_fixup): New function. Fill in and modify instruction bits for + a Neon data-processing instruction depending on whether we're in ARM + mode or Thumb-2 mode. + (neon_logbits): New function. + (neon_three_same, neon_two_same, do_neon_dyadic_i_su) + (do_neon_dyadic_i64_su, neon_imm_shift, do_neon_shl_imm) + (do_neon_qshl_imm, neon_cmode_for_logic_imm, neon_bits_same_in_bytes) + (neon_squash_bits, neon_is_quarter_float, neon_qfloat_bits) + (neon_cmode_for_move_imm, neon_write_immbits, neon_invert_size) + (do_neon_logic, do_neon_bitfield, neon_dyadic, do_neon_dyadic_if_su) + (do_neon_dyadic_if_su_d, do_neon_dyadic_if_i, do_neon_dyadic_if_i_d) + (do_neon_addsub_if_i, neon_exchange_operands, neon_compare) + (do_neon_cmp, do_neon_cmp_inv, do_neon_ceq, neon_scalar_for_mul) + (neon_mul_mac, do_neon_mac_maybe_scalar, do_neon_tst, do_neon_mul) + (do_neon_qdmulh, do_neon_fcmp_absolute, do_neon_fcmp_absolute_inv) + (do_neon_step, do_neon_abs_neg, do_neon_sli, do_neon_sri) + (do_neon_qshlu_imm, do_neon_qmovn, do_neon_qmovun) + (do_neon_rshift_sat_narrow, do_neon_rshift_sat_narrow_u, do_neon_movn) + (do_neon_rshift_narrow, do_neon_shll, neon_cvt_flavour, do_neon_cvt) + (neon_move_immediate, do_neon_mvn, neon_mixed_length) + (do_neon_dyadic_long, do_neon_abal, neon_mac_reg_scalar_long) + (do_neon_mac_maybe_scalar_long, do_neon_dyadic_wide, do_neon_vmull) + (do_neon_ext, do_neon_rev, do_neon_dup, do_neon_mov) + (do_neon_rshift_round_imm, do_neon_movl, do_neon_trn, do_neon_zip_uzp) + (do_neon_sat_abs_neg, do_neon_pair_long, do_neon_recip_est) + (do_neon_cls, do_neon_clz, do_neon_cnt, do_neon_swp, do_neon_tbl_tbx) + (do_neon_ldm_stm, do_neon_ldr_str, do_neon_ld_st_interleave) + (neon_alignment_bit, do_neon_ld_st_lane, do_neon_ld_dup) + (do_neon_ldx_stx): New functions. Neon bit encoding and encoding + helpers. + (parse_neon_type): New function. Parse Neon type specifier. + (opcode_lookup): Allow parsing of Neon type specifiers. + (REGNUM2, REGSETH, REGSET2): New macros. + (reg_names): Add new VFPv3 and Neon registers. + (NUF, nUF, NCE, nCE): New macros for opcode table. + (insns): More VFP registers allowed in fcpyd, fmdhr, fmdlr, fmrdh, + fmrdl, fabsd, fnegd, fsqrtd, faddd, fsubd, fmuld, fdivd, fmacd, fmscd, + fnmuld, fnmacd, fnmscd, fcmpd, fcmpzd, fcmped, fcmpezd, fmdrr, fmrrd. + Add Neon instructions vaba, vhadd, vrhadd, vhsub, vqadd, vqsub, vrshl, + vqrshl, vshl, vqshl{u}, vand, vbic, vorr, vorn, veor, vbsl, vbit, vbif, + vabd, vmax, vmin, vcge, vcgt, vclt, vcle, vceq, vpmax, vpmin, vmla, + vmls, vpadd, vadd, vsub, vtst, vmul, vqdmulh, vqrdmulh, vacge, vacgt, + vaclt, vacle, vrecps, vrsqrts, vabs, vneg, v{r}shr, v{r}sra, vsli, + vsri, vqshrn, vq{r}shr{u}n, v{r}shrn, vshll, vcvt, vmov, vmvn, vabal, + vabdl, vaddl, vsubl, vmlal, vmlsl, vaddw, vsubw, v{r}addhn, v{r}subhn, + vqdmlal, vqdmlsl, vqdmull, vmull, vext, vrev64, vrev32, vrev16, vdup, + vmovl, v{q}movn, vzip, vuzp, vqabs, vqneg, vpadal, vpaddl, vrecpe, + vrsqrte, vcls, vclz, vcnt, vswp, vtrn, vtbl, vtbx, vldm, vstm, vldr, + vstr, vld[1234], vst[1234], fconst[sd], f[us][lh]to[sd], + fto[us][lh][sd]. + (tc_arm_regname_to_dw2regnum): Update for arm_reg_parse args. + (arm_cpu_option_table): Add Neon and VFPv3 to Cortex-A8. + (arm_option_cpu_value): Add vfp3 and neon. + (aeabi_set_public_attributes): Support VFPv3 and NEON attributes. Fix + VFPv1 attribute. + +2006-04-25 Bob Wilson + + * config/xtensa-relax.c (widen_spec_list): Use new "WIDE." + syntax instead of hardcoded opcodes with ".w18" suffixes. + (wide_branch_opcode): New. + (build_transition): Use it to check for wide branch opcodes with + either ".w18" or ".w15" suffixes. + +2006-04-25 Bob Wilson + + * config/tc-xtensa.c (xtensa_create_literal_symbol, + xg_assemble_literal, xg_assemble_literal_space): Do not set the + frag's is_literal flag. + +2006-04-25 Bob Wilson + + * config/xtensa-relax.c (XCHAL_HAVE_WIDE_BRANCHES): Provide default. + +2006-04-23 Kazu Hirata + + * config/obj-coff.c, config/tc-arm.c, config/tc-bfin.c, + config/tc-cris.c, config/tc-crx.c, config/tc-i386.c, + config/tc-ia64.c, config/tc-maxq.c, config/tc-maxq.h, + config/tc-mips.c, config/tc-msp430.c, config/tc-sh.c, + config/tc-tic4x.c, config/tc-xtensa.c: Fix comment typos. + +2005-04-20 Paul Brook + + * config/tc-arm.c (s_arm_arch, s_arm_cpu, s_arm_fpu): Enable for + all targets. + (md_pseudo_table): Enable .arch, .cpu and .fpu for all targets. + +2006-04-19 Alan Modra + + * Makefile.am (CPU_TYPES): Add maxq and mt. Sort. + (CPU_OBJ_VALID): Change sense of COFF test to default to invalid. + Make some cpus unsupported on ELF. Run "make dep-am". + * Makefile.in: Regenerate. + +2006-04-19 Alan Modra + + * configure.in (--enable-targets): Indent help message. + * configure: Regenerate. + +2006-04-18 H.J. Lu + + PR gas/2533 + * config/tc-i386.c (i386_immediate): Check illegal immediate + register operand. + +2006-04-18 Alan Modra + + * config/tc-i386.c: Formatting. + (output_disp, output_imm): ISO C90 params. + + * frags.c (frag_offset_fixed_p): Constify args. + * frags.h (frag_offset_fixed_p): Ditto. + + * config/tc-dlx.h (tc_coff_symbol_emit_hook): Delete. + (COFF_MAGIC): Delete. + + * config/tc-xc16x.h (TC_LINKRELAX_FIXUP): Delete. + +2006-04-16 Daniel Jacobowitz + + * po/POTFILES.in: Regenerated. + +2006-04-16 Mark Mitchell + + * doc/as.texinfo: Mention that some .type syntaxes are not + supported on all architectures. + +2006-04-14 Sterling Augustine + + * config/tc-xtensa.c (emit_single_op): Do not relax MOVI + instructions when such transformations have been disabled. + +2006-04-10 Sterling Augustine + + * config/tc-xtensa.c (xg_assemble_vliw_tokens): Record loop target + symbols in RELAX[_CHECK]_ALIGN_NEXT_OPCODE frags. + (xtensa_fix_close_loop_end_frags): Use the recorded values instead of + decoding the loop instructions. Remove current_offset variable. + (xtensa_fix_short_loop_frags): Likewise. + (min_bytes_to_other_loop_end): Remove current_offset argument. + +2006-04-09 Arnold Metselaar + + * config/tc-z80.c (z80_optimize_expr): Removed. + * config/tc-z80.h (z80_optimize_expr, md_optimize_expr): Removed. + +2006-04-07 Joerg Wunsch + + * gas/config/tc-avr.c (mcu_types): Add support for attiny261, + attiny461, attiny861, attiny25, attiny45, attiny85,attiny24, + attiny44, attiny84, at90pwm2, at90pwm3, atmega164, atmega324, + atmega644, atmega329, atmega3290, atmega649, atmega6490, + atmega406, atmega640, atmega1280, atmega1281, at90can32, + at90can64, at90usb646, at90usb647, at90usb1286 and + at90usb1287. + Move atmega48 and atmega88 from AVR_ISA_M8 to AVR_ISA_PWMx. + +2006-04-07 Paul Brook + + * config/tc-arm.c (parse_operands): Set default error message. + +2006-04-07 Paul Brook + + * config/tc-arm.c (parse_tb): Set inst.error before returning FAIL. + +2006-04-07 Paul Brook + + * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction. + +2006-04-07 Paul Brook + + * config/tc-arm.c (THUMB2_LOAD_BIT): Define. + (move_or_literal_pool): Handle Thumb-2 instructions. + (do_t_ldst): Call move_or_literal_pool for =N addressing modes. + +2006-04-07 Alan Modra + + PR 2512. + * config/tc-i386.c (match_template): Move 64-bit operand tests + inside loop. + +2006-04-06 Carlos O'Donell + + * 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, htmldir. + * configure: Regenerate. + * doc/Makefile.am: Add install-html and install-html-am targets. + * doc/Makefile.in: Regenerate. + +2006-04-06 Alan Modra + + * frags.c (frag_offset_fixed_p): Reinitialise offset before + second scan. + +2006-04-05 Richard Sandiford + Daniel Jacobowitz + + * config/tc-sparc.c (sparc_target_format): Handle TE_VXWORKS. + (GOTT_BASE, GOTT_INDEX): New. + (tc_gen_reloc): Don't alter relocations against GOTT_BASE and + GOTT_INDEX when generating VxWorks PIC. + * configure.tgt (sparc*-*-vxworks*): Remove this special case; + use the generic *-*-vxworks* stanza instead. + +2006-04-04 Alan Modra + + PR 997 + * frags.c (frag_offset_fixed_p): New function. + * frags.h (frag_offset_fixed_p): Declare. + * expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction. + (resolve_expression): Likewise. + +2006-04-03 Sterling Augustine + + * config/tc-xtensa.c (init_op_placement_info_table): Check for formats + of the same length but different numbers of slots. + +2006-03-30 Andreas Schwab + + * configure.in: Fix help string for --enable-targets option. + * configure: Regenerate. + +2006-03-28 Nathan Sidwell + + * gas/config/tc-m68k.c (find_cf_chip): Merge into ... + (m68k_ip): ... here. Use for all chips. Protect against buffer + overrun and avoid excessive copying. + + * config/tc-m68k.c (m68000_control_regs, m68010_control_regs, + m68020_control_regs, m68040_control_regs, m68060_control_regs, + mcf_control_regs, mcf5208_control_regs, mcf5213_control_regs, + mcf5329_control_regs, mcf5249_control_regs, mcf528x_control_regs, + mcfv4e_control_regs, m68010_control_regs): Rename and reorder to ... + (m68000_ctrl, m68010_ctrl, m68020_ctrl, m68040_ctrl, m68060_ctrl, + mcf_ctrl, mcf5208_ctrl, mcf5213_ctrl, mcf5235_ctrl, mcf5249_ctrl, + mcf5216_ctrl, mcf5250_ctrl, mcf5271_ctrl, mcf5272_ctrl, + mcf5282_ctrl, mcfv4e_ctrl): ... these. + (mcf5275_ctrl, mcf5329_ctrl, mcf5373_ctrl): New. + (struct m68k_cpu): Change chip field to control_regs. + (current_chip): Remove. + (control_regs): New. + (m68k_archs, m68k_extensions): Adjust. + (m68k_cpus): Reorder to be in cpu number order. Adjust. + (CPU_ALLOW_MC, CPU_ALLOW_NEGATION): Remove. + (find_cf_chip): Reimplement for new organization of cpu table. + (select_control_regs): Remove. + (mri_chip): Adjust. + (struct save_opts): Save control regs, not chip. + (s_save, s_restore): Adjust. + (m68k_lookup_cpu): Give deprecated warning when necessary. + (m68k_init_arch): Adjust. + (md_show_usage): Adjust for new cpu table organization. + +2006-03-25 Bernd Schmidt + + * config/bfin-defs.h (Expr_Node_Type enum): Add Expr_Node_GOT_Reloc. + * config/bfin-lex.l: Recognize GOT17M4 and FUNCDESC_GOT17M4. + * config/bfin-parse.y: Include "libbfd.h", "elf/common.h" and + "elf/bfin.h". + (GOT17M4, FUNCDESC_GOT17M4): New tokens of type . + (any_gotrel): New rule. + (got): Use it, and create Expr_Node_GOT_Reloc nodes. + * config/tc-bfin.c: Include "libbfd.h", "elf/common.h" and + "elf/bfin.h". + (DEFAULT_FLAGS, bfin_flags, bfin_pic_flag): New. + (bfin_pic_ptr): New function. + (md_pseudo_table): Add it for ".picptr". + (OPTION_FDPIC): New macro. + (md_longopts): Add -mfdpic. + (md_parse_option): Handle it. + (md_begin): Set BFD flags. + (md_apply_fix3, bfin_fix_adjustable): Handle new relocs. + (bfin_gen_ldstidxi): Adjust to match the trees that the parser gives + us for GOT relocs. + * Makefile.am (bfin-parse.o): Update dependencies. + (DEPTC_bfin_elf): Likewise. + * Makefile.in: Regenerate. + +2006-03-25 Richard Sandiford + + * config/tc-m68k.c (m68k_cpus): Change cpu_cf5208 entries to use + mcfemac instead of mcfmac. + +2006-03-23 Michael Matz + + * config/tc-i386.c (type_names): Correct placement of 'static'. + (reloc): Map some more relocs to their 64 bit counterpart when + size is 8. + (output_insn): Work around breakage if DEBUG386 is defined. + (output_disp): A BFD_RELOC_64 with GOT_symbol as operand also + needs to be mapped to BFD_RELOC_X86_64_GOTPC64 or + BFD_RELOC_X86_64_GOTPC32. Also x86-64 handles pcrel addressing + different from i386. + (output_imm): Ditto. + (lex_got): Recognize @PLTOFF and @GOTPLT. Make @GOT accept also + Imm64. + (md_convert_frag): Jumps can now be larger than 2GB away, error + out in that case. + (tc_gen_reloc): New relocs are passed through. BFD_RELOC_64 + and BFD_RELOC_64_PCREL are mapped to BFD_RELOC_X86_64_GOTPC64. + +2006-03-22 Richard Sandiford + Daniel Jacobowitz + Phil Edwards + Zack Weinberg + Mark Mitchell + Nathan Sidwell + + * config/tc-mips.c (mips_target_format): Handle vxworks targets. + (md_begin): Complain about -G being used for PIC. Don't change + the text, data and bss alignments on VxWorks. + (reloc_needs_lo_p): Don't return true for R_MIPS_GOT16 when + generating VxWorks PIC. + (load_address): Extend SVR4_PIC handling to VXWORKS_PIC. + (macro): Likewise, but do not treat la $25 specially for + VxWorks PIC, and do not handle jal. + (OPTION_MVXWORKS_PIC): New macro. + (md_longopts): Add -mvxworks-pic. + (md_parse_option): Don't complain about using PIC and -G together here. + Handle OPTION_MVXWORKS_PIC. + (md_estimate_size_before_relax): Always use the first relaxation + sequence on VxWorks. + * config/tc-mips.h (VXWORKS_PIC): New. + +2006-03-21 Paul Brook + + * config/tc-arm.c (md_apply_fix): Fix typo in offset mask. + +2006-03-21 Sterling Augustine + + * config/tc-xtensa.c (enforce_three_byte_loop_align): New flag. + (xtensa_setup_hw_workarounds): Set this new flag for older hardware. + (get_loop_align_size): New. + (xtensa_end): Skip xtensa_mark_narrow_branches when not aligning. + (xtensa_mark_zcl_first_insns): Prevent widening of first loop frag. + (get_text_align_power): Rewrite to handle inputs in the range 2-8. + (get_noop_aligned_address): Use get_loop_align_size. + (get_aligned_diff): Likewise. + +2006-03-21 Paul Brook + + * config/tc-arm.c (insns): Correct opcodes for ldrbt and strbt. + +2006-03-20 Paul Brook + + * config/tc-arm.c (BAD_BRANCH, BAD_NOT_IT): Define. + (do_t_branch): Encode branches inside IT blocks as unconditional. + (do_t_cps): New function. + (do_t_blx, do_t_bkpt, do_t_branch23, do_t_bx, do_t_bxj, do_t_cpsi, + do_t_czb, do_t_it, do_t_setend, do_t_tb): Add IT constaints. + (opcode_lookup): Allow conditional suffixes on all instructions in + Thumb mode. + (md_assemble): Advance condexec state before checking for errors. + (insns): Use do_t_cps. + +2006-03-20 Paul Brook + + * config/tc-arm.c (output_relax_insn): Call dwarf2_emit_insn before + outputting the insn. + +2006-03-18 Jan-Benedict Glaw + + * config/tc-vax.c: Update copyright year. + * config/tc-vax.h: Likewise. + +2006-03-18 Jan-Benedict Glaw + + * config/tc-vax.c (md_chars_to_number): Used only locally, so + make it static. + * config/tc-vax.h (md_chars_to_number): Remove obsolete declaration. + +2006-03-17 Paul Brook + + * config/tc-arm.c (insns): Add ldm and stm. + +2006-03-17 Ben Elliston + + PR gas/2446 + * doc/as.texinfo (Ident): Document this directive more thoroughly. + +2006-03-16 Paul Brook + + * config/tc-arm.c (insns): Add "svc". + +2006-03-13 Bob Wilson + + * config/tc-xtensa.c (xg_translate_sysreg_op): Remove has_underbar + flag and avoid double underscore prefixes. + +2006-03-10 Paul Brook + + * config/tc-arm.c (md_begin): Handle EABIv5. + (arm_eabis): Add EF_ARM_EABI_VER5. + * doc/c-arm.texi: Document -meabi=5. + +2006-03-10 Ben Elliston + + * app.c (do_scrub_chars): Simplify string handling. + +2006-03-07 Richard Sandiford + Daniel Jacobowitz + Zack Weinberg + Nathan Sidwell + Paul Brook + Ricardo Anguiano + Phil Edwards + + * config/tc-arm.c (md_apply_fix): Install a value of zero into a + BFD_RELOC_ARM_OFFSET_IMM field if we're going to generate a RELA + R_ARM_ABS12 reloc. + (tc_gen_reloc): Keep the original fx_offset for RELA pc-relative + relocs, but adjust by md_pcrel_from_section. Create R_ARM_ABS12 + relocations for BFD_RELOC_ARM_OFFSET_IMM on RELA targets. + +2006-03-06 Bob Wilson + + * config/tc-xtensa.c (xtensa_post_relax_hook): Generate literal tables + even when using the text-section-literals option. + +2006-03-06 Nathan Sidwell + + * config/tc-m68k.c (m68k_extensions): Allow 'float' on both m68k + and cf. + (m68k_ip): Check we have some control regs. + (md_parse_option): Allow raw arch switch. + (m68k_init_arch): Better detection of arch/cpu mismatch. Detect + whether 68881 or cfloat was meant by -mfloat. + (md_show_usage): Adjust extension display. + (m68k_elf_final_processing): Adjust. + +2006-03-03 Bjoern Haase + + * config/tc-avr.c (avr_mod_hash_value): New function. + (md_apply_fix, exp_mod): Use BFD_RELOC_HH8_LDI and + BFD_RELOC_MS8_LDI for hlo8() and hhi8() + (md_begin): Set linkrelax variable to 1, use avr_mod_hash_value + instead of int avr_ldi_expression: use avr_mod_hash_value instead + of (int). + (tc_gen_reloc): Handle substractions of symbols, if possible do + fixups, abort otherwise. + * config/tc-avr.h (TC_LINKRELAX_FIXUP, TC_VALIDATE_FIX, + tc_fix_adjustable): Define. + +2006-03-02 James E Wilson + + * config/tc-ia64.c (emit_one_bundle): For IA64_OPCODE_LAST, if we + change the template, then clear md.slot[curr].end_of_insn_group. + +2006-02-28 Jan Beulich + + * macro.c (get_any_string): Don't insert quotes for <>-quoted input. + +2006-02-28 Jan Beulich + + PR/1070 + * macro.c (getstring): Don't treat parentheses special anymore. + (get_any_string): Don't consider '(' and ')' as quoting anymore. + Special-case '(', ')', '[', and ']' when dealing with non-quoting + characters. + +2006-02-28 Mat + + * dwarf2dbg.c (get_filenum): Don't inadvertently decrease files_in_use. + +2006-02-27 Jakub Jelinek + + * dw2gencfi.c (struct fde_entry, struct cie_entry): Add signal_frame + field. + (CFI_signal_frame): Define. + (cfi_pseudo_table): Add .cfi_signal_frame. + (dot_cfi): Handle CFI_signal_frame. + (output_cie): Handle cie->signal_frame. + (select_cie_for_fde): Don't share CIE if signal_frame flag is + different. Copy signal_frame from FDE to newly created CIE. + * doc/as.texinfo: Document .cfi_signal_frame. + +2006-02-27 Carlos O'Donell + + * doc/Makefile.am: Add html target. + * doc/Makefile.in: Regenerate. + * po/Make-in: Add html target. + +2006-02-27 H.J. Lu + + * config/tc-i386.c (output_insn): Support Intel Merom New + Instructions. + + * config/tc-i386.h (CpuMNI): New. + (CpuUnknownFlags): Add CpuMNI. + +2006-02-24 David S. Miller + + * config/tc-sparc.c (priv_reg_table): Add entry for "gl". + (hpriv_reg_table): New table for hyperprivileged registers. + (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged + register encoding. + +2006-02-24 DJ Delorie + + * config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix. + (tc_gen_reloc): Don't define. + * config/tc-m32c.c (rl_for, relaxable): New convenience macros. + (OPTION_LINKRELAX): New. + (md_longopts): Add it. + (m32c_relax): New. + (md_parse_options): Set it. + (md_assemble): Emit relaxation relocs as needed. + (md_convert_frag): Emit relaxation relocs as needed. + (md_cgen_lookup_reloc): Add LAB_8_8 and LAB_8_16. + (m32c_apply_fix): New. + (tc_gen_reloc): New. + (m32c_force_relocation): Force out jump relocs when relaxing. + (m32c_fix_adjustable): Return false if relaxing. + +2006-02-24 Paul Brook + + * config/arm/tc-arm.c (arm_ext_v6_notm, arm_ext_div, arm_ext_v7, + arm_ext_v7a, arm_ext_v7r, arm_ext_v7m): New variables. + (struct asm_barrier_opt): Define. + (arm_v7m_psr_hsh, arm_barrier_opt_hsh): New variables. + (parse_psr): Accept V7M psr names. + (parse_barrier): New function. + (enum operand_parse_code): Add OP_oBARRIER. + (parse_operands): Implement OP_oBARRIER. + (do_barrier): New function. + (do_dbg, do_pli, do_t_barrier, do_t_dbg, do_t_div): New functions. + (do_t_cpsi): Add V7M restrictions. + (do_t_mrs, do_t_msr): Validate V7M variants. + (md_assemble): Check for NULL variants. + (v7m_psrs, barrier_opt_names): New tables. + (insns): Add V7 instructions. Mark V6 instructions absent from V7M. + (md_begin): Initialize arm_v7m_psr_hsh and arm_barrier_opt_hsh. + (arm_cpu_option_table): Add Cortex-M3, R4 and A8. + (arm_arch_option_table): Add armv7, armv7a, armv7r and armv7m. + (struct cpu_arch_ver_table): Define. + (cpu_arch_ver): New. + (aeabi_set_public_attributes): Use cpu_arch_ver. Set + Tag_CPU_arch_profile. + * doc/c-arm.texi: Document new cpu and arch options. + +2006-02-23 H.J. Lu + + * config/tc-ia64.c (operand_match): Handle IA64_OPND_IMMU5b. + +2006-02-23 H.J. Lu + + * config/tc-ia64.c: Update copyright years. + +2006-02-22 H.J. Lu + + * config/tc-ia64.c (specify_resource): Add the rule 17 from + SDM 2.2. + +2005-02-22 Paul Brook + + * config/tc-arm.c (do_pld): Remove incorrect write to + inst.instruction. + (encode_thumb32_addr_mode): Use correct operand. + +2006-02-21 Paul Brook + + * config/tc-arm.c (md_apply_fix): Fix off-by-one errors. + +2006-02-17 Shrirang Khisti + Anil Paranjape + Shilin Shakti + + * Makefile.am: Add xc16x related entry. + * Makefile.in: Regenerate. + * configure.in: Added xc16x related entry. + * configure: Regenerate. + * config/tc-xc16x.h: New file + * config/tc-xc16x.c: New file + * doc/c-xc16x.texi: New file for xc16x + * doc/all.texi: Entry for xc16x + * doc/Makefile.texi: Added c-xc16x.texi + * NEWS: Announce the support for the new target. + +2006-02-16 Nick Hudson + + * configure.tgt: set emulation for mips-*-netbsd* + +2006-02-14 Jakub Jelinek + + * config.in: Rebuilt. + +2006-02-13 Bob Wilson + + * config/tc-xtensa.c (xg_add_opcode_fix): Number operands starting + from 1, not 0, in error messages. + (md_assemble): Simplify special-case check for ENTRY instructions. + (tinsn_has_invalid_symbolic_operands): Do not include opcode and + operand in error message. + +2006-02-13 Joseph S. Myers + + * configure.tgt (arm-*-linux-gnueabi*): Change to + arm-*-linux-*eabi*. + +2006-02-10 Nick Clifton + + * config/tc-crx.c (check_range): Ensure that the sign bit of a + 32-bit value is propagated into the upper bits of a 64-bit long. + + * config/tc-arc.c (init_opcode_tables): Fix cast. + (arc_extoper, md_operand): Likewise. + +2006-02-09 David Heine + + * config/tc-xtensa.c (xg_assembly_relax): Increment steps_taken for + each relaxation step. + +2006-02-09 Eric Botcazou + + * configure.in (CHECK_DECLS): Add vsnprintf. + * configure: Regenerate. + * messages.c (errno.h, stdarg.h, varargs.h, va_list): Do not + include/declare here, but... + * as.h: Move code detecting VARARGS idiom to the top. + (errno.h, stdarg.h, varargs.h, va_list): ...here. + (vsnprintf): Declare if not already declared. + +2006-02-08 H.J. Lu + + * as.c (close_output_file): New. + (main): Register close_output_file with xatexit before + dump_statistics. Don't call output_file_close. + +2006-02-07 Nathan Sidwell + + * config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs, + mcf5329_control_regs): New. + (not_current_architecture, selected_arch, selected_cpu): New. + (m68k_archs, m68k_extensions): New. + (archs): Renamed to ... + (m68k_cpus): ... here. Adjust. + (n_arches): Remove. + (md_pseudo_table): Add arch and cpu directives. + (find_cf_chip, m68k_ip): Adjust table scanning. + (no_68851, no_68881): Remove. + (md_assemble): Lazily initialize. + (select_control_regs): Adjust cpu names. Add 5208, 5213, 5329. + (md_init_after_args): Move functionality to m68k_init_arch. + (mri_chip): Adjust table scanning. + (md_parse_option): Reimplement 'm' processing to add -march & -mcpu + options with saner parsing. + (m68k_lookup_cpu, m68k_set_arch, m68k_set_cpu, m68k_set_extension, + m68k_init_arch): New. + (s_m68k_cpu, s_m68k_arch): New. + (md_show_usage): Adjust. + (m68k_elf_final_processing): Set CF EF flags. + * config/tc-m68k.h (m68k_init_after_args): Remove. + (tc_init_after_args): Remove. + * doc/c-m68k.texi (M68K-Opts): Document -march, -mcpu options. + (M68k-Directives): Document .arch and .cpu directives. + +2006-02-05 Arnold Metselaar + + * config/tc-z80.c (z80_start_line_hook): allow .equ and .defl as + synonyms for equ and defl. + (z80_cons_fix_new): New function. + (emit_byte): Disallow relative jumps to absolute locations. + (emit_data): Only handle defb, prototype changed, because defb is + now handled as pseudo-op rather than an instruction. + (instab): Entries for defb,defw,db,dw moved from here... + (md_pseudo_table): ... to here, use generic cons() for defw,dw. + Add entries for def24,def32,d24,d32. + (md_assemble): Improved error handling. + (md_apply_fix): New case BFD_RELOC_24, set fixP->fx_no_overflow to one. + * config/tc-z80.h (TC_CONS_FIX_NEW): Define. + (z80_cons_fix_new): Declare. + * doc/c-z80.texi (defb, db): Mention warning on overflow. + (def24,d24,def32,d32): New pseudo-ops. + +2006-02-02 Paul Brook + + * config/tc-arm.c (do_shift): Remove Thumb-1 constraint. + +2005-02-02 Paul Brook + + * config/tc-arm.c (T2_OPCODE_MASK, T2_DATA_OP_SHIFT, T2_OPCODE_AND, + T2_OPCODE_BIC, T2_OPCODE_ORR, T2_OPCODE_ORN, T2_OPCODE_EOR, + T2_OPCODE_ADD, T2_OPCODE_ADC, T2_OPCODE_SBC, T2_OPCODE_SUB, + T2_OPCODE_RSB): Define. + (thumb32_negate_data_op): New function. + (md_apply_fix): Use it. + +2006-01-31 Bob Wilson + + * config/xtensa-istack.h (TInsn): Remove record_fix and sub_symbol + fields. + * config/tc-xtensa.h (xtensa_frag_type): Remove slot_sub_symbols field. + * config/tc-xtensa.c (md_apply_fix): Check for unexpected uses of + subtracted symbols. + (relaxation_requirements): Add pfinish_frag argument and use it to + replace setting tinsn->record_fix fields. + (xg_assemble_vliw_tokens): Adjust calls to relaxation_requirements + and vinsn_to_insnbuf. Remove references to record_fix and + slot_sub_symbols fields. + (xtensa_mark_narrow_branches): Delete unused code. + (is_narrow_branch_guaranteed_in_range): Handle expr that is not just + a symbol. + (convert_frag_immed): Adjust vinsn_to_insnbuf call and do not set + record_fix fields. + (tinsn_immed_from_frag): Remove code for handling slot_sub_symbols. + (vinsn_to_insnbuf): Change use of record_fixup argument, replacing use + of the record_fix field. Simplify error messages for unexpected + symbolic operands. + (set_expr_symbol_offset_diff): Delete. + +2006-01-31 Paul Brook + + * config/tc-arm.c (arm_reg_parse): Check if reg is non-NULL. + +2006-01-31 Paul Brook + Richard Earnshaw + + * config/tc-arm.c: Use arm_feature_set. + (arm_ext_*, arm_arch_full, arm_arch_t2, arm_arch_none, + arm_cext_iwmmxt, arm_cext_xscale, arm_cext_maverick, fpu_fpa_ext_v1, + fpu_fpa_ext_v2, fpu_vfp_ext_v1xd, fpu_vfp_ext_v1, fpu_vfp_ext_v2): + New variables. + (insns): Use them. + (md_atof, opcode_select, opcode_select, md_assemble, md_assemble, + md_begin, arm_parse_extension, arm_parse_cpu, arm_parse_arch, + arm_parse_fpu, arm_parse_float_abi, aeabi_set_public_attributes, + s_arm_cpu, s_arm_arch, s_arm_fpu): Use macros for accessing CPU + feature flags. + (arm_legacy_option_table, arm_option_cpu_value_table): New types. + (arm_opts): Move old cpu/arch options from here... + (arm_legacy_opts): ... to here. + (md_parse_option): Search arm_legacy_opts. + (arm_cpus, arm_archs, arm_extensions, arm_fpus) + (arm_float_abis, arm_eabis): Make const. + +2006-01-25 Bob Wilson + + * config/tc-xtensa.c (md_apply_fix): Set value to zero for PLT relocs. + +2006-01-21 Jie Zhang + + * config/bfin-parse.y (asm_1): Check value range for 16 bit immediate + in load immediate intruction. + +2006-01-21 Jie Zhang + + * config/bfin-parse.y (value_match): Use correct conversion + specifications in template string for __FILE__ and __LINE__. + (binary): Ditto. + (unary): Ditto. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * config/tc-i386.c (tc_i386_fix_adjustable): Handle + BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC_CALL, + BFD_RELOC_X86_64_GOTPC32_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL. + (optimize_disp): Emit fix up for BFD_RELOC_386_TLS_DESC_CALL and + BFD_RELOC_X86_64_TLSDESC_CALL immediately, and clear the + displacement bits. + (build_modrm_byte): Set up zero modrm for TLS desc calls. + (lex_got): Handle @tlsdesc and @tlscall. + (md_apply_fix, tc_gen_reloc): Handle the new relocations. + +2006-01-11 Nick Clifton + + Fixes for building on 64-bit hosts: + * config/tc-avr.c (mod_index): New union to allow conversion + between pointers and integers. + (md_begin, avr_ldi_expression): Use it. + * config/tc-i370.c (md_assemble): Add cast for argument to print + statement. + * config/tc-tic54x.c (subsym_substitute): Likewise. + * config/tc-mn10200.c (md_assemble): Use a union to convert the + opindex field of fr_cgen structure into a pointer so that it can + be stored in a frag. + * config/tc-mn10300.c (md_assemble): Likewise. + * config/tc-frv.c (frv_debug_tomcat): Use %p to print pointer + types. + * config/tc-v850.c: Replace uses of (int) casts with correct + types. + +2006-01-09 H.J. Lu + + PR gas/2117 + * symbols.c (snapshot_symbol): Don't change a defined symbol. + +2006-01-03 Hans-Peter Nilsson + + PR gas/2101 + * config/tc-mmix.c (mmix_handle_mmixal): Don't treat #[0-9][FB] as + a local-label reference. + +For older changes see ChangeLog-2005 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/gas/Makefile.am b/contrib/binutils/gas/Makefile.am index 08b9842fc6b..670423660d0 100644 --- a/contrib/binutils/gas/Makefile.am +++ b/contrib/binutils/gas/Makefile.am @@ -1,9 +1,7 @@ ## Process this file with automake to generate Makefile.in -## Work around apparent automake bug. -INTLLIBS = @INTLLIBS@ - AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po # Automake should figure this out on its own. It doesn't, because @@ -15,6 +13,10 @@ tooldir = $(exec_prefix)/$(target_alias) YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` +# We have to set this, because autoconf 2.59 does not substitute YFLAGS. +# Autoconf 2.61 does, so this can be removed when we upgrade. +YFLAGS = + WARN_CFLAGS = @WARN_CFLAGS@ NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) @@ -33,7 +35,7 @@ ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c ATOF_TARG_O = atof-@atof@.o # use @target_cpu_type@ for refering to configured target name -IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h +IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o @@ -46,6 +48,7 @@ CPU_TYPES = \ arm \ avr \ bfin \ + cr16 \ cris \ crx \ d10v \ @@ -55,22 +58,25 @@ CPU_TYPES = \ frv \ h8300 \ hppa \ - ia64 \ i370 \ i386 \ i860 \ i960 \ + ia64 \ ip2k \ m32c \ m32r \ m68hc11 \ m68k \ + maxq \ mcore \ + mep \ mips \ mmix \ mn10200 \ mn10300 \ msp430 \ + mt \ ns32k \ openrisc \ or32 \ @@ -78,16 +84,18 @@ CPU_TYPES = \ pj \ ppc \ s390 \ + score \ sh \ sh64 \ sparc \ + spu \ tic30 \ tic4x \ tic54x \ - vax \ v850 \ - xstormy16 \ + vax \ xc16x \ + xstormy16 \ xtensa \ z80 \ z8k @@ -100,8 +108,7 @@ OBJ_FORMATS = \ coff \ ecoff \ elf \ - evax \ - ieee + evax # This is an sh case which sets valid according to whether the CPU # type in the shell variable c and the OS type in the shell variable o @@ -116,16 +123,20 @@ CPU_OBJ_VALID = \ arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \ valid=yes ;; \ esac ;; \ - coff) valid=yes; \ + coff) \ case $$c in \ - cris | i860 | mmix | sh64) \ - valid= ;; \ + arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \ + | ppc | sh | sparc | tic* | xscale | z80 | z8k) \ + valid=yes ;; \ esac ;; \ ecoff) \ case $$c in \ mips | alpha) valid=yes ;; \ esac ;; \ - elf) valid=yes ;; \ + elf) valid=yes ; \ + case $$c in \ + maxq | ns32k | tic* | z80 | z8k) valid= ;; \ + esac ;; \ evax) \ case $$c in \ alpha) valid=yes ;; \ @@ -230,6 +241,7 @@ TARGET_CPU_CFILES = \ config/tc-arm.c \ config/tc-avr.c \ config/tc-bfin.c \ + config/tc-cr16.c \ config/tc-cris.c \ config/tc-crx.c \ config/tc-d10v.c \ @@ -250,6 +262,7 @@ TARGET_CPU_CFILES = \ config/tc-m68hc11.c \ config/tc-m68k.c \ config/tc-mcore.c \ + config/tc-mep.c \ config/tc-mips.c \ config/tc-mmix.c \ config/tc-mn10200.c \ @@ -262,9 +275,11 @@ TARGET_CPU_CFILES = \ config/tc-pj.c \ config/tc-ppc.c \ config/tc-s390.c \ + config/tc-score.c \ config/tc-sh.c \ config/tc-sh64.c \ config/tc-sparc.c \ + config/tc-spu.c \ config/tc-tic30.c \ config/tc-tic54x.c \ config/tc-vax.c \ @@ -281,6 +296,7 @@ TARGET_CPU_HFILES = \ config/tc-arm.h \ config/tc-avr.h \ config/tc-bfin.h \ + config/tc-cr16.h \ config/tc-cris.h \ config/tc-crx.h \ config/tc-d10v.h \ @@ -301,6 +317,7 @@ TARGET_CPU_HFILES = \ config/tc-m68hc11.h \ config/tc-m68k.h \ config/tc-mcore.h \ + config/tc-mep.h \ config/tc-mips.h \ config/tc-mmix.h \ config/tc-mn10200.h \ @@ -313,9 +330,11 @@ TARGET_CPU_HFILES = \ config/tc-pj.h \ config/tc-ppc.h \ config/tc-s390.h \ + config/tc-score.h \ config/tc-sh.h \ config/tc-sh64.h \ config/tc-sparc.h \ + config/tc-spu.h \ config/tc-tic30.h \ config/tc-tic54x.h \ config/tc-vax.h \ @@ -334,7 +353,6 @@ OBJ_FORMAT_CFILES = \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ - config/obj-ieee.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ @@ -343,7 +361,6 @@ OBJ_FORMAT_HFILES = \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ - config/obj-ieee.h \ config/obj-som.h # Emulation header files in config @@ -381,7 +398,8 @@ TARG_ENV_HFILES = \ config/te-sun3.h \ config/te-svr4.h \ config/te-symbian.h \ - config/te-tmips.h + config/te-tmips.h \ + config/te-wince-pe.h # Multi files in config @@ -464,13 +482,18 @@ INCDIR = $(BASEDIR)/include # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation # subdirectory rather than in the source directory. -INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(datadir)/locale\"" +INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \ + -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" # This should be parallel to INCLUDES, but should replace $(srcdir) # with $${srcdir}, and should work in a subdirectory. This is used # when building dependencies, because the dependency building is done # in a subdirectory. -DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(datadir)/locale\"" +DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd \ + -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. \ + -I$${srcdir}/../bfd @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" DEP_FLAGS = -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) @@ -478,25 +501,22 @@ DEP_FLAGS = -DOBJ_MAYBE_ELF \ # How to link with both our special library facilities # and the system's installed libraries. -GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a +GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) -BFDVER_H = @BFDVER_H@ - -$(OBJS): @ALL_OBJ_DEPS@ - as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) + $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLDEPS) + $(extra_objects) $(GASLIBS) $(LIBINTL_DEP) # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. -$(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - $(INCDIR)/progress.h $(INCDIR)/fopen-same.h \ +$(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/fopen-bin.h $(INCDIR)/fopen-vms.h \ $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \ as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \ frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h @@ -540,18 +560,16 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ # We need all these explicit rules for the multi stuff. Because of # these rules, we don't need one for OBJ_FORMAT_O. -obj-aout.o : $(srcdir)/config/obj-aout.c +obj-aout.o : $(srcdir)/config/obj-aout.c $(DEP_@target_cpu_type@_aout) $(COMPILE) -c $(srcdir)/config/obj-aout.c -obj-coff.o: $(srcdir)/config/obj-coff.c +obj-coff.o: $(srcdir)/config/obj-coff.c $(DEP_@target_cpu_type@_coff) $(COMPILE) -c $(srcdir)/config/obj-coff.c -obj-ecoff.o : $(srcdir)/config/obj-ecoff.c +obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(DEP_@target_cpu_type@_ecoff) $(COMPILE) -c $(srcdir)/config/obj-ecoff.c -obj-elf.o : $(srcdir)/config/obj-elf.c +obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf) $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c -obj-ieee.o : $(srcdir)/config/obj-ieee.c - $(COMPILE) -c $(srcdir)/config/obj-ieee.c obj-multi.o : $(srcdir)/config/obj-multi.c $(COMPILE) -c $(srcdir)/config/obj-multi.c obj-som.o : $(srcdir)/config/obj-som.c @@ -602,7 +620,7 @@ m68k-parse.c: $(srcdir)/config/m68k-parse.y rm -f m68k-parse.y; \ else true; fi # 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. m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h $(COMPILE) -c $< $(NO_WERROR) @@ -629,12 +647,12 @@ bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h itbl-lex.c: $(srcdir)/itbl-lex.l # 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. itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) # 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. itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) @@ -988,582 +1006,443 @@ dep-am: DEP .PHONY: dep dep-in dep-am AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ +DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c +DEPTC_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c +DEPTC_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h -DEPTC_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h -DEPTC_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h -DEPTC_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ +DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h +DEPTC_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h -DEPTC_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h +DEPTC_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h dwarf2dbg.h +DEPTC_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/avr.h -DEPTC_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h dwarf2dbg.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h \ - $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h -DEPTC_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h struc-symbol.h $(srcdir)/config/bfin-defs.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(srcdir)/config/bfin-aux.h \ - $(INCDIR)/opcode/bfin.h $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h -DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + struc-symbol.h $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h \ + $(INCDIR)/elf/reloc-macros.h $(srcdir)/config/bfin-aux.h \ + $(srcdir)/config/bfin-defs.h $(INCDIR)/opcode/bfin.h +DEPTC_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/cr16.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h +DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h \ + dwarf2dbg.h +DEPTC_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/cris.h -DEPTC_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/opcode/crx.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/crx.h \ +DEPTC_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/crx.h \ $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ + dwarf2dbg.h $(srcdir)/config/tc-dlx.h $(INCDIR)/opcode/dlx.h +DEPTC_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d30v.h -DEPTC_dlx_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/dlx.h -DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-dlx.h dwarf2dbg.h $(INCDIR)/opcode/dlx.h -DEPTC_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/fr30-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/fr30-opc.h cgen.h -DEPTC_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ - cgen.h -DEPTC_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ + $(srcdir)/../opcodes/fr30-opc.h cgen.h +DEPTC_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/frv-opc.h \ cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h -DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \ - $(INCDIR)/hashtab.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h -DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ - $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h -DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ +DEPTC_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + dwarf2dbg.h $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h +DEPTC_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h -DEPTC_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ +DEPTC_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ - dwarf2dbg.h -DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h -DEPTC_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h dwarf2dbg.h +DEPTC_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h +DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h -DEPTC_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ +DEPTC_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i960.h -DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \ +DEPTC_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h +DEPTC_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/ip2k-opc.h \ cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/ip2k.h \ $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/ip2k.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32c-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32c-opc.h \ - $(srcdir)/../opcodes/cgen-types.h $(srcdir)/../opcodes/cgen-ops.h \ - cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h -DEPTC_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/m32c-opc.h $(srcdir)/../opcodes/cgen-types.h \ - $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h -DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32r-desc.h \ +DEPTC_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/m32c-opc.h \ + $(srcdir)/../opcodes/cgen-types.h ../bfd/bfd_stdint.h \ + $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/m32c.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/safe-ctype.h +DEPTC_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ $(srcdir)/../opcodes/m32r-opc.h cgen.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ - cgen.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h -DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h \ - $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h -DEPTC_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/m68hc11.h $(INCDIR)/elf/m68hc11.h \ +DEPTC_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h -DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - subsegs.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h -DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h +DEPTC_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/safe-ctype.h -DEPTC_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ +DEPTC_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/opcode/maxq.h +DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/mcore-opc.h $(INCDIR)/safe-ctype.h +DEPTC_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h +DEPTC_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mep-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mep-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h +DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \ dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h +DEPTC_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h +DEPTC_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h \ + itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(srcdir)/config/obj-elf.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ +DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \ - $(INCDIR)/safe-ctype.h -DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h -DEPTC_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/obstack.h +DEPTC_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10200.h -DEPTC_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ - dwarf2dbg.h -DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/mn10300.h -DEPTC_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/msp430.h $(INCDIR)/safe-ctype.h dwarf2dbg.h -DEPTC_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ - $(INCDIR)/safe-ctype.h -DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ +DEPTC_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h +DEPTC_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mt-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mt-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ $(INCDIR)/obstack.h -DEPTC_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/openrisc-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \ - cgen.h -DEPTC_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ +DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/openrisc-opc.h cgen.h -DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-or32.h dwarf2dbg.h $(INCDIR)/opcode/or32.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h -DEPTC_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h -DEPTC_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pdp11.h -DEPTC_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h -DEPTC_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pj.h -DEPTC_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h -DEPTC_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h -DEPTC_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h -DEPTC_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h -DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -DEPTC_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ - $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h -DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h -DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h -DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h -DEPTC_tic4x_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-tic4x.h dwarf2dbg.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h -DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h sb.h macro.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h -DEPTC_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h sb.h macro.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h -DEPTC_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/vax.h -DEPTC_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ - $(INCDIR)/obstack.h subsegs.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/vax.h -DEPTC_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - subsegs.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h -DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h dwarf2dbg.h -DEPTC_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h -DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xstormy16-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/openrisc-opc.h \ cgen.h -DEPTC_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h +DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ + dwarf2dbg.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ + $(INCDIR)/elf/reloc-macros.h +DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/pdp11.h +DEPTC_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h +DEPTC_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h +DEPTC_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/ppc.h +DEPTC_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h +DEPTC_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h +DEPTC_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/score-inst.h $(INCDIR)/opcode/score-datadep.h \ + struc-symbol.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h +DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ + $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h +DEPTC_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h +DEPTC_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/spu-insns.h +DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h +DEPTC_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h +DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h +DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + sb.h macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ + $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h +DEPTC_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \ + dwarf2dbg.h +DEPTC_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/vax.h +DEPTC_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h +DEPTC_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ + $(srcdir)/../opcodes/xc16x-opc.h cgen.h dwarf2dbg.h \ + $(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h +DEPTC_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xstormy16-opc.h cgen.h -DEPTC_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xc16x-opc.h cgen.h -DEPTC_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h sb.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/xstormy16-opc.h \ + cgen.h +DEPTC_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/tc-xtensa.h subsegs.h $(INCDIR)/obstack.h \ $(srcdir)/config/xtensa-relax.h $(srcdir)/config/xtensa-istack.h \ - dwarf2dbg.h struc-symbol.h -DEPTC_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h -DEPTC_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h -DEPTC_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h -DEPTC_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h + dwarf2dbg.h struc-symbol.h $(INCDIR)/xtensa-config.h +DEPTC_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h +DEPTC_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/../opcodes/z8k-opc.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ $(BFDDIR)/som.h @@ -1572,483 +1451,364 @@ DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h -DEPOBJ_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h -DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_dlx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-dlx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_dlx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h -DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_or32_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_or32_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic4x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic4x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ +DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h -DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + $(BFDDIR)/libecoff.h +DEPOBJ_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ +DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h +DEPOBJ_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/aout/aout64.h +DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h +DEPOBJ_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(BFDDIR)/libecoff.h +DEPOBJ_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h +DEPOBJ_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h +DEPOBJ_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h +DEPOBJ_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h +DEPOBJ_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h +DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def @@ -2057,354 +1817,309 @@ DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf) -DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h +DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h -DEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_arc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h +DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_arm_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h -DEP_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_avr_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h -DEP_bfin_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-bfin.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h +DEP_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_cris_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h -DEP_crx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-crx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_crx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h -DEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h -DEP_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h -DEP_dlx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h -DEP_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h -DEP_frv_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_frv_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h +DEP_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h +DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h +DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h -DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h -DEP_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/symcat.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h -DEP_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_i370_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h +DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h +DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h +DEP_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h -DEP_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h -DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h -DEP_ip2k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ip2k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ +DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h +DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h -DEP_m32c_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32c.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h -DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h -DEP_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h +DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h +DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h +DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h +DEP_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h +DEP_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h -DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h -DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h -DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h -DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h +DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h +DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h -DEP_openrisc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-openrisc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h +DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_or32_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h -DEP_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_pj_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h +DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h -DEP_s390_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-s390.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_s390_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h +DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h +DEP_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h -DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h +DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h +DEP_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic4x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h -DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/symcat.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h -DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h -DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h +DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h +DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h DEP_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_z80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_hppa_som = $(BFDDIR)/som.h DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \ $(DEP_i386_elf) @@ -2413,66 +2128,52 @@ DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \ DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf) BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -app.o: app.c $(INCDIR)/symcat.h -as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(BFDVER_H) -atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h -cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h -depend.o: depend.c $(INCDIR)/symcat.h -dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ +app.o: app.c +as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + sb.h macro.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + ../bfd/bfdver.h +atof-generic.o: atof-generic.c $(INCDIR)/safe-ctype.h +cond.o: cond.c sb.h macro.h $(INCDIR)/obstack.h +depend.o: depend.c +dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/safe-ctype.h dwarf2dbg.h \ + $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h -dw2gencfi.o: dw2gencfi.c $(INCDIR)/symcat.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h -ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/elf/dwarf2.h -expr.o: expr.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -flonum-copy.o: flonum-copy.c $(INCDIR)/symcat.h +dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + subsegs.h $(INCDIR)/obstack.h +ecoff.o: ecoff.c ecoff.h +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +flonum-copy.o: flonum-copy.c flonum-konst.o: flonum-konst.c flonum-mult.o: flonum-mult.c -frags.o: frags.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -hash.o: hash.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \ - $(INCDIR)/safe-ctype.h -input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \ - sb.h -listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - $(INCDIR)/safe-ctype.h input-file.h subsegs.h -literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -macro.o: macro.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - sb.h macro.h -messages.o: messages.c $(INCDIR)/symcat.h -output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h -read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h -sb.o: sb.c sb.h $(INCDIR)/symcat.h -stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h struc-symbol.h -write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h dwarf2dbg.h -itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h -e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ - emul-target.h -e-criself.o: $(srcdir)/config/e-criself.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/symcat.h \ - emul-target.h +frags.o: frags.c subsegs.h $(INCDIR)/obstack.h +hash.o: hash.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +input-file.o: input-file.c input-file.h $(INCDIR)/safe-ctype.h +input-scrub.o: input-scrub.c input-file.h sb.h +listing.o: listing.c $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + input-file.h subsegs.h +literal.o: literal.c subsegs.h $(INCDIR)/obstack.h +macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h +messages.o: messages.c +output-file.o: output-file.c output-file.h +read.o: read.c $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + sb.h macro.h ecoff.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +sb.o: sb.c sb.h +stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h +symbols.o: symbols.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + subsegs.h struc-symbol.h +write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + dwarf2dbg.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +itbl-ops.o: itbl-ops.c itbl-ops.h +e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h +e-criself.o: $(srcdir)/config/e-criself.c emul-target.h +e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h +e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h +e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h +e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h +e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h $(OBJS): $(DEP_@target_cpu_type@_@obj_format@) $(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@) $(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@) diff --git a/contrib/binutils/gas/Makefile.in b/contrib/binutils/gas/Makefile.in index 4cc485f9683..6a43ccaeb48 100644 --- a/contrib/binutils/gas/Makefile.in +++ b/contrib/binutils/gas/Makefile.in @@ -51,9 +51,16 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ $(srcdir)/../config.sub subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.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/lead-dot.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)/acinclude.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 \ @@ -78,7 +85,7 @@ am__DEPENDENCIES_1 = tc-@target_cpu_type@.o am__DEPENDENCIES_2 = obj-@obj_format@.o am__DEPENDENCIES_3 = atof-@atof@.o am__DEPENDENCIES_4 = -am__DEPENDENCIES_5 = ../libiberty/libiberty.a +am__DEPENDENCIES_5 = ../bfd/libbfd.la ../libiberty/libiberty.a am_itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT) itbl_test_OBJECTS = $(am_itbl_test_OBJECTS) itbl_test_DEPENDENCIES = itbl-tops.o itbl-test.o $(am__DEPENDENCIES_5) @@ -88,11 +95,11 @@ 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) @@ -114,16 +121,14 @@ DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ -ALL_OBJ_DEPS = @ALL_OBJ_DEPS@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BFDLIB = @BFDLIB@ -BFDVER_H = @BFDVER_H@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ @@ -135,29 +140,32 @@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GDBINIT = @GDBINIT@ -GMOFILES = @GMOFILES@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +GREP = @GREP@ +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@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -170,6 +178,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ @@ -180,19 +190,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../bison/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@ @@ -225,10 +236,10 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ install_tooldir = @install_tooldir@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ obj_format = @obj_format@ @@ -246,11 +257,16 @@ target_os = @target_os@ target_vendor = @target_vendor@ te_file = @te_file@ AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu +ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd SUBDIRS = doc po # Automake should figure this out on its own. It doesn't, because # of the "cygnus" option. But distclean still wants it. DIST_SUBDIRS = $(SUBDIRS) tooldir = $(exec_prefix)/$(target_alias) + +# We have to set this, because autoconf 2.59 does not substitute YFLAGS. +# Autoconf 2.61 does, so this can be removed when we upgrade. +YFLAGS = AM_CFLAGS = $(WARN_CFLAGS) MKDEP = gcc -MM TARG_CPU = @target_cpu_type@ @@ -265,7 +281,7 @@ ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c ATOF_TARG_O = atof-@atof@.o # use @target_cpu_type@ for refering to configured target name -IT_HDRS = itbl-parse.h $(srcdir)/itbl-ops.h +IT_HDRS = itbl-parse.h $(srcdir)/itbl-ops.h IT_SRCS = itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c IT_DEPS = $(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h IT_OBJS = itbl-parse.o itbl-lex.o itbl-ops.o @@ -277,6 +293,7 @@ CPU_TYPES = \ arm \ avr \ bfin \ + cr16 \ cris \ crx \ d10v \ @@ -286,22 +303,25 @@ CPU_TYPES = \ frv \ h8300 \ hppa \ - ia64 \ i370 \ i386 \ i860 \ i960 \ + ia64 \ ip2k \ m32c \ m32r \ m68hc11 \ m68k \ + maxq \ mcore \ + mep \ mips \ mmix \ mn10200 \ mn10300 \ msp430 \ + mt \ ns32k \ openrisc \ or32 \ @@ -309,16 +329,18 @@ CPU_TYPES = \ pj \ ppc \ s390 \ + score \ sh \ sh64 \ sparc \ + spu \ tic30 \ tic4x \ tic54x \ - vax \ v850 \ - xstormy16 \ + vax \ xc16x \ + xstormy16 \ xtensa \ z80 \ z8k @@ -331,8 +353,7 @@ OBJ_FORMATS = \ coff \ ecoff \ elf \ - evax \ - ieee + evax # This is an sh case which sets valid according to whether the CPU @@ -347,16 +368,20 @@ CPU_OBJ_VALID = \ arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \ valid=yes ;; \ esac ;; \ - coff) valid=yes; \ + coff) \ case $$c in \ - cris | i860 | mmix | sh64) \ - valid= ;; \ + arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \ + | ppc | sh | sparc | tic* | xscale | z80 | z8k) \ + valid=yes ;; \ esac ;; \ ecoff) \ case $$c in \ mips | alpha) valid=yes ;; \ esac ;; \ - elf) valid=yes ;; \ + elf) valid=yes ; \ + case $$c in \ + maxq | ns32k | tic* | z80 | z8k) valid= ;; \ + esac ;; \ evax) \ case $$c in \ alpha) valid=yes ;; \ @@ -459,6 +484,7 @@ TARGET_CPU_CFILES = \ config/tc-arm.c \ config/tc-avr.c \ config/tc-bfin.c \ + config/tc-cr16.c \ config/tc-cris.c \ config/tc-crx.c \ config/tc-d10v.c \ @@ -479,6 +505,7 @@ TARGET_CPU_CFILES = \ config/tc-m68hc11.c \ config/tc-m68k.c \ config/tc-mcore.c \ + config/tc-mep.c \ config/tc-mips.c \ config/tc-mmix.c \ config/tc-mn10200.c \ @@ -491,9 +518,11 @@ TARGET_CPU_CFILES = \ config/tc-pj.c \ config/tc-ppc.c \ config/tc-s390.c \ + config/tc-score.c \ config/tc-sh.c \ config/tc-sh64.c \ config/tc-sparc.c \ + config/tc-spu.c \ config/tc-tic30.c \ config/tc-tic54x.c \ config/tc-vax.c \ @@ -510,6 +539,7 @@ TARGET_CPU_HFILES = \ config/tc-arm.h \ config/tc-avr.h \ config/tc-bfin.h \ + config/tc-cr16.h \ config/tc-cris.h \ config/tc-crx.h \ config/tc-d10v.h \ @@ -530,6 +560,7 @@ TARGET_CPU_HFILES = \ config/tc-m68hc11.h \ config/tc-m68k.h \ config/tc-mcore.h \ + config/tc-mep.h \ config/tc-mips.h \ config/tc-mmix.h \ config/tc-mn10200.h \ @@ -542,9 +573,11 @@ TARGET_CPU_HFILES = \ config/tc-pj.h \ config/tc-ppc.h \ config/tc-s390.h \ + config/tc-score.h \ config/tc-sh.h \ config/tc-sh64.h \ config/tc-sparc.h \ + config/tc-spu.h \ config/tc-tic30.h \ config/tc-tic54x.h \ config/tc-vax.h \ @@ -563,7 +596,6 @@ OBJ_FORMAT_CFILES = \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ - config/obj-ieee.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ @@ -572,7 +604,6 @@ OBJ_FORMAT_HFILES = \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ - config/obj-ieee.h \ config/obj-som.h @@ -610,7 +641,8 @@ TARG_ENV_HFILES = \ config/te-sun3.h \ config/te-svr4.h \ config/te-symbian.h \ - config/te-tmips.h + config/te-tmips.h \ + config/te-wince-pe.h # Multi files in config @@ -681,29 +713,36 @@ INCDIR = $(BASEDIR)/include # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation # subdirectory rather than in the source directory. -INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(datadir)/locale\"" +INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \ + -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" + # This should be parallel to INCLUDES, but should replace $(srcdir) # with $${srcdir}, and should work in a subdirectory. This is used # when building dependencies, because the dependency building is done # in a subdirectory. -DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(datadir)/locale\"" +DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd \ + -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. \ + -I$${srcdir}/../bfd @INCINTL@ \ + -DLOCALEDIR="\"$(datadir)/locale\"" + DEP_FLAGS = -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) # How to link with both our special library facilities # and the system's installed libraries. -GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a +GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) + $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLDEPS) + $(extra_objects) $(GASLIBS) $(LIBINTL_DEP) EXPECT = expect RUNTEST = runtest @@ -729,687 +768,520 @@ DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c - -DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c - -DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ +DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/atof-vax.c + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \ +DEPTC_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c -DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \ + $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c + +DEPTC_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h -DEPTC_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h +DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h -DEPTC_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h - -DEPTC_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h - -DEPTC_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/arm.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h - -DEPTC_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ +DEPTC_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + dwarf2dbg.h -DEPTC_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \ + $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h dwarf2dbg.h + +DEPTC_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/avr.h -DEPTC_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h dwarf2dbg.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(srcdir)/config/bfin-aux.h $(INCDIR)/opcode/bfin.h \ - $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h +DEPTC_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + struc-symbol.h $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h \ + $(INCDIR)/elf/reloc-macros.h $(srcdir)/config/bfin-aux.h \ + $(srcdir)/config/bfin-defs.h $(INCDIR)/opcode/bfin.h -DEPTC_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h struc-symbol.h $(srcdir)/config/bfin-defs.h \ - $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(srcdir)/config/bfin-aux.h \ - $(INCDIR)/opcode/bfin.h $(srcdir)/config/bfin-defs.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h +DEPTC_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/cr16.h \ + $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h -DEPTC_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h \ + dwarf2dbg.h + +DEPTC_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/cris.h - -DEPTC_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/opcode/crx.h $(INCDIR)/elf/crx.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/crx.h \ +DEPTC_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/crx.h \ $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d10v.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ +DEPTC_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ + dwarf2dbg.h $(srcdir)/config/tc-dlx.h $(INCDIR)/opcode/dlx.h + +DEPTC_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/d30v.h - -DEPTC_dlx_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/dlx.h - -DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-dlx.h dwarf2dbg.h $(INCDIR)/opcode/dlx.h - -DEPTC_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/fr30-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ $(srcdir)/../opcodes/fr30-opc.h cgen.h -DEPTC_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ - cgen.h - -DEPTC_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ +DEPTC_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/frv-opc.h \ cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h -DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \ - $(INCDIR)/hashtab.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h +DEPTC_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + dwarf2dbg.h $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h -DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ - $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h - -DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ +DEPTC_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h - -DEPTC_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ +DEPTC_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ - dwarf2dbg.h + subsegs.h $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h dwarf2dbg.h -DEPTC_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h - -DEPTC_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h - -DEPTC_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h - -DEPTC_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ +DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h \ - $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h - -DEPTC_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ +DEPTC_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i960.h -DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \ +DEPTC_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h + +DEPTC_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h + +DEPTC_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/ip2k-opc.h \ cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/ip2k.h \ $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ +DEPTC_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/ip2k.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/m32c-opc.h \ + $(srcdir)/../opcodes/cgen-types.h ../bfd/bfd_stdint.h \ + $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/m32c.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/hashtab.h $(INCDIR)/safe-ctype.h -DEPTC_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32c-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32c-opc.h \ - $(srcdir)/../opcodes/cgen-types.h $(srcdir)/../opcodes/cgen-ops.h \ - cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/m32c-opc.h $(srcdir)/../opcodes/cgen-types.h \ - $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/m32c.h \ - $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32r-desc.h \ - $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ +DEPTC_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ $(srcdir)/../opcodes/m32r-opc.h cgen.h $(INCDIR)/elf/m32r.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ - cgen.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h \ - $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/m68hc11.h $(INCDIR)/elf/m68hc11.h \ +DEPTC_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h -DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - subsegs.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h +DEPTC_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h -DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ +DEPTC_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ - $(INCDIR)/safe-ctype.h +DEPTC_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/opcode/maxq.h -DEPTC_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ +DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/mcore-opc.h $(INCDIR)/safe-ctype.h + +DEPTC_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h -DEPTC_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ +DEPTC_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mep-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mep-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/xregex.h \ + $(INCDIR)/xregex2.h -DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \ dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEPTC_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ +DEPTC_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h + +DEPTC_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h \ + itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(srcdir)/config/obj-elf.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h + +DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \ - $(INCDIR)/safe-ctype.h + $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/obstack.h -DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h - -DEPTC_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10200.h -DEPTC_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ - dwarf2dbg.h +DEPTC_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/mn10300.h dwarf2dbg.h -DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/mn10300.h +DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ + $(INCDIR)/safe-ctype.h dwarf2dbg.h -DEPTC_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/msp430.h $(INCDIR)/safe-ctype.h dwarf2dbg.h +DEPTC_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mt-desc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mt-opc.h \ + cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h -DEPTC_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h - -DEPTC_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ +DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \ $(INCDIR)/obstack.h -DEPTC_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h - -DEPTC_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/openrisc-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \ - cgen.h - -DEPTC_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ +DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/openrisc-opc.h cgen.h - -DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ - $(INCDIR)/elf/reloc-macros.h - -DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-or32.h dwarf2dbg.h $(INCDIR)/opcode/or32.h \ - $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h - -DEPTC_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pdp11.h - -DEPTC_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h - -DEPTC_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/pj.h - -DEPTC_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h - -DEPTC_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h - -DEPTC_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h - -DEPTC_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h - -DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ - $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h - -DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h - -DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h - -DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h - -DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h - -DEPTC_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h - -DEPTC_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h - -DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h - -DEPTC_tic4x_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/tc-tic4x.h dwarf2dbg.h $(INCDIR)/opcode/tic4x.h \ - subsegs.h $(INCDIR)/obstack.h - -DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h sb.h macro.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h - -DEPTC_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h sb.h macro.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ - $(BFDDIR)/libcoff.h - -DEPTC_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/vax.h - -DEPTC_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ - $(INCDIR)/obstack.h subsegs.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/opcode/vax.h - -DEPTC_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - subsegs.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h - -DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h dwarf2dbg.h - -DEPTC_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/v850.h - -DEPTC_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xstormy16-desc.h $(INCDIR)/opcode/cgen-bitset.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/openrisc-opc.h \ cgen.h -DEPTC_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ +DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ + dwarf2dbg.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \ + $(INCDIR)/elf/reloc-macros.h + +DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/pdp11.h + +DEPTC_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h + +DEPTC_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h + +DEPTC_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/ppc.h + +DEPTC_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h + +DEPTC_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/score-inst.h $(INCDIR)/opcode/score-datadep.h \ + struc-symbol.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h + +DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \ + $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ + $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \ + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h + +DEPTC_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + dwarf2dbg.h + +DEPTC_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/spu-insns.h + +DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h + +DEPTC_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/tic30.h + +DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h + +DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + sb.h macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ + $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h + +DEPTC_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \ + dwarf2dbg.h + +DEPTC_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \ + $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + $(INCDIR)/opcode/vax.h + +DEPTC_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h + +DEPTC_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen-bitset.h \ + $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \ + $(srcdir)/../opcodes/xc16x-opc.h cgen.h dwarf2dbg.h \ + $(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h + +DEPTC_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xstormy16-opc.h cgen.h + $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/xstormy16-opc.h \ + cgen.h -DEPTC_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen.h \ - $(srcdir)/../opcodes/xc16x-opc.h cgen.h - -DEPTC_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h sb.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ +DEPTC_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/tc-xtensa.h subsegs.h $(INCDIR)/obstack.h \ $(srcdir)/config/xtensa-relax.h $(srcdir)/config/xtensa-istack.h \ - dwarf2dbg.h struc-symbol.h + dwarf2dbg.h struc-symbol.h $(INCDIR)/xtensa-config.h -DEPTC_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h +DEPTC_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h -DEPTC_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h - -DEPTC_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h - -DEPTC_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/z8k-opc.h +DEPTC_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/../opcodes/z8k-opc.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ @@ -1422,588 +1294,439 @@ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h +DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(BFDDIR)/libecoff.h -DEPOBJ_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h - -DEPOBJ_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ +DEPOBJ_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h - -DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_arm_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ +DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h +DEPOBJ_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_bfin_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-bfin.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_bfin_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_crx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-crx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_crx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_dlx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-dlx.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_dlx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m32c_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32c.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_m32c_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mips_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h - -DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_ns32k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_or32_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_or32_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_pdp11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pdp11.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h subsegs.h \ $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h +DEPOBJ_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h -DEPOBJ_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_tic30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic4x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic4x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - -DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_vax_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ +DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h + subsegs.h $(INCDIR)/obstack.h -DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h +DEPOBJ_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h \ +DEPOBJ_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ +DEPOBJ_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h + subsegs.h $(INCDIR)/obstack.h -DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_xc16x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h \ +DEPOBJ_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ +DEPOBJ_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h -DEPOBJ_z80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_z80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ +DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/mep.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ + ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(BFDDIR)/libecoff.h + +DEPOBJ_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h -DEPOBJ_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ +DEPOBJ_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + +DEPOBJ_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ + $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/obstack.h + +DEPOBJ_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \ + dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h $(INCDIR)/obstack.h DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ @@ -2016,458 +1739,385 @@ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf) -DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h +DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h -DEP_arc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_arc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - dwarf2dbg.h +DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_arm_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h +DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h -DEP_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_avr_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ - dwarf2dbg.h +DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_bfin_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-bfin.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h \ - dwarf2dbg.h +DEP_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_cris_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ - dwarf2dbg.h +DEP_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_crx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-crx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_crx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h \ - dwarf2dbg.h +DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h -DEP_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h -DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h +DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h - -DEP_dlx_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-dlx.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ - dwarf2dbg.h - -DEP_fr30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-fr30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ - dwarf2dbg.h - -DEP_frv_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-frv.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_frv_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h +DEP_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - dwarf2dbg.h - -DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ - $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/reloc-macros.h - -DEP_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/symcat.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ - $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h +DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h -DEP_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \ + $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ + $(INCDIR)/elf/reloc-macros.h -DEP_i370_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ - dwarf2dbg.h +DEP_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ - dwarf2dbg.h - -DEP_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ - dwarf2dbg.h - -DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ + $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ - dwarf2dbg.h +DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \ + $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h -DEP_ip2k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ip2k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ +DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h + +DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ - dwarf2dbg.h +DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h -DEP_m32c_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32c.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ + $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h -DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h \ - dwarf2dbg.h +DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ - dwarf2dbg.h +DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_m68hc11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68hc11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ - dwarf2dbg.h +DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h +DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h + +DEP_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ - dwarf2dbg.h +DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h + +DEP_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h -DEP_mips_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h +DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h -DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ - dwarf2dbg.h +DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ - dwarf2dbg.h +DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ - dwarf2dbg.h - -DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ - dwarf2dbg.h +DEP_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ - dwarf2dbg.h - -DEP_openrisc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-openrisc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ - dwarf2dbg.h +DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h -DEP_or32_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ - dwarf2dbg.h +DEP_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ - dwarf2dbg.h - -DEP_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_pj_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ - dwarf2dbg.h +DEP_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ - dwarf2dbg.h - -DEP_s390_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-s390.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h -DEP_s390_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ - dwarf2dbg.h +DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h + +DEP_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h + +DEP_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h +DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h -DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(BFDDIR)/elf32-sh64.h +DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ - dwarf2dbg.h +DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h + +DEP_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \ + $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_tic4x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ - $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h +DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \ + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h +DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ - dwarf2dbg.h +DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \ + $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/symcat.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ + dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h -DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h - -DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ - dwarf2dbg.h - -DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h - -DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ - $(INCDIR)/xtensa-isa.h $(INCDIR)/xtensa-config.h +DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h DEP_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_z80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z80.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_z8k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ - dwarf2dbg.h + $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_hppa_som = $(BFDDIR)/som.h DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \ @@ -2489,15 +2139,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 \ @@ -2856,12 +2506,11 @@ po/POTFILES.in: @MAINT@ Makefile diststuff: $(EXTRA_DIST) info all: info -$(OBJS): @ALL_OBJ_DEPS@ - # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. -$(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ - $(INCDIR)/progress.h $(INCDIR)/fopen-same.h \ +$(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/fopen-bin.h $(INCDIR)/fopen-vms.h \ $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \ as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \ frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h @@ -2901,18 +2550,16 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ # We need all these explicit rules for the multi stuff. Because of # these rules, we don't need one for OBJ_FORMAT_O. -obj-aout.o : $(srcdir)/config/obj-aout.c +obj-aout.o : $(srcdir)/config/obj-aout.c $(DEP_@target_cpu_type@_aout) $(COMPILE) -c $(srcdir)/config/obj-aout.c -obj-coff.o: $(srcdir)/config/obj-coff.c +obj-coff.o: $(srcdir)/config/obj-coff.c $(DEP_@target_cpu_type@_coff) $(COMPILE) -c $(srcdir)/config/obj-coff.c -obj-ecoff.o : $(srcdir)/config/obj-ecoff.c +obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(DEP_@target_cpu_type@_ecoff) $(COMPILE) -c $(srcdir)/config/obj-ecoff.c -obj-elf.o : $(srcdir)/config/obj-elf.c +obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf) $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c -obj-ieee.o : $(srcdir)/config/obj-ieee.c - $(COMPILE) -c $(srcdir)/config/obj-ieee.c obj-multi.o : $(srcdir)/config/obj-multi.c $(COMPILE) -c $(srcdir)/config/obj-multi.c obj-som.o : $(srcdir)/config/obj-som.c @@ -2959,7 +2606,7 @@ m68k-parse.c: $(srcdir)/config/m68k-parse.y rm -f m68k-parse.y; \ else true; fi # 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. m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h $(COMPILE) -c $< $(NO_WERROR) @@ -2986,12 +2633,12 @@ bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h itbl-lex.c: $(srcdir)/itbl-lex.l # 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. itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) # 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. itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h $(COMPILE) -c $< $(NO_WERROR) @@ -3319,66 +2966,52 @@ dep-am: DEP # ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY. .PHONY: dep dep-in dep-am #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -app.o: app.c $(INCDIR)/symcat.h -as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(BFDVER_H) -atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h -cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h -depend.o: depend.c $(INCDIR)/symcat.h -dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - dwarf2dbg.h $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ +app.o: app.c +as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + sb.h macro.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + ../bfd/bfdver.h +atof-generic.o: atof-generic.c $(INCDIR)/safe-ctype.h +cond.o: cond.c sb.h macro.h $(INCDIR)/obstack.h +depend.o: depend.c +dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/safe-ctype.h dwarf2dbg.h \ + $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h -dw2gencfi.o: dw2gencfi.c $(INCDIR)/symcat.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h -ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/elf/dwarf2.h -expr.o: expr.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -flonum-copy.o: flonum-copy.c $(INCDIR)/symcat.h +dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + subsegs.h $(INCDIR)/obstack.h +ecoff.o: ecoff.c ecoff.h +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h +expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +flonum-copy.o: flonum-copy.c flonum-konst.o: flonum-konst.c flonum-mult.o: flonum-mult.c -frags.o: frags.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -hash.o: hash.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h -input-file.o: input-file.c $(INCDIR)/symcat.h input-file.h \ - $(INCDIR)/safe-ctype.h -input-scrub.o: input-scrub.c $(INCDIR)/symcat.h input-file.h \ - sb.h -listing.o: listing.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - $(INCDIR)/safe-ctype.h input-file.h subsegs.h -literal.o: literal.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -macro.o: macro.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - sb.h macro.h -messages.o: messages.c $(INCDIR)/symcat.h -output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h -read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ - dw2gencfi.h $(INCDIR)/elf/dwarf2.h -sb.o: sb.c sb.h $(INCDIR)/symcat.h -stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ - subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -subsegs.o: subsegs.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h -symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h struc-symbol.h -write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h dwarf2dbg.h -itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h -e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ - emul-target.h -e-criself.o: $(srcdir)/config/e-criself.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/symcat.h \ - emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/symcat.h \ - emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/symcat.h \ - emul-target.h +frags.o: frags.c subsegs.h $(INCDIR)/obstack.h +hash.o: hash.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h +input-file.o: input-file.c input-file.h $(INCDIR)/safe-ctype.h +input-scrub.o: input-scrub.c input-file.h sb.h +listing.o: listing.c $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \ + input-file.h subsegs.h +literal.o: literal.c subsegs.h $(INCDIR)/obstack.h +macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h +messages.o: messages.c +output-file.o: output-file.c output-file.h +read.o: read.c $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + sb.h macro.h ecoff.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h +sb.o: sb.c sb.h +stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h +symbols.o: symbols.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ + subsegs.h struc-symbol.h +write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \ + dwarf2dbg.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h +itbl-ops.o: itbl-ops.c itbl-ops.h +e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h +e-criself.o: $(srcdir)/config/e-criself.c emul-target.h +e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h +e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h +e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h +e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h +e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h $(OBJS): $(DEP_@target_cpu_type@_@obj_format@) $(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@) $(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@) diff --git a/contrib/binutils/gas/NEWS b/contrib/binutils/gas/NEWS index 4b4d029685a..bf278ef65a8 100644 --- a/contrib/binutils/gas/NEWS +++ b/contrib/binutils/gas/NEWS @@ -1,4 +1,12 @@ -*- text -*- +* Support for the National Semiconductor CR16 target has been added. + +* Added gas .reloc pseudo. This is a low-level interface for creating + relocations. + +* Add support for x86_64 PE+ target. + +* Add support for Score target. * Support for the Infineon XC16X has been added by KPIT Cummins Infosystems. diff --git a/contrib/binutils/gas/acinclude.m4 b/contrib/binutils/gas/acinclude.m4 index 0946e724f12..fa4c1bc6e9f 100644 --- a/contrib/binutils/gas/acinclude.m4 +++ b/contrib/binutils/gas/acinclude.m4 @@ -1,5 +1,3 @@ -sinclude(../bfd/warning.m4) - dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers) AC_DEFUN([GAS_CHECK_DECL_NEEDED],[ AC_MSG_CHECKING(whether declaration is required for $1) @@ -56,19 +54,3 @@ for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do done $1=[$]_gas_uniq_newlist ])dnl - -sinclude(../libtool.m4) -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_DEFUN([AC_CHECK_LIBM],) -AC_SUBST(LIBTOOL) -]) - -sinclude(../gettext.m4) -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) diff --git a/contrib/binutils/gas/aclocal.m4 b/contrib/binutils/gas/aclocal.m4 index cd4267338b7..1182e3622d1 100644 --- a/contrib/binutils/gas/aclocal.m4 +++ b/contrib/binutils/gas/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,16 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([../bfd/acinclude.m4]) +m4_include([../bfd/warning.m4]) +m4_include([../config/depstand.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/lead-dot.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]) m4_include([acinclude.m4]) diff --git a/contrib/binutils/gas/app.c b/contrib/binutils/gas/app.c index 275ad68ebb0..e5f177801fd 100644 --- a/contrib/binutils/gas/app.c +++ b/contrib/binutils/gas/app.c @@ -1,6 +1,6 @@ /* This is the Assembler Pre-Processor Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 + 1999, 2000, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,13 +21,12 @@ 02110-1301, USA. */ /* Modified by Allen Wirfs-Brock, Instantiations Inc 2/90. */ -/* App, the assembler pre-processor. This pre-processor strips out excess - spaces, turns single-quoted characters into a decimal constant, and turns - # into a .line \n.file - pair. This needs better error-handling. */ +/* App, the assembler pre-processor. This pre-processor strips out + excess spaces, turns single-quoted characters into a decimal + constant, and turns the # in # into a + .linefile. This needs better error-handling. */ -#include -#include "as.h" /* For BAD_CASE() only. */ +#include "as.h" #if (__STDC__ != 1) #ifndef const @@ -352,11 +351,11 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) 1: After first whitespace on line (flush more white) 2: After first non-white (opcode) on line (keep 1white) 3: after second white on line (into operands) (flush white) - 4: after putting out a .line, put out digits + 4: after putting out a .linefile, put out digits 5: parsing a string, then go to old-state 6: putting out \ escape in a "d string. - 7: After putting out a .appfile, put out string. - 8: After putting out a .appfile string, flush until newline. + 7: no longer used + 8: no longer used 9: After seeing symbol char in state 3 (keep 1white after symchar) 10: After seeing whitespace in state 9 (keep white before symchar) 11: After seeing a symbol character in state 0 (eg a label definition) @@ -511,14 +510,10 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) ch = GET (); if (ch == '"') { - UNGET (ch); - if (scrub_m68k_mri) - out_string = "\n\tappfile "; - else - out_string = "\n\t.appfile "; - old_state = 7; - state = -1; - PUT (*out_string++); + quotechar = ch; + state = 5; + old_state = 3; + PUT (ch); } else { @@ -555,6 +550,8 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) memcpy (to, from, len); to += len; from += len; + if (to >= toend) + goto tofull; } } @@ -639,24 +636,6 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) PUT (ch); continue; - case 7: - ch = GET (); - quotechar = ch; - state = 5; - old_state = 8; - PUT (ch); - continue; - - case 8: - do - ch = GET (); - while (ch != '\n' && ch != EOF); - if (ch == EOF) - goto fromeof; - state = 0; - PUT (ch); - continue; - #ifdef DOUBLEBAR_PARALLEL case 13: ch = GET (); @@ -888,9 +867,6 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) switch (state) { - case 0: - state++; - goto recycle; /* Punted leading sp */ case 1: /* We can arrive here if we leave a leading whitespace character at the beginning of a line. */ @@ -1200,9 +1176,9 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) old_state = 4; state = -1; if (scrub_m68k_mri) - out_string = "\tappline "; + out_string = "\tlinefile "; else - out_string = "\t.appline "; + out_string = "\t.linefile "; PUT (*out_string++); break; } @@ -1245,6 +1221,15 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) if ((symver_state != NULL) && (*symver_state == 0)) goto de_fault; #endif + +#ifdef TC_ARM + /* For the ARM, care is needed not to damage occurrences of \@ + by stripping the @ onwards. Yuck. */ + if (to > tostart && *(to - 1) == '\\') + /* Do not treat the @ as a start-of-comment. */ + goto de_fault; +#endif + #ifdef WARN_COMMENTS if (!found_comment) as_where (&found_comment_file, &found_comment); @@ -1377,7 +1362,15 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) the space. We don't have enough information to make the right choice, so here we are making the choice which is more likely to be correct. */ - PUT (' '); + if (to + 1 >= toend) + { + /* If we're near the end of the buffer, save the + character for the next time round. Otherwise + we'll lose our state. */ + UNGET (ch); + goto tofull; + } + *to++ = ' '; } state = 3; diff --git a/contrib/binutils/gas/as.c b/contrib/binutils/gas/as.c index 727a1dd40ee..b05f9d514a3 100644 --- a/contrib/binutils/gas/as.c +++ b/contrib/binutils/gas/as.c @@ -1,6 +1,6 @@ /* as.c - GAS main program. Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -31,8 +31,6 @@ Since no-one else says they will support them in future: I don't support them now. */ -#include "ansidecl.h" - #define COMMON #include "as.h" @@ -42,7 +40,6 @@ #include "macro.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" -#include "hash.h" #include "bfdver.h" #ifdef HAVE_ITBL_CPU @@ -352,7 +349,9 @@ Options:\n\ md_show_usage (stream); fputc ('\n', stream); - fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + + if (REPORT_BUGS_TO[0] && stream == stdout) + fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); } /* Since it is easy to do here we interpret the special arg "-" @@ -591,7 +590,7 @@ parse_args (int * pargc, char *** pargv) case OPTION_VERSION: /* This output is intended to follow the GNU standards document. */ printf (_("GNU assembler %s\n"), 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")); @@ -1032,6 +1031,33 @@ perform_an_assembly_pass (int argc, char ** argv) read_a_source_file (""); } +#ifdef OBJ_ELF +static void +create_obj_attrs_section (void) +{ + segT s; + char *p; + addressT addr; + offsetT size; + const char *name; + + size = bfd_elf_obj_attr_size (stdoutput); + if (size) + { + name = get_elf_backend_data (stdoutput)->obj_attrs_section; + if (!name) + name = ".gnu.attributes"; + s = subseg_new (name, 0); + elf_section_type (s) + = get_elf_backend_data (stdoutput)->obj_attrs_section_type; + bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA); + addr = frag_now_fix (); + p = frag_more (size); + bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size); + } +} +#endif + int main (int argc, char ** argv) @@ -1125,6 +1151,11 @@ main (int argc, char ** argv) sym = symbol_new (defsyms->name, absolute_section, defsyms->value, &zero_address_frag); + /* Make symbols defined on the command line volatile, so that they + can be redefined inside a source file. This makes this assembler's + behaviour compatible with earlier versions, but it may not be + completely intuitive. */ + S_SET_VOLATILE (sym); symbol_table_insert (sym); next = defsyms->next; free (defsyms); @@ -1142,6 +1173,11 @@ main (int argc, char ** argv) md_end (); #endif +#ifdef OBJ_ELF + if (IS_ELF) + create_obj_attrs_section (); +#endif + #if defined OBJ_ELF || defined OBJ_MAYBE_ELF if ((flag_execstack || flag_noexecstack) && OUTPUT_FLAVOR == bfd_target_elf_flavour) diff --git a/contrib/binutils/gas/as.h b/contrib/binutils/gas/as.h index 2f92c2ed774..4ea63abeea9 100644 --- a/contrib/binutils/gas/as.h +++ b/contrib/binutils/gas/as.h @@ -1,6 +1,6 @@ /* as.h - global header file Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -37,7 +37,6 @@ If TEST is #defined, then we are testing a module: #define COMMON as "". */ #include "config.h" -#include "bin-bugs.h" /* This is the code recommended in the autoconf documentation, almost verbatim. If it doesn't work for you, let me know, and notify @@ -210,7 +209,7 @@ extern int vsnprintf(char *, size_t, const char *, va_list); #endif /* __FILE__ */ #ifndef FOPEN_WB -#if defined GO32 || defined __MINGW32__ +#ifdef USE_BINARY_FOPEN #include "fopen-bin.h" #else #include "fopen-same.h" @@ -259,7 +258,11 @@ typedef addressT valueT; #endif /* COMMON now defined */ -#ifdef DEBUG +#ifndef ENABLE_CHECKING +#define ENABLE_CHECKING 0 +#endif + +#if ENABLE_CHECKING || defined (DEBUG) #ifndef know #define know(p) assert(p) /* Verify our assumptions! */ #endif /* not yet defined */ @@ -544,7 +547,6 @@ void cond_finish_check (int); void cond_exit_macro (int); int seen_at_least_1_file (void); void app_pop (char *); -void as_perror (const char *, const char *); void as_where (char **, unsigned int *); void bump_line_counters (void); void do_scrub_begin (int); @@ -552,6 +554,7 @@ void input_scrub_begin (void); void input_scrub_close (void); void input_scrub_end (void); int new_logical_line (char *, int); +int new_logical_line_flags (char *, int, int); void subsegs_begin (void); void subseg_change (segT, int); segT subseg_new (const char *, subsegT); @@ -567,7 +570,6 @@ segT subseg_get (const char *, int); struct expressionS; struct fix; typedef struct symbol symbolS; -struct relax_type; typedef struct frag fragS; /* literal.c */ diff --git a/contrib/binutils/gas/atof-generic.c b/contrib/binutils/gas/atof-generic.c index 6a5c2f15b3c..3021c4c861b 100644 --- a/contrib/binutils/gas/atof-generic.c +++ b/contrib/binutils/gas/atof-generic.c @@ -1,6 +1,6 @@ /* atof_generic.c - turn a string of digits into a Flonum Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, - 2001, 2003, 2005 Free Software Foundation, Inc. + 2001, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,8 +19,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "as.h" #include "safe-ctype.h" diff --git a/contrib/binutils/gas/cgen.c b/contrib/binutils/gas/cgen.c index 363c05e5318..5b0694b03e2 100644 --- a/contrib/binutils/gas/cgen.c +++ b/contrib/binutils/gas/cgen.c @@ -1,6 +1,6 @@ /* GAS interface for targets using CGEN: Cpu tools GENerator. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,16 +19,34 @@ Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include -#include "ansidecl.h" -#include "libiberty.h" -#include "bfd.h" +#include "as.h" #include "symcat.h" #include "cgen-desc.h" -#include "as.h" #include "subsegs.h" #include "cgen.h" #include "dwarf2dbg.h" +#include "symbols.h" +#include "struc-symbol.h" + +#ifdef OBJ_COMPLEX_RELC +static expressionS * make_right_shifted_expr + (expressionS *, const int, const int); + +static unsigned long gas_cgen_encode_addend + (const unsigned long, const unsigned long, const unsigned long, \ + const unsigned long, const unsigned long, const unsigned long, \ + const unsigned long); + +static char * weak_operand_overflow_check + (const expressionS *, const CGEN_OPERAND *); + +static void queue_fixup_recursively + (const int, const int, expressionS *, \ + const CGEN_MAYBE_MULTI_IFLD *, const int, const int); + +static int rightshift = 0; +#endif static void queue_fixup (int, int, expressionS *); /* Opcode table descriptor, must be set by md_begin. */ @@ -66,6 +84,8 @@ struct fixup int opindex; int opinfo; expressionS exp; + struct cgen_maybe_multi_ifield * field; + int msb_field_p; }; static struct fixup fixups[GAS_CGEN_MAX_FIXUPS]; @@ -249,6 +269,8 @@ gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offse + (int) operand->type)); fixP->fx_cgen.insn = insn; fixP->fx_cgen.opinfo = opinfo; + fixP->fx_cgen.field = NULL; + fixP->fx_cgen.msb_field_p = 0; return fixP; } @@ -287,10 +309,26 @@ gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) + (int) operand->type)); fixP->fx_cgen.insn = insn; fixP->fx_cgen.opinfo = opinfo; + fixP->fx_cgen.field = NULL; + fixP->fx_cgen.msb_field_p = 0; return fixP; } +#ifdef OBJ_COMPLEX_RELC +static symbolS * +expr_build_binary (operatorT op, symbolS * s1, symbolS * s2) +{ + expressionS e; + + e.X_op = op; + e.X_add_symbol = s1; + e.X_op_symbol = s2; + e.X_add_number = 0; + return make_expr_symbol (& e); +} +#endif + /* Used for communication between the next two procedures. */ static jmp_buf expr_jmp_buf; static int expr_jmp_buf_p; @@ -308,7 +346,12 @@ static int expr_jmp_buf_p; const char * gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) + +#ifdef OBJ_COMPLEX_RELC + CGEN_CPU_DESC cd; +#else CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; +#endif enum cgen_parse_operand_type want; const char **strP; int opindex; @@ -329,6 +372,13 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) const char *errmsg; expressionS exp; +#ifdef OBJ_COMPLEX_RELC + volatile int signed_p = 0; + symbolS * stmp = NULL; + bfd_reloc_code_real_type reloc_type; + const CGEN_OPERAND * operand; + fixS dummy_fixup; +#endif if (want == CGEN_PARSE_OPERAND_INIT) { gas_cgen_init_parse (); @@ -386,9 +436,82 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) break; de_fault: default: +#ifdef OBJ_COMPLEX_RELC + /* Look up operand, check to see if there's an obvious + overflow (this helps disambiguate some insn parses). */ + operand = cgen_operand_lookup_by_num (cd, opindex); + errmsg = weak_operand_overflow_check (& exp, operand); + + if (! errmsg) + { + /* Fragment the expression as necessary, and queue a reloc. */ + memset (& dummy_fixup, 0, sizeof (fixS)); + + reloc_type = md_cgen_lookup_reloc (0, operand, & dummy_fixup); + + if (exp.X_op == O_symbol + && reloc_type == BFD_RELOC_RELC + && exp.X_add_symbol->sy_value.X_op == O_constant + && exp.X_add_symbol->bsym->section != expr_section + && exp.X_add_symbol->bsym->section != absolute_section + && exp.X_add_symbol->bsym->section != undefined_section) + { + /* Local labels will have been (eagerly) turned into constants + by now, due to the inappropriately deep insight of the + expression parser. Unfortunately make_expr_symbol + prematurely dives into the symbol evaluator, and in this + case it gets a bad answer, so we manually create the + expression symbol we want here. */ + stmp = symbol_create (FAKE_LABEL_NAME, expr_section, 0, + & zero_address_frag); + symbol_set_value_expression (stmp, & exp); + } + else + stmp = make_expr_symbol (& exp); + + /* If this is a pc-relative RELC operand, we + need to subtract "." from the expression. */ + if (reloc_type == BFD_RELOC_RELC + && CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR)) + stmp = expr_build_binary (O_subtract, stmp, expr_build_dot ()); + + /* FIXME: this is not a perfect heuristic for figuring out + whether an operand is signed: it only works when the operand + is an immediate. it's not terribly likely that any other + values will be signed relocs, but it's possible. */ + if (operand && (operand->hw_type == HW_H_SINT)) + signed_p = 1; + + if (stmp->bsym && (stmp->bsym->section == expr_section)) + { + if (signed_p) + stmp->bsym->flags |= BSF_SRELC; + else + stmp->bsym->flags |= BSF_RELC; + } + + /* Now package it all up for the fixup emitter. */ + exp.X_op = O_symbol; + exp.X_op_symbol = 0; + exp.X_add_symbol = stmp; + exp.X_add_number = 0; + + /* Re-init rightshift quantity, just in case. */ + rightshift = operand->length; + queue_fixup_recursively (opindex, opinfo_1, & exp, + (reloc_type == BFD_RELOC_RELC) ? + & (operand->index_fields) : 0, + signed_p, -1); + } + * resultP = errmsg + ? CGEN_PARSE_OPERAND_RESULT_ERROR + : CGEN_PARSE_OPERAND_RESULT_QUEUED; + *valueP = 0; +#else queue_fixup (opindex, opinfo_1, &exp); *valueP = 0; *resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED; +#endif break; } @@ -556,6 +679,8 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) insn, length, operand, fixups[i].opinfo, &fixups[i].exp); + fixP->fx_cgen.field = fixups[i].field; + fixP->fx_cgen.msb_field_p = fixups[i].msb_field_p; if (result) result->fixups[i] = fixP; } @@ -567,6 +692,167 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) } } +#ifdef OBJ_COMPLEX_RELC +/* Queue many fixups, recursively. If the field is a multi-ifield, + repeatedly queue its sub-parts, right shifted to fit into the field (we + assume here multi-fields represent a left-to-right, MSB0-LSB0 + reading). */ + +static void +queue_fixup_recursively (const int opindex, + const int opinfo, + expressionS * expP, + const CGEN_MAYBE_MULTI_IFLD * field, + const int signed_p, + const int part_of_multi) +{ + if (field && field->count) + { + int i; + + for (i = 0; i < field->count; ++ i) + queue_fixup_recursively (opindex, opinfo, expP, + & (field->val.multi[i]), signed_p, i); + } + else + { + expressionS * new_exp = expP; + +#ifdef DEBUG + printf ("queueing fixup for field %s\n", + (field ? field->val.leaf->name : "??")); + print_symbol_value (expP->X_add_symbol); +#endif + if (field && part_of_multi != -1) + { + rightshift -= field->val.leaf->length; + + /* Shift reloc value by number of bits remaining after this + field. */ + if (rightshift) + new_exp = make_right_shifted_expr (expP, rightshift, signed_p); + } + + /* Truncate reloc values to length, *after* leftmost one. */ + fixups[num_fixups].msb_field_p = (part_of_multi <= 0); + fixups[num_fixups].field = (CGEN_MAYBE_MULTI_IFLD *) field; + + queue_fixup (opindex, opinfo, new_exp); + } +} + +/* Encode the self-describing RELC reloc format's addend. */ + +static unsigned long +gas_cgen_encode_addend (const unsigned long start, /* in bits */ + const unsigned long len, /* in bits */ + const unsigned long oplen, /* in bits */ + const unsigned long wordsz, /* in bytes */ + const unsigned long chunksz, /* in bytes */ + const unsigned long signed_p, + const unsigned long trunc_p) +{ + unsigned long res = 0L; + + res |= start & 0x3F; + res |= (oplen & 0x3F) << 6; + res |= (len & 0x3F) << 12; + res |= (wordsz & 0xF) << 18; + res |= (chunksz & 0xF) << 22; + res |= (CGEN_INSN_LSB0_P ? 1 : 0) << 27; + res |= signed_p << 28; + res |= trunc_p << 29; + + return res; +} + +/* Purpose: make a weak check that the expression doesn't overflow the + operand it's to be inserted into. + + Rationale: some insns used to use %operators to disambiguate during a + parse. when these %operators are translated to expressions by the macro + expander, the ambiguity returns. we attempt to disambiguate by field + size. + + Method: check to see if the expression's top node is an O_and operator, + and the mask is larger than the operand length. This would be an + overflow, so signal it by returning an error string. Any other case is + ambiguous, so we assume it's OK and return NULL. */ + +static char * +weak_operand_overflow_check (const expressionS * exp, + const CGEN_OPERAND * operand) +{ + const unsigned long len = operand->length; + unsigned long mask; + unsigned long opmask = (((1L << (len - 1)) - 1) << 1) | 1; + + if (!exp) + return NULL; + + if (exp->X_op != O_bit_and) + { + /* Check for implicit overflow flag. */ + if (CGEN_OPERAND_ATTR_VALUE + (operand, CGEN_OPERAND_RELOC_IMPLIES_OVERFLOW)) + return _("a reloc on this operand implies an overflow"); + return NULL; + } + + mask = exp->X_add_number; + + if (exp->X_add_symbol && + exp->X_add_symbol->sy_value.X_op == O_constant) + mask |= exp->X_add_symbol->sy_value.X_add_number; + + if (exp->X_op_symbol && + exp->X_op_symbol->sy_value.X_op == O_constant) + mask |= exp->X_op_symbol->sy_value.X_add_number; + + /* Want to know if mask covers more bits than opmask. + this is the same as asking if mask has any bits not in opmask, + or whether (mask & ~opmask) is nonzero. */ + if (mask && (mask & ~opmask)) + { +#ifdef DEBUG + printf ("overflow: (mask = %8.8x, ~opmask = %8.8x, AND = %8.8x)\n", + mask, ~opmask, (mask & ~opmask)); +#endif + return _("operand mask overflow"); + } + + return NULL; +} + + +static expressionS * +make_right_shifted_expr (expressionS * exp, + const int amount, + const int signed_p) +{ + symbolS * stmp = 0; + expressionS * new_exp; + + stmp = expr_build_binary (O_right_shift, + make_expr_symbol (exp), + expr_build_uconstant (amount)); + + if (signed_p) + stmp->bsym->flags |= BSF_SRELC; + else + stmp->bsym->flags |= BSF_RELC; + + /* Then wrap that in a "symbol expr" for good measure. */ + new_exp = xmalloc (sizeof (expressionS)); + memset (new_exp, 0, sizeof (expressionS)); + new_exp->X_op = O_symbol; + new_exp->X_op_symbol = 0; + new_exp->X_add_symbol = stmp; + new_exp->X_add_number = 0; + + return new_exp; +} +#endif /* Apply a fixup to the object code. This is called for all the fixups we generated by the call to fix_new_exp, above. In the call above we used a reloc code which was the largest legal reloc code @@ -605,6 +891,30 @@ gas_cgen_md_apply_fix (fixP, valP, seg) bfd_reloc_code_real_type reloc_type; CGEN_FIELDS *fields = alloca (CGEN_CPU_SIZEOF_FIELDS (cd)); const CGEN_INSN *insn = fixP->fx_cgen.insn; + int start; + int length; + int signed_p = 0; + + if (fixP->fx_cgen.field) + { + /* Use the twisty little pointer path + back to the ifield if it exists. */ + start = fixP->fx_cgen.field->val.leaf->start; + length = fixP->fx_cgen.field->val.leaf->length; + } + else + { + /* Or the far less useful operand-size guesstimate. */ + start = operand->start; + length = operand->length; + } + + /* FIXME: this is not a perfect heuristic for figuring out + whether an operand is signed: it only works when the operand + is an immediate. it's not terribly likely that any other + values will be signed relocs, but it's possible. */ + if (operand && (operand->hw_type == HW_H_SINT)) + signed_p = 1; /* If the reloc has been fully resolved finish the operand here. */ /* FIXME: This duplicates the capabilities of code in BFD. */ @@ -647,6 +957,18 @@ gas_cgen_md_apply_fix (fixP, valP, seg) partial_inplace == false. */ reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); +#ifdef OBJ_COMPLEX_RELC + if (reloc_type == BFD_RELOC_RELC) + { + /* Change addend to "self-describing" form, + for BFD to handle in the linker. */ + value = gas_cgen_encode_addend (start, operand->length, + length, fixP->fx_size, + cd->insn_chunk_bitsize / 8, + signed_p, + ! (fixP->fx_cgen.msb_field_p)); + } +#endif if (reloc_type != BFD_RELOC_NONE) fixP->fx_r_type = reloc_type; @@ -702,7 +1024,6 @@ gas_cgen_tc_gen_reloc (section, fixP) fixS * fixP; { arelent *reloc; - reloc = (arelent *) xmalloc (sizeof (arelent)); reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); @@ -740,3 +1061,4 @@ gas_cgen_begin () else cgen_clear_signed_overflow_ok (gas_cgen_cpu_desc); } + diff --git a/contrib/binutils/gas/cond.c b/contrib/binutils/gas/cond.c index d6c32acc253..d76e4d98d9a 100644 --- a/contrib/binutils/gas/cond.c +++ b/contrib/binutils/gas/cond.c @@ -1,6 +1,6 @@ /* cond.c - conditional assembly pseudo-ops, and .include Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 2000, 2001, 2002, - 2003 Free Software Foundation, Inc. + 2003, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,6 +20,7 @@ 02110-1301, USA. */ #include "as.h" +#include "sb.h" #include "macro.h" #include "obstack.h" diff --git a/contrib/binutils/gas/config.in b/contrib/binutils/gas/config.in index b15d8024aba..20d5df9a4e2 100644 --- a/contrib/binutils/gas/config.in +++ b/contrib/binutils/gas/config.in @@ -29,7 +29,11 @@ /* Supported emulations. */ #undef EMULATIONS -/* Define to 1 if NLS is requested */ +/* Define if you want run-time sanity checks. */ +#undef ENABLE_CHECKING + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ @@ -39,12 +43,6 @@ */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the `dcgettext' function. */ -#undef HAVE_DCGETTEXT - /* Is the prototype for getopt in in the expected format? */ #undef HAVE_DECL_GETOPT @@ -52,60 +50,24 @@ don't. */ #undef HAVE_DECL_VSNPRINTF +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* 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 - /* Define to 1 if you have the 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 header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - /* Define to 1 if you have the 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 `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the 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 `remove' function. */ #undef HAVE_REMOVE /* 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 header file. */ #undef HAVE_STDARG_H @@ -115,24 +77,12 @@ /* Define to 1 if you have the 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 header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -145,24 +95,16 @@ /* Define to 1 if you have the `unlink' function. */ #undef HAVE_UNLINK -/* Define to 1 if you have the header file. */ -#undef HAVE_VALUES_H - /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_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 to 1 if you have the `__argz_stringify' function. */ -#undef HAVE___ARGZ_STRINGIFY - /* Using i386 COFF? */ #undef I386COFF +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Using m68k COFF? */ #undef M68KCOFF @@ -217,9 +159,6 @@ /* generic support? */ #undef OBJ_MAYBE_GENERIC -/* IEEE support? */ -#undef OBJ_MAYBE_IEEE - /* SOM support? */ #undef OBJ_MAYBE_SOM @@ -282,6 +221,9 @@ /* Target vendor. */ #undef TARGET_VENDOR +/* Use b modifier when opening binary files? */ +#undef USE_BINARY_FOPEN + /* Use emulation support? */ #undef USE_EMULATIONS @@ -302,17 +244,8 @@ `char[]'. */ #undef YYTEXT_POINTER -/* 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 does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/contrib/binutils/gas/config/atof-vax.c b/contrib/binutils/gas/config/atof-vax.c index 75756904fb8..fe9f8b9b106 100644 --- a/contrib/binutils/gas/config/atof-vax.c +++ b/contrib/binutils/gas/config/atof-vax.c @@ -1,5 +1,5 @@ /* atof_vax.c - turn a Flonum into a VAX floating point number - Copyright 1987, 1992, 1993, 1995, 1997, 1999, 2000, 2005 + Copyright 1987, 1992, 1993, 1995, 1997, 1999, 2000, 2005, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -35,7 +35,7 @@ int flonum_gen2vax (int, FLONUM_TYPE *, LITTLENUM_TYPE *); /* Number of chars in flonum type 'letter'. */ -static int +static unsigned int atof_vax_sizeof (int letter) { int return_value; @@ -395,7 +395,7 @@ md_atof (int what_statement_type, { LITTLENUM_TYPE words[MAXIMUM_NUMBER_OF_LITTLENUMS]; char kind_of_float; - int number_of_chars; + unsigned int number_of_chars; LITTLENUM_TYPE *littlenumP; switch (what_statement_type) diff --git a/contrib/binutils/gas/config/obj-coff.c b/contrib/binutils/gas/config/obj-coff.c index a5a76ff3da0..1ac8a138f08 100644 --- a/contrib/binutils/gas/config/obj-coff.c +++ b/contrib/binutils/gas/config/obj-coff.c @@ -1026,7 +1026,7 @@ weak_name2altname (const char * name) } /* Return the name of the weak symbol corresponding to an - alterate symbol. */ + alternate symbol. */ static const char * weak_altname2name (const char * name) @@ -1579,7 +1579,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED) if (! load_removed) flags |= SEC_LOAD; /* Note - the READONLY flag is set here, even for the 'x' - attrbiute in order to be compatible with the MSVC + attribute in order to be compatible with the MSVC linker. */ if (! readonly_removed) flags |= SEC_READONLY; diff --git a/contrib/binutils/gas/config/obj-coff.h b/contrib/binutils/gas/config/obj-coff.h index 6fcbc9f06cb..d2b212565ef 100644 --- a/contrib/binutils/gas/config/obj-coff.h +++ b/contrib/binutils/gas/config/obj-coff.h @@ -1,6 +1,6 @@ /* coff object file format Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS. @@ -27,8 +27,6 @@ #include "targ-cpu.h" -#include "bfd.h" - /* This internal_lineno crap is to stop namespace pollution from the bfd internal coff headerfile. */ #define internal_lineno bfd_internal_lineno @@ -57,16 +55,30 @@ #endif #ifdef TC_I386 +#ifndef TE_PEP +#include "coff/x86_64.h" +#else #include "coff/i386.h" +#endif #ifdef TE_PE +#ifdef TE_PEP +extern const char * x86_64_target_format (void); +#define TARGET_FORMAT x86_64_target_format () +#define COFF_TARGET_FORMAT "pe-x86-64" +#else #define TARGET_FORMAT "pe-i386" #endif +#endif #ifndef TARGET_FORMAT +#ifdef TE_PEP +#define TARGET_FORMAT "coff-x86-64" +#else #define TARGET_FORMAT "coff-i386" #endif #endif +#endif #ifdef TC_M68K #include "coff/m68k.h" diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c index f922149cae0..2f93990e721 100644 --- a/contrib/binutils/gas/config/obj-elf.c +++ b/contrib/binutils/gas/config/obj-elf.c @@ -1,6 +1,7 @@ /* ELF object file format Copyright 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 GAS, the GNU Assembler. @@ -57,6 +58,10 @@ #include "elf/x86-64.h" #endif +#ifdef TC_MEP +#include "elf/mep.h" +#endif + static void obj_elf_line (int); static void obj_elf_size (int); static void obj_elf_type (int); @@ -632,6 +637,11 @@ obj_elf_change_section (const char *name, else if (attr == SHF_EXECINSTR && strcmp (name, ".note.GNU-stack") == 0) override = TRUE; +#ifdef TC_ALPHA + /* A section on Alpha may have SHF_ALPHA_GPREL. */ + else if ((attr & ~ssect->attr) == SHF_ALPHA_GPREL) + override = TRUE; +#endif else { if (group_name == NULL) @@ -1414,11 +1424,12 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) Elf_Internal_Note i_note; Elf_External_Note e_note; asection *note_secp = NULL; - int len; SKIP_WHITESPACE (); if (*input_line_pointer == '\"') { + unsigned int len; + ++input_line_pointer; /* -> 1st char of string. */ name = input_line_pointer; @@ -1429,19 +1440,19 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) *(input_line_pointer - 1) = '\0'; *input_line_pointer = c; - /* create the .note section */ - + /* Create the .note section. */ note_secp = subseg_new (".note", 0); bfd_set_section_flags (stdoutput, note_secp, SEC_HAS_CONTENTS | SEC_READONLY); - /* process the version string */ + /* Process the version string. */ + len = strlen (name) + 1; - len = strlen (name); - - i_note.namesz = ((len + 1) + 3) & ~3; /* round this to word boundary */ - i_note.descsz = 0; /* no description */ + /* PR 3456: Although the name field is padded out to an 4-byte + boundary, the namesz field should not be adjusted. */ + i_note.namesz = len; + i_note.descsz = 0; /* No description. */ i_note.type = NT_VERSION; p = frag_more (sizeof (e_note.namesz)); md_number_to_chars (p, i_note.namesz, sizeof (e_note.namesz)); @@ -1449,17 +1460,16 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED) md_number_to_chars (p, i_note.descsz, sizeof (e_note.descsz)); p = frag_more (sizeof (e_note.type)); md_number_to_chars (p, i_note.type, sizeof (e_note.type)); - p = frag_more (len + 1); - strcpy (p, name); + p = frag_more (len); + memcpy (p, name, len); frag_align (2, 0, 0); subseg_set (seg, subseg); } else - { - as_bad (_("expected quoted string")); - } + as_bad (_("expected quoted string")); + demand_empty_rest_of_line (); } @@ -1684,6 +1694,9 @@ adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) this at the moment, so we do it ourselves. We save the information in the symbol. */ +#ifdef OBJ_MAYBE_ELF +static +#endif void elf_ecoff_set_ext (symbolS *sym, struct ecoff_extr *ext) { @@ -1978,6 +1991,7 @@ elf_frob_file (void) bfd_set_section_size (stdoutput, s, size); s->contents = (unsigned char *) frag_more (size); frag_now->fr_fix = frag_now_fix_octets (); + frag_wane (frag_now); } #ifdef elf_tc_final_processing diff --git a/contrib/binutils/gas/config/obj-elf.h b/contrib/binutils/gas/config/obj-elf.h index 7ff9ef09aa3..29356ab3b06 100644 --- a/contrib/binutils/gas/config/obj-elf.h +++ b/contrib/binutils/gas/config/obj-elf.h @@ -1,6 +1,6 @@ /* ELF object file format. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -34,8 +34,6 @@ #define OUTPUT_FLAVOR bfd_target_elf_flavour #endif -#include "bfd.h" - #define BYTES_IN_WORD 4 /* for now */ #include "bfd/elf-bfd.h" @@ -83,15 +81,13 @@ struct elf_obj_sy #define OBJ_SYMFIELD_TYPE struct elf_obj_sy /* Symbol fields used by the ELF back end. */ -#define ELF_TARGET_SYMBOL_FIELDS int local:1; +#define ELF_TARGET_SYMBOL_FIELDS unsigned int local:1; /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */ #ifndef TARGET_SYMBOL_FIELDS #define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS #endif -/* #include "targ-cpu.h" */ - #ifndef FALSE #define FALSE 0 #define TRUE !FALSE @@ -134,13 +130,6 @@ int elf_s_get_other (symbolS *); extern asection *gdb_section; -#ifndef obj_sec_set_private_data -#define obj_sec_set_private_data(B, S) \ - if (! BFD_SEND ((B), _new_section_hook, ((B), (S)))) \ - as_fatal (_("can't allocate ELF private section data: %s"), \ - bfd_errmsg (bfd_get_error ())) -#endif - #ifndef obj_frob_file #define obj_frob_file elf_frob_file #endif @@ -247,6 +236,7 @@ extern void elf_pop_insert (void); #endif #ifndef OBJ_MAYBE_ELF +/* If OBJ_MAYBE_ELF then obj-multi.h will define obj_ecoff_set_ext. */ #define obj_ecoff_set_ext elf_ecoff_set_ext struct ecoff_extr; extern void elf_ecoff_set_ext (symbolS *, struct ecoff_extr *); diff --git a/contrib/binutils/gas/config/obj-ieee.c b/contrib/binutils/gas/config/obj-ieee.c deleted file mode 100644 index bac46757c13..00000000000 --- a/contrib/binutils/gas/config/obj-ieee.c +++ /dev/null @@ -1,613 +0,0 @@ -/* obj-format for ieee-695 records. - Copyright 1991, 1992, 1993, 1994, 1997, 2000, 2001, 2002, 2003, 2005 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Created by Steve Chamberlain . */ - -/* This will hopefully become the port through which bfd and gas talk, - for the moment, only ieee is known to work well. */ - -#include "bfd.h" -#include "as.h" -#include "subsegs.h" -#include "output-file.h" -#include "frags.h" - -bfd *abfd; - -/* How many addresses does the .align take? */ - -static relax_addressT -relax_align (address, alignment) - /* Address now. */ - register relax_addressT address; - - /* Alignment (binary). */ - register long alignment; -{ - relax_addressT mask; - relax_addressT new_address; - - mask = ~((~0) << alignment); - new_address = (address + mask) & (~mask); - return (new_address - address); -} - -/* Calculate the size of the frag chain - and create a bfd section to contain all of it. */ - -static void -size_section (abfd, idx) - bfd *abfd; - unsigned int idx; -{ - asection *sec; - unsigned int size = 0; - fragS *frag = segment_info[idx].frag_root; - - while (frag) - { - if (frag->fr_address != size) - { - printf (_("Out of step\n")); - size = frag->fr_address; - } - size += frag->fr_fix; - switch (frag->fr_type) - { - case rs_fill: - case rs_org: - size += frag->fr_offset * frag->fr_var; - break; - case rs_align: - case rs_align_code: - { - addressT off; - - off = relax_align (size, frag->fr_offset); - if (frag->fr_subtype != 0 && off > frag->fr_subtype) - off = 0; - size += off; - } - } - frag = frag->fr_next; - } - if (size) - { - char *name = segment_info[idx].name; - - if (name == (char *) NULL) - name = ".data"; - - segment_info[idx].user_stuff = - (char *) (sec = bfd_make_section (abfd, name)); - /* Make it output through itself. */ - sec->output_section = sec; - sec->flags |= SEC_HAS_CONTENTS; - bfd_set_section_size (abfd, sec, size); - } -} - -/* Run through a frag chain and write out the data to go with it. */ - -static void -fill_section (abfd, idx) - bfd *abfd; - unsigned int idx; -{ - asection *sec = segment_info[idx].user_stuff; - - if (sec) - { - fragS *frag = segment_info[idx].frag_root; - unsigned int offset = 0; - while (frag) - { - unsigned int fill_size; - unsigned int count; - switch (frag->fr_type) - { - case rs_fill: - case rs_align: - case rs_org: - if (frag->fr_fix) - { - bfd_set_section_contents (abfd, - sec, - frag->fr_literal, - frag->fr_address, - frag->fr_fix); - } - offset += frag->fr_fix; - fill_size = frag->fr_var; - if (fill_size) - { - unsigned int off = frag->fr_fix; - for (count = frag->fr_offset; count; count--) - { - bfd_set_section_contents (abfd, sec, - frag->fr_literal + - frag->fr_fix, - frag->fr_address + off, - fill_size); - off += fill_size; - } - } - break; - default: - abort (); - } - frag = frag->fr_next; - } - } -} - -/* Count the relocations in a chain. */ - -static unsigned int -count_entries_in_chain (idx) - unsigned int idx; -{ - unsigned int nrelocs; - fixS *fixup_ptr; - - /* Count the relocations. */ - fixup_ptr = segment_info[idx].fix_root; - nrelocs = 0; - while (fixup_ptr != (fixS *) NULL) - { - fixup_ptr = fixup_ptr->fx_next; - nrelocs++; - } - return nrelocs; -} - -/* Output all the relocations for a section. */ - -void -do_relocs_for (idx) - unsigned int idx; -{ - unsigned int nrelocs; - arelent **reloc_ptr_vector; - arelent *reloc_vector; - asymbol **ptrs; - asection *section = (asection *) (segment_info[idx].user_stuff); - unsigned int i; - fixS *from; - - if (section) - { - nrelocs = count_entries_in_chain (idx); - - reloc_ptr_vector = - (arelent **) malloc ((nrelocs + 1) * sizeof (arelent *)); - reloc_vector = (arelent *) malloc (nrelocs * sizeof (arelent)); - ptrs = (asymbol **) malloc (nrelocs * sizeof (asymbol *)); - from = segment_info[idx].fix_root; - for (i = 0; i < nrelocs; i++) - { - arelent *to = reloc_vector + i; - asymbol *s; - reloc_ptr_vector[i] = to; - to->howto = (reloc_howto_type *) (from->fx_r_type); - - s = &(from->fx_addsy->sy_symbol.sy); - to->address = ((char *) (from->fx_frag->fr_address + - from->fx_where)) - - ((char *) (&(from->fx_frag->fr_literal))); - to->addend = from->fx_offset; - /* If we know the symbol which we want to relocate to, turn - this reloaction into a section relative. - - If this relocation is pcrelative, and we know the - destination, we still want to keep the relocation - since - the linker might relax some of the bytes, but it stops - being pc relative and turns into an absolute relocation. */ - if (s) - { - if ((s->flags & BSF_UNDEFINED) == 0) - { - to->section = s->section; - - /* We can refer directly to the value field here, - rather than using S_GET_VALUE, because this is - only called after do_symbols, which sets up the - value field. */ - to->addend += s->value; - - to->sym_ptr_ptr = 0; - if (to->howto->pcrel_offset) - /* This is a pcrel relocation, the addend should - be adjusted. */ - to->addend -= to->address + 1; - } - else - { - to->section = 0; - *ptrs = &(from->fx_addsy->sy_symbol.sy); - to->sym_ptr_ptr = ptrs; - - if (to->howto->pcrel_offset) - /* This is a pcrel relocation, the addend should - be adjusted. */ - to->addend -= to->address - 1; - } - } - else - to->section = 0; - - ptrs++; - from = from->fx_next; - } - - /* Attach to the section. */ - section->orelocation = reloc_ptr_vector; - section->reloc_count = nrelocs; - section->flags |= SEC_LOAD; - } -} - -/* Do the symbols. */ - -static void -do_symbols (abfd) - bfd *abfd; -{ - extern symbolS *symbol_rootP; - symbolS *ptr; - asymbol **symbol_ptr_vec; - asymbol *symbol_vec; - unsigned int count = 0; - unsigned int index; - - for (ptr = symbol_rootP; - ptr != (symbolS *) NULL; - ptr = ptr->sy_next) - { - if (SEG_NORMAL (ptr->sy_symbol.seg)) - { - ptr->sy_symbol.sy.section = - (asection *) (segment_info[ptr->sy_symbol.seg].user_stuff); - S_SET_VALUE (ptr, S_GET_VALUE (ptr)); - if (ptr->sy_symbol.sy.flags == 0) - ptr->sy_symbol.sy.flags = BSF_LOCAL; - } - else - { - switch (ptr->sy_symbol.seg) - { - case SEG_ABSOLUTE: - ptr->sy_symbol.sy.flags |= BSF_ABSOLUTE; - ptr->sy_symbol.sy.section = 0; - break; - case SEG_UNKNOWN: - ptr->sy_symbol.sy.flags = BSF_UNDEFINED; - ptr->sy_symbol.sy.section = 0; - break; - default: - abort (); - } - } - ptr->sy_symbol.sy.value = S_GET_VALUE (ptr); - count++; - } - symbol_ptr_vec = (asymbol **) malloc ((count + 1) * sizeof (asymbol *)); - - index = 0; - for (ptr = symbol_rootP; - ptr != (symbolS *) NULL; - ptr = ptr->sy_next) - { - symbol_ptr_vec[index] = &(ptr->sy_symbol.sy); - index++; - } - symbol_ptr_vec[index] = 0; - abfd->outsymbols = symbol_ptr_vec; - abfd->symcount = count; -} - -/* The generic as->bfd converter. Other backends may have special case - code. */ - -void -bfd_as_write_hook () -{ - int i; - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - size_section (abfd, i); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - fill_section (abfd, i); - - do_symbols (abfd); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - do_relocs_for (i); -} - -S_SET_SEGMENT (x, y) - symbolS *x; - int y; -{ - x->sy_symbol.seg = y; -} - -S_IS_DEFINED (x) - symbolS *x; -{ - if (SEG_NORMAL (x->sy_symbol.seg)) - { - return 1; - } - switch (x->sy_symbol.seg) - { - case SEG_UNKNOWN: - return 0; - default: - abort (); - } -} - -S_IS_EXTERNAL (x) -{ - abort (); -} - -S_GET_DESC (x) -{ - abort (); -} - -S_GET_SEGMENT (x) - symbolS *x; -{ - return x->sy_symbol.seg; -} - -S_SET_EXTERNAL (x) - symbolS *x; -{ - x->sy_symbol.sy.flags |= BSF_GLOBAL | BSF_EXPORT; -} - -S_SET_NAME (x, y) - symbolS *x; - char *y; -{ - x->sy_symbol.sy.name = y; -} - -S_GET_OTHER (x) -{ - abort (); -} - -S_IS_DEBUG (x) -{ - abort (); -} - -#ifndef segment_name -char * -segment_name () -{ - abort (); -} -#endif - -void -obj_read_begin_hook () -{ -} - -static void -obj_ieee_section (ignore) - int ignore; -{ - extern char *input_line_pointer; - extern char is_end_of_line[]; - char *p = input_line_pointer; - char *s = p; - int i; - - /* Look up the name, if it doesn't exist, make it. */ - while (*p && *p != ' ' && *p != ',' && !is_end_of_line[*p]) - { - p++; - } - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - if (segment_info[i].hadone) - { - if (strncmp (segment_info[i].name, s, p - s) == 0) - goto ok; - } - else - break; - } - if (i == SEG_UNKNOWN) - { - as_bad (_("too many sections")); - return; - } - - segment_info[i].hadone = 1; - segment_info[i].name = malloc (p - s + 1); - memcpy (segment_info[i].name, s, p - s); - segment_info[i].name[p - s] = 0; -ok: - subseg_set (i, 0); - while (!is_end_of_line[*p]) - p++; - input_line_pointer = p; -} - -const pseudo_typeS obj_pseudo_table[] = -{ - {"section", obj_ieee_section, 0}, - {"data.b" , cons , 1}, - {"data.w" , cons , 2}, - {"data.l" , cons , 4}, - {"export" , s_globl , 0}, - {"option" , s_ignore , 0}, - {"end" , s_ignore , 0}, - {"import" , s_ignore , 0}, - {"sdata" , stringer , 0}, - 0, -}; - -void -obj_symbol_new_hook (symbolP) - symbolS *symbolP; -{ - symbolP->sy_symbol.sy.the_bfd = abfd; -} - -#if 1 - -#ifndef SUB_SEGMENT_ALIGN -#ifdef HANDLE_ALIGN -/* The last subsegment gets an alignment corresponding to the alignment - of the section. This allows proper nop-filling at the end of - code-bearing sections. */ -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ - (!(FRCHAIN)->frch_next || (FRCHAIN)->frch_next->frch_seg != (SEG) \ - ? get_recorded_alignment (SEG) : 0) -#else -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 2 -#endif -#endif - -extern void -write_object_file () -{ - int i; - struct frchain *frchain_ptr; - struct frag *frag_ptr; - - abfd = bfd_openw (out_file_name, "ieee"); - - if (abfd == 0) - { - as_perror (_("FATAL: Can't create %s"), out_file_name); - exit (EXIT_FAILURE); - } - bfd_set_format (abfd, bfd_object); - bfd_set_arch_mach (abfd, bfd_arch_h8300, 0); - subseg_set (1, 0); - subseg_set (2, 0); - subseg_set (3, 0); - - /* Run through all the sub-segments and align them up. Also - close any open frags. We tack a .fill onto the end of the - frag chain so that any .align's size can be worked by looking - at the next frag. */ - for (frchain_ptr = frchain_root; - frchain_ptr != (struct frchain *) NULL; - frchain_ptr = frchain_ptr->frch_next) - { - int alignment; - - subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg); - - alignment = SUB_SEGMENT_ALIGN (now_seg, frchain_ptr) - -#ifdef md_do_align - md_do_align (alignment, (char *) NULL, 0, 0, alignment_done); -#endif - if (subseg_text_p (now_seg)) - frag_align_code (alignment, 0); - else - frag_align (alignment, 0, 0); - -#ifdef md_do_align - alignment_done: -#endif - - frag_wane (frag_now); - frag_now->fr_fix = 0; - know (frag_now->fr_next == NULL); - } - - /* Now build one big frag chain for each segment, linked through - fr_next. */ - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - fragS **prev_frag_ptr_ptr; - struct frchain *next_frchain_ptr; - - segment_info[i].frag_root = segment_info[i].frchainP->frch_root; - } - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - relax_segment (segment_info[i].frag_root, i); - - /* Relaxation has completed. Freeze all syms. */ - finalize_syms = 1; - - /* Now the addresses of the frags are correct within the segment. */ - - bfd_as_write_hook (); - bfd_close (abfd); -} - -#endif - -H_SET_TEXT_SIZE (a, b) -{ - abort (); -} - -H_GET_TEXT_SIZE () -{ - abort (); -} - -H_SET_BSS_SIZE () -{ - abort (); -} - -H_SET_STRING_SIZE () -{ - abort (); -} - -H_SET_RELOCATION_SIZE () -{ - abort (); -} - -H_SET_MAGIC_NUMBER () -{ - abort (); -} - -H_GET_FILE_SIZE () -{ - abort (); -} - -H_GET_TEXT_RELOCATION_SIZE () -{ - abort (); -} diff --git a/contrib/binutils/gas/config/obj-ieee.h b/contrib/binutils/gas/config/obj-ieee.h deleted file mode 100644 index 29654296e83..00000000000 --- a/contrib/binutils/gas/config/obj-ieee.h +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is obj-ieee.h - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2002, 2003 - Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - - GAS 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. - - GAS 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 GAS; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "bfd.h" - -typedef struct -{ - asymbol sy; - int seg; -} -obj_symbol_type; - -#define S_GET_NAME(s) (((s)->sy_symbol.sy.name)) - -/* Return true for symbols that should not be reduced to section - symbols or eliminated from expressions, because they may be - overridden by the linker. */ -#define S_FORCE_RELOC(s, strict) (!SEG_NORMAL (x->sy_symbol.seg)) - -typedef struct - { - int x; - } -object_headers; - -int lineno_rootP; - -#define IEEE_STYLE diff --git a/contrib/binutils/gas/config/tc-alpha.c b/contrib/binutils/gas/config/tc-alpha.c index 3765b08c73a..e8f0bad55f3 100644 --- a/contrib/binutils/gas/config/tc-alpha.c +++ b/contrib/binutils/gas/config/tc-alpha.c @@ -1,6 +1,6 @@ /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Carnegie Mellon University, 1993. Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. Modified by Ken Raeburn for gas-2.x and ECOFF support. @@ -2383,15 +2383,15 @@ emit_ustX (const expressionS *tok, newtok[2] = newtok[0]; assemble_tokens ("or", newtok, 3, 1); - /* Emit "stq_u $t9, 0($at)". */ - set_tok_reg (newtok[0], AXP_REG_T9); - set_tok_const (newtok[1], 0); - set_tok_preg (newtok[2], AXP_REG_AT); - assemble_tokens ("stq_u", newtok, 3, 1); - /* Emit "stq_u $t10, size-1($at)". */ set_tok_reg (newtok[0], AXP_REG_T10); set_tok_const (newtok[1], (1 << lgsize) - 1); + set_tok_preg (newtok[2], AXP_REG_AT); + assemble_tokens ("stq_u", newtok, 3, 1); + + /* Emit "stq_u $t9, 0($at)". */ + set_tok_reg (newtok[0], AXP_REG_T9); + set_tok_const (newtok[1], 0); assemble_tokens ("stq_u", newtok, 3, 1); } diff --git a/contrib/binutils/gas/config/tc-alpha.h b/contrib/binutils/gas/config/tc-alpha.h index 42e004e4148..d28ab9ff35a 100644 --- a/contrib/binutils/gas/config/tc-alpha.h +++ b/contrib/binutils/gas/config/tc-alpha.h @@ -1,6 +1,6 @@ /* This file is tc-alpha.h Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - 2005 + 2005, 2006 Free Software Foundation, Inc. Written by Ken Raeburn . @@ -180,4 +180,4 @@ extern void alpha_cfi_frame_initial_instructions (void); #define DWARF2_LINE_MIN_INSN_LENGTH 4 #define DWARF2_DEFAULT_RETURN_COLUMN 26 -#define DWARF2_CIE_DATA_ALIGNMENT -8 +#define DWARF2_CIE_DATA_ALIGNMENT (-8) diff --git a/contrib/binutils/gas/config/tc-arc.c b/contrib/binutils/gas/config/tc-arc.c index 525b54083fb..490f327efd4 100644 --- a/contrib/binutils/gas/config/tc-arc.c +++ b/contrib/binutils/gas/config/tc-arc.c @@ -20,8 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include "libiberty.h" #include "as.h" #include "struc-symbol.h" #include "safe-ctype.h" diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c index ae420b35347..683e6ee48e2 100644 --- a/contrib/binutils/gas/config/tc-arm.c +++ b/contrib/binutils/gas/config/tc-arm.c @@ -1,6 +1,6 @@ /* tc-arm.c -- Assemble for the ARM Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 + 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -25,28 +25,24 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include +#include #define NO_RELOC 0 #include "as.h" #include "safe-ctype.h" - -/* Need TARGET_CPU. */ -#include "config.h" #include "subsegs.h" #include "obstack.h" -#include "symbols.h" -#include "listing.h" #include "opcode/arm.h" #ifdef OBJ_ELF #include "elf/arm.h" -#include "dwarf2dbg.h" #include "dw2gencfi.h" #endif -/* XXX Set this to 1 after the next binutils release. */ -#define WARN_DEPRECATED 0 +#include "dwarf2dbg.h" + +#define WARN_DEPRECATED 1 #ifdef OBJ_ELF /* Must be at least the size of the largest unwind opcode (currently two). */ @@ -90,6 +86,15 @@ static unsigned int marked_pr_dependency = 0; #endif /* OBJ_ELF */ +/* Results from operand parsing worker functions. */ + +typedef enum +{ + PARSE_OPERAND_SUCCESS, + PARSE_OPERAND_FAIL, + PARSE_OPERAND_FAIL_NO_BACKTRACK +} parse_operand_result; + enum arm_float_abi { ARM_FLOAT_ABI_HARD, @@ -150,11 +155,14 @@ static const arm_feature_set *mcpu_fpu_opt = NULL; static const arm_feature_set *march_cpu_opt = NULL; static const arm_feature_set *march_fpu_opt = NULL; static const arm_feature_set *mfpu_opt = NULL; +static const arm_feature_set *object_arch = NULL; /* Constants for known architecture features. */ static const arm_feature_set fpu_default = FPU_DEFAULT; static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1; static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2; +static const arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3; +static const arm_feature_set fpu_arch_neon_v1 = FPU_ARCH_NEON_V1; static const arm_feature_set fpu_arch_fpa = FPU_ARCH_FPA; static const arm_feature_set fpu_any_hard = FPU_ANY_HARD; static const arm_feature_set fpu_arch_maverick = FPU_ARCH_MAVERICK; @@ -194,6 +202,8 @@ static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1); static const arm_feature_set arm_arch_t2 = ARM_ARCH_THUMB2; static const arm_feature_set arm_arch_none = ARM_ARCH_NONE; +static const arm_feature_set arm_cext_iwmmxt2 = + ARM_FEATURE (0, ARM_CEXT_IWMMXT2); static const arm_feature_set arm_cext_iwmmxt = ARM_FEATURE (0, ARM_CEXT_IWMMXT); static const arm_feature_set arm_cext_xscale = @@ -206,6 +216,10 @@ static const arm_feature_set fpu_vfp_ext_v1xd = ARM_FEATURE (0, FPU_VFP_EXT_V1xD); static const arm_feature_set fpu_vfp_ext_v1 = ARM_FEATURE (0, FPU_VFP_EXT_V1); static const arm_feature_set fpu_vfp_ext_v2 = ARM_FEATURE (0, FPU_VFP_EXT_V2); +static const arm_feature_set fpu_vfp_ext_v3 = ARM_FEATURE (0, FPU_VFP_EXT_V3); +static const arm_feature_set fpu_neon_ext_v1 = ARM_FEATURE (0, FPU_NEON_EXT_V1); +static const arm_feature_set fpu_vfp_v3_or_neon_ext = + ARM_FEATURE (0, FPU_NEON_EXT_V1 | FPU_VFP_EXT_V3); static int mfloat_abi_opt = -1; /* Record user cpu selection for object attributes. */ @@ -218,6 +232,12 @@ static int meabi_flags = EABI_DEFAULT; # else static int meabi_flags = EF_ARM_EABI_UNKNOWN; # endif + +bfd_boolean +arm_is_eabi(void) +{ + return (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4); +} #endif #ifdef OBJ_ELF @@ -256,6 +276,31 @@ static int thumb_mode = 0; static bfd_boolean unified_syntax = FALSE; +enum neon_el_type +{ + NT_invtype, + NT_untyped, + NT_integer, + NT_float, + NT_poly, + NT_signed, + NT_unsigned +}; + +struct neon_type_el +{ + enum neon_el_type type; + unsigned size; +}; + +#define NEON_MAX_TYPE_ELS 4 + +struct neon_type +{ + struct neon_type_el el[NEON_MAX_TYPE_ELS]; + unsigned elems; +}; + struct arm_it { const char * error; @@ -263,6 +308,11 @@ struct arm_it int size; int size_req; int cond; + /* "uncond_value" is set to the value in place of the conditional field in + unconditional versions of the instruction, or -1 if nothing is + appropriate. */ + int uncond_value; + struct neon_type vectype; /* Set to the opcode if the instruction needs relaxation. Zero if the instruction is not relaxed. */ unsigned long relax; @@ -277,9 +327,19 @@ struct arm_it { unsigned reg; signed int imm; + struct neon_type_el vectype; unsigned present : 1; /* Operand present. */ unsigned isreg : 1; /* Operand was a register. */ unsigned immisreg : 1; /* .imm field is a second register. */ + unsigned isscalar : 1; /* Operand is a (Neon) scalar. */ + unsigned immisalign : 1; /* Immediate is an alignment specifier. */ + unsigned immisfloat : 1; /* Immediate was parsed as a float. */ + /* Note: we abuse "regisimm" to mean "is Neon register" in VMOV + instructions. This allows us to disambiguate ARM <-> vector insns. */ + unsigned regisimm : 1; /* 64-bit immediate, reg forms high 32 bits. */ + unsigned isvec : 1; /* Is a single, double or quad VFP/Neon reg. */ + unsigned isquad : 1; /* Operand is Neon quad-precision register. */ + unsigned issingle : 1; /* Operand is VFP single-precision register. */ unsigned hasreloc : 1; /* Operand has relocation suffix. */ unsigned writeback : 1; /* Operand has trailing ! */ unsigned preind : 1; /* Preindexed address. */ @@ -355,9 +415,10 @@ struct reloc_entry bfd_reloc_code_real_type reloc; }; -enum vfp_sp_reg_pos +enum vfp_reg_pos { - VFP_REG_Sd, VFP_REG_Sm, VFP_REG_Sn + VFP_REG_Sd, VFP_REG_Sm, VFP_REG_Sn, + VFP_REG_Dd, VFP_REG_Dm, VFP_REG_Dn }; enum vfp_ldstm_type @@ -365,6 +426,17 @@ enum vfp_ldstm_type VFP_LDSTMIA, VFP_LDSTMDB, VFP_LDSTMIAX, VFP_LDSTMDBX }; +/* Bits for DEFINED field in neon_typed_alias. */ +#define NTA_HASTYPE 1 +#define NTA_HASINDEX 2 + +struct neon_typed_alias +{ + unsigned char defined; + unsigned char index; + struct neon_type_el eltype; +}; + /* ARM register categories. This includes coprocessor numbers and various architecture extensions' registers. */ enum arm_reg_type @@ -375,6 +447,10 @@ enum arm_reg_type REG_TYPE_FN, REG_TYPE_VFS, REG_TYPE_VFD, + REG_TYPE_NQ, + REG_TYPE_VFSD, + REG_TYPE_NDQ, + REG_TYPE_NSDQ, REG_TYPE_VFC, REG_TYPE_MVF, REG_TYPE_MVD, @@ -388,13 +464,17 @@ enum arm_reg_type REG_TYPE_XSCALE, }; -/* Structure for a hash table entry for a register. */ +/* Structure for a hash table entry for a register. + If TYPE is REG_TYPE_VFD or REG_TYPE_NQ, the NEON field can point to extra + information which states whether a vector type or index is specified (for a + register alias created with .dn or .qn). Otherwise NEON should be NULL. */ struct reg_entry { - const char *name; - unsigned char number; - unsigned char type; - unsigned char builtin; + const char *name; + unsigned char number; + unsigned char type; + unsigned char builtin; + struct neon_typed_alias *neon; }; /* Diagnostics used when we don't get a register of the expected type. */ @@ -405,7 +485,11 @@ const char *const reg_expected_msgs[] = N_("co-processor register expected"), N_("FPA register expected"), N_("VFP single precision register expected"), - N_("VFP double precision register expected"), + N_("VFP/Neon double precision register expected"), + N_("Neon quad precision register expected"), + N_("VFP single or double precision register expected"), + N_("Neon double or quad precision register expected"), + N_("VFP single, double or Neon quad precision register expected"), N_("VFP system register expected"), N_("Maverick MVF register expected"), N_("Maverick MVD register expected"), @@ -465,11 +549,14 @@ struct asm_opcode #define INDEX_UP 0x00800000 #define WRITE_BACK 0x00200000 #define LDM_TYPE_2_OR_3 0x00400000 +#define CPSI_MMOD 0x00020000 #define LITERAL_MASK 0xf000f000 #define OPCODE_MASK 0xfe1fffff #define V4_STR_BIT 0x00000020 +#define T2_SUBS_PC_LR 0xf3de8f00 + #define DATA_OP_SHIFT 21 #define T2_OPCODE_MASK 0xfe1fffff @@ -571,6 +658,7 @@ struct asm_opcode #define BAD_ADDR_MODE _("instruction does not accept this addressing mode"); #define BAD_BRANCH _("branch must be last instruction in IT block") #define BAD_NOT_IT _("instruction not allowed in IT block") +#define BAD_FPU _("selected FPU does not support instruction") static struct hash_control *arm_ops_hsh; static struct hash_control *arm_cond_hsh; @@ -691,6 +779,9 @@ static int in_my_get_expression = 0; #define GE_NO_PREFIX 0 #define GE_IMM_PREFIX 1 #define GE_OPT_PREFIX 2 +/* This is a bit of a hack. Use an optional prefix, and also allow big (64-bit) + immediates, as can be used in Neon VMVN and VMOV immediate instructions. */ +#define GE_OPT_PREFIX_BIG 3 static int my_get_expression (expressionS * ep, char ** str, int prefix_mode) @@ -700,7 +791,8 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) /* In unified syntax, all prefixes are optional. */ if (unified_syntax) - prefix_mode = GE_OPT_PREFIX; + prefix_mode = (prefix_mode == GE_OPT_PREFIX_BIG) ? prefix_mode + : GE_OPT_PREFIX; switch (prefix_mode) { @@ -714,6 +806,7 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) (*str)++; break; case GE_OPT_PREFIX: + case GE_OPT_PREFIX_BIG: if (is_immediate_prefix (**str)) (*str)++; break; @@ -755,11 +848,12 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode) /* Get rid of any bignums now, so that we don't generate an error for which we can't establish a line number later on. Big numbers are never valid in instructions, which is where this routine is always called. */ - if (ep->X_op == O_big - || (ep->X_add_symbol - && (walk_no_bignums (ep->X_add_symbol) - || (ep->X_op_symbol - && walk_no_bignums (ep->X_op_symbol))))) + if (prefix_mode != GE_OPT_PREFIX_BIG + && (ep->X_op == O_big + || (ep->X_add_symbol + && (walk_no_bignums (ep->X_add_symbol) + || (ep->X_op_symbol + && walk_no_bignums (ep->X_op_symbol)))))) { inst.error = _("invalid constant"); *str = input_line_pointer; @@ -939,18 +1033,10 @@ arm_reg_parse_multi (char **ccp) return reg; } -/* As above, but the register must be of type TYPE, and the return - value is the register number or FAIL. */ - static int -arm_reg_parse (char **ccp, enum arm_reg_type type) +arm_reg_alt_syntax (char **ccp, char *start, struct reg_entry *reg, + enum arm_reg_type type) { - char *start = *ccp; - struct reg_entry *reg = arm_reg_parse_multi (ccp); - - if (reg && reg->type == type) - return reg->number; - /* Alternative syntaxes are accepted for a few register classes. */ switch (type) { @@ -982,10 +1068,354 @@ arm_reg_parse (char **ccp, enum arm_reg_type type) break; } + return FAIL; +} + +/* As arm_reg_parse_multi, but the register must be of type TYPE, and the + return value is the register number or FAIL. */ + +static int +arm_reg_parse (char **ccp, enum arm_reg_type type) +{ + char *start = *ccp; + struct reg_entry *reg = arm_reg_parse_multi (ccp); + int ret; + + /* Do not allow a scalar (reg+index) to parse as a register. */ + if (reg && reg->neon && (reg->neon->defined & NTA_HASINDEX)) + return FAIL; + + if (reg && reg->type == type) + return reg->number; + + if ((ret = arm_reg_alt_syntax (ccp, start, reg, type)) != FAIL) + return ret; + *ccp = start; return FAIL; } +/* Parse a Neon type specifier. *STR should point at the leading '.' + character. Does no verification at this stage that the type fits the opcode + properly. E.g., + + .i32.i32.s16 + .s32.f32 + .u16 + + Can all be legally parsed by this function. + + Fills in neon_type struct pointer with parsed information, and updates STR + to point after the parsed type specifier. Returns SUCCESS if this was a legal + type, FAIL if not. */ + +static int +parse_neon_type (struct neon_type *type, char **str) +{ + char *ptr = *str; + + if (type) + type->elems = 0; + + while (type->elems < NEON_MAX_TYPE_ELS) + { + enum neon_el_type thistype = NT_untyped; + unsigned thissize = -1u; + + if (*ptr != '.') + break; + + ptr++; + + /* Just a size without an explicit type. */ + if (ISDIGIT (*ptr)) + goto parsesize; + + switch (TOLOWER (*ptr)) + { + case 'i': thistype = NT_integer; break; + case 'f': thistype = NT_float; break; + case 'p': thistype = NT_poly; break; + case 's': thistype = NT_signed; break; + case 'u': thistype = NT_unsigned; break; + case 'd': + thistype = NT_float; + thissize = 64; + ptr++; + goto done; + default: + as_bad (_("unexpected character `%c' in type specifier"), *ptr); + return FAIL; + } + + ptr++; + + /* .f is an abbreviation for .f32. */ + if (thistype == NT_float && !ISDIGIT (*ptr)) + thissize = 32; + else + { + parsesize: + thissize = strtoul (ptr, &ptr, 10); + + if (thissize != 8 && thissize != 16 && thissize != 32 + && thissize != 64) + { + as_bad (_("bad size %d in type specifier"), thissize); + return FAIL; + } + } + + done: + if (type) + { + type->el[type->elems].type = thistype; + type->el[type->elems].size = thissize; + type->elems++; + } + } + + /* Empty/missing type is not a successful parse. */ + if (type->elems == 0) + return FAIL; + + *str = ptr; + + return SUCCESS; +} + +/* Errors may be set multiple times during parsing or bit encoding + (particularly in the Neon bits), but usually the earliest error which is set + will be the most meaningful. Avoid overwriting it with later (cascading) + errors by calling this function. */ + +static void +first_error (const char *err) +{ + if (!inst.error) + inst.error = err; +} + +/* Parse a single type, e.g. ".s32", leading period included. */ +static int +parse_neon_operand_type (struct neon_type_el *vectype, char **ccp) +{ + char *str = *ccp; + struct neon_type optype; + + if (*str == '.') + { + if (parse_neon_type (&optype, &str) == SUCCESS) + { + if (optype.elems == 1) + *vectype = optype.el[0]; + else + { + first_error (_("only one type should be specified for operand")); + return FAIL; + } + } + else + { + first_error (_("vector type expected")); + return FAIL; + } + } + else + return FAIL; + + *ccp = str; + + return SUCCESS; +} + +/* Special meanings for indices (which have a range of 0-7), which will fit into + a 4-bit integer. */ + +#define NEON_ALL_LANES 15 +#define NEON_INTERLEAVE_LANES 14 + +/* Parse either a register or a scalar, with an optional type. Return the + register number, and optionally fill in the actual type of the register + when multiple alternatives were given (NEON_TYPE_NDQ) in *RTYPE, and + type/index information in *TYPEINFO. */ + +static int +parse_typed_reg_or_scalar (char **ccp, enum arm_reg_type type, + enum arm_reg_type *rtype, + struct neon_typed_alias *typeinfo) +{ + char *str = *ccp; + struct reg_entry *reg = arm_reg_parse_multi (&str); + struct neon_typed_alias atype; + struct neon_type_el parsetype; + + atype.defined = 0; + atype.index = -1; + atype.eltype.type = NT_invtype; + atype.eltype.size = -1; + + /* Try alternate syntax for some types of register. Note these are mutually + exclusive with the Neon syntax extensions. */ + if (reg == NULL) + { + int altreg = arm_reg_alt_syntax (&str, *ccp, reg, type); + if (altreg != FAIL) + *ccp = str; + if (typeinfo) + *typeinfo = atype; + return altreg; + } + + /* Undo polymorphism when a set of register types may be accepted. */ + if ((type == REG_TYPE_NDQ + && (reg->type == REG_TYPE_NQ || reg->type == REG_TYPE_VFD)) + || (type == REG_TYPE_VFSD + && (reg->type == REG_TYPE_VFS || reg->type == REG_TYPE_VFD)) + || (type == REG_TYPE_NSDQ + && (reg->type == REG_TYPE_VFS || reg->type == REG_TYPE_VFD + || reg->type == REG_TYPE_NQ)) + || (type == REG_TYPE_MMXWC + && (reg->type == REG_TYPE_MMXWCG))) + type = reg->type; + + if (type != reg->type) + return FAIL; + + if (reg->neon) + atype = *reg->neon; + + if (parse_neon_operand_type (&parsetype, &str) == SUCCESS) + { + if ((atype.defined & NTA_HASTYPE) != 0) + { + first_error (_("can't redefine type for operand")); + return FAIL; + } + atype.defined |= NTA_HASTYPE; + atype.eltype = parsetype; + } + + if (skip_past_char (&str, '[') == SUCCESS) + { + if (type != REG_TYPE_VFD) + { + first_error (_("only D registers may be indexed")); + return FAIL; + } + + if ((atype.defined & NTA_HASINDEX) != 0) + { + first_error (_("can't change index for operand")); + return FAIL; + } + + atype.defined |= NTA_HASINDEX; + + if (skip_past_char (&str, ']') == SUCCESS) + atype.index = NEON_ALL_LANES; + else + { + expressionS exp; + + my_get_expression (&exp, &str, GE_NO_PREFIX); + + if (exp.X_op != O_constant) + { + first_error (_("constant expression required")); + return FAIL; + } + + if (skip_past_char (&str, ']') == FAIL) + return FAIL; + + atype.index = exp.X_add_number; + } + } + + if (typeinfo) + *typeinfo = atype; + + if (rtype) + *rtype = type; + + *ccp = str; + + return reg->number; +} + +/* Like arm_reg_parse, but allow allow the following extra features: + - If RTYPE is non-zero, return the (possibly restricted) type of the + register (e.g. Neon double or quad reg when either has been requested). + - If this is a Neon vector type with additional type information, fill + in the struct pointed to by VECTYPE (if non-NULL). + This function will fault on encountering a scalar. +*/ + +static int +arm_typed_reg_parse (char **ccp, enum arm_reg_type type, + enum arm_reg_type *rtype, struct neon_type_el *vectype) +{ + struct neon_typed_alias atype; + char *str = *ccp; + int reg = parse_typed_reg_or_scalar (&str, type, rtype, &atype); + + if (reg == FAIL) + return FAIL; + + /* Do not allow a scalar (reg+index) to parse as a register. */ + if ((atype.defined & NTA_HASINDEX) != 0) + { + first_error (_("register operand expected, but got scalar")); + return FAIL; + } + + if (vectype) + *vectype = atype.eltype; + + *ccp = str; + + return reg; +} + +#define NEON_SCALAR_REG(X) ((X) >> 4) +#define NEON_SCALAR_INDEX(X) ((X) & 15) + +/* Parse a Neon scalar. Most of the time when we're parsing a scalar, we don't + have enough information to be able to do a good job bounds-checking. So, we + just do easy checks here, and do further checks later. */ + +static int +parse_scalar (char **ccp, int elsize, struct neon_type_el *type) +{ + int reg; + char *str = *ccp; + struct neon_typed_alias atype; + + reg = parse_typed_reg_or_scalar (&str, REG_TYPE_VFD, NULL, &atype); + + if (reg == FAIL || (atype.defined & NTA_HASINDEX) == 0) + return FAIL; + + if (atype.index == NEON_ALL_LANES) + { + first_error (_("scalar must have an index")); + return FAIL; + } + else if (atype.index >= 64 / elsize) + { + first_error (_("scalar index out of range")); + return FAIL; + } + + if (type) + *type = atype.eltype; + + *ccp = str; + + return reg * 16 + atype.index; +} + /* Parse an ARM register list. Returns the bitmask, or FAIL. */ static long parse_reg_list (char ** strp) @@ -1011,7 +1441,7 @@ parse_reg_list (char ** strp) if ((reg = arm_reg_parse (&str, REG_TYPE_RN)) == FAIL) { - inst.error = _(reg_expected_msgs[REG_TYPE_RN]); + first_error (_(reg_expected_msgs[REG_TYPE_RN])); return FAIL; } @@ -1021,7 +1451,7 @@ parse_reg_list (char ** strp) if (reg <= cur_reg) { - inst.error = _("bad range in register list"); + first_error (_("bad range in register list")); return FAIL; } @@ -1052,7 +1482,7 @@ parse_reg_list (char ** strp) if (*str++ != '}') { - inst.error = _("missing `}'"); + first_error (_("missing `}'")); return FAIL; } } @@ -1111,55 +1541,117 @@ parse_reg_list (char ** strp) return range; } +/* Types of registers in a list. */ + +enum reg_list_els +{ + REGLIST_VFP_S, + REGLIST_VFP_D, + REGLIST_NEON_D +}; + /* Parse a VFP register list. If the string is invalid return FAIL. Otherwise return the number of registers, and set PBASE to the first - register. Double precision registers are matched if DP is nonzero. */ + register. Parses registers of type ETYPE. + If REGLIST_NEON_D is used, several syntax enhancements are enabled: + - Q registers can be used to specify pairs of D registers + - { } can be omitted from around a singleton register list + FIXME: This is not implemented, as it would require backtracking in + some cases, e.g.: + vtbl.8 d3,d4,d5 + This could be done (the meaning isn't really ambiguous), but doesn't + fit in well with the current parsing framework. + - 32 D registers may be used (also true for VFPv3). + FIXME: Types are ignored in these register lists, which is probably a + bug. */ static int -parse_vfp_reg_list (char **str, unsigned int *pbase, int dp) +parse_vfp_reg_list (char **ccp, unsigned int *pbase, enum reg_list_els etype) { + char *str = *ccp; int base_reg; int new_base; - int regtype; - int max_regs; + enum arm_reg_type regtype = 0; + int max_regs = 0; int count = 0; int warned = 0; unsigned long mask = 0; int i; - if (**str != '{') - return FAIL; - - (*str)++; - - if (dp) + if (*str != '{') { - regtype = REG_TYPE_VFD; - max_regs = 16; + inst.error = _("expecting {"); + return FAIL; } - else + + str++; + + switch (etype) { + case REGLIST_VFP_S: regtype = REG_TYPE_VFS; max_regs = 32; + break; + + case REGLIST_VFP_D: + regtype = REG_TYPE_VFD; + break; + + case REGLIST_NEON_D: + regtype = REG_TYPE_NDQ; + break; + } + + if (etype != REGLIST_VFP_S) + { + /* VFPv3 allows 32 D registers. */ + if (ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v3)) + { + max_regs = 32; + if (thumb_mode) + ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, + fpu_vfp_ext_v3); + else + ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, + fpu_vfp_ext_v3); + } + else + max_regs = 16; } base_reg = max_regs; do { - new_base = arm_reg_parse (str, regtype); + int setmask = 1, addregs = 1; + + new_base = arm_typed_reg_parse (&str, regtype, ®type, NULL); + if (new_base == FAIL) { - inst.error = gettext (reg_expected_msgs[regtype]); + first_error (_(reg_expected_msgs[regtype])); return FAIL; } + + if (new_base >= max_regs) + { + first_error (_("register out of range in list")); + return FAIL; + } + + /* Note: a value of 2 * n is returned for the register Q. */ + if (regtype == REG_TYPE_NQ) + { + setmask = 3; + addregs = 2; + } if (new_base < base_reg) base_reg = new_base; - if (mask & (1 << new_base)) + if (mask & (setmask << new_base)) { - inst.error = _("invalid register list"); + first_error (_("invalid register list")); return FAIL; } @@ -1169,43 +1661,53 @@ parse_vfp_reg_list (char **str, unsigned int *pbase, int dp) warned = 1; } - mask |= 1 << new_base; - count++; + mask |= setmask << new_base; + count += addregs; - if (**str == '-') /* We have the start of a range expression */ + if (*str == '-') /* We have the start of a range expression */ { int high_range; - (*str)++; + str++; - if ((high_range = arm_reg_parse (str, regtype)) == FAIL) + if ((high_range = arm_typed_reg_parse (&str, regtype, NULL, NULL)) + == FAIL) { inst.error = gettext (reg_expected_msgs[regtype]); return FAIL; } + if (high_range >= max_regs) + { + first_error (_("register out of range in list")); + return FAIL; + } + + if (regtype == REG_TYPE_NQ) + high_range = high_range + 1; + if (high_range <= new_base) { inst.error = _("register range not in ascending order"); return FAIL; } - for (new_base++; new_base <= high_range; new_base++) + for (new_base += addregs; new_base <= high_range; new_base += addregs) { - if (mask & (1 << new_base)) + if (mask & (setmask << new_base)) { inst.error = _("invalid register list"); return FAIL; } - mask |= 1 << new_base; - count++; + mask |= setmask << new_base; + count += addregs; } } } - while (skip_past_comma (str) != FAIL); + while (skip_past_comma (&str) != FAIL); - (*str)++; + str++; /* Sanity check -- should have raised a parse error above. */ if (count == 0 || count > max_regs) @@ -1224,9 +1726,204 @@ parse_vfp_reg_list (char **str, unsigned int *pbase, int dp) } } + *ccp = str; + return count; } +/* True if two alias types are the same. */ + +static int +neon_alias_types_same (struct neon_typed_alias *a, struct neon_typed_alias *b) +{ + if (!a && !b) + return 1; + + if (!a || !b) + return 0; + + if (a->defined != b->defined) + return 0; + + if ((a->defined & NTA_HASTYPE) != 0 + && (a->eltype.type != b->eltype.type + || a->eltype.size != b->eltype.size)) + return 0; + + if ((a->defined & NTA_HASINDEX) != 0 + && (a->index != b->index)) + return 0; + + return 1; +} + +/* Parse element/structure lists for Neon VLD and VST instructions. + The base register is put in *PBASE. + The lane (or one of the NEON_*_LANES constants) is placed in bits [3:0] of + the return value. + The register stride (minus one) is put in bit 4 of the return value. + Bits [6:5] encode the list length (minus one). + The type of the list elements is put in *ELTYPE, if non-NULL. */ + +#define NEON_LANE(X) ((X) & 0xf) +#define NEON_REG_STRIDE(X) ((((X) >> 4) & 1) + 1) +#define NEON_REGLIST_LENGTH(X) ((((X) >> 5) & 3) + 1) + +static int +parse_neon_el_struct_list (char **str, unsigned *pbase, + struct neon_type_el *eltype) +{ + char *ptr = *str; + int base_reg = -1; + int reg_incr = -1; + int count = 0; + int lane = -1; + int leading_brace = 0; + enum arm_reg_type rtype = REG_TYPE_NDQ; + int addregs = 1; + const char *const incr_error = "register stride must be 1 or 2"; + const char *const type_error = "mismatched element/structure types in list"; + struct neon_typed_alias firsttype; + + if (skip_past_char (&ptr, '{') == SUCCESS) + leading_brace = 1; + + do + { + struct neon_typed_alias atype; + int getreg = parse_typed_reg_or_scalar (&ptr, rtype, &rtype, &atype); + + if (getreg == FAIL) + { + first_error (_(reg_expected_msgs[rtype])); + return FAIL; + } + + if (base_reg == -1) + { + base_reg = getreg; + if (rtype == REG_TYPE_NQ) + { + reg_incr = 1; + addregs = 2; + } + firsttype = atype; + } + else if (reg_incr == -1) + { + reg_incr = getreg - base_reg; + if (reg_incr < 1 || reg_incr > 2) + { + first_error (_(incr_error)); + return FAIL; + } + } + else if (getreg != base_reg + reg_incr * count) + { + first_error (_(incr_error)); + return FAIL; + } + + if (!neon_alias_types_same (&atype, &firsttype)) + { + first_error (_(type_error)); + return FAIL; + } + + /* Handle Dn-Dm or Qn-Qm syntax. Can only be used with non-indexed list + modes. */ + if (ptr[0] == '-') + { + struct neon_typed_alias htype; + int hireg, dregs = (rtype == REG_TYPE_NQ) ? 2 : 1; + if (lane == -1) + lane = NEON_INTERLEAVE_LANES; + else if (lane != NEON_INTERLEAVE_LANES) + { + first_error (_(type_error)); + return FAIL; + } + if (reg_incr == -1) + reg_incr = 1; + else if (reg_incr != 1) + { + first_error (_("don't use Rn-Rm syntax with non-unit stride")); + return FAIL; + } + ptr++; + hireg = parse_typed_reg_or_scalar (&ptr, rtype, NULL, &htype); + if (hireg == FAIL) + { + first_error (_(reg_expected_msgs[rtype])); + return FAIL; + } + if (!neon_alias_types_same (&htype, &firsttype)) + { + first_error (_(type_error)); + return FAIL; + } + count += hireg + dregs - getreg; + continue; + } + + /* If we're using Q registers, we can't use [] or [n] syntax. */ + if (rtype == REG_TYPE_NQ) + { + count += 2; + continue; + } + + if ((atype.defined & NTA_HASINDEX) != 0) + { + if (lane == -1) + lane = atype.index; + else if (lane != atype.index) + { + first_error (_(type_error)); + return FAIL; + } + } + else if (lane == -1) + lane = NEON_INTERLEAVE_LANES; + else if (lane != NEON_INTERLEAVE_LANES) + { + first_error (_(type_error)); + return FAIL; + } + count++; + } + while ((count != 1 || leading_brace) && skip_past_comma (&ptr) != FAIL); + + /* No lane set by [x]. We must be interleaving structures. */ + if (lane == -1) + lane = NEON_INTERLEAVE_LANES; + + /* Sanity check. */ + if (lane == -1 || base_reg == -1 || count < 1 || count > 4 + || (count > 1 && reg_incr == -1)) + { + first_error (_("error parsing element/structure list")); + return FAIL; + } + + if ((count > 1 || leading_brace) && skip_past_char (&ptr, '}') == FAIL) + { + first_error (_("expected }")); + return FAIL; + } + + if (reg_incr == -1) + reg_incr = 1; + + if (eltype) + *eltype = firsttype.eltype; + + *pbase = base_reg; + *str = ptr; + + return lane | ((reg_incr - 1) << 4) | ((count - 1) << 5); +} + /* Parse an explicit relocation suffix on an expression. This is either nothing, or a word in parentheses. Note that if !OBJ_ELF, arm_reloc_hsh contains no entries, so this function can only @@ -1258,7 +1955,7 @@ parse_reloc (char **str) /* Directives: register aliases. */ -static void +static struct reg_entry * insert_reg_alias (char *str, int number, int type) { struct reg_entry *new; @@ -1274,7 +1971,7 @@ insert_reg_alias (char *str, int number, int type) else if (new->number != number || new->type != type) as_warn (_("ignoring redefinition of register alias '%s'"), str); - return; + return 0; } name = xstrdup (str); @@ -1284,9 +1981,31 @@ insert_reg_alias (char *str, int number, int type) new->number = number; new->type = type; new->builtin = FALSE; + new->neon = NULL; if (hash_insert (arm_reg_hsh, name, (PTR) new)) abort (); + + return new; +} + +static void +insert_neon_reg_alias (char *str, int number, int type, + struct neon_typed_alias *atype) +{ + struct reg_entry *reg = insert_reg_alias (str, number, type); + + if (!reg) + { + first_error (_("attempt to redefine typed alias")); + return; + } + + if (atype) + { + reg->neon = xmalloc (sizeof (struct neon_typed_alias)); + *reg->neon = *atype; + } } /* Look for the .req directive. This is of the form: @@ -1354,6 +2073,148 @@ create_register_alias (char * newname, char *p) return 1; } +/* Create a Neon typed/indexed register alias using directives, e.g.: + X .dn d5.s32[1] + Y .qn 6.s16 + Z .dn d7 + T .dn Z[0] + These typed registers can be used instead of the types specified after the + Neon mnemonic, so long as all operands given have types. Types can also be + specified directly, e.g.: + vadd d0.s32, d1.s32, d2.s32 +*/ + +static int +create_neon_reg_alias (char *newname, char *p) +{ + enum arm_reg_type basetype; + struct reg_entry *basereg; + struct reg_entry mybasereg; + struct neon_type ntype; + struct neon_typed_alias typeinfo; + char *namebuf, *nameend; + int namelen; + + typeinfo.defined = 0; + typeinfo.eltype.type = NT_invtype; + typeinfo.eltype.size = -1; + typeinfo.index = -1; + + nameend = p; + + if (strncmp (p, " .dn ", 5) == 0) + basetype = REG_TYPE_VFD; + else if (strncmp (p, " .qn ", 5) == 0) + basetype = REG_TYPE_NQ; + else + return 0; + + p += 5; + + if (*p == '\0') + return 0; + + basereg = arm_reg_parse_multi (&p); + + if (basereg && basereg->type != basetype) + { + as_bad (_("bad type for register")); + return 0; + } + + if (basereg == NULL) + { + expressionS exp; + /* Try parsing as an integer. */ + my_get_expression (&exp, &p, GE_NO_PREFIX); + if (exp.X_op != O_constant) + { + as_bad (_("expression must be constant")); + return 0; + } + basereg = &mybasereg; + basereg->number = (basetype == REG_TYPE_NQ) ? exp.X_add_number * 2 + : exp.X_add_number; + basereg->neon = 0; + } + + if (basereg->neon) + typeinfo = *basereg->neon; + + if (parse_neon_type (&ntype, &p) == SUCCESS) + { + /* We got a type. */ + if (typeinfo.defined & NTA_HASTYPE) + { + as_bad (_("can't redefine the type of a register alias")); + return 0; + } + + typeinfo.defined |= NTA_HASTYPE; + if (ntype.elems != 1) + { + as_bad (_("you must specify a single type only")); + return 0; + } + typeinfo.eltype = ntype.el[0]; + } + + if (skip_past_char (&p, '[') == SUCCESS) + { + expressionS exp; + /* We got a scalar index. */ + + if (typeinfo.defined & NTA_HASINDEX) + { + as_bad (_("can't redefine the index of a scalar alias")); + return 0; + } + + my_get_expression (&exp, &p, GE_NO_PREFIX); + + if (exp.X_op != O_constant) + { + as_bad (_("scalar index must be constant")); + return 0; + } + + typeinfo.defined |= NTA_HASINDEX; + typeinfo.index = exp.X_add_number; + + if (skip_past_char (&p, ']') == FAIL) + { + as_bad (_("expecting ]")); + return 0; + } + } + + namelen = nameend - newname; + namebuf = alloca (namelen + 1); + strncpy (namebuf, newname, namelen); + namebuf[namelen] = '\0'; + + insert_neon_reg_alias (namebuf, basereg->number, basetype, + typeinfo.defined != 0 ? &typeinfo : NULL); + + /* Insert name in all uppercase. */ + for (p = namebuf; *p; p++) + *p = TOUPPER (*p); + + if (strncmp (namebuf, newname, namelen)) + insert_neon_reg_alias (namebuf, basereg->number, basetype, + typeinfo.defined != 0 ? &typeinfo : NULL); + + /* Insert name in all lowercase. */ + for (p = namebuf; *p; p++) + *p = TOLOWER (*p); + + if (strncmp (namebuf, newname, namelen)) + insert_neon_reg_alias (namebuf, basereg->number, basetype, + typeinfo.defined != 0 ? &typeinfo : NULL); + + return 1; +} + /* Should never be called, as .req goes between the alias and the register name, not at the beginning of the line. */ static void @@ -1362,6 +2223,18 @@ s_req (int a ATTRIBUTE_UNUSED) as_bad (_("invalid syntax for .req directive")); } +static void +s_dn (int a ATTRIBUTE_UNUSED) +{ + as_bad (_("invalid syntax for .dn directive")); +} + +static void +s_qn (int a ATTRIBUTE_UNUSED) +{ + as_bad (_("invalid syntax for .qn directive")); +} + /* The .unreq directive deletes an alias which was previously defined by .req. For example: @@ -1399,6 +2272,8 @@ s_unreq (int a ATTRIBUTE_UNUSED) { hash_delete (arm_reg_hsh, name); free ((char *) reg->name); + if (reg->neon) + free (reg->neon); free (reg); } } @@ -1417,7 +2292,7 @@ s_unreq (int a ATTRIBUTE_UNUSED) static enum mstate mapstate = MAP_UNDEFINED; -static void +void mapping_state (enum mstate state) { symbolS * symbolP; @@ -1738,6 +2613,7 @@ static void s_align (int unused ATTRIBUTE_UNUSED) { int temp; + bfd_boolean fill_p; long temp_fill; long max_alignment = 15; @@ -1754,16 +2630,25 @@ s_align (int unused ATTRIBUTE_UNUSED) { input_line_pointer++; temp_fill = get_absolute_expression (); + fill_p = TRUE; } else - temp_fill = 0; + { + fill_p = FALSE; + temp_fill = 0; + } if (!temp) temp = 2; /* Only make a frag if we HAVE to. */ if (temp && !need_pass_2) - frag_align (temp, (int) temp_fill, 0); + { + if (!fill_p && subseg_text_p (now_seg)) + frag_align_code (temp, 0); + else + frag_align (temp, (int) temp_fill, 0); + } demand_empty_rest_of_line (); record_alignment (now_seg, temp); @@ -2414,7 +3299,57 @@ s_arm_unwind_save_fpa (int reg) } -/* Parse a directive saving VFP registers. */ +/* Parse a directive saving VFP registers for ARMv6 and above. */ + +static void +s_arm_unwind_save_vfp_armv6 (void) +{ + int count; + unsigned int start; + valueT op; + int num_vfpv3_regs = 0; + int num_regs_below_16; + + count = parse_vfp_reg_list (&input_line_pointer, &start, REGLIST_VFP_D); + if (count == FAIL) + { + as_bad (_("expected register list")); + ignore_rest_of_line (); + return; + } + + demand_empty_rest_of_line (); + + /* We always generate FSTMD/FLDMD-style unwinding opcodes (rather + than FSTMX/FLDMX-style ones). */ + + /* Generate opcode for (VFPv3) registers numbered in the range 16 .. 31. */ + if (start >= 16) + num_vfpv3_regs = count; + else if (start + count > 16) + num_vfpv3_regs = start + count - 16; + + if (num_vfpv3_regs > 0) + { + int start_offset = start > 16 ? start - 16 : 0; + op = 0xc800 | (start_offset << 4) | (num_vfpv3_regs - 1); + add_unwind_opcode (op, 2); + } + + /* Generate opcode for registers numbered in the range 0 .. 15. */ + num_regs_below_16 = num_vfpv3_regs > 0 ? 16 - (int) start : count; + assert (num_regs_below_16 + num_vfpv3_regs == count); + if (num_regs_below_16 > 0) + { + op = 0xc900 | (start << 4) | (num_regs_below_16 - 1); + add_unwind_opcode (op, 2); + } + + unwind.frame_size += count * 8; +} + + +/* Parse a directive saving VFP registers for pre-ARMv6. */ static void s_arm_unwind_save_vfp (void) @@ -2423,7 +3358,7 @@ s_arm_unwind_save_vfp (void) unsigned int reg; valueT op; - count = parse_vfp_reg_list (&input_line_pointer, ®, 1); + count = parse_vfp_reg_list (&input_line_pointer, ®, REGLIST_VFP_D); if (count == FAIL) { as_bad (_("expected register list")); @@ -2502,7 +3437,7 @@ s_arm_unwind_save_mmxwr (void) demand_empty_rest_of_line (); - /* Generate any deferred opcodes becuuse we're going to be looking at + /* Generate any deferred opcodes because we're going to be looking at the list. */ flush_pending_unwind (); @@ -2538,7 +3473,7 @@ s_arm_unwind_save_mmxwr (void) op = 0xffff << (reg - 1); if (reg > 0 - || ((mask & op) == (1u << (reg - 1)))) + && ((mask & op) == (1u << (reg - 1)))) { op = (1 << (reg + i + 1)) - 1; op &= ~((1 << reg) - 1); @@ -2635,7 +3570,7 @@ s_arm_unwind_save_mmxwcg (void) demand_empty_rest_of_line (); - /* Generate any deferred opcodes becuuse we're going to be looking at + /* Generate any deferred opcodes because we're going to be looking at the list. */ flush_pending_unwind (); @@ -2652,10 +3587,11 @@ error: } -/* Parse an unwind_save directive. */ +/* Parse an unwind_save directive. + If the argument is non-zero, this is a .vsave directive. */ static void -s_arm_unwind_save (int ignored ATTRIBUTE_UNUSED) +s_arm_unwind_save (int arch_v6) { char *peek; struct reg_entry *reg; @@ -2692,7 +3628,12 @@ s_arm_unwind_save (int ignored ATTRIBUTE_UNUSED) return; case REG_TYPE_RN: s_arm_unwind_save_core (); return; - case REG_TYPE_VFD: s_arm_unwind_save_vfp (); return; + case REG_TYPE_VFD: + if (arch_v6) + s_arm_unwind_save_vfp_armv6 (); + else + s_arm_unwind_save_vfp (); + return; case REG_TYPE_MMXWR: s_arm_unwind_save_mmxwr (); return; case REG_TYPE_MMXWCG: s_arm_unwind_save_mmxwcg (); return; @@ -2710,6 +3651,7 @@ s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) { int reg; valueT op; + int offset; reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN); if (reg == FAIL) @@ -2718,6 +3660,16 @@ s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) ignore_rest_of_line (); return; } + + /* Optional constant. */ + if (skip_past_comma (&input_line_pointer) != FAIL) + { + if (immediate_for_directive (&offset) == FAIL) + return; + } + else + offset = 0; + demand_empty_rest_of_line (); if (reg == REG_SP || reg == REG_PC) @@ -2735,7 +3687,7 @@ s_arm_unwind_movsp (int ignored ATTRIBUTE_UNUSED) /* Record the information for later. */ unwind.fp_reg = reg; - unwind.fp_offset = unwind.frame_size; + unwind.fp_offset = unwind.frame_size - offset; unwind.sp_restored = 1; } @@ -2818,7 +3770,7 @@ static void s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) { expressionS exp; - /* This is an arbitary limit. */ + /* This is an arbitrary limit. */ unsigned char op[16]; int count; @@ -2877,90 +3829,36 @@ s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) static void s_arm_eabi_attribute (int ignored ATTRIBUTE_UNUSED) { - expressionS exp; - bfd_boolean is_string; - int tag; - unsigned int i = 0; - char *s = NULL; - char saved_char; - - expression (& exp); - if (exp.X_op != O_constant) - goto bad; - - tag = exp.X_add_number; - if (tag == 4 || tag == 5 || tag == 32 || (tag > 32 && (tag & 1) != 0)) - is_string = 1; - else - is_string = 0; - - if (skip_past_comma (&input_line_pointer) == FAIL) - goto bad; - if (tag == 32 || !is_string) - { - expression (& exp); - if (exp.X_op != O_constant) - { - as_bad (_("expected numeric constant")); - ignore_rest_of_line (); - return; - } - i = exp.X_add_number; - } - if (tag == Tag_compatibility - && skip_past_comma (&input_line_pointer) == FAIL) - { - as_bad (_("expected comma")); - ignore_rest_of_line (); - return; - } - if (is_string) - { - skip_whitespace(input_line_pointer); - if (*input_line_pointer != '"') - goto bad_string; - input_line_pointer++; - s = input_line_pointer; - while (*input_line_pointer && *input_line_pointer != '"') - input_line_pointer++; - if (*input_line_pointer != '"') - goto bad_string; - saved_char = *input_line_pointer; - *input_line_pointer = 0; - } - else - { - s = NULL; - saved_char = 0; - } - - if (tag == Tag_compatibility) - elf32_arm_add_eabi_attr_compat (stdoutput, i, s); - else if (is_string) - elf32_arm_add_eabi_attr_string (stdoutput, tag, s); - else - elf32_arm_add_eabi_attr_int (stdoutput, tag, i); - - if (s) - { - *input_line_pointer = saved_char; - input_line_pointer++; - } - demand_empty_rest_of_line (); - return; -bad_string: - as_bad (_("bad string constant")); - ignore_rest_of_line (); - return; -bad: - as_bad (_("expected , ")); - ignore_rest_of_line (); + s_vendor_attribute (OBJ_ATTR_PROC); } +#endif /* OBJ_ELF */ static void s_arm_arch (int); +static void s_arm_object_arch (int); static void s_arm_cpu (int); static void s_arm_fpu (int); -#endif /* OBJ_ELF */ + +#ifdef TE_PE + +static void +pe_directive_secrel (int dummy ATTRIBUTE_UNUSED) +{ + expressionS exp; + + do + { + expression (&exp); + if (exp.X_op == O_symbol) + exp.X_op = O_secrel; + + emit_expr (&exp, 4); + } + while (*input_line_pointer++ == ','); + + input_line_pointer--; + demand_empty_rest_of_line (); +} +#endif /* TE_PE */ /* This table describes all the machine specific pseudo-ops the assembler has to support. The fields are: @@ -2972,6 +3870,9 @@ const pseudo_typeS md_pseudo_table[] = { /* Never called because '.req' does not start a line. */ { "req", s_req, 0 }, + /* Following two are likewise never called. */ + { "dn", s_dn, 0 }, + { "qn", s_qn, 0 }, { "unreq", s_unreq, 0 }, { "bss", s_bss, 0 }, { "align", s_align, 0 }, @@ -2985,6 +3886,10 @@ const pseudo_typeS md_pseudo_table[] = { "ltorg", s_ltorg, 0 }, { "pool", s_ltorg, 0 }, { "syntax", s_syntax, 0 }, + { "cpu", s_arm_cpu, 0 }, + { "arch", s_arm_arch, 0 }, + { "object_arch", s_arm_object_arch, 0 }, + { "fpu", s_arm_fpu, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, @@ -2996,20 +3901,30 @@ const pseudo_typeS md_pseudo_table[] = { "personalityindex", s_arm_unwind_personalityindex, 0 }, { "handlerdata", s_arm_unwind_handlerdata, 0 }, { "save", s_arm_unwind_save, 0 }, + { "vsave", s_arm_unwind_save, 1 }, { "movsp", s_arm_unwind_movsp, 0 }, { "pad", s_arm_unwind_pad, 0 }, { "setfp", s_arm_unwind_setfp, 0 }, { "unwind_raw", s_arm_unwind_raw, 0 }, - { "cpu", s_arm_cpu, 0 }, - { "arch", s_arm_arch, 0 }, - { "fpu", s_arm_fpu, 0 }, { "eabi_attribute", s_arm_eabi_attribute, 0 }, #else { "word", cons, 4}, + + /* These are used for dwarf. */ + {"2byte", cons, 2}, + {"4byte", cons, 4}, + {"8byte", cons, 8}, + /* These are used for dwarf2. */ + { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, + { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, #endif { "extend", float_cons, 'x' }, { "ldouble", float_cons, 'x' }, { "packed", float_cons, 'p' }, +#ifdef TE_PE + {"secrel32", pe_directive_secrel, 0}, +#endif { 0, 0, 0 } }; @@ -3043,6 +3958,58 @@ parse_immediate (char **str, int *val, int min, int max, return SUCCESS; } +/* Less-generic immediate-value read function with the possibility of loading a + big (64-bit) immediate, as required by Neon VMOV, VMVN and logic immediate + instructions. Puts the result directly in inst.operands[i]. */ + +static int +parse_big_immediate (char **str, int i) +{ + expressionS exp; + char *ptr = *str; + + my_get_expression (&exp, &ptr, GE_OPT_PREFIX_BIG); + + if (exp.X_op == O_constant) + { + inst.operands[i].imm = exp.X_add_number & 0xffffffff; + /* If we're on a 64-bit host, then a 64-bit number can be returned using + O_constant. We have to be careful not to break compilation for + 32-bit X_add_number, though. */ + if ((exp.X_add_number & ~0xffffffffl) != 0) + { + /* X >> 32 is illegal if sizeof (exp.X_add_number) == 4. */ + inst.operands[i].reg = ((exp.X_add_number >> 16) >> 16) & 0xffffffff; + inst.operands[i].regisimm = 1; + } + } + else if (exp.X_op == O_big + && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number > 32 + && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number <= 64) + { + unsigned parts = 32 / LITTLENUM_NUMBER_OF_BITS, j, idx = 0; + /* Bignums have their least significant bits in + generic_bignum[0]. Make sure we put 32 bits in imm and + 32 bits in reg, in a (hopefully) portable way. */ + assert (parts != 0); + inst.operands[i].imm = 0; + for (j = 0; j < parts; j++, idx++) + inst.operands[i].imm |= generic_bignum[idx] + << (LITTLENUM_NUMBER_OF_BITS * j); + inst.operands[i].reg = 0; + for (j = 0; j < parts; j++, idx++) + inst.operands[i].reg |= generic_bignum[idx] + << (LITTLENUM_NUMBER_OF_BITS * j); + inst.operands[i].regisimm = 1; + } + else + return FAIL; + + *str = ptr; + + return SUCCESS; +} + /* Returns the pseudo-register number of an FPA immediate constant, or FAIL if there isn't a valid constant here. */ @@ -3134,6 +4101,80 @@ parse_fpa_immediate (char ** str) return FAIL; } +/* Returns 1 if a number has "quarter-precision" float format + 0baBbbbbbc defgh000 00000000 00000000. */ + +static int +is_quarter_float (unsigned imm) +{ + int bs = (imm & 0x20000000) ? 0x3e000000 : 0x40000000; + return (imm & 0x7ffff) == 0 && ((imm & 0x7e000000) ^ bs) == 0; +} + +/* Parse an 8-bit "quarter-precision" floating point number of the form: + 0baBbbbbbc defgh000 00000000 00000000. + The zero and minus-zero cases need special handling, since they can't be + encoded in the "quarter-precision" float format, but can nonetheless be + loaded as integer constants. */ + +static unsigned +parse_qfloat_immediate (char **ccp, int *immed) +{ + char *str = *ccp; + char *fpnum; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + int found_fpchar = 0; + + skip_past_char (&str, '#'); + + /* We must not accidentally parse an integer as a floating-point number. Make + sure that the value we parse is not an integer by checking for special + characters '.' or 'e'. + FIXME: This is a horrible hack, but doing better is tricky because type + information isn't in a very usable state at parse time. */ + fpnum = str; + skip_whitespace (fpnum); + + if (strncmp (fpnum, "0x", 2) == 0) + return FAIL; + else + { + for (; *fpnum != '\0' && *fpnum != ' ' && *fpnum != '\n'; fpnum++) + if (*fpnum == '.' || *fpnum == 'e' || *fpnum == 'E') + { + found_fpchar = 1; + break; + } + + if (!found_fpchar) + return FAIL; + } + + if ((str = atof_ieee (str, 's', words)) != NULL) + { + unsigned fpword = 0; + int i; + + /* Our FP word must be 32 bits (single-precision FP). */ + for (i = 0; i < 32 / LITTLENUM_NUMBER_OF_BITS; i++) + { + fpword <<= LITTLENUM_NUMBER_OF_BITS; + fpword |= words[i]; + } + + if (is_quarter_float (fpword) || (fpword & 0x7fffffff) == 0) + *immed = fpword; + else + return FAIL; + + *ccp = str; + + return SUCCESS; + } + + return FAIL; +} + /* Shift operands. */ enum shift_kind { @@ -3317,6 +4358,168 @@ parse_shifter_operand (char **str, int i) return SUCCESS; } +/* Group relocation information. Each entry in the table contains the + textual name of the relocation as may appear in assembler source + and must end with a colon. + Along with this textual name are the relocation codes to be used if + the corresponding instruction is an ALU instruction (ADD or SUB only), + an LDR, an LDRS, or an LDC. */ + +struct group_reloc_table_entry +{ + const char *name; + int alu_code; + int ldr_code; + int ldrs_code; + int ldc_code; +}; + +typedef enum +{ + /* Varieties of non-ALU group relocation. */ + + GROUP_LDR, + GROUP_LDRS, + GROUP_LDC +} group_reloc_type; + +static struct group_reloc_table_entry group_reloc_table[] = + { /* Program counter relative: */ + { "pc_g0_nc", + BFD_RELOC_ARM_ALU_PC_G0_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "pc_g0", + BFD_RELOC_ARM_ALU_PC_G0, /* ALU */ + BFD_RELOC_ARM_LDR_PC_G0, /* LDR */ + BFD_RELOC_ARM_LDRS_PC_G0, /* LDRS */ + BFD_RELOC_ARM_LDC_PC_G0 }, /* LDC */ + { "pc_g1_nc", + BFD_RELOC_ARM_ALU_PC_G1_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "pc_g1", + BFD_RELOC_ARM_ALU_PC_G1, /* ALU */ + BFD_RELOC_ARM_LDR_PC_G1, /* LDR */ + BFD_RELOC_ARM_LDRS_PC_G1, /* LDRS */ + BFD_RELOC_ARM_LDC_PC_G1 }, /* LDC */ + { "pc_g2", + BFD_RELOC_ARM_ALU_PC_G2, /* ALU */ + BFD_RELOC_ARM_LDR_PC_G2, /* LDR */ + BFD_RELOC_ARM_LDRS_PC_G2, /* LDRS */ + BFD_RELOC_ARM_LDC_PC_G2 }, /* LDC */ + /* Section base relative */ + { "sb_g0_nc", + BFD_RELOC_ARM_ALU_SB_G0_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "sb_g0", + BFD_RELOC_ARM_ALU_SB_G0, /* ALU */ + BFD_RELOC_ARM_LDR_SB_G0, /* LDR */ + BFD_RELOC_ARM_LDRS_SB_G0, /* LDRS */ + BFD_RELOC_ARM_LDC_SB_G0 }, /* LDC */ + { "sb_g1_nc", + BFD_RELOC_ARM_ALU_SB_G1_NC, /* ALU */ + 0, /* LDR */ + 0, /* LDRS */ + 0 }, /* LDC */ + { "sb_g1", + BFD_RELOC_ARM_ALU_SB_G1, /* ALU */ + BFD_RELOC_ARM_LDR_SB_G1, /* LDR */ + BFD_RELOC_ARM_LDRS_SB_G1, /* LDRS */ + BFD_RELOC_ARM_LDC_SB_G1 }, /* LDC */ + { "sb_g2", + BFD_RELOC_ARM_ALU_SB_G2, /* ALU */ + BFD_RELOC_ARM_LDR_SB_G2, /* LDR */ + BFD_RELOC_ARM_LDRS_SB_G2, /* LDRS */ + BFD_RELOC_ARM_LDC_SB_G2 } }; /* LDC */ + +/* Given the address of a pointer pointing to the textual name of a group + relocation as may appear in assembler source, attempt to find its details + in group_reloc_table. The pointer will be updated to the character after + the trailing colon. On failure, FAIL will be returned; SUCCESS + otherwise. On success, *entry will be updated to point at the relevant + group_reloc_table entry. */ + +static int +find_group_reloc_table_entry (char **str, struct group_reloc_table_entry **out) +{ + unsigned int i; + for (i = 0; i < ARRAY_SIZE (group_reloc_table); i++) + { + int length = strlen (group_reloc_table[i].name); + + if (strncasecmp (group_reloc_table[i].name, *str, length) == 0 && + (*str)[length] == ':') + { + *out = &group_reloc_table[i]; + *str += (length + 1); + return SUCCESS; + } + } + + return FAIL; +} + +/* Parse a for an ARM data processing instruction + (as for parse_shifter_operand) where group relocations are allowed: + + # + #, + #:: + + , + + where is one of the strings defined in group_reloc_table. + The hashes are optional. + + Everything else is as for parse_shifter_operand. */ + +static parse_operand_result +parse_shifter_operand_group_reloc (char **str, int i) +{ + /* Determine if we have the sequence of characters #: or just : + coming next. If we do, then we check for a group relocation. + If we don't, punt the whole lot to parse_shifter_operand. */ + + if (((*str)[0] == '#' && (*str)[1] == ':') + || (*str)[0] == ':') + { + struct group_reloc_table_entry *entry; + + if ((*str)[0] == '#') + (*str) += 2; + else + (*str)++; + + /* Try to parse a group relocation. Anything else is an error. */ + if (find_group_reloc_table_entry (str, &entry) == FAIL) + { + inst.error = _("unknown group relocation"); + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + } + + /* We now have the group relocation table entry corresponding to + the name in the assembler source. Next, we parse the expression. */ + if (my_get_expression (&inst.reloc.exp, str, GE_NO_PREFIX)) + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + + /* Record the relocation type (always the ALU variant here). */ + inst.reloc.type = entry->alu_code; + assert (inst.reloc.type != 0); + + return PARSE_OPERAND_SUCCESS; + } + else + return parse_shifter_operand (str, i) == SUCCESS + ? PARSE_OPERAND_SUCCESS : PARSE_OPERAND_FAIL; + + /* Never reached. */ +} + /* Parse all forms of an ARM address expression. Information is written to inst.operands[i] and/or inst.reloc. @@ -3349,8 +4552,9 @@ parse_shifter_operand (char **str, int i) It is the caller's responsibility to check for addressing modes not supported by the instruction, and to set inst.reloc.type. */ -static int -parse_address (char **str, int i) +static parse_operand_result +parse_address_main (char **str, int i, int group_relocations, + group_reloc_type group_type) { char *p = *str; int reg; @@ -3368,16 +4572,16 @@ parse_address (char **str, int i) /* else a load-constant pseudo op, no special treatment needed here */ if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) - return FAIL; + return PARSE_OPERAND_FAIL; *str = p; - return SUCCESS; + return PARSE_OPERAND_SUCCESS; } if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) == FAIL) { inst.error = _(reg_expected_msgs[REG_TYPE_RN]); - return FAIL; + return PARSE_OPERAND_FAIL; } inst.operands[i].reg = reg; inst.operands[i].isreg = 1; @@ -3396,8 +4600,25 @@ parse_address (char **str, int i) if (skip_past_comma (&p) == SUCCESS) if (parse_shift (&p, i, SHIFT_IMMEDIATE) == FAIL) - return FAIL; + return PARSE_OPERAND_FAIL; } + else if (skip_past_char (&p, ':') == SUCCESS) + { + /* FIXME: '@' should be used here, but it's filtered out by generic + code before we get to see it here. This may be subject to + change. */ + expressionS exp; + my_get_expression (&exp, &p, GE_NO_PREFIX); + if (exp.X_op != O_constant) + { + inst.error = _("alignment must be constant"); + return PARSE_OPERAND_FAIL; + } + inst.operands[i].imm = exp.X_add_number << 8; + inst.operands[i].immisalign = 1; + /* Alignments are not pre-indexes. */ + inst.operands[i].preind = 0; + } else { if (inst.operands[i].negative) @@ -3405,15 +4626,68 @@ parse_address (char **str, int i) inst.operands[i].negative = 0; p--; } - if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) - return FAIL; + + if (group_relocations && + ((*p == '#' && *(p + 1) == ':') || *p == ':')) + + { + struct group_reloc_table_entry *entry; + + /* Skip over the #: or : sequence. */ + if (*p == '#') + p += 2; + else + p++; + + /* Try to parse a group relocation. Anything else is an + error. */ + if (find_group_reloc_table_entry (&p, &entry) == FAIL) + { + inst.error = _("unknown group relocation"); + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + } + + /* We now have the group relocation table entry corresponding to + the name in the assembler source. Next, we parse the + expression. */ + if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + + /* Record the relocation type. */ + switch (group_type) + { + case GROUP_LDR: + inst.reloc.type = entry->ldr_code; + break; + + case GROUP_LDRS: + inst.reloc.type = entry->ldrs_code; + break; + + case GROUP_LDC: + inst.reloc.type = entry->ldc_code; + break; + + default: + assert (0); + } + + if (inst.reloc.type == 0) + { + inst.error = _("this group relocation is not allowed on this instruction"); + return PARSE_OPERAND_FAIL_NO_BACKTRACK; + } + } + else + if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) + return PARSE_OPERAND_FAIL; } } if (skip_past_char (&p, ']') == FAIL) { inst.error = _("']' expected"); - return FAIL; + return PARSE_OPERAND_FAIL; } if (skip_past_char (&p, '!') == SUCCESS) @@ -3426,20 +4700,20 @@ parse_address (char **str, int i) /* [Rn], {expr} - unindexed, with option */ if (parse_immediate (&p, &inst.operands[i].imm, 0, 255, TRUE) == FAIL) - return FAIL; + return PARSE_OPERAND_FAIL; if (skip_past_char (&p, '}') == FAIL) { inst.error = _("'}' expected at end of 'option' field"); - return FAIL; + return PARSE_OPERAND_FAIL; } if (inst.operands[i].preind) { inst.error = _("cannot combine index with option"); - return FAIL; + return PARSE_OPERAND_FAIL; } *str = p; - return SUCCESS; + return PARSE_OPERAND_SUCCESS; } else { @@ -3449,7 +4723,7 @@ parse_address (char **str, int i) if (inst.operands[i].preind) { inst.error = _("cannot combine pre- and post-indexing"); - return FAIL; + return PARSE_OPERAND_FAIL; } if (*p == '+') p++; @@ -3457,12 +4731,17 @@ parse_address (char **str, int i) if ((reg = arm_reg_parse (&p, REG_TYPE_RN)) != FAIL) { - inst.operands[i].imm = reg; + /* We might be using the immediate for alignment already. If we + are, OR the register number into the low-order bits. */ + if (inst.operands[i].immisalign) + inst.operands[i].imm |= reg; + else + inst.operands[i].imm = reg; inst.operands[i].immisreg = 1; if (skip_past_comma (&p) == SUCCESS) if (parse_shift (&p, i, SHIFT_IMMEDIATE) == FAIL) - return FAIL; + return PARSE_OPERAND_FAIL; } else { @@ -3472,7 +4751,7 @@ parse_address (char **str, int i) p--; } if (my_get_expression (&inst.reloc.exp, &p, GE_IMM_PREFIX)) - return FAIL; + return PARSE_OPERAND_FAIL; } } } @@ -3486,6 +4765,59 @@ parse_address (char **str, int i) inst.reloc.exp.X_add_number = 0; } *str = p; + return PARSE_OPERAND_SUCCESS; +} + +static int +parse_address (char **str, int i) +{ + return parse_address_main (str, i, 0, 0) == PARSE_OPERAND_SUCCESS + ? SUCCESS : FAIL; +} + +static parse_operand_result +parse_address_group_reloc (char **str, int i, group_reloc_type type) +{ + return parse_address_main (str, i, 1, type); +} + +/* Parse an operand for a MOVW or MOVT instruction. */ +static int +parse_half (char **str) +{ + char * p; + + p = *str; + skip_past_char (&p, '#'); + if (strncasecmp (p, ":lower16:", 9) == 0) + inst.reloc.type = BFD_RELOC_ARM_MOVW; + else if (strncasecmp (p, ":upper16:", 9) == 0) + inst.reloc.type = BFD_RELOC_ARM_MOVT; + + if (inst.reloc.type != BFD_RELOC_UNUSED) + { + p += 9; + skip_whitespace(p); + } + + if (my_get_expression (&inst.reloc.exp, &p, GE_NO_PREFIX)) + return FAIL; + + if (inst.reloc.type == BFD_RELOC_UNUSED) + { + if (inst.reloc.exp.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return FAIL; + } + if (inst.reloc.exp.X_add_number < 0 + || inst.reloc.exp.X_add_number > 0xffff) + { + inst.error = _("immediate value out of range"); + return FAIL; + } + } + *str = p; return SUCCESS; } @@ -3752,6 +5084,228 @@ parse_tb (char **str) return SUCCESS; } +/* Parse the operands of a Neon VMOV instruction. See do_neon_mov for more + information on the types the operands can take and how they are encoded. + Up to four operands may be read; this function handles setting the + ".present" field for each read operand itself. + Updates STR and WHICH_OPERAND if parsing is successful and returns SUCCESS, + else returns FAIL. */ + +static int +parse_neon_mov (char **str, int *which_operand) +{ + int i = *which_operand, val; + enum arm_reg_type rtype; + char *ptr = *str; + struct neon_type_el optype; + + if ((val = parse_scalar (&ptr, 8, &optype)) != FAIL) + { + /* Case 4: VMOV. , . */ + inst.operands[i].reg = val; + inst.operands[i].isscalar = 1; + inst.operands[i].vectype = optype; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].present = 1; + } + else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_NSDQ, &rtype, &optype)) + != FAIL) + { + /* Cases 0, 1, 2, 3, 5 (D only). */ + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); + inst.operands[i].isvec = 1; + inst.operands[i].vectype = optype; + inst.operands[i++].present = 1; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) != FAIL) + { + /* Case 5: VMOV , , . + Case 13: VMOV , */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].present = 1; + + if (rtype == REG_TYPE_NQ) + { + first_error (_("can't use Neon quad register here")); + return FAIL; + } + else if (rtype != REG_TYPE_VFS) + { + i++; + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].present = 1; + } + } + else if (parse_qfloat_immediate (&ptr, &inst.operands[i].imm) == SUCCESS) + /* Case 2: VMOV.
, # + Case 3: VMOV.
, # + Case 10: VMOV.F32 , # + Case 11: VMOV.F64
, # */ + inst.operands[i].immisfloat = 1; + else if (parse_big_immediate (&ptr, i) == SUCCESS) + /* Case 2: VMOV.
, # + Case 3: VMOV.
, # */ + ; + else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_NSDQ, &rtype, + &optype)) != FAIL) + { + /* Case 0: VMOV , + Case 1: VMOV
, + Case 8: VMOV.F32 , + Case 15: VMOV , , , */ + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); + inst.operands[i].isvec = 1; + inst.operands[i].vectype = optype; + inst.operands[i].present = 1; + + if (skip_past_comma (&ptr) == SUCCESS) + { + /* Case 15. */ + i++; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) == FAIL) + goto wanted_arm; + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + } + } + else + { + first_error (_("expected or or operand")); + return FAIL; + } + } + else if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) != FAIL) + { + /* Cases 6, 7. */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = parse_scalar (&ptr, 8, &optype)) != FAIL) + { + /* Case 6: VMOV.
, */ + inst.operands[i].reg = val; + inst.operands[i].isscalar = 1; + inst.operands[i].present = 1; + inst.operands[i].vectype = optype; + } + else if ((val = arm_reg_parse (&ptr, REG_TYPE_RN)) != FAIL) + { + /* Case 7: VMOV , , */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i++].present = 1; + + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + + if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_VFSD, &rtype, &optype)) + == FAIL) + { + first_error (_(reg_expected_msgs[REG_TYPE_VFSD])); + return FAIL; + } + + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isvec = 1; + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); + inst.operands[i].vectype = optype; + inst.operands[i].present = 1; + + if (rtype == REG_TYPE_VFS) + { + /* Case 14. */ + i++; + if (skip_past_comma (&ptr) == FAIL) + goto wanted_comma; + if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_VFS, NULL, + &optype)) == FAIL) + { + first_error (_(reg_expected_msgs[REG_TYPE_VFS])); + return FAIL; + } + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isvec = 1; + inst.operands[i].issingle = 1; + inst.operands[i].vectype = optype; + inst.operands[i].present = 1; + } + } + else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_VFS, NULL, &optype)) + != FAIL) + { + /* Case 13. */ + inst.operands[i].reg = val; + inst.operands[i].isreg = 1; + inst.operands[i].isvec = 1; + inst.operands[i].issingle = 1; + inst.operands[i].vectype = optype; + inst.operands[i++].present = 1; + } + } + else + { + first_error (_("parse error")); + return FAIL; + } + + /* Successfully parsed the operands. Update args. */ + *which_operand = i; + *str = ptr; + return SUCCESS; + + wanted_comma: + first_error (_("expected comma")); + return FAIL; + + wanted_arm: + first_error (_(reg_expected_msgs[REG_TYPE_RN])); + return FAIL; +} + /* Matcher codes for parse_operands. */ enum operand_parse_code { @@ -3765,7 +5319,13 @@ enum operand_parse_code OP_RCN, /* Coprocessor register */ OP_RF, /* FPA register */ OP_RVS, /* VFP single precision register */ - OP_RVD, /* VFP double precision register */ + OP_RVD, /* VFP double precision register (0..15) */ + OP_RND, /* Neon double precision register (0..31) */ + OP_RNQ, /* Neon quad precision register */ + OP_RVSD, /* VFP single or double precision register */ + OP_RNDQ, /* Neon double or quad precision register */ + OP_RNSDQ, /* Neon single, double or quad precision register */ + OP_RNSC, /* Neon scalar D[X] */ OP_RVC, /* VFP control register */ OP_RMF, /* Maverick F register */ OP_RMD, /* Maverick D register */ @@ -3781,16 +5341,36 @@ enum operand_parse_code OP_REGLST, /* ARM register list */ OP_VRSLST, /* VFP single-precision register list */ OP_VRDLST, /* VFP double-precision register list */ + OP_VRSDLST, /* VFP single or double-precision register list (& quad) */ + OP_NRDLST, /* Neon double-precision register list (d0-d31, qN aliases) */ + OP_NSTRLST, /* Neon element/structure list */ + OP_NILO, /* Neon immediate/logic operands 2 or 2+3. (VBIC, VORR...) */ + OP_RNDQ_I0, /* Neon D or Q reg, or immediate zero. */ + OP_RVSD_I0, /* VFP S or D reg, or immediate zero. */ + OP_RR_RNSC, /* ARM reg or Neon scalar. */ + OP_RNSDQ_RNSC, /* Vector S, D or Q reg, or Neon scalar. */ + OP_RNDQ_RNSC, /* Neon D or Q reg, or Neon scalar. */ + OP_RND_RNSC, /* Neon D reg, or Neon scalar. */ + OP_VMOV, /* Neon VMOV operands. */ + OP_RNDQ_IMVNb,/* Neon D or Q reg, or immediate good for VMVN. */ + OP_RNDQ_I63b, /* Neon D or Q reg, or immediate for shift. */ + OP_RIWR_I32z, /* iWMMXt wR register, or immediate 0 .. 32 for iWMMXt2. */ + + OP_I0, /* immediate zero */ OP_I7, /* immediate value 0 .. 7 */ OP_I15, /* 0 .. 15 */ OP_I16, /* 1 .. 16 */ + OP_I16z, /* 0 .. 16 */ OP_I31, /* 0 .. 31 */ OP_I31w, /* 0 .. 31, optional trailing ! */ OP_I32, /* 1 .. 32 */ + OP_I32z, /* 0 .. 32 */ + OP_I63, /* 0 .. 63 */ OP_I63s, /* -64 .. 63 */ + OP_I64, /* 1 .. 64 */ + OP_I64z, /* 0 .. 64 */ OP_I255, /* 0 .. 255 */ - OP_Iffff, /* 0 .. 65535 */ OP_I4b, /* immediate, prefix optional, 1 .. 4 */ OP_I7b, /* 0 .. 7 */ @@ -3798,10 +5378,15 @@ enum operand_parse_code OP_I31b, /* 0 .. 31 */ OP_SH, /* shifter operand */ + OP_SHG, /* shifter operand with possible group relocation */ OP_ADDR, /* Memory address expression (any mode) */ + OP_ADDRGLDR, /* Mem addr expr (any mode) with possible LDR group reloc */ + OP_ADDRGLDRS, /* Mem addr expr (any mode) with possible LDRS group reloc */ + OP_ADDRGLDC, /* Mem addr expr (any mode) with possible LDC group reloc */ OP_EXP, /* arbitrary expression */ OP_EXPi, /* same, with optional immediate prefix */ OP_EXPr, /* same, with optional relocation suffix */ + OP_HALF, /* 0 .. 65535 or low/high reloc. */ OP_CPSF, /* CPS flags */ OP_ENDI, /* Endianness specifier */ @@ -3809,20 +5394,30 @@ enum operand_parse_code OP_COND, /* conditional code */ OP_TB, /* Table branch. */ + OP_RVC_PSR, /* CPSR/SPSR mask for msr, or VFP control register. */ + OP_APSR_RR, /* ARM register or "APSR_nzcv". */ + OP_RRnpc_I0, /* ARM register or literal 0 */ OP_RR_EXr, /* ARM register or expression with opt. reloc suff. */ OP_RR_EXi, /* ARM register or expression with imm prefix */ OP_RF_IF, /* FPA register or immediate */ OP_RIWR_RIWC, /* iWMMXt R or C reg */ + OP_RIWC_RIWG, /* iWMMXt wC or wCG reg */ /* Optional operands. */ OP_oI7b, /* immediate, prefix optional, 0 .. 7 */ OP_oI31b, /* 0 .. 31 */ + OP_oI32b, /* 1 .. 32 */ OP_oIffffb, /* 0 .. 65535 */ OP_oI255c, /* curly-brace enclosed, 0 .. 255 */ OP_oRR, /* ARM register */ OP_oRRnpc, /* ARM register, not the PC */ + OP_oRRw, /* ARM register, not r15, optional trailing ! */ + OP_oRND, /* Optional Neon double precision register */ + OP_oRNQ, /* Optional Neon quad precision register */ + OP_oRNDQ, /* Optional Neon double or quad precision register */ + OP_oRNSDQ, /* Optional single, double or quad precision vector register */ OP_oSHll, /* LSL immediate */ OP_oSHar, /* ASR immediate */ OP_oSHllar, /* LSL or ASR immediate */ @@ -3843,30 +5438,44 @@ parse_operands (char *str, const unsigned char *pattern) char *backtrack_pos = 0; const char *backtrack_error = 0; int i, val, backtrack_index = 0; + enum arm_reg_type rtype; + parse_operand_result result; #define po_char_or_fail(chr) do { \ if (skip_past_char (&str, chr) == FAIL) \ goto bad_args; \ } while (0) -#define po_reg_or_fail(regtype) do { \ - val = arm_reg_parse (&str, regtype); \ - if (val == FAIL) \ - { \ - inst.error = _(reg_expected_msgs[regtype]); \ - goto failure; \ - } \ - inst.operands[i].reg = val; \ - inst.operands[i].isreg = 1; \ +#define po_reg_or_fail(regtype) do { \ + val = arm_typed_reg_parse (&str, regtype, &rtype, \ + &inst.operands[i].vectype); \ + if (val == FAIL) \ + { \ + first_error (_(reg_expected_msgs[regtype])); \ + goto failure; \ + } \ + inst.operands[i].reg = val; \ + inst.operands[i].isreg = 1; \ + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); \ + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); \ + inst.operands[i].isvec = (rtype == REG_TYPE_VFS \ + || rtype == REG_TYPE_VFD \ + || rtype == REG_TYPE_NQ); \ } while (0) -#define po_reg_or_goto(regtype, label) do { \ - val = arm_reg_parse (&str, regtype); \ - if (val == FAIL) \ - goto label; \ - \ - inst.operands[i].reg = val; \ - inst.operands[i].isreg = 1; \ +#define po_reg_or_goto(regtype, label) do { \ + val = arm_typed_reg_parse (&str, regtype, &rtype, \ + &inst.operands[i].vectype); \ + if (val == FAIL) \ + goto label; \ + \ + inst.operands[i].reg = val; \ + inst.operands[i].isreg = 1; \ + inst.operands[i].isquad = (rtype == REG_TYPE_NQ); \ + inst.operands[i].issingle = (rtype == REG_TYPE_VFS); \ + inst.operands[i].isvec = (rtype == REG_TYPE_VFS \ + || rtype == REG_TYPE_VFD \ + || rtype == REG_TYPE_NQ); \ } while (0) #define po_imm_or_fail(min, max, popt) do { \ @@ -3875,11 +5484,27 @@ parse_operands (char *str, const unsigned char *pattern) inst.operands[i].imm = val; \ } while (0) +#define po_scalar_or_goto(elsz, label) do { \ + val = parse_scalar (&str, elsz, &inst.operands[i].vectype); \ + if (val == FAIL) \ + goto label; \ + inst.operands[i].reg = val; \ + inst.operands[i].isscalar = 1; \ +} while (0) + #define po_misc_or_fail(expr) do { \ if (expr) \ goto failure; \ } while (0) +#define po_misc_or_fail_no_backtrack(expr) do { \ + result = expr; \ + if (result == PARSE_OPERAND_FAIL_NO_BACKTRACK)\ + backtrack_pos = 0; \ + if (result != PARSE_OPERAND_SUCCESS) \ + goto failure; \ +} while (0) + skip_whitespace (str); for (i = 0; upat[i] != OP_stop; i++) @@ -3893,7 +5518,7 @@ parse_operands (char *str, const unsigned char *pattern) backtrack_index = i; } - if (i > 0) + if (i > 0 && (i > 1 || inst.operands[0].present)) po_char_or_fail (','); switch (upat[i]) @@ -3908,7 +5533,15 @@ parse_operands (char *str, const unsigned char *pattern) case OP_RF: po_reg_or_fail (REG_TYPE_FN); break; case OP_RVS: po_reg_or_fail (REG_TYPE_VFS); break; case OP_RVD: po_reg_or_fail (REG_TYPE_VFD); break; - case OP_RVC: po_reg_or_fail (REG_TYPE_VFC); break; + case OP_oRND: + case OP_RND: po_reg_or_fail (REG_TYPE_VFD); break; + case OP_RVC: + po_reg_or_goto (REG_TYPE_VFC, coproc_reg); + break; + /* Also accept generic coprocessor regs for unknown registers. */ + coproc_reg: + po_reg_or_fail (REG_TYPE_CN); + break; case OP_RMF: po_reg_or_fail (REG_TYPE_MVF); break; case OP_RMD: po_reg_or_fail (REG_TYPE_MVD); break; case OP_RMFX: po_reg_or_fail (REG_TYPE_MVFX); break; @@ -3919,6 +5552,126 @@ parse_operands (char *str, const unsigned char *pattern) case OP_RIWC: po_reg_or_fail (REG_TYPE_MMXWC); break; case OP_RIWG: po_reg_or_fail (REG_TYPE_MMXWCG); break; case OP_RXA: po_reg_or_fail (REG_TYPE_XSCALE); break; + case OP_oRNQ: + case OP_RNQ: po_reg_or_fail (REG_TYPE_NQ); break; + case OP_oRNDQ: + case OP_RNDQ: po_reg_or_fail (REG_TYPE_NDQ); break; + case OP_RVSD: po_reg_or_fail (REG_TYPE_VFSD); break; + case OP_oRNSDQ: + case OP_RNSDQ: po_reg_or_fail (REG_TYPE_NSDQ); break; + + /* Neon scalar. Using an element size of 8 means that some invalid + scalars are accepted here, so deal with those in later code. */ + case OP_RNSC: po_scalar_or_goto (8, failure); break; + + /* WARNING: We can expand to two operands here. This has the potential + to totally confuse the backtracking mechanism! It will be OK at + least as long as we don't try to use optional args as well, + though. */ + case OP_NILO: + { + po_reg_or_goto (REG_TYPE_NDQ, try_imm); + inst.operands[i].present = 1; + i++; + skip_past_comma (&str); + po_reg_or_goto (REG_TYPE_NDQ, one_reg_only); + break; + one_reg_only: + /* Optional register operand was omitted. Unfortunately, it's in + operands[i-1] and we need it to be in inst.operands[i]. Fix that + here (this is a bit grotty). */ + inst.operands[i] = inst.operands[i-1]; + inst.operands[i-1].present = 0; + break; + try_imm: + /* There's a possibility of getting a 64-bit immediate here, so + we need special handling. */ + if (parse_big_immediate (&str, i) == FAIL) + { + inst.error = _("immediate value is out of range"); + goto failure; + } + } + break; + + case OP_RNDQ_I0: + { + po_reg_or_goto (REG_TYPE_NDQ, try_imm0); + break; + try_imm0: + po_imm_or_fail (0, 0, TRUE); + } + break; + + case OP_RVSD_I0: + po_reg_or_goto (REG_TYPE_VFSD, try_imm0); + break; + + case OP_RR_RNSC: + { + po_scalar_or_goto (8, try_rr); + break; + try_rr: + po_reg_or_fail (REG_TYPE_RN); + } + break; + + case OP_RNSDQ_RNSC: + { + po_scalar_or_goto (8, try_nsdq); + break; + try_nsdq: + po_reg_or_fail (REG_TYPE_NSDQ); + } + break; + + case OP_RNDQ_RNSC: + { + po_scalar_or_goto (8, try_ndq); + break; + try_ndq: + po_reg_or_fail (REG_TYPE_NDQ); + } + break; + + case OP_RND_RNSC: + { + po_scalar_or_goto (8, try_vfd); + break; + try_vfd: + po_reg_or_fail (REG_TYPE_VFD); + } + break; + + case OP_VMOV: + /* WARNING: parse_neon_mov can move the operand counter, i. If we're + not careful then bad things might happen. */ + po_misc_or_fail (parse_neon_mov (&str, &i) == FAIL); + break; + + case OP_RNDQ_IMVNb: + { + po_reg_or_goto (REG_TYPE_NDQ, try_mvnimm); + break; + try_mvnimm: + /* There's a possibility of getting a 64-bit immediate here, so + we need special handling. */ + if (parse_big_immediate (&str, i) == FAIL) + { + inst.error = _("immediate value is out of range"); + goto failure; + } + } + break; + + case OP_RNDQ_I63b: + { + po_reg_or_goto (REG_TYPE_NDQ, try_shimm); + break; + try_shimm: + po_imm_or_fail (0, 63, TRUE); + } + break; case OP_RRnpcb: po_char_or_fail ('['); @@ -3927,6 +5680,7 @@ parse_operands (char *str, const unsigned char *pattern) break; case OP_RRw: + case OP_oRRw: po_reg_or_fail (REG_TYPE_RN); if (skip_past_char (&str, '!') == SUCCESS) inst.operands[i].writeback = 1; @@ -3936,11 +5690,15 @@ parse_operands (char *str, const unsigned char *pattern) case OP_I7: po_imm_or_fail ( 0, 7, FALSE); break; case OP_I15: po_imm_or_fail ( 0, 15, FALSE); break; case OP_I16: po_imm_or_fail ( 1, 16, FALSE); break; + case OP_I16z: po_imm_or_fail ( 0, 16, FALSE); break; case OP_I31: po_imm_or_fail ( 0, 31, FALSE); break; case OP_I32: po_imm_or_fail ( 1, 32, FALSE); break; + case OP_I32z: po_imm_or_fail ( 0, 32, FALSE); break; case OP_I63s: po_imm_or_fail (-64, 63, FALSE); break; + case OP_I63: po_imm_or_fail ( 0, 63, FALSE); break; + case OP_I64: po_imm_or_fail ( 1, 64, FALSE); break; + case OP_I64z: po_imm_or_fail ( 0, 64, FALSE); break; case OP_I255: po_imm_or_fail ( 0, 255, FALSE); break; - case OP_Iffff: po_imm_or_fail ( 0, 0xffff, FALSE); break; case OP_I4b: po_imm_or_fail ( 1, 4, TRUE); break; case OP_oI7b: @@ -3948,6 +5706,7 @@ parse_operands (char *str, const unsigned char *pattern) case OP_I15b: po_imm_or_fail ( 0, 15, TRUE); break; case OP_oI31b: case OP_I31b: po_imm_or_fail ( 0, 31, TRUE); break; + case OP_oI32b: po_imm_or_fail ( 1, 32, TRUE); break; case OP_oIffffb: po_imm_or_fail ( 0, 0xffff, TRUE); break; /* Immediate variants */ @@ -4005,6 +5764,11 @@ parse_operands (char *str, const unsigned char *pattern) } break; + /* Operand for MOVW or MOVT. */ + case OP_HALF: + po_misc_or_fail (parse_half (&str)); + break; + /* Register or expression */ case OP_RR_EXr: po_reg_or_goto (REG_TYPE_RN, EXPr); break; case OP_RR_EXi: po_reg_or_goto (REG_TYPE_RN, EXPi); break; @@ -4027,13 +5791,17 @@ parse_operands (char *str, const unsigned char *pattern) inst.operands[i].isreg = 1; break; + case OP_RIWR_I32z: po_reg_or_goto (REG_TYPE_MMXWR, I32z); break; + I32z: po_imm_or_fail (0, 32, FALSE); break; + /* Two kinds of register */ case OP_RIWR_RIWC: { struct reg_entry *rege = arm_reg_parse_multi (&str); - if (rege->type != REG_TYPE_MMXWR - && rege->type != REG_TYPE_MMXWC - && rege->type != REG_TYPE_MMXWCG) + if (!rege + || (rege->type != REG_TYPE_MMXWR + && rege->type != REG_TYPE_MMXWC + && rege->type != REG_TYPE_MMXWCG)) { inst.error = _("iWMMXt data or control register expected"); goto failure; @@ -4043,6 +5811,21 @@ parse_operands (char *str, const unsigned char *pattern) } break; + case OP_RIWC_RIWG: + { + struct reg_entry *rege = arm_reg_parse_multi (&str); + if (!rege + || (rege->type != REG_TYPE_MMXWC + && rege->type != REG_TYPE_MMXWCG)) + { + inst.error = _("iWMMXt control register expected"); + goto failure; + } + inst.operands[i].reg = rege->number; + inst.operands[i].isreg = 1; + } + break; + /* Misc */ case OP_CPSF: val = parse_cps_flags (&str); break; case OP_ENDI: val = parse_endian_specifier (&str); break; @@ -4051,6 +5834,41 @@ parse_operands (char *str, const unsigned char *pattern) case OP_COND: val = parse_cond (&str); break; case OP_oBARRIER:val = parse_barrier (&str); break; + case OP_RVC_PSR: + po_reg_or_goto (REG_TYPE_VFC, try_psr); + inst.operands[i].isvec = 1; /* Mark VFP control reg as vector. */ + break; + try_psr: + val = parse_psr (&str); + break; + + case OP_APSR_RR: + po_reg_or_goto (REG_TYPE_RN, try_apsr); + break; + try_apsr: + /* Parse "APSR_nvzc" operand (for FMSTAT-equivalent MRS + instruction). */ + if (strncasecmp (str, "APSR_", 5) == 0) + { + unsigned found = 0; + str += 5; + while (found < 15) + switch (*str++) + { + case 'c': found = (found & 1) ? 16 : found | 1; break; + case 'n': found = (found & 2) ? 16 : found | 2; break; + case 'z': found = (found & 4) ? 16 : found | 4; break; + case 'v': found = (found & 8) ? 16 : found | 8; break; + default: found = 16; + } + if (found != 15) + goto failure; + inst.operands[i].isvec = 1; + } + else + goto failure; + break; + case OP_TB: po_misc_or_fail (parse_tb (&str)); break; @@ -4066,22 +5884,65 @@ parse_operands (char *str, const unsigned char *pattern) break; case OP_VRSLST: - val = parse_vfp_reg_list (&str, &inst.operands[i].reg, 0); + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, REGLIST_VFP_S); break; case OP_VRDLST: - val = parse_vfp_reg_list (&str, &inst.operands[i].reg, 1); + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, REGLIST_VFP_D); break; + case OP_VRSDLST: + /* Allow Q registers too. */ + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, + REGLIST_NEON_D); + if (val == FAIL) + { + inst.error = NULL; + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, + REGLIST_VFP_S); + inst.operands[i].issingle = 1; + } + break; + + case OP_NRDLST: + val = parse_vfp_reg_list (&str, &inst.operands[i].reg, + REGLIST_NEON_D); + break; + + case OP_NSTRLST: + val = parse_neon_el_struct_list (&str, &inst.operands[i].reg, + &inst.operands[i].vectype); + break; + /* Addressing modes */ case OP_ADDR: po_misc_or_fail (parse_address (&str, i)); break; + case OP_ADDRGLDR: + po_misc_or_fail_no_backtrack ( + parse_address_group_reloc (&str, i, GROUP_LDR)); + break; + + case OP_ADDRGLDRS: + po_misc_or_fail_no_backtrack ( + parse_address_group_reloc (&str, i, GROUP_LDRS)); + break; + + case OP_ADDRGLDC: + po_misc_or_fail_no_backtrack ( + parse_address_group_reloc (&str, i, GROUP_LDC)); + break; + case OP_SH: po_misc_or_fail (parse_shifter_operand (&str, i)); break; + case OP_SHG: + po_misc_or_fail_no_backtrack ( + parse_shifter_operand_group_reloc (&str, i)); + break; + case OP_oSHll: po_misc_or_fail (parse_shift (&str, i, SHIFT_LSL_IMMEDIATE)); break; @@ -4107,6 +5968,7 @@ parse_operands (char *str, const unsigned char *pattern) case OP_RRnpc: case OP_RRnpcb: case OP_RRw: + case OP_oRRw: case OP_RRnpc_I0: if (inst.operands[i].isreg && inst.operands[i].reg == REG_PC) inst.error = BAD_PC; @@ -4116,11 +5978,15 @@ parse_operands (char *str, const unsigned char *pattern) case OP_ENDI: case OP_oROR: case OP_PSR: + case OP_RVC_PSR: case OP_COND: case OP_oBARRIER: case OP_REGLST: case OP_VRSLST: case OP_VRDLST: + case OP_VRSDLST: + case OP_NRDLST: + case OP_NSTRLST: if (val == FAIL) goto failure; inst.operands[i].imm = val; @@ -4178,6 +6044,7 @@ parse_operands (char *str, const unsigned char *pattern) #undef po_reg_or_fail #undef po_reg_or_goto #undef po_imm_or_fail +#undef po_scalar_or_fail /* Shorthand macro for instruction encoding functions issuing errors. */ #define constraint(expr, err) do { \ @@ -4236,11 +6103,30 @@ encode_thumb32_immediate (unsigned int val) return FAIL; } -/* Encode a VFP SP register number into inst.instruction. */ +/* Encode a VFP SP or DP register number into inst.instruction. */ static void -encode_arm_vfp_sp_reg (int reg, enum vfp_sp_reg_pos pos) +encode_arm_vfp_reg (int reg, enum vfp_reg_pos pos) { + if ((pos == VFP_REG_Dd || pos == VFP_REG_Dn || pos == VFP_REG_Dm) + && reg > 15) + { + if (ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v3)) + { + if (thumb_mode) + ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, + fpu_vfp_ext_v3); + else + ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, + fpu_vfp_ext_v3); + } + else + { + first_error (_("D register out of range for selected VFP version")); + return; + } + } + switch (pos) { case VFP_REG_Sd: @@ -4255,6 +6141,18 @@ encode_arm_vfp_sp_reg (int reg, enum vfp_sp_reg_pos pos) inst.instruction |= ((reg >> 1) << 0) | ((reg & 1) << 5); break; + case VFP_REG_Dd: + inst.instruction |= ((reg & 15) << 12) | ((reg >> 4) << 22); + break; + + case VFP_REG_Dn: + inst.instruction |= ((reg & 15) << 16) | ((reg >> 4) << 7); + break; + + case VFP_REG_Dm: + inst.instruction |= (reg & 15) | ((reg >> 4) << 5); + break; + default: abort (); } @@ -4399,7 +6297,8 @@ encode_arm_addr_mode_3 (int i, bfd_boolean is_t) into a coprocessor load/store instruction. If wb_ok is false, reject use of writeback; if unind_ok is false, reject use of unindexed addressing. If reloc_override is not 0, use it instead - of BFD_ARM_CP_OFF_IMM. */ + of BFD_ARM_CP_OFF_IMM, unless the initial relocation is a group one + (in which case it is preserved). */ static int encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override) @@ -4441,10 +6340,16 @@ encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override) if (reloc_override) inst.reloc.type = reloc_override; - else if (thumb_mode) - inst.reloc.type = BFD_RELOC_ARM_T32_CP_OFF_IMM; - else - inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; + else if ((inst.reloc.type < BFD_RELOC_ARM_ALU_PC_G0_NC + || inst.reloc.type > BFD_RELOC_ARM_LDC_SB_G2) + && inst.reloc.type != BFD_RELOC_ARM_LDR_PC_G0) + { + if (thumb_mode) + inst.reloc.type = BFD_RELOC_ARM_T32_CP_OFF_IMM; + else + inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM; + } + return SUCCESS; } @@ -4570,7 +6475,7 @@ static void do_rd_rm_rn (void) { unsigned Rn = inst.operands[2].reg; - /* Enforce resutrictions on SWP instruction. */ + /* Enforce restrictions on SWP instruction. */ if ((inst.instruction & 0x0fbfffff) == 0x01000090) constraint (Rn == inst.operands[0].reg || Rn == inst.operands[1].reg, _("Rn must not overlap other operands")); @@ -4894,7 +6799,11 @@ static void do_cpsi (void) { inst.instruction |= inst.operands[0].imm << 6; - inst.instruction |= inst.operands[1].imm; + if (inst.operands[1].present) + { + inst.instruction |= CPSI_MMOD; + inst.instruction |= inst.operands[1].imm; + } } static void @@ -5112,17 +7021,16 @@ do_lstc (void) static void do_mlas (void) { - /* This restriction does not apply to mls (nor to mla in v6, but - that's hard to detect at present). */ + /* This restriction does not apply to mls (nor to mla in v6 or later). */ if (inst.operands[0].reg == inst.operands[1].reg + && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6) && !(inst.instruction & 0x00400000)) - as_tsktsk (_("rd and rm should be different in mla")); + as_tsktsk (_("Rd and Rm should be different in mla")); inst.instruction |= inst.operands[0].reg << 16; inst.instruction |= inst.operands[1].reg; inst.instruction |= inst.operands[2].reg << 8; inst.instruction |= inst.operands[3].reg << 12; - } static void @@ -5136,15 +7044,62 @@ do_mov (void) static void do_mov16 (void) { + bfd_vma imm; + bfd_boolean top; + + top = (inst.instruction & 0x00400000) != 0; + constraint (top && inst.reloc.type == BFD_RELOC_ARM_MOVW, + _(":lower16: not allowed this instruction")); + constraint (!top && inst.reloc.type == BFD_RELOC_ARM_MOVT, + _(":upper16: not allowed instruction")); inst.instruction |= inst.operands[0].reg << 12; - /* The value is in two pieces: 0:11, 16:19. */ - inst.instruction |= (inst.operands[1].imm & 0x00000fff); - inst.instruction |= (inst.operands[1].imm & 0x0000f000) << 4; + if (inst.reloc.type == BFD_RELOC_UNUSED) + { + imm = inst.reloc.exp.X_add_number; + /* The value is in two pieces: 0:11, 16:19. */ + inst.instruction |= (imm & 0x00000fff); + inst.instruction |= (imm & 0x0000f000) << 4; + } +} + +static void do_vfp_nsyn_opcode (const char *); + +static int +do_vfp_nsyn_mrs (void) +{ + if (inst.operands[0].isvec) + { + if (inst.operands[1].reg != 1) + first_error (_("operand 1 must be FPSCR")); + memset (&inst.operands[0], '\0', sizeof (inst.operands[0])); + memset (&inst.operands[1], '\0', sizeof (inst.operands[1])); + do_vfp_nsyn_opcode ("fmstat"); + } + else if (inst.operands[1].isvec) + do_vfp_nsyn_opcode ("fmrx"); + else + return FAIL; + + return SUCCESS; +} + +static int +do_vfp_nsyn_msr (void) +{ + if (inst.operands[0].isvec) + do_vfp_nsyn_opcode ("fmxr"); + else + return FAIL; + + return SUCCESS; } static void do_mrs (void) { + if (do_vfp_nsyn_mrs () == SUCCESS) + return; + /* mrs only accepts CPSR/SPSR/CPSR_all/SPSR_all. */ constraint ((inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f)) != (PSR_c|PSR_f), @@ -5160,6 +7115,9 @@ do_mrs (void) static void do_msr (void) { + if (do_vfp_nsyn_msr () == SUCCESS) + return; + inst.instruction |= inst.operands[0].imm; if (inst.operands[1].isreg) inst.instruction |= inst.operands[1].reg; @@ -5180,8 +7138,9 @@ do_mul (void) inst.instruction |= inst.operands[1].reg; inst.instruction |= inst.operands[2].reg << 8; - if (inst.operands[0].reg == inst.operands[1].reg) - as_tsktsk (_("rd and rm should be different in mul")); + if (inst.operands[0].reg == inst.operands[1].reg + && !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6)) + as_tsktsk (_("Rd and Rm should be different in mul")); } /* Long Multiply Parser @@ -5447,13 +7406,25 @@ do_smul (void) inst.instruction |= inst.operands[2].reg << 8; } -/* ARM V6 srs (argument parse). */ +/* ARM V6 srs (argument parse). The variable fields in the encoding are + the same for both ARM and Thumb-2. */ static void do_srs (void) { - inst.instruction |= inst.operands[0].imm; - if (inst.operands[0].writeback) + int reg; + + if (inst.operands[0].present) + { + reg = inst.operands[0].reg; + constraint (reg != 13, _("SRS base register must be r13")); + } + else + reg = 13; + + inst.instruction |= reg << 16; + inst.instruction |= inst.operands[1].imm; + if (inst.operands[0].writeback || inst.operands[1].writeback) inst.instruction |= WRITE_BACK; } @@ -5542,43 +7513,43 @@ do_sxth (void) static void do_vfp_sp_monadic (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sm); } static void do_vfp_sp_dyadic (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sn); - encode_arm_vfp_sp_reg (inst.operands[2].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sn); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Sm); } static void do_vfp_sp_compare_z (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); } static void do_vfp_dp_sp_cvt (void) { - inst.instruction |= inst.operands[0].reg << 12; - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sm); } static void do_vfp_sp_dp_cvt (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); - inst.instruction |= inst.operands[1].reg; + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dm); } static void do_vfp_reg_from_sp (void) { inst.instruction |= inst.operands[0].reg << 12; - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sn); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sn); } static void @@ -5588,13 +7559,13 @@ do_vfp_reg2_from_sp2 (void) _("only two consecutive VFP SP registers allowed here")); inst.instruction |= inst.operands[0].reg << 12; inst.instruction |= inst.operands[1].reg << 16; - encode_arm_vfp_sp_reg (inst.operands[2].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Sm); } static void do_vfp_sp_from_reg (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sn); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sn); inst.instruction |= inst.operands[1].reg << 12; } @@ -5603,7 +7574,7 @@ do_vfp_sp2_from_reg2 (void) { constraint (inst.operands[0].imm != 2, _("only two consecutive VFP SP registers allowed here")); - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sm); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sm); inst.instruction |= inst.operands[1].reg << 12; inst.instruction |= inst.operands[2].reg << 16; } @@ -5611,14 +7582,14 @@ do_vfp_sp2_from_reg2 (void) static void do_vfp_sp_ldst (void) { - encode_arm_vfp_sp_reg (inst.operands[0].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); encode_arm_cp_address (1, FALSE, TRUE, 0); } static void do_vfp_dp_ldst (void) { - inst.instruction |= inst.operands[0].reg << 12; + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); encode_arm_cp_address (1, FALSE, TRUE, 0); } @@ -5632,7 +7603,7 @@ vfp_sp_ldstm (enum vfp_ldstm_type ldstm_type) constraint (ldstm_type != VFP_LDSTMIA, _("this addressing mode requires base-register writeback")); inst.instruction |= inst.operands[0].reg << 16; - encode_arm_vfp_sp_reg (inst.operands[1].reg, VFP_REG_Sd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Sd); inst.instruction |= inst.operands[1].imm; } @@ -5648,7 +7619,7 @@ vfp_dp_ldstm (enum vfp_ldstm_type ldstm_type) _("this addressing mode requires base-register writeback")); inst.instruction |= inst.operands[0].reg << 16; - inst.instruction |= inst.operands[1].reg << 12; + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dd); count = inst.operands[1].imm << 1; if (ldstm_type == VFP_LDSTMIAX || ldstm_type == VFP_LDSTMDBX) @@ -5692,6 +7663,103 @@ do_vfp_xp_ldstmdb (void) { vfp_dp_ldstm (VFP_LDSTMDBX); } + +static void +do_vfp_dp_rd_rm (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dm); +} + +static void +do_vfp_dp_rn_rd (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dn); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dd); +} + +static void +do_vfp_dp_rd_rn (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dn); +} + +static void +do_vfp_dp_rd_rn_rm (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dn); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Dm); +} + +static void +do_vfp_dp_rd (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); +} + +static void +do_vfp_dp_rm_rd_rn (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dm); + encode_arm_vfp_reg (inst.operands[1].reg, VFP_REG_Dd); + encode_arm_vfp_reg (inst.operands[2].reg, VFP_REG_Dn); +} + +/* VFPv3 instructions. */ +static void +do_vfp_sp_const (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + inst.instruction |= (inst.operands[1].imm & 0xf0) << 12; + inst.instruction |= (inst.operands[1].imm & 0x0f); +} + +static void +do_vfp_dp_const (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + inst.instruction |= (inst.operands[1].imm & 0xf0) << 12; + inst.instruction |= (inst.operands[1].imm & 0x0f); +} + +static void +vfp_conv (int srcsize) +{ + unsigned immbits = srcsize - inst.operands[1].imm; + inst.instruction |= (immbits & 1) << 5; + inst.instruction |= (immbits >> 1); +} + +static void +do_vfp_sp_conv_16 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + vfp_conv (16); +} + +static void +do_vfp_dp_conv_16 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + vfp_conv (16); +} + +static void +do_vfp_sp_conv_32 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Sd); + vfp_conv (32); +} + +static void +do_vfp_dp_conv_32 (void) +{ + encode_arm_vfp_reg (inst.operands[0].reg, VFP_REG_Dd); + vfp_conv (32); +} + /* FPA instructions. Also in a logical order. */ @@ -5740,6 +7808,7 @@ do_fpa_ldmstm (void) encode_arm_cp_address (2, TRUE, TRUE, 0); } + /* iWMMXt instructions: strictly in alphabetical order. */ @@ -5789,6 +7858,15 @@ do_iwmmxt_waligni (void) inst.instruction |= inst.operands[3].imm << 20; } +static void +do_iwmmxt_wmerge (void) +{ + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[2].reg; + inst.instruction |= inst.operands[3].imm << 21; +} + static void do_iwmmxt_wmov (void) { @@ -5828,7 +7906,23 @@ static void do_iwmmxt_wldstd (void) { inst.instruction |= inst.operands[0].reg << 12; - encode_arm_cp_address (1, TRUE, FALSE, 0); + if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt2) + && inst.operands[1].immisreg) + { + inst.instruction &= ~0x1a000ff; + inst.instruction |= (0xf << 28); + if (inst.operands[1].preind) + inst.instruction |= PRE_INDEX; + if (!inst.operands[1].negative) + inst.instruction |= INDEX_UP; + if (inst.operands[1].writeback) + inst.instruction |= WRITE_BACK; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.reloc.exp.X_add_number << 4; + inst.instruction |= inst.operands[1].imm; + } + else + encode_arm_cp_address (1, TRUE, FALSE, 0); } static void @@ -5848,6 +7942,56 @@ do_iwmmxt_wzero (void) inst.instruction |= inst.operands[0].reg << 12; inst.instruction |= inst.operands[0].reg << 16; } + +static void +do_iwmmxt_wrwrwr_or_imm5 (void) +{ + if (inst.operands[2].isreg) + do_rd_rn_rm (); + else { + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt2), + _("immediate operand requires iWMMXt2")); + do_rd_rn (); + if (inst.operands[2].imm == 0) + { + switch ((inst.instruction >> 20) & 0xf) + { + case 4: + case 5: + case 6: + case 7: + /* w...h wrd, wrn, #0 -> wrorh wrd, wrn, #16. */ + inst.operands[2].imm = 16; + inst.instruction = (inst.instruction & 0xff0fffff) | (0x7 << 20); + break; + case 8: + case 9: + case 10: + case 11: + /* w...w wrd, wrn, #0 -> wrorw wrd, wrn, #32. */ + inst.operands[2].imm = 32; + inst.instruction = (inst.instruction & 0xff0fffff) | (0xb << 20); + break; + case 12: + case 13: + case 14: + case 15: + { + /* w...d wrd, wrn, #0 -> wor wrd, wrn, wrn. */ + unsigned long wrn; + wrn = (inst.instruction >> 16) & 0xf; + inst.instruction &= 0xff0fff0f; + inst.instruction |= wrn; + /* Bail out here; the instruction is now assembled. */ + return; + } + } + } + /* Map 32 -> 0, etc. */ + inst.operands[2].imm &= 0x1f; + inst.instruction |= (0xf << 28) | ((inst.operands[2].imm & 0x10) << 4) | (inst.operands[2].imm & 0xf); + } +} /* Cirrus Maverick instructions. Simple 2-, 3-, and 4-register operations first, then control, shift, and load/store. */ @@ -6082,7 +8226,7 @@ encode_thumb32_addr_mode (int i, bfd_boolean is_t, bfd_boolean is_d) X(cpsie, b660, f3af8400), \ X(cpsid, b670, f3af8600), \ X(cpy, 4600, ea4f0000), \ - X(dec_sp,80dd, f1bd0d00), \ + X(dec_sp,80dd, f1ad0d00), \ X(eor, 4040, ea800000), \ X(eors, 4040, ea900000), \ X(inc_sp,00dd, f10d0d00), \ @@ -6200,13 +8344,13 @@ do_t_add_sub (void) narrow = (current_it_mask != 0); if (!inst.operands[2].isreg) { + int add; + + add = (inst.instruction == T_MNEM_add + || inst.instruction == T_MNEM_adds); opcode = 0; if (inst.size_req != 4) { - int add; - - add = (inst.instruction == T_MNEM_add - || inst.instruction == T_MNEM_adds); /* Attempt to use a narrow opcode, with relaxation if appropriate. */ if (Rd == REG_SP && Rs == REG_SP && !flags) @@ -6236,12 +8380,38 @@ do_t_add_sub (void) if (inst.size_req == 4 || (inst.size_req != 2 && !opcode)) { - /* ??? Convert large immediates to addw/subw. */ - inst.instruction = THUMB_OP32 (inst.instruction); - inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; - inst.instruction |= inst.operands[0].reg << 8; - inst.instruction |= inst.operands[1].reg << 16; - inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + if (Rd == REG_PC) + { + constraint (Rs != REG_LR || inst.instruction != T_MNEM_subs, + _("only SUBS PC, LR, #const allowed")); + constraint (inst.reloc.exp.X_op != O_constant, + _("expression too complex")); + constraint (inst.reloc.exp.X_add_number < 0 + || inst.reloc.exp.X_add_number > 0xff, + _("immediate value out of range")); + inst.instruction = T2_SUBS_PC_LR + | inst.reloc.exp.X_add_number; + inst.reloc.type = BFD_RELOC_UNUSED; + return; + } + else if (Rs == REG_PC) + { + /* Always use addw/subw. */ + inst.instruction = add ? 0xf20f0000 : 0xf2af0000; + inst.reloc.type = BFD_RELOC_ARM_T32_IMM12; + } + else + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = (inst.instruction & 0xe1ffffff) + | 0x10000000; + if (flags) + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + else + inst.reloc.type = BFD_RELOC_ARM_T32_ADD_IMM; + } + inst.instruction |= Rd << 8; + inst.instruction |= Rs << 16; } } else @@ -6807,7 +8977,7 @@ do_t_cpy (void) } static void -do_t_czb (void) +do_t_cbz (void) { constraint (current_it_mask, BAD_NOT_IT); constraint (inst.operands[0].reg > 7, BAD_HIREG); @@ -6871,6 +9041,68 @@ do_t_it (void) inst.instruction |= cond << 4; } +/* Helper function used for both push/pop and ldm/stm. */ +static void +encode_thumb2_ldmstm (int base, unsigned mask, bfd_boolean writeback) +{ + bfd_boolean load; + + load = (inst.instruction & (1 << 20)) != 0; + + if (mask & (1 << 13)) + inst.error = _("SP not allowed in register list"); + if (load) + { + if (mask & (1 << 14) + && mask & (1 << 15)) + inst.error = _("LR and PC should not both be in register list"); + + if ((mask & (1 << base)) != 0 + && writeback) + as_warn (_("base register should not be in register list " + "when written back")); + } + else + { + if (mask & (1 << 15)) + inst.error = _("PC not allowed in register list"); + + if (mask & (1 << base)) + as_warn (_("value stored for r%d is UNPREDICTABLE"), base); + } + + if ((mask & (mask - 1)) == 0) + { + /* Single register transfers implemented as str/ldr. */ + if (writeback) + { + if (inst.instruction & (1 << 23)) + inst.instruction = 0x00000b04; /* ia! -> [base], #4 */ + else + inst.instruction = 0x00000d04; /* db! -> [base, #-4]! */ + } + else + { + if (inst.instruction & (1 << 23)) + inst.instruction = 0x00800000; /* ia -> [base] */ + else + inst.instruction = 0x00000c04; /* db -> [base, #-4] */ + } + + inst.instruction |= 0xf8400000; + if (load) + inst.instruction |= 0x00100000; + + mask = ffs(mask) - 1; + mask <<= 12; + } + else if (writeback) + inst.instruction |= WRITE_BACK; + + inst.instruction |= mask; + inst.instruction |= base << 16; +} + static void do_t_ldmstm (void) { @@ -6882,60 +9114,60 @@ do_t_ldmstm (void) if (unified_syntax) { + bfd_boolean narrow; + unsigned mask; + + narrow = FALSE; /* See if we can use a 16-bit instruction. */ if (inst.instruction < 0xffff /* not ldmdb/stmdb */ && inst.size_req != 4 - && inst.operands[0].reg <= 7 - && !(inst.operands[1].imm & ~0xff) - && (inst.instruction == T_MNEM_stmia - ? inst.operands[0].writeback - : (inst.operands[0].writeback - == !(inst.operands[1].imm & (1 << inst.operands[0].reg))))) + && !(inst.operands[1].imm & ~0xff)) { - if (inst.instruction == T_MNEM_stmia - && (inst.operands[1].imm & (1 << inst.operands[0].reg)) - && (inst.operands[1].imm & ((1 << inst.operands[0].reg) - 1))) - as_warn (_("value stored for r%d is UNPREDICTABLE"), - inst.operands[0].reg); + mask = 1 << inst.operands[0].reg; - inst.instruction = THUMB_OP16 (inst.instruction); - inst.instruction |= inst.operands[0].reg << 8; - inst.instruction |= inst.operands[1].imm; - } - else - { - if (inst.operands[1].imm & (1 << 13)) - as_warn (_("SP should not be in register list")); - if (inst.instruction == T_MNEM_stmia) + if (inst.operands[0].reg <= 7 + && (inst.instruction == T_MNEM_stmia + ? inst.operands[0].writeback + : (inst.operands[0].writeback + == !(inst.operands[1].imm & mask)))) { - if (inst.operands[1].imm & (1 << 15)) - as_warn (_("PC should not be in register list")); - if (inst.operands[1].imm & (1 << inst.operands[0].reg)) + if (inst.instruction == T_MNEM_stmia + && (inst.operands[1].imm & mask) + && (inst.operands[1].imm & (mask - 1))) as_warn (_("value stored for r%d is UNPREDICTABLE"), inst.operands[0].reg); + + inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].imm; + narrow = TRUE; } - else + else if (inst.operands[0] .reg == REG_SP + && inst.operands[0].writeback) { - if (inst.operands[1].imm & (1 << 14) - && inst.operands[1].imm & (1 << 15)) - as_warn (_("LR and PC should not both be in register list")); - if ((inst.operands[1].imm & (1 << inst.operands[0].reg)) - && inst.operands[0].writeback) - as_warn (_("base register should not be in register list " - "when written back")); + inst.instruction = THUMB_OP16 (inst.instruction == T_MNEM_stmia + ? T_MNEM_push : T_MNEM_pop); + inst.instruction |= inst.operands[1].imm; + narrow = TRUE; } + } + + if (!narrow) + { if (inst.instruction < 0xffff) inst.instruction = THUMB_OP32 (inst.instruction); - inst.instruction |= inst.operands[0].reg << 16; - inst.instruction |= inst.operands[1].imm; - if (inst.operands[0].writeback) - inst.instruction |= WRITE_BACK; + + encode_thumb2_ldmstm(inst.operands[0].reg, inst.operands[1].imm, + inst.operands[0].writeback); } } else { constraint (inst.operands[0].reg > 7 || (inst.operands[1].imm & ~0xff), BAD_HIREG); + constraint (inst.instruction != T_MNEM_ldmia + && inst.instruction != T_MNEM_stmia, + _("Thumb-2 instruction only valid in unified syntax")); if (inst.instruction == T_MNEM_stmia) { if (!inst.operands[0].writeback) @@ -7209,6 +9441,16 @@ do_t_mov_cmp (void) || inst.operands[1].shifted) narrow = FALSE; + /* MOVS PC, LR is encoded as SUBS PC, LR, #0. */ + if (opcode == T_MNEM_movs && inst.operands[1].isreg + && !inst.operands[1].shifted + && inst.operands[0].reg == REG_PC + && inst.operands[1].reg == REG_LR) + { + inst.instruction = T2_SUBS_PC_LR; + return; + } + if (!inst.operands[1].isreg) { /* Immediate operand. */ @@ -7231,11 +9473,98 @@ do_t_mov_cmp (void) inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; } } + else if (inst.operands[1].shifted && inst.operands[1].immisreg + && (inst.instruction == T_MNEM_mov + || inst.instruction == T_MNEM_movs)) + { + /* Register shifts are encoded as separate shift instructions. */ + bfd_boolean flags = (inst.instruction == T_MNEM_movs); + + if (current_it_mask) + narrow = !flags; + else + narrow = flags; + + if (inst.size_req == 4) + narrow = FALSE; + + if (!low_regs || inst.operands[1].imm > 7) + narrow = FALSE; + + if (inst.operands[0].reg != inst.operands[1].reg) + narrow = FALSE; + + switch (inst.operands[1].shift_kind) + { + case SHIFT_LSL: + opcode = narrow ? T_OPCODE_LSL_R : THUMB_OP32 (T_MNEM_lsl); + break; + case SHIFT_ASR: + opcode = narrow ? T_OPCODE_ASR_R : THUMB_OP32 (T_MNEM_asr); + break; + case SHIFT_LSR: + opcode = narrow ? T_OPCODE_LSR_R : THUMB_OP32 (T_MNEM_lsr); + break; + case SHIFT_ROR: + opcode = narrow ? T_OPCODE_ROR_R : THUMB_OP32 (T_MNEM_ror); + break; + default: + abort(); + } + + inst.instruction = opcode; + if (narrow) + { + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].imm << 3; + } + else + { + if (flags) + inst.instruction |= CONDS_BIT; + + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= inst.operands[1].imm; + } + } else if (!narrow) { - inst.instruction = THUMB_OP32 (inst.instruction); - inst.instruction |= inst.operands[0].reg << r0off; - encode_thumb32_shifted_operand (1); + /* Some mov with immediate shift have narrow variants. + Register shifts are handled above. */ + if (low_regs && inst.operands[1].shifted + && (inst.instruction == T_MNEM_mov + || inst.instruction == T_MNEM_movs)) + { + if (current_it_mask) + narrow = (inst.instruction == T_MNEM_mov); + else + narrow = (inst.instruction == T_MNEM_movs); + } + + if (narrow) + { + switch (inst.operands[1].shift_kind) + { + case SHIFT_LSL: inst.instruction = T_OPCODE_LSL_I; break; + case SHIFT_LSR: inst.instruction = T_OPCODE_LSR_I; break; + case SHIFT_ASR: inst.instruction = T_OPCODE_ASR_I; break; + default: narrow = FALSE; break; + } + } + + if (narrow) + { + inst.instruction |= inst.operands[0].reg; + inst.instruction |= inst.operands[1].reg << 3; + inst.reloc.type = BFD_RELOC_ARM_THUMB_SHIFT; + } + else + { + inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction |= inst.operands[0].reg << r0off; + encode_thumb32_shifted_operand (1); + } } else switch (inst.instruction) @@ -7310,11 +9639,30 @@ do_t_mov_cmp (void) static void do_t_mov16 (void) { + bfd_vma imm; + bfd_boolean top; + + top = (inst.instruction & 0x00800000) != 0; + if (inst.reloc.type == BFD_RELOC_ARM_MOVW) + { + constraint (top, _(":lower16: not allowed this instruction")); + inst.reloc.type = BFD_RELOC_ARM_THUMB_MOVW; + } + else if (inst.reloc.type == BFD_RELOC_ARM_MOVT) + { + constraint (!top, _(":upper16: not allowed this instruction")); + inst.reloc.type = BFD_RELOC_ARM_THUMB_MOVT; + } + inst.instruction |= inst.operands[0].reg << 8; - inst.instruction |= (inst.operands[1].imm & 0xf000) << 4; - inst.instruction |= (inst.operands[1].imm & 0x0800) << 15; - inst.instruction |= (inst.operands[1].imm & 0x0700) << 4; - inst.instruction |= (inst.operands[1].imm & 0x00ff); + if (inst.reloc.type == BFD_RELOC_UNUSED) + { + imm = inst.reloc.exp.X_add_number; + inst.instruction |= (imm & 0xf000) << 4; + inst.instruction |= (imm & 0x0800) << 15; + inst.instruction |= (imm & 0x0700) << 4; + inst.instruction |= (imm & 0x00ff); + } } static void @@ -7388,6 +9736,10 @@ static void do_t_mrs (void) { int flags; + + if (do_vfp_nsyn_mrs () == SUCCESS) + return; + flags = inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT); if (flags == 0) { @@ -7415,6 +9767,9 @@ do_t_msr (void) { int flags; + if (do_vfp_nsyn_msr () == SUCCESS) + return; + constraint (!inst.operands[1].isreg, _("Thumb encoding does not support an immediate here")); flags = inst.operands[0].imm; @@ -7589,7 +9944,7 @@ do_t_push_pop (void) mask = inst.operands[0].imm; if ((mask & ~0xff) == 0) - inst.instruction = THUMB_OP16 (inst.instruction); + inst.instruction = THUMB_OP16 (inst.instruction) | mask; else if ((inst.instruction == T_MNEM_push && (mask & ~0xff) == 1 << REG_LR) || (inst.instruction == T_MNEM_pop @@ -7597,43 +9952,18 @@ do_t_push_pop (void) { inst.instruction = THUMB_OP16 (inst.instruction); inst.instruction |= THUMB_PP_PC_LR; - mask &= 0xff; + inst.instruction |= mask & 0xff; } else if (unified_syntax) { - if (mask & (1 << 13)) - inst.error = _("SP not allowed in register list"); - if (inst.instruction == T_MNEM_push) - { - if (mask & (1 << 15)) - inst.error = _("PC not allowed in register list"); - } - else - { - if (mask & (1 << 14) - && mask & (1 << 15)) - inst.error = _("LR and PC should not both be in register list"); - } - if ((mask & (mask - 1)) == 0) - { - /* Single register push/pop implemented as str/ldr. */ - if (inst.instruction == T_MNEM_push) - inst.instruction = 0xf84d0d04; /* str reg, [sp, #-4]! */ - else - inst.instruction = 0xf85d0b04; /* ldr reg, [sp], #4 */ - mask = ffs(mask) - 1; - mask <<= 12; - } - else - inst.instruction = THUMB_OP32 (inst.instruction); + inst.instruction = THUMB_OP32 (inst.instruction); + encode_thumb2_ldmstm(13, mask, TRUE); } else { inst.error = _("invalid register list to push/pop instruction"); return; } - - inst.instruction |= mask; } static void @@ -7678,8 +10008,37 @@ do_t_rsb (void) inst.instruction |= Rs << 16; if (!inst.operands[2].isreg) { - inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; - inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + bfd_boolean narrow; + + if ((inst.instruction & 0x00100000) != 0) + narrow = (current_it_mask == 0); + else + narrow = (current_it_mask != 0); + + if (Rd > 7 || Rs > 7) + narrow = FALSE; + + if (inst.size_req == 4 || !unified_syntax) + narrow = FALSE; + + if (inst.reloc.exp.X_op != O_constant + || inst.reloc.exp.X_add_number != 0) + narrow = FALSE; + + /* Turn rsb #0 into 16-bit neg. We should probably do this via + relaxation, but it doesn't seem worth the hassle. */ + if (narrow) + { + inst.reloc.type = BFD_RELOC_UNUSED; + inst.instruction = THUMB_OP16 (T_MNEM_negs); + inst.instruction |= Rs << 3; + inst.instruction |= Rd; + } + else + { + inst.instruction = (inst.instruction & 0xe1ffffff) | 0x10000000; + inst.reloc.type = BFD_RELOC_ARM_T32_IMMEDIATE; + } } else encode_thumb32_shifted_operand (2); @@ -7997,6 +10356,3387 @@ do_t_usat16 (void) inst.instruction |= inst.operands[1].imm; inst.instruction |= inst.operands[2].reg << 16; } + +/* Neon instruction encoder helpers. */ + +/* Encodings for the different types for various Neon opcodes. */ + +/* An "invalid" code for the following tables. */ +#define N_INV -1u + +struct neon_tab_entry +{ + unsigned integer; + unsigned float_or_poly; + unsigned scalar_or_imm; +}; + +/* Map overloaded Neon opcodes to their respective encodings. */ +#define NEON_ENC_TAB \ + X(vabd, 0x0000700, 0x1200d00, N_INV), \ + X(vmax, 0x0000600, 0x0000f00, N_INV), \ + X(vmin, 0x0000610, 0x0200f00, N_INV), \ + X(vpadd, 0x0000b10, 0x1000d00, N_INV), \ + X(vpmax, 0x0000a00, 0x1000f00, N_INV), \ + X(vpmin, 0x0000a10, 0x1200f00, N_INV), \ + X(vadd, 0x0000800, 0x0000d00, N_INV), \ + X(vsub, 0x1000800, 0x0200d00, N_INV), \ + X(vceq, 0x1000810, 0x0000e00, 0x1b10100), \ + X(vcge, 0x0000310, 0x1000e00, 0x1b10080), \ + X(vcgt, 0x0000300, 0x1200e00, 0x1b10000), \ + /* Register variants of the following two instructions are encoded as + vcge / vcgt with the operands reversed. */ \ + X(vclt, 0x0000300, 0x1200e00, 0x1b10200), \ + X(vcle, 0x0000310, 0x1000e00, 0x1b10180), \ + X(vmla, 0x0000900, 0x0000d10, 0x0800040), \ + X(vmls, 0x1000900, 0x0200d10, 0x0800440), \ + X(vmul, 0x0000910, 0x1000d10, 0x0800840), \ + X(vmull, 0x0800c00, 0x0800e00, 0x0800a40), /* polynomial not float. */ \ + X(vmlal, 0x0800800, N_INV, 0x0800240), \ + X(vmlsl, 0x0800a00, N_INV, 0x0800640), \ + X(vqdmlal, 0x0800900, N_INV, 0x0800340), \ + X(vqdmlsl, 0x0800b00, N_INV, 0x0800740), \ + X(vqdmull, 0x0800d00, N_INV, 0x0800b40), \ + X(vqdmulh, 0x0000b00, N_INV, 0x0800c40), \ + X(vqrdmulh, 0x1000b00, N_INV, 0x0800d40), \ + X(vshl, 0x0000400, N_INV, 0x0800510), \ + X(vqshl, 0x0000410, N_INV, 0x0800710), \ + X(vand, 0x0000110, N_INV, 0x0800030), \ + X(vbic, 0x0100110, N_INV, 0x0800030), \ + X(veor, 0x1000110, N_INV, N_INV), \ + X(vorn, 0x0300110, N_INV, 0x0800010), \ + X(vorr, 0x0200110, N_INV, 0x0800010), \ + X(vmvn, 0x1b00580, N_INV, 0x0800030), \ + X(vshll, 0x1b20300, N_INV, 0x0800a10), /* max shift, immediate. */ \ + X(vcvt, 0x1b30600, N_INV, 0x0800e10), /* integer, fixed-point. */ \ + X(vdup, 0xe800b10, N_INV, 0x1b00c00), /* arm, scalar. */ \ + X(vld1, 0x0200000, 0x0a00000, 0x0a00c00), /* interlv, lane, dup. */ \ + X(vst1, 0x0000000, 0x0800000, N_INV), \ + X(vld2, 0x0200100, 0x0a00100, 0x0a00d00), \ + X(vst2, 0x0000100, 0x0800100, N_INV), \ + X(vld3, 0x0200200, 0x0a00200, 0x0a00e00), \ + X(vst3, 0x0000200, 0x0800200, N_INV), \ + X(vld4, 0x0200300, 0x0a00300, 0x0a00f00), \ + X(vst4, 0x0000300, 0x0800300, N_INV), \ + X(vmovn, 0x1b20200, N_INV, N_INV), \ + X(vtrn, 0x1b20080, N_INV, N_INV), \ + X(vqmovn, 0x1b20200, N_INV, N_INV), \ + X(vqmovun, 0x1b20240, N_INV, N_INV), \ + X(vnmul, 0xe200a40, 0xe200b40, N_INV), \ + X(vnmla, 0xe000a40, 0xe000b40, N_INV), \ + X(vnmls, 0xe100a40, 0xe100b40, N_INV), \ + X(vcmp, 0xeb40a40, 0xeb40b40, N_INV), \ + X(vcmpz, 0xeb50a40, 0xeb50b40, N_INV), \ + X(vcmpe, 0xeb40ac0, 0xeb40bc0, N_INV), \ + X(vcmpez, 0xeb50ac0, 0xeb50bc0, N_INV) + +enum neon_opc +{ +#define X(OPC,I,F,S) N_MNEM_##OPC +NEON_ENC_TAB +#undef X +}; + +static const struct neon_tab_entry neon_enc_tab[] = +{ +#define X(OPC,I,F,S) { (I), (F), (S) } +NEON_ENC_TAB +#undef X +}; + +#define NEON_ENC_INTEGER(X) (neon_enc_tab[(X) & 0x0fffffff].integer) +#define NEON_ENC_ARMREG(X) (neon_enc_tab[(X) & 0x0fffffff].integer) +#define NEON_ENC_POLY(X) (neon_enc_tab[(X) & 0x0fffffff].float_or_poly) +#define NEON_ENC_FLOAT(X) (neon_enc_tab[(X) & 0x0fffffff].float_or_poly) +#define NEON_ENC_SCALAR(X) (neon_enc_tab[(X) & 0x0fffffff].scalar_or_imm) +#define NEON_ENC_IMMED(X) (neon_enc_tab[(X) & 0x0fffffff].scalar_or_imm) +#define NEON_ENC_INTERLV(X) (neon_enc_tab[(X) & 0x0fffffff].integer) +#define NEON_ENC_LANE(X) (neon_enc_tab[(X) & 0x0fffffff].float_or_poly) +#define NEON_ENC_DUP(X) (neon_enc_tab[(X) & 0x0fffffff].scalar_or_imm) +#define NEON_ENC_SINGLE(X) \ + ((neon_enc_tab[(X) & 0x0fffffff].integer) | ((X) & 0xf0000000)) +#define NEON_ENC_DOUBLE(X) \ + ((neon_enc_tab[(X) & 0x0fffffff].float_or_poly) | ((X) & 0xf0000000)) + +/* Define shapes for instruction operands. The following mnemonic characters + are used in this table: + + F - VFP S register + D - Neon D register + Q - Neon Q register + I - Immediate + S - Scalar + R - ARM register + L - D register list + + This table is used to generate various data: + - enumerations of the form NS_DDR to be used as arguments to + neon_select_shape. + - a table classifying shapes into single, double, quad, mixed. + - a table used to drive neon_select_shape. +*/ + +#define NEON_SHAPE_DEF \ + X(3, (D, D, D), DOUBLE), \ + X(3, (Q, Q, Q), QUAD), \ + X(3, (D, D, I), DOUBLE), \ + X(3, (Q, Q, I), QUAD), \ + X(3, (D, D, S), DOUBLE), \ + X(3, (Q, Q, S), QUAD), \ + X(2, (D, D), DOUBLE), \ + X(2, (Q, Q), QUAD), \ + X(2, (D, S), DOUBLE), \ + X(2, (Q, S), QUAD), \ + X(2, (D, R), DOUBLE), \ + X(2, (Q, R), QUAD), \ + X(2, (D, I), DOUBLE), \ + X(2, (Q, I), QUAD), \ + X(3, (D, L, D), DOUBLE), \ + X(2, (D, Q), MIXED), \ + X(2, (Q, D), MIXED), \ + X(3, (D, Q, I), MIXED), \ + X(3, (Q, D, I), MIXED), \ + X(3, (Q, D, D), MIXED), \ + X(3, (D, Q, Q), MIXED), \ + X(3, (Q, Q, D), MIXED), \ + X(3, (Q, D, S), MIXED), \ + X(3, (D, Q, S), MIXED), \ + X(4, (D, D, D, I), DOUBLE), \ + X(4, (Q, Q, Q, I), QUAD), \ + X(2, (F, F), SINGLE), \ + X(3, (F, F, F), SINGLE), \ + X(2, (F, I), SINGLE), \ + X(2, (F, D), MIXED), \ + X(2, (D, F), MIXED), \ + X(3, (F, F, I), MIXED), \ + X(4, (R, R, F, F), SINGLE), \ + X(4, (F, F, R, R), SINGLE), \ + X(3, (D, R, R), DOUBLE), \ + X(3, (R, R, D), DOUBLE), \ + X(2, (S, R), SINGLE), \ + X(2, (R, S), SINGLE), \ + X(2, (F, R), SINGLE), \ + X(2, (R, F), SINGLE) + +#define S2(A,B) NS_##A##B +#define S3(A,B,C) NS_##A##B##C +#define S4(A,B,C,D) NS_##A##B##C##D + +#define X(N, L, C) S##N L + +enum neon_shape +{ + NEON_SHAPE_DEF, + NS_NULL +}; + +#undef X +#undef S2 +#undef S3 +#undef S4 + +enum neon_shape_class +{ + SC_SINGLE, + SC_DOUBLE, + SC_QUAD, + SC_MIXED +}; + +#define X(N, L, C) SC_##C + +static enum neon_shape_class neon_shape_class[] = +{ + NEON_SHAPE_DEF +}; + +#undef X + +enum neon_shape_el +{ + SE_F, + SE_D, + SE_Q, + SE_I, + SE_S, + SE_R, + SE_L +}; + +/* Register widths of above. */ +static unsigned neon_shape_el_size[] = +{ + 32, + 64, + 128, + 0, + 32, + 32, + 0 +}; + +struct neon_shape_info +{ + unsigned els; + enum neon_shape_el el[NEON_MAX_TYPE_ELS]; +}; + +#define S2(A,B) { SE_##A, SE_##B } +#define S3(A,B,C) { SE_##A, SE_##B, SE_##C } +#define S4(A,B,C,D) { SE_##A, SE_##B, SE_##C, SE_##D } + +#define X(N, L, C) { N, S##N L } + +static struct neon_shape_info neon_shape_tab[] = +{ + NEON_SHAPE_DEF +}; + +#undef X +#undef S2 +#undef S3 +#undef S4 + +/* Bit masks used in type checking given instructions. + 'N_EQK' means the type must be the same as (or based on in some way) the key + type, which itself is marked with the 'N_KEY' bit. If the 'N_EQK' bit is + set, various other bits can be set as well in order to modify the meaning of + the type constraint. */ + +enum neon_type_mask +{ + N_S8 = 0x000001, + N_S16 = 0x000002, + N_S32 = 0x000004, + N_S64 = 0x000008, + N_U8 = 0x000010, + N_U16 = 0x000020, + N_U32 = 0x000040, + N_U64 = 0x000080, + N_I8 = 0x000100, + N_I16 = 0x000200, + N_I32 = 0x000400, + N_I64 = 0x000800, + N_8 = 0x001000, + N_16 = 0x002000, + N_32 = 0x004000, + N_64 = 0x008000, + N_P8 = 0x010000, + N_P16 = 0x020000, + N_F32 = 0x040000, + N_F64 = 0x080000, + N_KEY = 0x100000, /* key element (main type specifier). */ + N_EQK = 0x200000, /* given operand has the same type & size as the key. */ + N_VFP = 0x400000, /* VFP mode: operand size must match register width. */ + N_DBL = 0x000001, /* if N_EQK, this operand is twice the size. */ + N_HLF = 0x000002, /* if N_EQK, this operand is half the size. */ + N_SGN = 0x000004, /* if N_EQK, this operand is forced to be signed. */ + N_UNS = 0x000008, /* if N_EQK, this operand is forced to be unsigned. */ + N_INT = 0x000010, /* if N_EQK, this operand is forced to be integer. */ + N_FLT = 0x000020, /* if N_EQK, this operand is forced to be float. */ + N_SIZ = 0x000040, /* if N_EQK, this operand is forced to be size-only. */ + N_UTYP = 0, + N_MAX_NONSPECIAL = N_F64 +}; + +#define N_ALLMODS (N_DBL | N_HLF | N_SGN | N_UNS | N_INT | N_FLT | N_SIZ) + +#define N_SU_ALL (N_S8 | N_S16 | N_S32 | N_S64 | N_U8 | N_U16 | N_U32 | N_U64) +#define N_SU_32 (N_S8 | N_S16 | N_S32 | N_U8 | N_U16 | N_U32) +#define N_SU_16_64 (N_S16 | N_S32 | N_S64 | N_U16 | N_U32 | N_U64) +#define N_SUF_32 (N_SU_32 | N_F32) +#define N_I_ALL (N_I8 | N_I16 | N_I32 | N_I64) +#define N_IF_32 (N_I8 | N_I16 | N_I32 | N_F32) + +/* Pass this as the first type argument to neon_check_type to ignore types + altogether. */ +#define N_IGNORE_TYPE (N_KEY | N_EQK) + +/* Select a "shape" for the current instruction (describing register types or + sizes) from a list of alternatives. Return NS_NULL if the current instruction + doesn't fit. For non-polymorphic shapes, checking is usually done as a + function of operand parsing, so this function doesn't need to be called. + Shapes should be listed in order of decreasing length. */ + +static enum neon_shape +neon_select_shape (enum neon_shape shape, ...) +{ + va_list ap; + enum neon_shape first_shape = shape; + + /* Fix missing optional operands. FIXME: we don't know at this point how + many arguments we should have, so this makes the assumption that we have + > 1. This is true of all current Neon opcodes, I think, but may not be + true in the future. */ + if (!inst.operands[1].present) + inst.operands[1] = inst.operands[0]; + + va_start (ap, shape); + + for (; shape != NS_NULL; shape = va_arg (ap, int)) + { + unsigned j; + int matches = 1; + + for (j = 0; j < neon_shape_tab[shape].els; j++) + { + if (!inst.operands[j].present) + { + matches = 0; + break; + } + + switch (neon_shape_tab[shape].el[j]) + { + case SE_F: + if (!(inst.operands[j].isreg + && inst.operands[j].isvec + && inst.operands[j].issingle + && !inst.operands[j].isquad)) + matches = 0; + break; + + case SE_D: + if (!(inst.operands[j].isreg + && inst.operands[j].isvec + && !inst.operands[j].isquad + && !inst.operands[j].issingle)) + matches = 0; + break; + + case SE_R: + if (!(inst.operands[j].isreg + && !inst.operands[j].isvec)) + matches = 0; + break; + + case SE_Q: + if (!(inst.operands[j].isreg + && inst.operands[j].isvec + && inst.operands[j].isquad + && !inst.operands[j].issingle)) + matches = 0; + break; + + case SE_I: + if (!(!inst.operands[j].isreg + && !inst.operands[j].isscalar)) + matches = 0; + break; + + case SE_S: + if (!(!inst.operands[j].isreg + && inst.operands[j].isscalar)) + matches = 0; + break; + + case SE_L: + break; + } + } + if (matches) + break; + } + + va_end (ap); + + if (shape == NS_NULL && first_shape != NS_NULL) + first_error (_("invalid instruction shape")); + + return shape; +} + +/* True if SHAPE is predominantly a quadword operation (most of the time, this + means the Q bit should be set). */ + +static int +neon_quad (enum neon_shape shape) +{ + return neon_shape_class[shape] == SC_QUAD; +} + +static void +neon_modify_type_size (unsigned typebits, enum neon_el_type *g_type, + unsigned *g_size) +{ + /* Allow modification to be made to types which are constrained to be + based on the key element, based on bits set alongside N_EQK. */ + if ((typebits & N_EQK) != 0) + { + if ((typebits & N_HLF) != 0) + *g_size /= 2; + else if ((typebits & N_DBL) != 0) + *g_size *= 2; + if ((typebits & N_SGN) != 0) + *g_type = NT_signed; + else if ((typebits & N_UNS) != 0) + *g_type = NT_unsigned; + else if ((typebits & N_INT) != 0) + *g_type = NT_integer; + else if ((typebits & N_FLT) != 0) + *g_type = NT_float; + else if ((typebits & N_SIZ) != 0) + *g_type = NT_untyped; + } +} + +/* Return operand OPNO promoted by bits set in THISARG. KEY should be the "key" + operand type, i.e. the single type specified in a Neon instruction when it + is the only one given. */ + +static struct neon_type_el +neon_type_promote (struct neon_type_el *key, unsigned thisarg) +{ + struct neon_type_el dest = *key; + + assert ((thisarg & N_EQK) != 0); + + neon_modify_type_size (thisarg, &dest.type, &dest.size); + + return dest; +} + +/* Convert Neon type and size into compact bitmask representation. */ + +static enum neon_type_mask +type_chk_of_el_type (enum neon_el_type type, unsigned size) +{ + switch (type) + { + case NT_untyped: + switch (size) + { + case 8: return N_8; + case 16: return N_16; + case 32: return N_32; + case 64: return N_64; + default: ; + } + break; + + case NT_integer: + switch (size) + { + case 8: return N_I8; + case 16: return N_I16; + case 32: return N_I32; + case 64: return N_I64; + default: ; + } + break; + + case NT_float: + switch (size) + { + case 32: return N_F32; + case 64: return N_F64; + default: ; + } + break; + + case NT_poly: + switch (size) + { + case 8: return N_P8; + case 16: return N_P16; + default: ; + } + break; + + case NT_signed: + switch (size) + { + case 8: return N_S8; + case 16: return N_S16; + case 32: return N_S32; + case 64: return N_S64; + default: ; + } + break; + + case NT_unsigned: + switch (size) + { + case 8: return N_U8; + case 16: return N_U16; + case 32: return N_U32; + case 64: return N_U64; + default: ; + } + break; + + default: ; + } + + return N_UTYP; +} + +/* Convert compact Neon bitmask type representation to a type and size. Only + handles the case where a single bit is set in the mask. */ + +static int +el_type_of_type_chk (enum neon_el_type *type, unsigned *size, + enum neon_type_mask mask) +{ + if ((mask & N_EQK) != 0) + return FAIL; + + if ((mask & (N_S8 | N_U8 | N_I8 | N_8 | N_P8)) != 0) + *size = 8; + else if ((mask & (N_S16 | N_U16 | N_I16 | N_16 | N_P16)) != 0) + *size = 16; + else if ((mask & (N_S32 | N_U32 | N_I32 | N_32 | N_F32)) != 0) + *size = 32; + else if ((mask & (N_S64 | N_U64 | N_I64 | N_64 | N_F64)) != 0) + *size = 64; + else + return FAIL; + + if ((mask & (N_S8 | N_S16 | N_S32 | N_S64)) != 0) + *type = NT_signed; + else if ((mask & (N_U8 | N_U16 | N_U32 | N_U64)) != 0) + *type = NT_unsigned; + else if ((mask & (N_I8 | N_I16 | N_I32 | N_I64)) != 0) + *type = NT_integer; + else if ((mask & (N_8 | N_16 | N_32 | N_64)) != 0) + *type = NT_untyped; + else if ((mask & (N_P8 | N_P16)) != 0) + *type = NT_poly; + else if ((mask & (N_F32 | N_F64)) != 0) + *type = NT_float; + else + return FAIL; + + return SUCCESS; +} + +/* Modify a bitmask of allowed types. This is only needed for type + relaxation. */ + +static unsigned +modify_types_allowed (unsigned allowed, unsigned mods) +{ + unsigned size; + enum neon_el_type type; + unsigned destmask; + int i; + + destmask = 0; + + for (i = 1; i <= N_MAX_NONSPECIAL; i <<= 1) + { + if (el_type_of_type_chk (&type, &size, allowed & i) == SUCCESS) + { + neon_modify_type_size (mods, &type, &size); + destmask |= type_chk_of_el_type (type, size); + } + } + + return destmask; +} + +/* Check type and return type classification. + The manual states (paraphrase): If one datatype is given, it indicates the + type given in: + - the second operand, if there is one + - the operand, if there is no second operand + - the result, if there are no operands. + This isn't quite good enough though, so we use a concept of a "key" datatype + which is set on a per-instruction basis, which is the one which matters when + only one data type is written. + Note: this function has side-effects (e.g. filling in missing operands). All + Neon instructions should call it before performing bit encoding. */ + +static struct neon_type_el +neon_check_type (unsigned els, enum neon_shape ns, ...) +{ + va_list ap; + unsigned i, pass, key_el = 0; + unsigned types[NEON_MAX_TYPE_ELS]; + enum neon_el_type k_type = NT_invtype; + unsigned k_size = -1u; + struct neon_type_el badtype = {NT_invtype, -1}; + unsigned key_allowed = 0; + + /* Optional registers in Neon instructions are always (not) in operand 1. + Fill in the missing operand here, if it was omitted. */ + if (els > 1 && !inst.operands[1].present) + inst.operands[1] = inst.operands[0]; + + /* Suck up all the varargs. */ + va_start (ap, ns); + for (i = 0; i < els; i++) + { + unsigned thisarg = va_arg (ap, unsigned); + if (thisarg == N_IGNORE_TYPE) + { + va_end (ap); + return badtype; + } + types[i] = thisarg; + if ((thisarg & N_KEY) != 0) + key_el = i; + } + va_end (ap); + + if (inst.vectype.elems > 0) + for (i = 0; i < els; i++) + if (inst.operands[i].vectype.type != NT_invtype) + { + first_error (_("types specified in both the mnemonic and operands")); + return badtype; + } + + /* Duplicate inst.vectype elements here as necessary. + FIXME: No idea if this is exactly the same as the ARM assembler, + particularly when an insn takes one register and one non-register + operand. */ + if (inst.vectype.elems == 1 && els > 1) + { + unsigned j; + inst.vectype.elems = els; + inst.vectype.el[key_el] = inst.vectype.el[0]; + for (j = 0; j < els; j++) + if (j != key_el) + inst.vectype.el[j] = neon_type_promote (&inst.vectype.el[key_el], + types[j]); + } + else if (inst.vectype.elems == 0 && els > 0) + { + unsigned j; + /* No types were given after the mnemonic, so look for types specified + after each operand. We allow some flexibility here; as long as the + "key" operand has a type, we can infer the others. */ + for (j = 0; j < els; j++) + if (inst.operands[j].vectype.type != NT_invtype) + inst.vectype.el[j] = inst.operands[j].vectype; + + if (inst.operands[key_el].vectype.type != NT_invtype) + { + for (j = 0; j < els; j++) + if (inst.operands[j].vectype.type == NT_invtype) + inst.vectype.el[j] = neon_type_promote (&inst.vectype.el[key_el], + types[j]); + } + else + { + first_error (_("operand types can't be inferred")); + return badtype; + } + } + else if (inst.vectype.elems != els) + { + first_error (_("type specifier has the wrong number of parts")); + return badtype; + } + + for (pass = 0; pass < 2; pass++) + { + for (i = 0; i < els; i++) + { + unsigned thisarg = types[i]; + unsigned types_allowed = ((thisarg & N_EQK) != 0 && pass != 0) + ? modify_types_allowed (key_allowed, thisarg) : thisarg; + enum neon_el_type g_type = inst.vectype.el[i].type; + unsigned g_size = inst.vectype.el[i].size; + + /* Decay more-specific signed & unsigned types to sign-insensitive + integer types if sign-specific variants are unavailable. */ + if ((g_type == NT_signed || g_type == NT_unsigned) + && (types_allowed & N_SU_ALL) == 0) + g_type = NT_integer; + + /* If only untyped args are allowed, decay any more specific types to + them. Some instructions only care about signs for some element + sizes, so handle that properly. */ + if ((g_size == 8 && (types_allowed & N_8) != 0) + || (g_size == 16 && (types_allowed & N_16) != 0) + || (g_size == 32 && (types_allowed & N_32) != 0) + || (g_size == 64 && (types_allowed & N_64) != 0)) + g_type = NT_untyped; + + if (pass == 0) + { + if ((thisarg & N_KEY) != 0) + { + k_type = g_type; + k_size = g_size; + key_allowed = thisarg & ~N_KEY; + } + } + else + { + if ((thisarg & N_VFP) != 0) + { + enum neon_shape_el regshape = neon_shape_tab[ns].el[i]; + unsigned regwidth = neon_shape_el_size[regshape], match; + + /* In VFP mode, operands must match register widths. If we + have a key operand, use its width, else use the width of + the current operand. */ + if (k_size != -1u) + match = k_size; + else + match = g_size; + + if (regwidth != match) + { + first_error (_("operand size must match register width")); + return badtype; + } + } + + if ((thisarg & N_EQK) == 0) + { + unsigned given_type = type_chk_of_el_type (g_type, g_size); + + if ((given_type & types_allowed) == 0) + { + first_error (_("bad type in Neon instruction")); + return badtype; + } + } + else + { + enum neon_el_type mod_k_type = k_type; + unsigned mod_k_size = k_size; + neon_modify_type_size (thisarg, &mod_k_type, &mod_k_size); + if (g_type != mod_k_type || g_size != mod_k_size) + { + first_error (_("inconsistent types in Neon instruction")); + return badtype; + } + } + } + } + } + + return inst.vectype.el[key_el]; +} + +/* Neon-style VFP instruction forwarding. */ + +/* Thumb VFP instructions have 0xE in the condition field. */ + +static void +do_vfp_cond_or_thumb (void) +{ + if (thumb_mode) + inst.instruction |= 0xe0000000; + else + inst.instruction |= inst.cond << 28; +} + +/* Look up and encode a simple mnemonic, for use as a helper function for the + Neon-style VFP syntax. This avoids duplication of bits of the insns table, + etc. It is assumed that operand parsing has already been done, and that the + operands are in the form expected by the given opcode (this isn't necessarily + the same as the form in which they were parsed, hence some massaging must + take place before this function is called). + Checks current arch version against that in the looked-up opcode. */ + +static void +do_vfp_nsyn_opcode (const char *opname) +{ + const struct asm_opcode *opcode; + + opcode = hash_find (arm_ops_hsh, opname); + + if (!opcode) + abort (); + + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, + thumb_mode ? *opcode->tvariant : *opcode->avariant), + _(BAD_FPU)); + + if (thumb_mode) + { + inst.instruction = opcode->tvalue; + opcode->tencode (); + } + else + { + inst.instruction = (inst.cond << 28) | opcode->avalue; + opcode->aencode (); + } +} + +static void +do_vfp_nsyn_add_sub (enum neon_shape rs) +{ + int is_add = (inst.instruction & 0x0fffffff) == N_MNEM_vadd; + + if (rs == NS_FFF) + { + if (is_add) + do_vfp_nsyn_opcode ("fadds"); + else + do_vfp_nsyn_opcode ("fsubs"); + } + else + { + if (is_add) + do_vfp_nsyn_opcode ("faddd"); + else + do_vfp_nsyn_opcode ("fsubd"); + } +} + +/* Check operand types to see if this is a VFP instruction, and if so call + PFN (). */ + +static int +try_vfp_nsyn (int args, void (*pfn) (enum neon_shape)) +{ + enum neon_shape rs; + struct neon_type_el et; + + switch (args) + { + case 2: + rs = neon_select_shape (NS_FF, NS_DD, NS_NULL); + et = neon_check_type (2, rs, + N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + break; + + case 3: + rs = neon_select_shape (NS_FFF, NS_DDD, NS_NULL); + et = neon_check_type (3, rs, + N_EQK | N_VFP, N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + break; + + default: + abort (); + } + + if (et.type != NT_invtype) + { + pfn (rs); + return SUCCESS; + } + else + inst.error = NULL; + + return FAIL; +} + +static void +do_vfp_nsyn_mla_mls (enum neon_shape rs) +{ + int is_mla = (inst.instruction & 0x0fffffff) == N_MNEM_vmla; + + if (rs == NS_FFF) + { + if (is_mla) + do_vfp_nsyn_opcode ("fmacs"); + else + do_vfp_nsyn_opcode ("fmscs"); + } + else + { + if (is_mla) + do_vfp_nsyn_opcode ("fmacd"); + else + do_vfp_nsyn_opcode ("fmscd"); + } +} + +static void +do_vfp_nsyn_mul (enum neon_shape rs) +{ + if (rs == NS_FFF) + do_vfp_nsyn_opcode ("fmuls"); + else + do_vfp_nsyn_opcode ("fmuld"); +} + +static void +do_vfp_nsyn_abs_neg (enum neon_shape rs) +{ + int is_neg = (inst.instruction & 0x80) != 0; + neon_check_type (2, rs, N_EQK | N_VFP, N_F32 | N_F64 | N_VFP | N_KEY); + + if (rs == NS_FF) + { + if (is_neg) + do_vfp_nsyn_opcode ("fnegs"); + else + do_vfp_nsyn_opcode ("fabss"); + } + else + { + if (is_neg) + do_vfp_nsyn_opcode ("fnegd"); + else + do_vfp_nsyn_opcode ("fabsd"); + } +} + +/* Encode single-precision (only!) VFP fldm/fstm instructions. Double precision + insns belong to Neon, and are handled elsewhere. */ + +static void +do_vfp_nsyn_ldm_stm (int is_dbmode) +{ + int is_ldm = (inst.instruction & (1 << 20)) != 0; + if (is_ldm) + { + if (is_dbmode) + do_vfp_nsyn_opcode ("fldmdbs"); + else + do_vfp_nsyn_opcode ("fldmias"); + } + else + { + if (is_dbmode) + do_vfp_nsyn_opcode ("fstmdbs"); + else + do_vfp_nsyn_opcode ("fstmias"); + } +} + +static void +do_vfp_nsyn_sqrt (void) +{ + enum neon_shape rs = neon_select_shape (NS_FF, NS_DD, NS_NULL); + neon_check_type (2, rs, N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FF) + do_vfp_nsyn_opcode ("fsqrts"); + else + do_vfp_nsyn_opcode ("fsqrtd"); +} + +static void +do_vfp_nsyn_div (void) +{ + enum neon_shape rs = neon_select_shape (NS_FFF, NS_DDD, NS_NULL); + neon_check_type (3, rs, N_EQK | N_VFP, N_EQK | N_VFP, + N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FFF) + do_vfp_nsyn_opcode ("fdivs"); + else + do_vfp_nsyn_opcode ("fdivd"); +} + +static void +do_vfp_nsyn_nmul (void) +{ + enum neon_shape rs = neon_select_shape (NS_FFF, NS_DDD, NS_NULL); + neon_check_type (3, rs, N_EQK | N_VFP, N_EQK | N_VFP, + N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FFF) + { + inst.instruction = NEON_ENC_SINGLE (inst.instruction); + do_vfp_sp_dyadic (); + } + else + { + inst.instruction = NEON_ENC_DOUBLE (inst.instruction); + do_vfp_dp_rd_rn_rm (); + } + do_vfp_cond_or_thumb (); +} + +static void +do_vfp_nsyn_cmp (void) +{ + if (inst.operands[1].isreg) + { + enum neon_shape rs = neon_select_shape (NS_FF, NS_DD, NS_NULL); + neon_check_type (2, rs, N_EQK | N_VFP, N_F32 | N_F64 | N_KEY | N_VFP); + + if (rs == NS_FF) + { + inst.instruction = NEON_ENC_SINGLE (inst.instruction); + do_vfp_sp_monadic (); + } + else + { + inst.instruction = NEON_ENC_DOUBLE (inst.instruction); + do_vfp_dp_rd_rm (); + } + } + else + { + enum neon_shape rs = neon_select_shape (NS_FI, NS_DI, NS_NULL); + neon_check_type (2, rs, N_F32 | N_F64 | N_KEY | N_VFP, N_EQK); + + switch (inst.instruction & 0x0fffffff) + { + case N_MNEM_vcmp: + inst.instruction += N_MNEM_vcmpz - N_MNEM_vcmp; + break; + case N_MNEM_vcmpe: + inst.instruction += N_MNEM_vcmpez - N_MNEM_vcmpe; + break; + default: + abort (); + } + + if (rs == NS_FI) + { + inst.instruction = NEON_ENC_SINGLE (inst.instruction); + do_vfp_sp_compare_z (); + } + else + { + inst.instruction = NEON_ENC_DOUBLE (inst.instruction); + do_vfp_dp_rd (); + } + } + do_vfp_cond_or_thumb (); +} + +static void +nsyn_insert_sp (void) +{ + inst.operands[1] = inst.operands[0]; + memset (&inst.operands[0], '\0', sizeof (inst.operands[0])); + inst.operands[0].reg = 13; + inst.operands[0].isreg = 1; + inst.operands[0].writeback = 1; + inst.operands[0].present = 1; +} + +static void +do_vfp_nsyn_push (void) +{ + nsyn_insert_sp (); + if (inst.operands[1].issingle) + do_vfp_nsyn_opcode ("fstmdbs"); + else + do_vfp_nsyn_opcode ("fstmdbd"); +} + +static void +do_vfp_nsyn_pop (void) +{ + nsyn_insert_sp (); + if (inst.operands[1].issingle) + do_vfp_nsyn_opcode ("fldmias"); + else + do_vfp_nsyn_opcode ("fldmiad"); +} + +/* Fix up Neon data-processing instructions, ORing in the correct bits for + ARM mode or Thumb mode and moving the encoded bit 24 to bit 28. */ + +static unsigned +neon_dp_fixup (unsigned i) +{ + if (thumb_mode) + { + /* The U bit is at bit 24 by default. Move to bit 28 in Thumb mode. */ + if (i & (1 << 24)) + i |= 1 << 28; + + i &= ~(1 << 24); + + i |= 0xef000000; + } + else + i |= 0xf2000000; + + return i; +} + +/* Turn a size (8, 16, 32, 64) into the respective bit number minus 3 + (0, 1, 2, 3). */ + +static unsigned +neon_logbits (unsigned x) +{ + return ffs (x) - 4; +} + +#define LOW4(R) ((R) & 0xf) +#define HI1(R) (((R) >> 4) & 1) + +/* Encode insns with bit pattern: + + |28/24|23|22 |21 20|19 16|15 12|11 8|7|6|5|4|3 0| + | U |x |D |size | Rn | Rd |x x x x|N|Q|M|x| Rm | + + SIZE is passed in bits. -1 means size field isn't changed, in case it has a + different meaning for some instruction. */ + +static void +neon_three_same (int isquad, int ubit, int size) +{ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= (isquad != 0) << 6; + inst.instruction |= (ubit != 0) << 24; + if (size != -1) + inst.instruction |= neon_logbits (size) << 20; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +/* Encode instructions of the form: + + |28/24|23|22|21 20|19 18|17 16|15 12|11 7|6|5|4|3 0| + | U |x |D |x x |size |x x | Rd |x x x x x|Q|M|x| Rm | + + Don't write size if SIZE == -1. */ + +static void +neon_two_same (int qbit, int ubit, int size) +{ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= (qbit != 0) << 6; + inst.instruction |= (ubit != 0) << 24; + + if (size != -1) + inst.instruction |= neon_logbits (size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +/* Neon instruction encoders, in approximate order of appearance. */ + +static void +do_neon_dyadic_i_su (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_SU_32 | N_KEY); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); +} + +static void +do_neon_dyadic_i64_su (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_SU_ALL | N_KEY); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); +} + +static void +neon_imm_shift (int write_ubit, int uval, int isquad, struct neon_type_el et, + unsigned immbits) +{ + unsigned size = et.size >> 3; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= (isquad != 0) << 6; + inst.instruction |= immbits << 16; + inst.instruction |= (size >> 3) << 7; + inst.instruction |= (size & 0x7) << 19; + if (write_ubit) + inst.instruction |= (uval != 0) << 24; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_shl_imm (void) +{ + if (!inst.operands[2].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_KEY | N_I_ALL); + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_imm_shift (FALSE, 0, neon_quad (rs), et, inst.operands[2].imm); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_SU_ALL | N_KEY, N_EQK | N_SGN); + unsigned int tmp; + + /* VSHL/VQSHL 3-register variants have syntax such as: + vshl.xx Dd, Dm, Dn + whereas other 3-register operations encoded by neon_three_same have + syntax like: + vadd.xx Dd, Dn, Dm + (i.e. with Dn & Dm reversed). Swap operands[1].reg and operands[2].reg + here. */ + tmp = inst.operands[2].reg; + inst.operands[2].reg = inst.operands[1].reg; + inst.operands[1].reg = tmp; + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); + } +} + +static void +do_neon_qshl_imm (void) +{ + if (!inst.operands[2].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_SU_ALL | N_KEY); + + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_imm_shift (TRUE, et.type == NT_unsigned, neon_quad (rs), et, + inst.operands[2].imm); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_SU_ALL | N_KEY, N_EQK | N_SGN); + unsigned int tmp; + + /* See note in do_neon_shl_imm. */ + tmp = inst.operands[2].reg; + inst.operands[2].reg = inst.operands[1].reg; + inst.operands[1].reg = tmp; + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); + } +} + +static void +do_neon_rshl (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_SU_ALL | N_KEY); + unsigned int tmp; + + tmp = inst.operands[2].reg; + inst.operands[2].reg = inst.operands[1].reg; + inst.operands[1].reg = tmp; + neon_three_same (neon_quad (rs), et.type == NT_unsigned, et.size); +} + +static int +neon_cmode_for_logic_imm (unsigned immediate, unsigned *immbits, int size) +{ + /* Handle .I8 pseudo-instructions. */ + if (size == 8) + { + /* Unfortunately, this will make everything apart from zero out-of-range. + FIXME is this the intended semantics? There doesn't seem much point in + accepting .I8 if so. */ + immediate |= immediate << 8; + size = 16; + } + + if (size >= 32) + { + if (immediate == (immediate & 0x000000ff)) + { + *immbits = immediate; + return 0x1; + } + else if (immediate == (immediate & 0x0000ff00)) + { + *immbits = immediate >> 8; + return 0x3; + } + else if (immediate == (immediate & 0x00ff0000)) + { + *immbits = immediate >> 16; + return 0x5; + } + else if (immediate == (immediate & 0xff000000)) + { + *immbits = immediate >> 24; + return 0x7; + } + if ((immediate & 0xffff) != (immediate >> 16)) + goto bad_immediate; + immediate &= 0xffff; + } + + if (immediate == (immediate & 0x000000ff)) + { + *immbits = immediate; + return 0x9; + } + else if (immediate == (immediate & 0x0000ff00)) + { + *immbits = immediate >> 8; + return 0xb; + } + + bad_immediate: + first_error (_("immediate value out of range")); + return FAIL; +} + +/* True if IMM has form 0bAAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD for bits + A, B, C, D. */ + +static int +neon_bits_same_in_bytes (unsigned imm) +{ + return ((imm & 0x000000ff) == 0 || (imm & 0x000000ff) == 0x000000ff) + && ((imm & 0x0000ff00) == 0 || (imm & 0x0000ff00) == 0x0000ff00) + && ((imm & 0x00ff0000) == 0 || (imm & 0x00ff0000) == 0x00ff0000) + && ((imm & 0xff000000) == 0 || (imm & 0xff000000) == 0xff000000); +} + +/* For immediate of above form, return 0bABCD. */ + +static unsigned +neon_squash_bits (unsigned imm) +{ + return (imm & 0x01) | ((imm & 0x0100) >> 7) | ((imm & 0x010000) >> 14) + | ((imm & 0x01000000) >> 21); +} + +/* Compress quarter-float representation to 0b...000 abcdefgh. */ + +static unsigned +neon_qfloat_bits (unsigned imm) +{ + return ((imm >> 19) & 0x7f) | ((imm >> 24) & 0x80); +} + +/* Returns CMODE. IMMBITS [7:0] is set to bits suitable for inserting into + the instruction. *OP is passed as the initial value of the op field, and + may be set to a different value depending on the constant (i.e. + "MOV I64, 0bAAAAAAAABBBB..." which uses OP = 1 despite being MOV not + MVN). If the immediate looks like a repeated parttern then also + try smaller element sizes. */ + +static int +neon_cmode_for_move_imm (unsigned immlo, unsigned immhi, int float_p, + unsigned *immbits, int *op, int size, + enum neon_el_type type) +{ + /* Only permit float immediates (including 0.0/-0.0) if the operand type is + float. */ + if (type == NT_float && !float_p) + return FAIL; + + if (type == NT_float && is_quarter_float (immlo) && immhi == 0) + { + if (size != 32 || *op == 1) + return FAIL; + *immbits = neon_qfloat_bits (immlo); + return 0xf; + } + + if (size == 64) + { + if (neon_bits_same_in_bytes (immhi) + && neon_bits_same_in_bytes (immlo)) + { + if (*op == 1) + return FAIL; + *immbits = (neon_squash_bits (immhi) << 4) + | neon_squash_bits (immlo); + *op = 1; + return 0xe; + } + + if (immhi != immlo) + return FAIL; + } + + if (size >= 32) + { + if (immlo == (immlo & 0x000000ff)) + { + *immbits = immlo; + return 0x0; + } + else if (immlo == (immlo & 0x0000ff00)) + { + *immbits = immlo >> 8; + return 0x2; + } + else if (immlo == (immlo & 0x00ff0000)) + { + *immbits = immlo >> 16; + return 0x4; + } + else if (immlo == (immlo & 0xff000000)) + { + *immbits = immlo >> 24; + return 0x6; + } + else if (immlo == ((immlo & 0x0000ff00) | 0x000000ff)) + { + *immbits = (immlo >> 8) & 0xff; + return 0xc; + } + else if (immlo == ((immlo & 0x00ff0000) | 0x0000ffff)) + { + *immbits = (immlo >> 16) & 0xff; + return 0xd; + } + + if ((immlo & 0xffff) != (immlo >> 16)) + return FAIL; + immlo &= 0xffff; + } + + if (size >= 16) + { + if (immlo == (immlo & 0x000000ff)) + { + *immbits = immlo; + return 0x8; + } + else if (immlo == (immlo & 0x0000ff00)) + { + *immbits = immlo >> 8; + return 0xa; + } + + if ((immlo & 0xff) != (immlo >> 8)) + return FAIL; + immlo &= 0xff; + } + + if (immlo == (immlo & 0x000000ff)) + { + /* Don't allow MVN with 8-bit immediate. */ + if (*op == 1) + return FAIL; + *immbits = immlo; + return 0xe; + } + + return FAIL; +} + +/* Write immediate bits [7:0] to the following locations: + + |28/24|23 19|18 16|15 4|3 0| + | a |x x x x x|b c d|x x x x x x x x x x x x|e f g h| + + This function is used by VMOV/VMVN/VORR/VBIC. */ + +static void +neon_write_immbits (unsigned immbits) +{ + inst.instruction |= immbits & 0xf; + inst.instruction |= ((immbits >> 4) & 0x7) << 16; + inst.instruction |= ((immbits >> 7) & 0x1) << 24; +} + +/* Invert low-order SIZE bits of XHI:XLO. */ + +static void +neon_invert_size (unsigned *xlo, unsigned *xhi, int size) +{ + unsigned immlo = xlo ? *xlo : 0; + unsigned immhi = xhi ? *xhi : 0; + + switch (size) + { + case 8: + immlo = (~immlo) & 0xff; + break; + + case 16: + immlo = (~immlo) & 0xffff; + break; + + case 64: + immhi = (~immhi) & 0xffffffff; + /* fall through. */ + + case 32: + immlo = (~immlo) & 0xffffffff; + break; + + default: + abort (); + } + + if (xlo) + *xlo = immlo; + + if (xhi) + *xhi = immhi; +} + +static void +do_neon_logic (void) +{ + if (inst.operands[2].present && inst.operands[2].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_IGNORE_TYPE); + /* U bit and size field were set as part of the bitmask. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), 0, -1); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DI, NS_QI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_I8 | N_I16 | N_I32 | N_I64 | N_F32 | N_KEY, N_EQK); + enum neon_opc opcode = inst.instruction & 0x0fffffff; + unsigned immbits; + int cmode; + + if (et.type == NT_invtype) + return; + + inst.instruction = NEON_ENC_IMMED (inst.instruction); + + immbits = inst.operands[1].imm; + if (et.size == 64) + { + /* .i64 is a pseudo-op, so the immediate must be a repeating + pattern. */ + if (immbits != (inst.operands[1].regisimm ? + inst.operands[1].reg : 0)) + { + /* Set immbits to an invalid constant. */ + immbits = 0xdeadbeef; + } + } + + switch (opcode) + { + case N_MNEM_vbic: + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + case N_MNEM_vorr: + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + case N_MNEM_vand: + /* Pseudo-instruction for VBIC. */ + neon_invert_size (&immbits, 0, et.size); + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + case N_MNEM_vorn: + /* Pseudo-instruction for VORR. */ + neon_invert_size (&immbits, 0, et.size); + cmode = neon_cmode_for_logic_imm (immbits, &immbits, et.size); + break; + + default: + abort (); + } + + if (cmode == FAIL) + return; + + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= cmode << 8; + neon_write_immbits (immbits); + + inst.instruction = neon_dp_fixup (inst.instruction); + } +} + +static void +do_neon_bitfield (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_IGNORE_TYPE); + neon_three_same (neon_quad (rs), 0, -1); +} + +static void +neon_dyadic_misc (enum neon_el_type ubit_meaning, unsigned types, + unsigned destbits) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, N_EQK | destbits, N_EQK, + types | N_KEY); + if (et.type == NT_float) + { + inst.instruction = NEON_ENC_FLOAT (inst.instruction); + neon_three_same (neon_quad (rs), 0, -1); + } + else + { + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_three_same (neon_quad (rs), et.type == ubit_meaning, et.size); + } +} + +static void +do_neon_dyadic_if_su (void) +{ + neon_dyadic_misc (NT_unsigned, N_SUF_32, 0); +} + +static void +do_neon_dyadic_if_su_d (void) +{ + /* This version only allow D registers, but that constraint is enforced during + operand parsing so we don't need to do anything extra here. */ + neon_dyadic_misc (NT_unsigned, N_SUF_32, 0); +} + +static void +do_neon_dyadic_if_i_d (void) +{ + /* The "untyped" case can't happen. Do this to stop the "U" bit being + affected if we specify unsigned args. */ + neon_dyadic_misc (NT_untyped, N_IF_32, 0); +} + +enum vfp_or_neon_is_neon_bits +{ + NEON_CHECK_CC = 1, + NEON_CHECK_ARCH = 2 +}; + +/* Call this function if an instruction which may have belonged to the VFP or + Neon instruction sets, but turned out to be a Neon instruction (due to the + operand types involved, etc.). We have to check and/or fix-up a couple of + things: + + - Make sure the user hasn't attempted to make a Neon instruction + conditional. + - Alter the value in the condition code field if necessary. + - Make sure that the arch supports Neon instructions. + + Which of these operations take place depends on bits from enum + vfp_or_neon_is_neon_bits. + + WARNING: This function has side effects! If NEON_CHECK_CC is used and the + current instruction's condition is COND_ALWAYS, the condition field is + changed to inst.uncond_value. This is necessary because instructions shared + between VFP and Neon may be conditional for the VFP variants only, and the + unconditional Neon version must have, e.g., 0xF in the condition field. */ + +static int +vfp_or_neon_is_neon (unsigned check) +{ + /* Conditions are always legal in Thumb mode (IT blocks). */ + if (!thumb_mode && (check & NEON_CHECK_CC)) + { + if (inst.cond != COND_ALWAYS) + { + first_error (_(BAD_COND)); + return FAIL; + } + if (inst.uncond_value != -1) + inst.instruction |= inst.uncond_value << 28; + } + + if ((check & NEON_CHECK_ARCH) + && !ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1)) + { + first_error (_(BAD_FPU)); + return FAIL; + } + + return SUCCESS; +} + +static void +do_neon_addsub_if_i (void) +{ + if (try_vfp_nsyn (3, do_vfp_nsyn_add_sub) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + /* The "untyped" case can't happen. Do this to stop the "U" bit being + affected if we specify unsigned args. */ + neon_dyadic_misc (NT_untyped, N_IF_32 | N_I64, 0); +} + +/* Swaps operands 1 and 2. If operand 1 (optional arg) was omitted, we want the + result to be: + V A,B (A is operand 0, B is operand 2) + to mean: + V A,B,A + not: + V A,B,B + so handle that case specially. */ + +static void +neon_exchange_operands (void) +{ + void *scratch = alloca (sizeof (inst.operands[0])); + if (inst.operands[1].present) + { + /* Swap operands[1] and operands[2]. */ + memcpy (scratch, &inst.operands[1], sizeof (inst.operands[0])); + inst.operands[1] = inst.operands[2]; + memcpy (&inst.operands[2], scratch, sizeof (inst.operands[0])); + } + else + { + inst.operands[1] = inst.operands[2]; + inst.operands[2] = inst.operands[0]; + } +} + +static void +neon_compare (unsigned regtypes, unsigned immtypes, int invert) +{ + if (inst.operands[2].isreg) + { + if (invert) + neon_exchange_operands (); + neon_dyadic_misc (NT_unsigned, regtypes, N_SIZ); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_SIZ, immtypes | N_KEY); + + inst.instruction = NEON_ENC_IMMED (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= (et.type == NT_float) << 10; + inst.instruction |= neon_logbits (et.size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); + } +} + +static void +do_neon_cmp (void) +{ + neon_compare (N_SUF_32, N_S8 | N_S16 | N_S32 | N_F32, FALSE); +} + +static void +do_neon_cmp_inv (void) +{ + neon_compare (N_SUF_32, N_S8 | N_S16 | N_S32 | N_F32, TRUE); +} + +static void +do_neon_ceq (void) +{ + neon_compare (N_IF_32, N_IF_32, FALSE); +} + +/* For multiply instructions, we have the possibility of 16-bit or 32-bit + scalars, which are encoded in 5 bits, M : Rm. + For 16-bit scalars, the register is encoded in Rm[2:0] and the index in + M:Rm[3], and for 32-bit scalars, the register is encoded in Rm[3:0] and the + index in M. */ + +static unsigned +neon_scalar_for_mul (unsigned scalar, unsigned elsize) +{ + unsigned regno = NEON_SCALAR_REG (scalar); + unsigned elno = NEON_SCALAR_INDEX (scalar); + + switch (elsize) + { + case 16: + if (regno > 7 || elno > 3) + goto bad_scalar; + return regno | (elno << 3); + + case 32: + if (regno > 15 || elno > 1) + goto bad_scalar; + return regno | (elno << 4); + + default: + bad_scalar: + first_error (_("scalar out of range for multiply instruction")); + } + + return 0; +} + +/* Encode multiply / multiply-accumulate scalar instructions. */ + +static void +neon_mul_mac (struct neon_type_el et, int ubit) +{ + unsigned scalar; + + /* Give a more helpful error message if we have an invalid type. */ + if (et.type == NT_invtype) + return; + + scalar = neon_scalar_for_mul (inst.operands[2].reg, et.size); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (scalar); + inst.instruction |= HI1 (scalar) << 5; + inst.instruction |= (et.type == NT_float) << 8; + inst.instruction |= neon_logbits (et.size) << 20; + inst.instruction |= (ubit != 0) << 24; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_mac_maybe_scalar (void) +{ + if (try_vfp_nsyn (3, do_vfp_nsyn_mla_mls) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + if (inst.operands[2].isscalar) + { + enum neon_shape rs = neon_select_shape (NS_DDS, NS_QQS, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_I16 | N_I32 | N_F32 | N_KEY); + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + neon_mul_mac (et, neon_quad (rs)); + } + else + { + /* The "untyped" case can't happen. Do this to stop the "U" bit being + affected if we specify unsigned args. */ + neon_dyadic_misc (NT_untyped, N_IF_32, 0); + } +} + +static void +do_neon_tst (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_8 | N_16 | N_32 | N_KEY); + neon_three_same (neon_quad (rs), 0, et.size); +} + +/* VMUL with 3 registers allows the P8 type. The scalar version supports the + same types as the MAC equivalents. The polynomial type for this instruction + is encoded the same as the integer type. */ + +static void +do_neon_mul (void) +{ + if (try_vfp_nsyn (3, do_vfp_nsyn_mul) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + if (inst.operands[2].isscalar) + do_neon_mac_maybe_scalar (); + else + neon_dyadic_misc (NT_poly, N_I8 | N_I16 | N_I32 | N_F32 | N_P8, 0); +} + +static void +do_neon_qdmulh (void) +{ + if (inst.operands[2].isscalar) + { + enum neon_shape rs = neon_select_shape (NS_DDS, NS_QQS, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_S16 | N_S32 | N_KEY); + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + neon_mul_mac (et, neon_quad (rs)); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_S16 | N_S32 | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + /* The U bit (rounding) comes from bit mask. */ + neon_three_same (neon_quad (rs), 0, et.size); + } +} + +static void +do_neon_fcmp_absolute (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_EQK, N_EQK, N_F32 | N_KEY); + /* Size field comes from bit mask. */ + neon_three_same (neon_quad (rs), 1, -1); +} + +static void +do_neon_fcmp_absolute_inv (void) +{ + neon_exchange_operands (); + do_neon_fcmp_absolute (); +} + +static void +do_neon_step (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDD, NS_QQQ, NS_NULL); + neon_check_type (3, rs, N_EQK, N_EQK, N_F32 | N_KEY); + neon_three_same (neon_quad (rs), 0, -1); +} + +static void +do_neon_abs_neg (void) +{ + enum neon_shape rs; + struct neon_type_el et; + + if (try_vfp_nsyn (2, do_vfp_nsyn_abs_neg) == SUCCESS) + return; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + et = neon_check_type (2, rs, N_EQK, N_S8 | N_S16 | N_S32 | N_F32 | N_KEY); + + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= (et.type == NT_float) << 10; + inst.instruction |= neon_logbits (et.size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_sli (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_64 | N_KEY); + int imm = inst.operands[2].imm; + constraint (imm < 0 || (unsigned)imm >= et.size, + _("immediate out of range for insert")); + neon_imm_shift (FALSE, 0, neon_quad (rs), et, imm); +} + +static void +do_neon_sri (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_64 | N_KEY); + int imm = inst.operands[2].imm; + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range for insert")); + neon_imm_shift (FALSE, 0, neon_quad (rs), et, et.size - imm); +} + +static void +do_neon_qshlu_imm (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_UNS, N_S8 | N_S16 | N_S32 | N_S64 | N_KEY); + int imm = inst.operands[2].imm; + constraint (imm < 0 || (unsigned)imm >= et.size, + _("immediate out of range for shift")); + /* Only encodes the 'U present' variant of the instruction. + In this case, signed types have OP (bit 8) set to 0. + Unsigned types have OP set to 1. */ + inst.instruction |= (et.type == NT_unsigned) << 8; + /* The rest of the bits are the same as other immediate shifts. */ + neon_imm_shift (FALSE, 0, neon_quad (rs), et, imm); +} + +static void +do_neon_qmovn (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQ, + N_EQK | N_HLF, N_SU_16_64 | N_KEY); + /* Saturating move where operands can be signed or unsigned, and the + destination has the same signedness. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + if (et.type == NT_unsigned) + inst.instruction |= 0xc0; + else + inst.instruction |= 0x80; + neon_two_same (0, 1, et.size / 2); +} + +static void +do_neon_qmovun (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQ, + N_EQK | N_HLF | N_UNS, N_S16 | N_S32 | N_S64 | N_KEY); + /* Saturating move with unsigned results. Operands must be signed. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_two_same (0, 1, et.size / 2); +} + +static void +do_neon_rshift_sat_narrow (void) +{ + /* FIXME: Types for narrowing. If operands are signed, results can be signed + or unsigned. If operands are unsigned, results must also be unsigned. */ + struct neon_type_el et = neon_check_type (2, NS_DQI, + N_EQK | N_HLF, N_SU_16_64 | N_KEY); + int imm = inst.operands[2].imm; + /* This gets the bounds check, size encoding and immediate bits calculation + right. */ + et.size /= 2; + + /* VQ{R}SHRN.I
, , #0 is a synonym for + VQMOVN.I
, . */ + if (imm == 0) + { + inst.operands[2].present = 0; + inst.instruction = N_MNEM_vqmovn; + do_neon_qmovn (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range")); + neon_imm_shift (TRUE, et.type == NT_unsigned, 0, et, et.size - imm); +} + +static void +do_neon_rshift_sat_narrow_u (void) +{ + /* FIXME: Types for narrowing. If operands are signed, results can be signed + or unsigned. If operands are unsigned, results must also be unsigned. */ + struct neon_type_el et = neon_check_type (2, NS_DQI, + N_EQK | N_HLF | N_UNS, N_S16 | N_S32 | N_S64 | N_KEY); + int imm = inst.operands[2].imm; + /* This gets the bounds check, size encoding and immediate bits calculation + right. */ + et.size /= 2; + + /* VQSHRUN.I
, , #0 is a synonym for + VQMOVUN.I
, . */ + if (imm == 0) + { + inst.operands[2].present = 0; + inst.instruction = N_MNEM_vqmovun; + do_neon_qmovun (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range")); + /* FIXME: The manual is kind of unclear about what value U should have in + VQ{R}SHRUN instructions, but U=0, op=0 definitely encodes VRSHR, so it + must be 1. */ + neon_imm_shift (TRUE, 1, 0, et, et.size - imm); +} + +static void +do_neon_movn (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQ, + N_EQK | N_HLF, N_I16 | N_I32 | N_I64 | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_two_same (0, 1, et.size / 2); +} + +static void +do_neon_rshift_narrow (void) +{ + struct neon_type_el et = neon_check_type (2, NS_DQI, + N_EQK | N_HLF, N_I16 | N_I32 | N_I64 | N_KEY); + int imm = inst.operands[2].imm; + /* This gets the bounds check, size encoding and immediate bits calculation + right. */ + et.size /= 2; + + /* If immediate is zero then we are a pseudo-instruction for + VMOVN.I
, */ + if (imm == 0) + { + inst.operands[2].present = 0; + inst.instruction = N_MNEM_vmovn; + do_neon_movn (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range for narrowing operation")); + neon_imm_shift (FALSE, 0, 0, et, et.size - imm); +} + +static void +do_neon_shll (void) +{ + /* FIXME: Type checking when lengthening. */ + struct neon_type_el et = neon_check_type (2, NS_QDI, + N_EQK | N_DBL, N_I8 | N_I16 | N_I32 | N_KEY); + unsigned imm = inst.operands[2].imm; + + if (imm == et.size) + { + /* Maximum shift variant. */ + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_logbits (et.size) << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + else + { + /* A more-specific type check for non-max versions. */ + et = neon_check_type (2, NS_QDI, + N_EQK | N_DBL, N_SU_32 | N_KEY); + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_imm_shift (TRUE, et.type == NT_unsigned, 0, et, imm); + } +} + +/* Check the various types for the VCVT instruction, and return which version + the current instruction is. */ + +static int +neon_cvt_flavour (enum neon_shape rs) +{ +#define CVT_VAR(C,X,Y) \ + et = neon_check_type (2, rs, whole_reg | (X), whole_reg | (Y)); \ + if (et.type != NT_invtype) \ + { \ + inst.error = NULL; \ + return (C); \ + } + struct neon_type_el et; + unsigned whole_reg = (rs == NS_FFI || rs == NS_FD || rs == NS_DF + || rs == NS_FF) ? N_VFP : 0; + /* The instruction versions which take an immediate take one register + argument, which is extended to the width of the full register. Thus the + "source" and "destination" registers must have the same width. Hack that + here by making the size equal to the key (wider, in this case) operand. */ + unsigned key = (rs == NS_QQI || rs == NS_DDI || rs == NS_FFI) ? N_KEY : 0; + + CVT_VAR (0, N_S32, N_F32); + CVT_VAR (1, N_U32, N_F32); + CVT_VAR (2, N_F32, N_S32); + CVT_VAR (3, N_F32, N_U32); + + whole_reg = N_VFP; + + /* VFP instructions. */ + CVT_VAR (4, N_F32, N_F64); + CVT_VAR (5, N_F64, N_F32); + CVT_VAR (6, N_S32, N_F64 | key); + CVT_VAR (7, N_U32, N_F64 | key); + CVT_VAR (8, N_F64 | key, N_S32); + CVT_VAR (9, N_F64 | key, N_U32); + /* VFP instructions with bitshift. */ + CVT_VAR (10, N_F32 | key, N_S16); + CVT_VAR (11, N_F32 | key, N_U16); + CVT_VAR (12, N_F64 | key, N_S16); + CVT_VAR (13, N_F64 | key, N_U16); + CVT_VAR (14, N_S16, N_F32 | key); + CVT_VAR (15, N_U16, N_F32 | key); + CVT_VAR (16, N_S16, N_F64 | key); + CVT_VAR (17, N_U16, N_F64 | key); + + return -1; +#undef CVT_VAR +} + +/* Neon-syntax VFP conversions. */ + +static void +do_vfp_nsyn_cvt (enum neon_shape rs, int flavour) +{ + const char *opname = 0; + + if (rs == NS_DDI || rs == NS_QQI || rs == NS_FFI) + { + /* Conversions with immediate bitshift. */ + const char *enc[] = + { + "ftosls", + "ftouls", + "fsltos", + "fultos", + NULL, + NULL, + "ftosld", + "ftould", + "fsltod", + "fultod", + "fshtos", + "fuhtos", + "fshtod", + "fuhtod", + "ftoshs", + "ftouhs", + "ftoshd", + "ftouhd" + }; + + if (flavour >= 0 && flavour < (int) ARRAY_SIZE (enc)) + { + opname = enc[flavour]; + constraint (inst.operands[0].reg != inst.operands[1].reg, + _("operands 0 and 1 must be the same register")); + inst.operands[1] = inst.operands[2]; + memset (&inst.operands[2], '\0', sizeof (inst.operands[2])); + } + } + else + { + /* Conversions without bitshift. */ + const char *enc[] = + { + "ftosis", + "ftouis", + "fsitos", + "fuitos", + "fcvtsd", + "fcvtds", + "ftosid", + "ftouid", + "fsitod", + "fuitod" + }; + + if (flavour >= 0 && flavour < (int) ARRAY_SIZE (enc)) + opname = enc[flavour]; + } + + if (opname) + do_vfp_nsyn_opcode (opname); +} + +static void +do_vfp_nsyn_cvtz (void) +{ + enum neon_shape rs = neon_select_shape (NS_FF, NS_FD, NS_NULL); + int flavour = neon_cvt_flavour (rs); + const char *enc[] = + { + "ftosizs", + "ftouizs", + NULL, + NULL, + NULL, + NULL, + "ftosizd", + "ftouizd" + }; + + if (flavour >= 0 && flavour < (int) ARRAY_SIZE (enc) && enc[flavour]) + do_vfp_nsyn_opcode (enc[flavour]); +} + +static void +do_neon_cvt (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_FFI, NS_DD, NS_QQ, + NS_FD, NS_DF, NS_FF, NS_NULL); + int flavour = neon_cvt_flavour (rs); + + /* VFP rather than Neon conversions. */ + if (flavour >= 4) + { + do_vfp_nsyn_cvt (rs, flavour); + return; + } + + switch (rs) + { + case NS_DDI: + case NS_QQI: + { + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + /* Fixed-point conversion with #0 immediate is encoded as an + integer conversion. */ + if (inst.operands[2].present && inst.operands[2].imm == 0) + goto int_encode; + unsigned immbits = 32 - inst.operands[2].imm; + unsigned enctab[] = { 0x0000100, 0x1000100, 0x0, 0x1000000 }; + inst.instruction = NEON_ENC_IMMED (inst.instruction); + if (flavour != -1) + inst.instruction |= enctab[flavour]; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= 1 << 21; + inst.instruction |= immbits << 16; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + break; + + case NS_DD: + case NS_QQ: + int_encode: + { + unsigned enctab[] = { 0x100, 0x180, 0x0, 0x080 }; + + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + + if (flavour != -1) + inst.instruction |= enctab[flavour]; + + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= 2 << 18; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + break; + + default: + /* Some VFP conversions go here (s32 <-> f32, u32 <-> f32). */ + do_vfp_nsyn_cvt (rs, flavour); + } +} + +static void +neon_move_immediate (void) +{ + enum neon_shape rs = neon_select_shape (NS_DI, NS_QI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_I8 | N_I16 | N_I32 | N_I64 | N_F32 | N_KEY, N_EQK); + unsigned immlo, immhi = 0, immbits; + int op, cmode, float_p; + + constraint (et.type == NT_invtype, + _("operand size must be specified for immediate VMOV")); + + /* We start out as an MVN instruction if OP = 1, MOV otherwise. */ + op = (inst.instruction & (1 << 5)) != 0; + + immlo = inst.operands[1].imm; + if (inst.operands[1].regisimm) + immhi = inst.operands[1].reg; + + constraint (et.size < 32 && (immlo & ~((1 << et.size) - 1)) != 0, + _("immediate has bits set outside the operand size")); + + float_p = inst.operands[1].immisfloat; + + if ((cmode = neon_cmode_for_move_imm (immlo, immhi, float_p, &immbits, &op, + et.size, et.type)) == FAIL) + { + /* Invert relevant bits only. */ + neon_invert_size (&immlo, &immhi, et.size); + /* Flip from VMOV/VMVN to VMVN/VMOV. Some immediate types are unavailable + with one or the other; those cases are caught by + neon_cmode_for_move_imm. */ + op = !op; + if ((cmode = neon_cmode_for_move_imm (immlo, immhi, float_p, &immbits, + &op, et.size, et.type)) == FAIL) + { + first_error (_("immediate out of range")); + return; + } + } + + inst.instruction &= ~(1 << 5); + inst.instruction |= op << 5; + + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= cmode << 8; + + neon_write_immbits (immbits); +} + +static void +do_neon_mvn (void) +{ + if (inst.operands[1].isreg) + { + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + } + else + { + inst.instruction = NEON_ENC_IMMED (inst.instruction); + neon_move_immediate (); + } + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +/* Encode instructions of form: + + |28/24|23|22|21 20|19 16|15 12|11 8|7|6|5|4|3 0| + | U |x |D |size | Rn | Rd |x x x x|N|x|M|x| Rm | + +*/ + +static void +neon_mixed_length (struct neon_type_el et, unsigned size) +{ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= (et.type == NT_unsigned) << 24; + inst.instruction |= neon_logbits (size) << 20; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_dyadic_long (void) +{ + /* FIXME: Type checking for lengthening op. */ + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, N_SU_32 | N_KEY); + neon_mixed_length (et, et.size); +} + +static void +do_neon_abal (void) +{ + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_INT | N_DBL, N_EQK, N_SU_32 | N_KEY); + neon_mixed_length (et, et.size); +} + +static void +neon_mac_reg_scalar_long (unsigned regtypes, unsigned scalartypes) +{ + if (inst.operands[2].isscalar) + { + struct neon_type_el et = neon_check_type (3, NS_QDS, + N_EQK | N_DBL, N_EQK, regtypes | N_KEY); + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + neon_mul_mac (et, et.type == NT_unsigned); + } + else + { + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, scalartypes | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_mixed_length (et, et.size); + } +} + +static void +do_neon_mac_maybe_scalar_long (void) +{ + neon_mac_reg_scalar_long (N_S16 | N_S32 | N_U16 | N_U32, N_SU_32); +} + +static void +do_neon_dyadic_wide (void) +{ + struct neon_type_el et = neon_check_type (3, NS_QQD, + N_EQK | N_DBL, N_EQK | N_DBL, N_SU_32 | N_KEY); + neon_mixed_length (et, et.size); +} + +static void +do_neon_dyadic_narrow (void) +{ + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, N_I16 | N_I32 | N_I64 | N_KEY); + /* Operand sign is unimportant, and the U bit is part of the opcode, + so force the operand type to integer. */ + et.type = NT_integer; + neon_mixed_length (et, et.size / 2); +} + +static void +do_neon_mul_sat_scalar_long (void) +{ + neon_mac_reg_scalar_long (N_S16 | N_S32, N_S16 | N_S32); +} + +static void +do_neon_vmull (void) +{ + if (inst.operands[2].isscalar) + do_neon_mac_maybe_scalar_long (); + else + { + struct neon_type_el et = neon_check_type (3, NS_QDD, + N_EQK | N_DBL, N_EQK, N_SU_32 | N_P8 | N_KEY); + if (et.type == NT_poly) + inst.instruction = NEON_ENC_POLY (inst.instruction); + else + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + /* For polynomial encoding, size field must be 0b00 and the U bit must be + zero. Should be OK as-is. */ + neon_mixed_length (et, et.size); + } +} + +static void +do_neon_ext (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDDI, NS_QQQI, NS_NULL); + struct neon_type_el et = neon_check_type (3, rs, + N_EQK, N_EQK, N_8 | N_16 | N_32 | N_64 | N_KEY); + unsigned imm = (inst.operands[3].imm * et.size) / 8; + constraint (imm >= (neon_quad (rs) ? 16 : 8), _("shift out of range")); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= imm << 8; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_rev (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + unsigned op = (inst.instruction >> 7) & 3; + /* N (width of reversed regions) is encoded as part of the bitmask. We + extract it here to check the elements to be reversed are smaller. + Otherwise we'd get a reserved instruction. */ + unsigned elsize = (op == 2) ? 16 : (op == 1) ? 32 : (op == 0) ? 64 : 0; + assert (elsize != 0); + constraint (et.size >= elsize, + _("elements must be smaller than reversal region")); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_dup (void) +{ + if (inst.operands[1].isscalar) + { + enum neon_shape rs = neon_select_shape (NS_DS, NS_QS, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + unsigned sizebits = et.size >> 3; + unsigned dm = NEON_SCALAR_REG (inst.operands[1].reg); + int logsize = neon_logbits (et.size); + unsigned x = NEON_SCALAR_INDEX (inst.operands[1].reg) << logsize; + + if (vfp_or_neon_is_neon (NEON_CHECK_CC) == FAIL) + return; + + inst.instruction = NEON_ENC_SCALAR (inst.instruction); + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (dm); + inst.instruction |= HI1 (dm) << 5; + inst.instruction |= neon_quad (rs) << 6; + inst.instruction |= x << 17; + inst.instruction |= sizebits << 16; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + else + { + enum neon_shape rs = neon_select_shape (NS_DR, NS_QR, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_8 | N_16 | N_32 | N_KEY, N_EQK); + /* Duplicate ARM register to lanes of vector. */ + inst.instruction = NEON_ENC_ARMREG (inst.instruction); + switch (et.size) + { + case 8: inst.instruction |= 0x400000; break; + case 16: inst.instruction |= 0x000020; break; + case 32: inst.instruction |= 0x000000; break; + default: break; + } + inst.instruction |= LOW4 (inst.operands[1].reg) << 12; + inst.instruction |= LOW4 (inst.operands[0].reg) << 16; + inst.instruction |= HI1 (inst.operands[0].reg) << 7; + inst.instruction |= neon_quad (rs) << 21; + /* The encoding for this instruction is identical for the ARM and Thumb + variants, except for the condition field. */ + do_vfp_cond_or_thumb (); + } +} + +/* VMOV has particularly many variations. It can be one of: + 0. VMOV , + 1. VMOV
, + (Register operations, which are VORR with Rm = Rn.) + 2. VMOV.
, # + 3. VMOV.
, # + (Immediate loads.) + 4. VMOV. , + (ARM register to scalar.) + 5. VMOV , , + (Two ARM registers to vector.) + 6. VMOV.
, + (Scalar to ARM register.) + 7. VMOV , , + (Vector to two ARM registers.) + 8. VMOV.F32 , + 9. VMOV.F64
, + (VFP register moves.) + 10. VMOV.F32 , #imm + 11. VMOV.F64
, #imm + (VFP float immediate load.) + 12. VMOV , + (VFP single to ARM reg.) + 13. VMOV , + (ARM reg to VFP single.) + 14. VMOV , , , + (Two ARM regs to two VFP singles.) + 15. VMOV , , , + (Two VFP singles to two ARM regs.) + + These cases can be disambiguated using neon_select_shape, except cases 1/9 + and 3/11 which depend on the operand type too. + + All the encoded bits are hardcoded by this function. + + Cases 4, 6 may be used with VFPv1 and above (only 32-bit transfers!). + Cases 5, 7 may be used with VFPv2 and above. + + FIXME: Some of the checking may be a bit sloppy (in a couple of cases you + can specify a type where it doesn't make sense to, and is ignored). +*/ + +static void +do_neon_mov (void) +{ + enum neon_shape rs = neon_select_shape (NS_RRFF, NS_FFRR, NS_DRR, NS_RRD, + NS_QQ, NS_DD, NS_QI, NS_DI, NS_SR, NS_RS, NS_FF, NS_FI, NS_RF, NS_FR, + NS_NULL); + struct neon_type_el et; + const char *ldconst = 0; + + switch (rs) + { + case NS_DD: /* case 1/9. */ + et = neon_check_type (2, rs, N_EQK, N_F64 | N_KEY); + /* It is not an error here if no type is given. */ + inst.error = NULL; + if (et.type == NT_float && et.size == 64) + { + do_vfp_nsyn_opcode ("fcpyd"); + break; + } + /* fall through. */ + + case NS_QQ: /* case 0/1. */ + { + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + /* The architecture manual I have doesn't explicitly state which + value the U bit should have for register->register moves, but + the equivalent VORR instruction has U = 0, so do that. */ + inst.instruction = 0x0200110; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg); + inst.instruction |= HI1 (inst.operands[1].reg) << 5; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= neon_quad (rs) << 6; + + inst.instruction = neon_dp_fixup (inst.instruction); + } + break; + + case NS_DI: /* case 3/11. */ + et = neon_check_type (2, rs, N_EQK, N_F64 | N_KEY); + inst.error = NULL; + if (et.type == NT_float && et.size == 64) + { + /* case 11 (fconstd). */ + ldconst = "fconstd"; + goto encode_fconstd; + } + /* fall through. */ + + case NS_QI: /* case 2/3. */ + if (vfp_or_neon_is_neon (NEON_CHECK_CC | NEON_CHECK_ARCH) == FAIL) + return; + inst.instruction = 0x0800010; + neon_move_immediate (); + inst.instruction = neon_dp_fixup (inst.instruction); + break; + + case NS_SR: /* case 4. */ + { + unsigned bcdebits = 0; + struct neon_type_el et = neon_check_type (2, NS_NULL, + N_8 | N_16 | N_32 | N_KEY, N_EQK); + int logsize = neon_logbits (et.size); + unsigned dn = NEON_SCALAR_REG (inst.operands[0].reg); + unsigned x = NEON_SCALAR_INDEX (inst.operands[0].reg); + + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v1), + _(BAD_FPU)); + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1) + && et.size != 32, _(BAD_FPU)); + constraint (et.type == NT_invtype, _("bad type for scalar")); + constraint (x >= 64 / et.size, _("scalar index out of range")); + + switch (et.size) + { + case 8: bcdebits = 0x8; break; + case 16: bcdebits = 0x1; break; + case 32: bcdebits = 0x0; break; + default: ; + } + + bcdebits |= x << logsize; + + inst.instruction = 0xe000b10; + do_vfp_cond_or_thumb (); + inst.instruction |= LOW4 (dn) << 16; + inst.instruction |= HI1 (dn) << 7; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= (bcdebits & 3) << 5; + inst.instruction |= (bcdebits >> 2) << 21; + } + break; + + case NS_DRR: /* case 5 (fmdrr). */ + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v2), + _(BAD_FPU)); + + inst.instruction = 0xc400b10; + do_vfp_cond_or_thumb (); + inst.instruction |= LOW4 (inst.operands[0].reg); + inst.instruction |= HI1 (inst.operands[0].reg) << 5; + inst.instruction |= inst.operands[1].reg << 12; + inst.instruction |= inst.operands[2].reg << 16; + break; + + case NS_RS: /* case 6. */ + { + struct neon_type_el et = neon_check_type (2, NS_NULL, + N_EQK, N_S8 | N_S16 | N_U8 | N_U16 | N_32 | N_KEY); + unsigned logsize = neon_logbits (et.size); + unsigned dn = NEON_SCALAR_REG (inst.operands[1].reg); + unsigned x = NEON_SCALAR_INDEX (inst.operands[1].reg); + unsigned abcdebits = 0; + + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v1), + _(BAD_FPU)); + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1) + && et.size != 32, _(BAD_FPU)); + constraint (et.type == NT_invtype, _("bad type for scalar")); + constraint (x >= 64 / et.size, _("scalar index out of range")); + + switch (et.size) + { + case 8: abcdebits = (et.type == NT_signed) ? 0x08 : 0x18; break; + case 16: abcdebits = (et.type == NT_signed) ? 0x01 : 0x11; break; + case 32: abcdebits = 0x00; break; + default: ; + } + + abcdebits |= x << logsize; + inst.instruction = 0xe100b10; + do_vfp_cond_or_thumb (); + inst.instruction |= LOW4 (dn) << 16; + inst.instruction |= HI1 (dn) << 7; + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= (abcdebits & 3) << 5; + inst.instruction |= (abcdebits >> 2) << 21; + } + break; + + case NS_RRD: /* case 7 (fmrrd). */ + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v2), + _(BAD_FPU)); + + inst.instruction = 0xc500b10; + do_vfp_cond_or_thumb (); + inst.instruction |= inst.operands[0].reg << 12; + inst.instruction |= inst.operands[1].reg << 16; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + break; + + case NS_FF: /* case 8 (fcpys). */ + do_vfp_nsyn_opcode ("fcpys"); + break; + + case NS_FI: /* case 10 (fconsts). */ + ldconst = "fconsts"; + encode_fconstd: + if (is_quarter_float (inst.operands[1].imm)) + { + inst.operands[1].imm = neon_qfloat_bits (inst.operands[1].imm); + do_vfp_nsyn_opcode (ldconst); + } + else + first_error (_("immediate out of range")); + break; + + case NS_RF: /* case 12 (fmrs). */ + do_vfp_nsyn_opcode ("fmrs"); + break; + + case NS_FR: /* case 13 (fmsr). */ + do_vfp_nsyn_opcode ("fmsr"); + break; + + /* The encoders for the fmrrs and fmsrr instructions expect three operands + (one of which is a list), but we have parsed four. Do some fiddling to + make the operands what do_vfp_reg2_from_sp2 and do_vfp_sp2_from_reg2 + expect. */ + case NS_RRFF: /* case 14 (fmrrs). */ + constraint (inst.operands[3].reg != inst.operands[2].reg + 1, + _("VFP registers must be adjacent")); + inst.operands[2].imm = 2; + memset (&inst.operands[3], '\0', sizeof (inst.operands[3])); + do_vfp_nsyn_opcode ("fmrrs"); + break; + + case NS_FFRR: /* case 15 (fmsrr). */ + constraint (inst.operands[1].reg != inst.operands[0].reg + 1, + _("VFP registers must be adjacent")); + inst.operands[1] = inst.operands[2]; + inst.operands[2] = inst.operands[3]; + inst.operands[0].imm = 2; + memset (&inst.operands[3], '\0', sizeof (inst.operands[3])); + do_vfp_nsyn_opcode ("fmsrr"); + break; + + default: + abort (); + } +} + +static void +do_neon_rshift_round_imm (void) +{ + enum neon_shape rs = neon_select_shape (NS_DDI, NS_QQI, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_SU_ALL | N_KEY); + int imm = inst.operands[2].imm; + + /* imm == 0 case is encoded as VMOV for V{R}SHR. */ + if (imm == 0) + { + inst.operands[2].present = 0; + do_neon_mov (); + return; + } + + constraint (imm < 1 || (unsigned)imm > et.size, + _("immediate out of range for shift")); + neon_imm_shift (TRUE, et.type == NT_unsigned, neon_quad (rs), et, + et.size - imm); +} + +static void +do_neon_movl (void) +{ + struct neon_type_el et = neon_check_type (2, NS_QD, + N_EQK | N_DBL, N_SU_32 | N_KEY); + unsigned sizebits = et.size >> 3; + inst.instruction |= sizebits << 19; + neon_two_same (0, et.type == NT_unsigned, -1); +} + +static void +do_neon_trn (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + inst.instruction = NEON_ENC_INTEGER (inst.instruction); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_zip_uzp (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_8 | N_16 | N_32 | N_KEY); + if (rs == NS_DD && et.size == 32) + { + /* Special case: encode as VTRN.32
, . */ + inst.instruction = N_MNEM_vtrn; + do_neon_trn (); + return; + } + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_sat_abs_neg (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_S8 | N_S16 | N_S32 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_pair_long (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, N_EQK, N_SU_32 | N_KEY); + /* Unsigned is encoded in OP field (bit 7) for these instruction. */ + inst.instruction |= (et.type == NT_unsigned) << 7; + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_recip_est (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_FLT, N_F32 | N_U32 | N_KEY); + inst.instruction |= (et.type == NT_float) << 8; + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_cls (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_S8 | N_S16 | N_S32 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_clz (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK, N_I8 | N_I16 | N_I32 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_cnt (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + struct neon_type_el et = neon_check_type (2, rs, + N_EQK | N_INT, N_8 | N_KEY); + neon_two_same (neon_quad (rs), 1, et.size); +} + +static void +do_neon_swp (void) +{ + enum neon_shape rs = neon_select_shape (NS_DD, NS_QQ, NS_NULL); + neon_two_same (neon_quad (rs), 1, -1); +} + +static void +do_neon_tbl_tbx (void) +{ + unsigned listlenbits; + neon_check_type (3, NS_DLD, N_EQK, N_EQK, N_8 | N_KEY); + + if (inst.operands[1].imm < 1 || inst.operands[1].imm > 4) + { + first_error (_("bad list length for table lookup")); + return; + } + + listlenbits = inst.operands[1].imm - 1; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= listlenbits << 8; + + inst.instruction = neon_dp_fixup (inst.instruction); +} + +static void +do_neon_ldm_stm (void) +{ + /* P, U and L bits are part of bitmask. */ + int is_dbmode = (inst.instruction & (1 << 24)) != 0; + unsigned offsetbits = inst.operands[1].imm * 2; + + if (inst.operands[1].issingle) + { + do_vfp_nsyn_ldm_stm (is_dbmode); + return; + } + + constraint (is_dbmode && !inst.operands[0].writeback, + _("writeback (!) must be used for VLDMDB and VSTMDB")); + + constraint (inst.operands[1].imm < 1 || inst.operands[1].imm > 16, + _("register list must contain at least 1 and at most 16 " + "registers")); + + inst.instruction |= inst.operands[0].reg << 16; + inst.instruction |= inst.operands[0].writeback << 21; + inst.instruction |= LOW4 (inst.operands[1].reg) << 12; + inst.instruction |= HI1 (inst.operands[1].reg) << 22; + + inst.instruction |= offsetbits; + + do_vfp_cond_or_thumb (); +} + +static void +do_neon_ldr_str (void) +{ + int is_ldr = (inst.instruction & (1 << 20)) != 0; + + if (inst.operands[0].issingle) + { + if (is_ldr) + do_vfp_nsyn_opcode ("flds"); + else + do_vfp_nsyn_opcode ("fsts"); + } + else + { + if (is_ldr) + do_vfp_nsyn_opcode ("fldd"); + else + do_vfp_nsyn_opcode ("fstd"); + } +} + +/* "interleave" version also handles non-interleaving register VLD1/VST1 + instructions. */ + +static void +do_neon_ld_st_interleave (void) +{ + struct neon_type_el et = neon_check_type (1, NS_NULL, + N_8 | N_16 | N_32 | N_64); + unsigned alignbits = 0; + unsigned idx; + /* The bits in this table go: + 0: register stride of one (0) or two (1) + 1,2: register list length, minus one (1, 2, 3, 4). + 3,4: in instruction type, minus one (VLD / VST). + We use -1 for invalid entries. */ + const int typetable[] = + { + 0x7, -1, 0xa, -1, 0x6, -1, 0x2, -1, /* VLD1 / VST1. */ + -1, -1, 0x8, 0x9, -1, -1, 0x3, -1, /* VLD2 / VST2. */ + -1, -1, -1, -1, 0x4, 0x5, -1, -1, /* VLD3 / VST3. */ + -1, -1, -1, -1, -1, -1, 0x0, 0x1 /* VLD4 / VST4. */ + }; + int typebits; + + if (et.type == NT_invtype) + return; + + if (inst.operands[1].immisalign) + switch (inst.operands[1].imm >> 8) + { + case 64: alignbits = 1; break; + case 128: + if (NEON_REGLIST_LENGTH (inst.operands[0].imm) == 3) + goto bad_alignment; + alignbits = 2; + break; + case 256: + if (NEON_REGLIST_LENGTH (inst.operands[0].imm) == 3) + goto bad_alignment; + alignbits = 3; + break; + default: + bad_alignment: + first_error (_("bad alignment")); + return; + } + + inst.instruction |= alignbits << 4; + inst.instruction |= neon_logbits (et.size) << 6; + + /* Bits [4:6] of the immediate in a list specifier encode register stride + (minus 1) in bit 4, and list length in bits [5:6]. We put the of + VLD/VST in bits [9:8] of the initial bitmask. Suck it out here, look + up the right value for "type" in a table based on this value and the given + list style, then stick it back. */ + idx = ((inst.operands[0].imm >> 4) & 7) + | (((inst.instruction >> 8) & 3) << 3); + + typebits = typetable[idx]; + + constraint (typebits == -1, _("bad list type for instruction")); + + inst.instruction &= ~0xf00; + inst.instruction |= typebits << 8; +} + +/* Check alignment is valid for do_neon_ld_st_lane and do_neon_ld_dup. + *DO_ALIGN is set to 1 if the relevant alignment bit should be set, 0 + otherwise. The variable arguments are a list of pairs of legal (size, align) + values, terminated with -1. */ + +static int +neon_alignment_bit (int size, int align, int *do_align, ...) +{ + va_list ap; + int result = FAIL, thissize, thisalign; + + if (!inst.operands[1].immisalign) + { + *do_align = 0; + return SUCCESS; + } + + va_start (ap, do_align); + + do + { + thissize = va_arg (ap, int); + if (thissize == -1) + break; + thisalign = va_arg (ap, int); + + if (size == thissize && align == thisalign) + result = SUCCESS; + } + while (result != SUCCESS); + + va_end (ap); + + if (result == SUCCESS) + *do_align = 1; + else + first_error (_("unsupported alignment for instruction")); + + return result; +} + +static void +do_neon_ld_st_lane (void) +{ + struct neon_type_el et = neon_check_type (1, NS_NULL, N_8 | N_16 | N_32); + int align_good, do_align = 0; + int logsize = neon_logbits (et.size); + int align = inst.operands[1].imm >> 8; + int n = (inst.instruction >> 8) & 3; + int max_el = 64 / et.size; + + if (et.type == NT_invtype) + return; + + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != n + 1, + _("bad list length")); + constraint (NEON_LANE (inst.operands[0].imm) >= max_el, + _("scalar index out of range")); + constraint (n != 0 && NEON_REG_STRIDE (inst.operands[0].imm) == 2 + && et.size == 8, + _("stride of 2 unavailable when element size is 8")); + + switch (n) + { + case 0: /* VLD1 / VST1. */ + align_good = neon_alignment_bit (et.size, align, &do_align, 16, 16, + 32, 32, -1); + if (align_good == FAIL) + return; + if (do_align) + { + unsigned alignbits = 0; + switch (et.size) + { + case 16: alignbits = 0x1; break; + case 32: alignbits = 0x3; break; + default: ; + } + inst.instruction |= alignbits << 4; + } + break; + + case 1: /* VLD2 / VST2. */ + align_good = neon_alignment_bit (et.size, align, &do_align, 8, 16, 16, 32, + 32, 64, -1); + if (align_good == FAIL) + return; + if (do_align) + inst.instruction |= 1 << 4; + break; + + case 2: /* VLD3 / VST3. */ + constraint (inst.operands[1].immisalign, + _("can't use alignment with this instruction")); + break; + + case 3: /* VLD4 / VST4. */ + align_good = neon_alignment_bit (et.size, align, &do_align, 8, 32, + 16, 64, 32, 64, 32, 128, -1); + if (align_good == FAIL) + return; + if (do_align) + { + unsigned alignbits = 0; + switch (et.size) + { + case 8: alignbits = 0x1; break; + case 16: alignbits = 0x1; break; + case 32: alignbits = (align == 64) ? 0x1 : 0x2; break; + default: ; + } + inst.instruction |= alignbits << 4; + } + break; + + default: ; + } + + /* Reg stride of 2 is encoded in bit 5 when size==16, bit 6 when size==32. */ + if (n != 0 && NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << (4 + logsize); + + inst.instruction |= NEON_LANE (inst.operands[0].imm) << (logsize + 5); + inst.instruction |= logsize << 10; +} + +/* Encode single n-element structure to all lanes VLD instructions. */ + +static void +do_neon_ld_dup (void) +{ + struct neon_type_el et = neon_check_type (1, NS_NULL, N_8 | N_16 | N_32); + int align_good, do_align = 0; + + if (et.type == NT_invtype) + return; + + switch ((inst.instruction >> 8) & 3) + { + case 0: /* VLD1. */ + assert (NEON_REG_STRIDE (inst.operands[0].imm) != 2); + align_good = neon_alignment_bit (et.size, inst.operands[1].imm >> 8, + &do_align, 16, 16, 32, 32, -1); + if (align_good == FAIL) + return; + switch (NEON_REGLIST_LENGTH (inst.operands[0].imm)) + { + case 1: break; + case 2: inst.instruction |= 1 << 5; break; + default: first_error (_("bad list length")); return; + } + inst.instruction |= neon_logbits (et.size) << 6; + break; + + case 1: /* VLD2. */ + align_good = neon_alignment_bit (et.size, inst.operands[1].imm >> 8, + &do_align, 8, 16, 16, 32, 32, 64, -1); + if (align_good == FAIL) + return; + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != 2, + _("bad list length")); + if (NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << 5; + inst.instruction |= neon_logbits (et.size) << 6; + break; + + case 2: /* VLD3. */ + constraint (inst.operands[1].immisalign, + _("can't use alignment with this instruction")); + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != 3, + _("bad list length")); + if (NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << 5; + inst.instruction |= neon_logbits (et.size) << 6; + break; + + case 3: /* VLD4. */ + { + int align = inst.operands[1].imm >> 8; + align_good = neon_alignment_bit (et.size, align, &do_align, 8, 32, + 16, 64, 32, 64, 32, 128, -1); + if (align_good == FAIL) + return; + constraint (NEON_REGLIST_LENGTH (inst.operands[0].imm) != 4, + _("bad list length")); + if (NEON_REG_STRIDE (inst.operands[0].imm) == 2) + inst.instruction |= 1 << 5; + if (et.size == 32 && align == 128) + inst.instruction |= 0x3 << 6; + else + inst.instruction |= neon_logbits (et.size) << 6; + } + break; + + default: ; + } + + inst.instruction |= do_align << 4; +} + +/* Disambiguate VLD and VST instructions, and fill in common bits (those + apart from bits [11:4]. */ + +static void +do_neon_ldx_stx (void) +{ + switch (NEON_LANE (inst.operands[0].imm)) + { + case NEON_INTERLEAVE_LANES: + inst.instruction = NEON_ENC_INTERLV (inst.instruction); + do_neon_ld_st_interleave (); + break; + + case NEON_ALL_LANES: + inst.instruction = NEON_ENC_DUP (inst.instruction); + do_neon_ld_dup (); + break; + + default: + inst.instruction = NEON_ENC_LANE (inst.instruction); + do_neon_ld_st_lane (); + } + + /* L bit comes from bit mask. */ + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= inst.operands[1].reg << 16; + + if (inst.operands[1].postind) + { + int postreg = inst.operands[1].imm & 0xf; + constraint (!inst.operands[1].immisreg, + _("post-index must be a register")); + constraint (postreg == 0xd || postreg == 0xf, + _("bad register for post-index")); + inst.instruction |= postreg; + } + else if (inst.operands[1].writeback) + { + inst.instruction |= 0xd; + } + else + inst.instruction |= 0xf; + + if (thumb_mode) + inst.instruction |= 0xf9000000; + else + inst.instruction |= 0xf4000000; +} + /* Overall per-instruction processing. */ @@ -8045,11 +13785,9 @@ output_relax_insn (void) symbolS *sym; int offset; -#ifdef OBJ_ELF /* The size of the instruction is unknown, so tie the debug info to the start of the instruction. */ dwarf2_emit_insn (0); -#endif switch (inst.reloc.exp.X_op) { @@ -8117,9 +13855,7 @@ output_inst (const char * str) inst.size, & inst.reloc.exp, inst.reloc.pc_rel, inst.reloc.type); -#ifdef OBJ_ELF dwarf2_emit_insn (inst.size); -#endif } /* Tag values used in struct asm_opcode's tag field. */ @@ -8130,9 +13866,14 @@ enum opcode_tag OT_unconditionalF, /* Instruction cannot be conditionalized and carries 0xF in its ARM condition field. */ OT_csuffix, /* Instruction takes a conditional suffix. */ + OT_csuffixF, /* Some forms of the instruction take a conditional + suffix, others place 0xF where the condition field + would be. */ OT_cinfix3, /* Instruction takes a conditional infix, beginning at character index 3. (In unified mode, it becomes a suffix.) */ + OT_cinfix3_deprecated, /* The same as OT_cinfix3. This is used for + tsts, cmps, cmns, and teqs. */ OT_cinfix3_legacy, /* Legacy instruction takes a conditional infix at character index 3, even in unified mode. Used for legacy instructions where suffix and infix forms @@ -8211,27 +13952,46 @@ opcode_lookup (char **str) const struct asm_opcode *opcode; const struct asm_cond *cond; char save[2]; + bfd_boolean neon_supported; + + neon_supported = ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1); /* Scan up to the end of the mnemonic, which must end in white space, - '.' (in unified mode only), or end of string. */ + '.' (in unified mode, or for Neon instructions), or end of string. */ for (base = end = *str; *end != '\0'; end++) - if (*end == ' ' || (unified_syntax && *end == '.')) + if (*end == ' ' || ((unified_syntax || neon_supported) && *end == '.')) break; if (end == base) return 0; - /* Handle a possible width suffix. */ + /* Handle a possible width suffix and/or Neon type suffix. */ if (end[0] == '.') { - if (end[1] == 'w' && (end[2] == ' ' || end[2] == '\0')) + int offset = 2; + + /* The .w and .n suffixes are only valid if the unified syntax is in + use. */ + if (unified_syntax && end[1] == 'w') inst.size_req = 4; - else if (end[1] == 'n' && (end[2] == ' ' || end[2] == '\0')) + else if (unified_syntax && end[1] == 'n') inst.size_req = 2; else - return 0; + offset = 0; - *str = end + 2; + inst.vectype.elems = 0; + + *str = end + offset; + + if (end[offset] == '.') + { + /* See if we have a Neon type suffix (possible in either unified or + non-unified ARM syntax mode). */ + if (parse_neon_type (&inst.vectype, str) == FAIL) + return 0; + } + else if (end[offset] != '\0' && end[offset] != ' ') + return 0; } else *str = end; @@ -8276,12 +14036,14 @@ opcode_lookup (char **str) break; case OT_cinfix3: + case OT_cinfix3_deprecated: case OT_odd_infix_unc: if (!unified_syntax) return 0; /* else fall through */ case OT_csuffix: + case OT_csuffixF: case OT_csuf_or_in3: inst.cond = cond->value; return opcode; @@ -8322,11 +14084,16 @@ opcode_lookup (char **str) memmove (affix + 2, affix, (end - affix) - 2); memcpy (affix, save, 2); - if (opcode && (opcode->tag == OT_cinfix3 || opcode->tag == OT_csuf_or_in3 - || opcode->tag == OT_cinfix3_legacy)) + if (opcode + && (opcode->tag == OT_cinfix3 + || opcode->tag == OT_cinfix3_deprecated + || opcode->tag == OT_csuf_or_in3 + || opcode->tag == OT_cinfix3_legacy)) { /* step CM */ - if (unified_syntax && opcode->tag == OT_cinfix3) + if (unified_syntax + && (opcode->tag == OT_cinfix3 + || opcode->tag == OT_cinfix3_deprecated)) as_warn (_("conditional infixes are deprecated in unified syntax")); inst.cond = cond->value; @@ -8357,13 +14124,21 @@ md_assemble (char *str) if (!opcode) { /* It wasn't an instruction, but it might be a register alias of - the form alias .req reg. */ - if (!create_register_alias (str, p)) + the form alias .req reg, or a Neon .dn/.qn directive. */ + if (!create_register_alias (str, p) + && !create_neon_reg_alias (str, p)) as_bad (_("bad instruction `%s'"), str); return; } + if (opcode->tag == OT_cinfix3_deprecated) + as_warn (_("s suffix on comparison instruction is deprecated")); + + /* The value which unconditional instructions should have in place of the + condition field. */ + inst.uncond_value = (opcode->tag == OT_csuffixF) ? 0xf : -1; + if (thumb_mode) { arm_feature_set variant; @@ -8387,6 +14162,14 @@ md_assemble (char *str) return; } + if (!ARM_CPU_HAS_FEATURE (variant, arm_ext_v6t2) && !inst.size_req) + { + /* Implicit require narrow instructions on Thumb-1. This avoids + relaxation accidentally introducing Thumb-2 instructions. */ + if (opcode->tencode != do_t_blx && opcode->tencode != do_t_branch23) + inst.size_req = 2; + } + /* Check conditional suffixes. */ if (current_it_mask) { @@ -8428,10 +14211,15 @@ md_assemble (char *str) return; } } + + /* Something has gone badly wrong if we try to relax a fixed size + instruction. */ + assert (inst.size_req == 0 || !inst.relax); + ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, *opcode->tvariant); /* Many Thumb-2 instructions also have Thumb-1 variants, so explicitly - set those bits when Thumb-2 32-bit instuctions are seen. ie. + set those bits when Thumb-2 32-bit instructions are seen. ie. anything other than bl/blx. This is overly pessimistic for relaxable instructions. */ if ((inst.size == 4 && (inst.instruction & 0xf800e800) != 0xf000e800) @@ -8439,7 +14227,7 @@ md_assemble (char *str) ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used, arm_ext_v6t2); } - else + else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1)) { /* Check that this instruction is supported for this CPU. */ if (!opcode->avariant || @@ -8472,6 +14260,12 @@ md_assemble (char *str) ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, *opcode->avariant); } + else + { + as_bad (_("attempt to use an ARM instruction on a Thumb-only processor " + "-- `%s'"), str); + return; + } output_inst (str); } @@ -8537,9 +14331,7 @@ arm_frob_label (symbolS * sym) label_is_thumb_function_name = FALSE; } -#ifdef OBJ_ELF dwarf2_emit_label (sym); -#endif } int @@ -8573,13 +14365,24 @@ arm_canonicalize_symbol_name (char * name) should appear in both upper and lowercase variants. Some registers also have mixed-case names. */ -#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE } +#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE, 0 } #define REGNUM(p,n,t) REGDEF(p##n, n, t) +#define REGNUM2(p,n,t) REGDEF(p##n, 2 * n, t) #define REGSET(p,t) \ REGNUM(p, 0,t), REGNUM(p, 1,t), REGNUM(p, 2,t), REGNUM(p, 3,t), \ REGNUM(p, 4,t), REGNUM(p, 5,t), REGNUM(p, 6,t), REGNUM(p, 7,t), \ REGNUM(p, 8,t), REGNUM(p, 9,t), REGNUM(p,10,t), REGNUM(p,11,t), \ REGNUM(p,12,t), REGNUM(p,13,t), REGNUM(p,14,t), REGNUM(p,15,t) +#define REGSETH(p,t) \ + REGNUM(p,16,t), REGNUM(p,17,t), REGNUM(p,18,t), REGNUM(p,19,t), \ + REGNUM(p,20,t), REGNUM(p,21,t), REGNUM(p,22,t), REGNUM(p,23,t), \ + REGNUM(p,24,t), REGNUM(p,25,t), REGNUM(p,26,t), REGNUM(p,27,t), \ + REGNUM(p,28,t), REGNUM(p,29,t), REGNUM(p,30,t), REGNUM(p,31,t) +#define REGSET2(p,t) \ + REGNUM2(p, 0,t), REGNUM2(p, 1,t), REGNUM2(p, 2,t), REGNUM2(p, 3,t), \ + REGNUM2(p, 4,t), REGNUM2(p, 5,t), REGNUM2(p, 6,t), REGNUM2(p, 7,t), \ + REGNUM2(p, 8,t), REGNUM2(p, 9,t), REGNUM2(p,10,t), REGNUM2(p,11,t), \ + REGNUM2(p,12,t), REGNUM2(p,13,t), REGNUM2(p,14,t), REGNUM2(p,15,t) static const struct reg_entry reg_names[] = { @@ -8618,24 +14421,24 @@ static const struct reg_entry reg_names[] = REGNUM(F,4,FN), REGNUM(F,5,FN), REGNUM(F,6,FN), REGNUM(F,7, FN), /* VFP SP registers. */ - REGSET(s,VFS), - REGNUM(s,16,VFS), REGNUM(s,17,VFS), REGNUM(s,18,VFS), REGNUM(s,19,VFS), - REGNUM(s,20,VFS), REGNUM(s,21,VFS), REGNUM(s,22,VFS), REGNUM(s,23,VFS), - REGNUM(s,24,VFS), REGNUM(s,25,VFS), REGNUM(s,26,VFS), REGNUM(s,27,VFS), - REGNUM(s,28,VFS), REGNUM(s,29,VFS), REGNUM(s,30,VFS), REGNUM(s,31,VFS), - - REGSET(S,VFS), - REGNUM(S,16,VFS), REGNUM(S,17,VFS), REGNUM(S,18,VFS), REGNUM(S,19,VFS), - REGNUM(S,20,VFS), REGNUM(S,21,VFS), REGNUM(S,22,VFS), REGNUM(S,23,VFS), - REGNUM(S,24,VFS), REGNUM(S,25,VFS), REGNUM(S,26,VFS), REGNUM(S,27,VFS), - REGNUM(S,28,VFS), REGNUM(S,29,VFS), REGNUM(S,30,VFS), REGNUM(S,31,VFS), + REGSET(s,VFS), REGSET(S,VFS), + REGSETH(s,VFS), REGSETH(S,VFS), /* VFP DP Registers. */ - REGSET(d,VFD), REGSET(D,VFS), + REGSET(d,VFD), REGSET(D,VFD), + /* Extra Neon DP registers. */ + REGSETH(d,VFD), REGSETH(D,VFD), + + /* Neon QP registers. */ + REGSET2(q,NQ), REGSET2(Q,NQ), /* VFP control registers. */ REGDEF(fpsid,0,VFC), REGDEF(fpscr,1,VFC), REGDEF(fpexc,8,VFC), REGDEF(FPSID,0,VFC), REGDEF(FPSCR,1,VFC), REGDEF(FPEXC,8,VFC), + REGDEF(fpinst,9,VFC), REGDEF(fpinst2,10,VFC), + REGDEF(FPINST,9,VFC), REGDEF(FPINST2,10,VFC), + REGDEF(mvfr0,7,VFC), REGDEF(mvfr1,6,VFC), + REGDEF(MVFR0,7,VFC), REGDEF(MVFR1,6,VFC), /* Maverick DSP coprocessor registers. */ REGSET(mvf,MVF), REGSET(mvd,MVD), REGSET(mvfx,MVFX), REGSET(mvdx,MVDX), @@ -8752,20 +14555,21 @@ static const struct asm_psr psrs[] = /* Table of V7M psr names. */ static const struct asm_psr v7m_psrs[] = { - {"apsr", 0 }, - {"iapsr", 1 }, - {"eapsr", 2 }, - {"psr", 3 }, - {"ipsr", 5 }, - {"epsr", 6 }, - {"iepsr", 7 }, - {"msp", 8 }, - {"psp", 9 }, - {"primask", 16}, - {"basepri", 17}, - {"basepri_max", 18}, - {"faultmask", 19}, - {"control", 20} + {"apsr", 0 }, {"APSR", 0 }, + {"iapsr", 1 }, {"IAPSR", 1 }, + {"eapsr", 2 }, {"EAPSR", 2 }, + {"psr", 3 }, {"PSR", 3 }, + {"xpsr", 3 }, {"XPSR", 3 }, {"xPSR", 3 }, + {"ipsr", 5 }, {"IPSR", 5 }, + {"epsr", 6 }, {"EPSR", 6 }, + {"iepsr", 7 }, {"IEPSR", 7 }, + {"msp", 8 }, {"MSP", 8 }, + {"psp", 9 }, {"PSP", 9 }, + {"primask", 16}, {"PRIMASK", 16}, + {"basepri", 17}, {"BASEPRI", 17}, + {"basepri_max", 18}, {"BASEPRI_MAX", 18}, + {"faultmask", 19}, {"FAULTMASK", 19}, + {"control", 20}, {"CONTROL", 20} }; /* Table of all shift-in-operand names. */ @@ -8858,10 +14662,17 @@ static struct asm_barrier_opt barrier_opt_names[] = #define TxC3(mnem, op, top, nops, ops, ae, te) \ { #mnem, OPS##nops ops, OT_cinfix3, 0x##op, top, ARM_VARIANT, \ THUMB_VARIANT, do_##ae, do_##te } +#define TxC3w(mnem, op, top, nops, ops, ae, te) \ + { #mnem, OPS##nops ops, OT_cinfix3_deprecated, 0x##op, top, ARM_VARIANT, \ + THUMB_VARIANT, do_##ae, do_##te } #define TC3(mnem, aop, top, nops, ops, ae, te) \ TxC3(mnem, aop, 0x##top, nops, ops, ae, te) +#define TC3w(mnem, aop, top, nops, ops, ae, te) \ + TxC3w(mnem, aop, 0x##top, nops, ops, ae, te) #define tC3(mnem, aop, top, nops, ops, ae, te) \ TxC3(mnem, aop, T_MNEM_##top, nops, ops, ae, te) +#define tC3w(mnem, aop, top, nops, ops, ae, te) \ + TxC3w(mnem, aop, T_MNEM_##top, nops, ops, ae, te) /* Mnemonic with a conditional infix in an unusual place. Each and every variant has to appear in the condition table. */ @@ -8970,6 +14781,42 @@ static struct asm_barrier_opt barrier_opt_names[] = #define UF(mnem, op, nops, ops, ae) \ { #mnem, OPS##nops ops, OT_unconditionalF, 0x##op, 0, ARM_VARIANT, 0, do_##ae, NULL } +/* Neon data-processing. ARM versions are unconditional with cond=0xf. + The Thumb and ARM variants are mostly the same (bits 0-23 and 24/28), so we + use the same encoding function for each. */ +#define NUF(mnem, op, nops, ops, enc) \ + { #mnem, OPS##nops ops, OT_unconditionalF, 0x##op, 0x##op, \ + ARM_VARIANT, THUMB_VARIANT, do_##enc, do_##enc } + +/* Neon data processing, version which indirects through neon_enc_tab for + the various overloaded versions of opcodes. */ +#define nUF(mnem, op, nops, ops, enc) \ + { #mnem, OPS##nops ops, OT_unconditionalF, N_MNEM_##op, N_MNEM_##op, \ + ARM_VARIANT, THUMB_VARIANT, do_##enc, do_##enc } + +/* Neon insn with conditional suffix for the ARM version, non-overloaded + version. */ +#define NCE_tag(mnem, op, nops, ops, enc, tag) \ + { #mnem, OPS##nops ops, tag, 0x##op, 0x##op, ARM_VARIANT, \ + THUMB_VARIANT, do_##enc, do_##enc } + +#define NCE(mnem, op, nops, ops, enc) \ + NCE_tag(mnem, op, nops, ops, enc, OT_csuffix) + +#define NCEF(mnem, op, nops, ops, enc) \ + NCE_tag(mnem, op, nops, ops, enc, OT_csuffixF) + +/* Neon insn with conditional suffix for the ARM version, overloaded types. */ +#define nCE_tag(mnem, op, nops, ops, enc, tag) \ + { #mnem, OPS##nops ops, tag, N_MNEM_##op, N_MNEM_##op, \ + ARM_VARIANT, THUMB_VARIANT, do_##enc, do_##enc } + +#define nCE(mnem, op, nops, ops, enc) \ + nCE_tag(mnem, op, nops, ops, enc, OT_csuffix) + +#define nCEF(mnem, op, nops, ops, enc) \ + nCE_tag(mnem, op, nops, ops, enc, OT_csuffixF) + #define do_0 0 /* Thumb-only, unconditional. */ @@ -8985,8 +14832,8 @@ static const struct asm_opcode insns[] = tC3(eors, 0300000, eors, 3, (RR, oRR, SH), arit, t_arit3c), tCE(sub, 0400000, sub, 3, (RR, oRR, SH), arit, t_add_sub), tC3(subs, 0500000, subs, 3, (RR, oRR, SH), arit, t_add_sub), - tCE(add, 0800000, add, 3, (RR, oRR, SH), arit, t_add_sub), - tC3(adds, 0900000, adds, 3, (RR, oRR, SH), arit, t_add_sub), + tCE(add, 0800000, add, 3, (RR, oRR, SHG), arit, t_add_sub), + tC3(adds, 0900000, adds, 3, (RR, oRR, SHG), arit, t_add_sub), tCE(adc, 0a00000, adc, 3, (RR, oRR, SH), arit, t_arit3c), tC3(adcs, 0b00000, adcs, 3, (RR, oRR, SH), arit, t_arit3c), tCE(sbc, 0c00000, sbc, 3, (RR, oRR, SH), arit, t_arit3), @@ -9000,13 +14847,13 @@ static const struct asm_opcode insns[] = for setting PSR flag bits. They are obsolete in V6 and do not have Thumb equivalents. */ tCE(tst, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), - tC3(tsts, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), + tC3w(tsts, 1100000, tst, 2, (RR, SH), cmp, t_mvn_tst), CL(tstp, 110f000, 2, (RR, SH), cmp), tCE(cmp, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), - tC3(cmps, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), + tC3w(cmps, 1500000, cmp, 2, (RR, SH), cmp, t_mov_cmp), CL(cmpp, 150f000, 2, (RR, SH), cmp), tCE(cmn, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), - tC3(cmns, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), + tC3w(cmns, 1700000, cmn, 2, (RR, SH), cmp, t_mvn_tst), CL(cmnp, 170f000, 2, (RR, SH), cmp), tCE(mov, 1a00000, mov, 2, (RR, SH), mov, t_mov_cmp), @@ -9014,10 +14861,10 @@ static const struct asm_opcode insns[] = tCE(mvn, 1e00000, mvn, 2, (RR, SH), mov, t_mvn_tst), tC3(mvns, 1f00000, mvns, 2, (RR, SH), mov, t_mvn_tst), - tCE(ldr, 4100000, ldr, 2, (RR, ADDR), ldst, t_ldst), - tC3(ldrb, 4500000, ldrb, 2, (RR, ADDR), ldst, t_ldst), - tCE(str, 4000000, str, 2, (RR, ADDR), ldst, t_ldst), - tC3(strb, 4400000, strb, 2, (RR, ADDR), ldst, t_ldst), + tCE(ldr, 4100000, ldr, 2, (RR, ADDRGLDR),ldst, t_ldst), + tC3(ldrb, 4500000, ldrb, 2, (RR, ADDRGLDR),ldst, t_ldst), + tCE(str, 4000000, str, 2, (RR, ADDRGLDR),ldst, t_ldst), + tC3(strb, 4400000, strb, 2, (RR, ADDRGLDR),ldst, t_ldst), tCE(stm, 8800000, stmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), tC3(stmia, 8800000, stmia, 2, (RRw, REGLST), ldmstm, t_ldmstm), @@ -9050,6 +14897,10 @@ static const struct asm_opcode insns[] = tCE(push, 92d0000, push, 1, (REGLST), push_pop, t_push_pop), tCE(pop, 8bd0000, pop, 1, (REGLST), push_pop, t_push_pop), + /* These may simplify to neg. */ + TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), + TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), + #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6 TCE(cpy, 1a00000, 4600, 2, (RR, RR), rd_rm, t_cpy), @@ -9057,10 +14908,8 @@ static const struct asm_opcode insns[] = /* V1 instructions with no Thumb analogue prior to V6T2. */ #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6t2 - TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), - TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), TCE(teq, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), - TC3(teqs, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), + TC3w(teqs, 1300000, ea900f00, 2, (RR, SH), cmp, t_mvn_tst), CL(teqp, 130f000, 2, (RR, SH), cmp), TC3(ldrt, 4300000, f8500e00, 2, (RR, ADDR), ldstt, t_ldstt), @@ -9101,10 +14950,10 @@ static const struct asm_opcode insns[] = /* Generic coprocessor instructions. */ TCE(cdp, e000000, ee000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), - TCE(ldc, c100000, ec100000, 3, (RCP, RCN, ADDR), lstc, lstc), - TC3(ldcl, c500000, ec500000, 3, (RCP, RCN, ADDR), lstc, lstc), - TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDR), lstc, lstc), - TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDR), lstc, lstc), + TCE(ldc, c100000, ec100000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TC3(ldcl, c500000, ec500000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), @@ -9115,8 +14964,8 @@ static const struct asm_opcode insns[] = #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v3 /* ARM 6 Status register instructions. */ - TCE(mrs, 10f0000, f3ef8000, 2, (RR, PSR), mrs, t_mrs), - TCE(msr, 120f000, f3808000, 2, (PSR, RR_EXi), msr, t_msr), + TCE(mrs, 10f0000, f3ef8000, 2, (APSR_RR, RVC_PSR), mrs, t_mrs), + TCE(msr, 120f000, f3808000, 2, (RVC_PSR, RR_EXi), msr, t_msr), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v3m /* ARM 7M long multiplies. */ @@ -9133,12 +14982,12 @@ static const struct asm_opcode insns[] = #define ARM_VARIANT &arm_ext_v4 /* ARM Architecture 4. */ #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v4t - tC3(ldrh, 01000b0, ldrh, 2, (RR, ADDR), ldstv4, t_ldst), - tC3(strh, 00000b0, strh, 2, (RR, ADDR), ldstv4, t_ldst), - tC3(ldrsh, 01000f0, ldrsh, 2, (RR, ADDR), ldstv4, t_ldst), - tC3(ldrsb, 01000d0, ldrsb, 2, (RR, ADDR), ldstv4, t_ldst), - tCM(ld,sh, 01000f0, ldrsh, 2, (RR, ADDR), ldstv4, t_ldst), - tCM(ld,sb, 01000d0, ldrsb, 2, (RR, ADDR), ldstv4, t_ldst), + tC3(ldrh, 01000b0, ldrh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tC3(strh, 00000b0, strh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tC3(ldrsh, 01000f0, ldrsh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tC3(ldrsb, 01000d0, ldrsb, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tCM(ld,sh, 01000f0, ldrsh, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), + tCM(ld,sb, 01000d0, ldrsb, 2, (RR, ADDRGLDRS), ldstv4, t_ldst), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v4t_5 @@ -9159,10 +15008,10 @@ static const struct asm_opcode insns[] = #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6t2 TCE(clz, 16f0f10, fab0f080, 2, (RRnpc, RRnpc), rd_rm, t_clz), - TUF(ldc2, c100000, fc100000, 3, (RCP, RCN, ADDR), lstc, lstc), - TUF(ldc2l, c500000, fc500000, 3, (RCP, RCN, ADDR), lstc, lstc), - TUF(stc2, c000000, fc000000, 3, (RCP, RCN, ADDR), lstc, lstc), - TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDR), lstc, lstc), + TUF(ldc2, c100000, fc100000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TUF(ldc2l, c500000, fc500000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TUF(stc2, c000000, fc000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), + TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), @@ -9198,8 +15047,8 @@ static const struct asm_opcode insns[] = #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v5e /* ARM Architecture 5TE. */ TUF(pld, 450f000, f810f000, 1, (ADDR), pld, t_pld), - TC3(ldrd, 00000d0, e9500000, 3, (RRnpc, oRRnpc, ADDR), ldrd, t_ldstd), - TC3(strd, 00000f0, e9400000, 3, (RRnpc, oRRnpc, ADDR), ldrd, t_ldstd), + TC3(ldrd, 00000d0, e8500000, 3, (RRnpc, oRRnpc, ADDRGLDRS), ldrd, t_ldstd), + TC3(strd, 00000f0, e8400000, 3, (RRnpc, oRRnpc, ADDRGLDRS), ldrd, t_ldstd), TCE(mcrr, c400000, ec400000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), TCE(mrrc, c500000, ec500000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), @@ -9226,6 +15075,7 @@ static const struct asm_opcode insns[] = #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6t2 TCE(ldrex, 1900f9f, e8500f00, 2, (RRnpc, ADDR), ldrex, t_ldrex), + TCE(strex, 1800f90, e8400000, 3, (RRnpc, RRnpc, ADDR), strex, t_strex), TUF(mcrr2, c400000, fc400000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), TUF(mrrc2, c500000, fc500000, 5, (RCP, I15b, RRnpc, RRnpc, RCN), co_reg2c, co_reg2c), @@ -9309,12 +15159,11 @@ static const struct asm_opcode insns[] = TCE(smuadx, 700f030, fb20f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), TCE(smusd, 700f050, fb40f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), TCE(smusdx, 700f070, fb40f010, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), - TUF(srsia, 8cd0500, e980c000, 1, (I31w), srs, srs), - UF(srsib, 9cd0500, 1, (I31w), srs), - UF(srsda, 84d0500, 1, (I31w), srs), - TUF(srsdb, 94d0500, e800c000, 1, (I31w), srs, srs), + TUF(srsia, 8c00500, e980c000, 2, (oRRw, I31w), srs, srs), + UF(srsib, 9c00500, 2, (oRRw, I31w), srs), + UF(srsda, 8400500, 2, (oRRw, I31w), srs), + TUF(srsdb, 9400500, e800c000, 2, (oRRw, I31w), srs, srs), TCE(ssat16, 6a00f30, f3200000, 3, (RRnpc, I16, RRnpc), ssat16, t_ssat16), - TCE(strex, 1800f90, e8400000, 3, (RRnpc, RRnpc, ADDR), strex, t_strex), TCE(umaal, 0400090, fbe00060, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smlal, t_mlal), TCE(usad8, 780f010, fb70f000, 3, (RRnpc, RRnpc, RRnpc), smul, t_simd), TCE(usada8, 7800010, fb700000, 4, (RRnpc, RRnpc, RRnpc, RRnpc),smla, t_mla), @@ -9354,18 +15203,20 @@ static const struct asm_opcode insns[] = TCE(ubfx, 7e00050, f3c00000, 4, (RR, RR, I31, I32), bfx, t_bfx), TCE(mls, 0600090, fb000010, 4, (RRnpc, RRnpc, RRnpc, RRnpc), mlas, t_mla), - TCE(movw, 3000000, f2400000, 2, (RRnpc, Iffff), mov16, t_mov16), - TCE(movt, 3400000, f2c00000, 2, (RRnpc, Iffff), mov16, t_mov16), - TCE(rbit, 3ff0f30, fa90f0a0, 2, (RR, RR), rd_rm, t_rbit), + TCE(movw, 3000000, f2400000, 2, (RRnpc, HALF), mov16, t_mov16), + TCE(movt, 3400000, f2c00000, 2, (RRnpc, HALF), mov16, t_mov16), + TCE(rbit, 6ff0f30, fa90f0a0, 2, (RR, RR), rd_rm, t_rbit), TC3(ldrht, 03000b0, f8300e00, 2, (RR, ADDR), ldsttv4, t_ldstt), TC3(ldrsht, 03000f0, f9300e00, 2, (RR, ADDR), ldsttv4, t_ldstt), TC3(ldrsbt, 03000d0, f9100e00, 2, (RR, ADDR), ldsttv4, t_ldstt), TC3(strht, 02000b0, f8200e00, 2, (RR, ADDR), ldsttv4, t_ldstt), - UT(cbnz, b900, 2, (RR, EXP), t_czb), - UT(cbz, b100, 2, (RR, EXP), t_czb), - /* ARM does not really have an IT instruction. */ + UT(cbnz, b900, 2, (RR, EXP), t_cbz), + UT(cbz, b100, 2, (RR, EXP), t_cbz), + /* ARM does not really have an IT instruction, so always allow it. */ +#undef ARM_VARIANT +#define ARM_VARIANT &arm_ext_v1 TUE(it, 0, bf08, 1, (COND), it, t_it), TUE(itt, 0, bf0c, 1, (COND), it, t_it), TUE(ite, 0, bf04, 1, (COND), it, t_it), @@ -9415,15 +15266,15 @@ static const struct asm_opcode insns[] = cCE(wfc, e400110, 1, (RR), rd), cCE(rfc, e500110, 1, (RR), rd), - cCL(ldfs, c100100, 2, (RF, ADDR), rd_cpaddr), - cCL(ldfd, c108100, 2, (RF, ADDR), rd_cpaddr), - cCL(ldfe, c500100, 2, (RF, ADDR), rd_cpaddr), - cCL(ldfp, c508100, 2, (RF, ADDR), rd_cpaddr), + cCL(ldfs, c100100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(ldfd, c108100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(ldfe, c500100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(ldfp, c508100, 2, (RF, ADDRGLDC), rd_cpaddr), - cCL(stfs, c000100, 2, (RF, ADDR), rd_cpaddr), - cCL(stfd, c008100, 2, (RF, ADDR), rd_cpaddr), - cCL(stfe, c400100, 2, (RF, ADDR), rd_cpaddr), - cCL(stfp, c408100, 2, (RF, ADDR), rd_cpaddr), + cCL(stfs, c000100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(stfd, c008100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(stfe, c400100, 2, (RF, ADDRGLDC), rd_cpaddr), + cCL(stfp, c408100, 2, (RF, ADDRGLDC), rd_cpaddr), cCL(mvfs, e008100, 2, (RF, RF_IF), rd_rm), cCL(mvfsp, e008120, 2, (RF, RF_IF), rd_rm), @@ -9866,8 +15717,8 @@ static const struct asm_opcode insns[] = cCE(fmxr, ee00a10, 2, (RVC, RR), rn_rd), /* Memory operations. */ - cCE(flds, d100a00, 2, (RVS, ADDR), vfp_sp_ldst), - cCE(fsts, d000a00, 2, (RVS, ADDR), vfp_sp_ldst), + cCE(flds, d100a00, 2, (RVS, ADDRGLDC), vfp_sp_ldst), + cCE(fsts, d000a00, 2, (RVS, ADDRGLDC), vfp_sp_ldst), cCE(fldmias, c900a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), cCE(fldmfds, c900a00, 2, (RRw, VRSLST), vfp_sp_ldstmia), cCE(fldmdbs, d300a00, 2, (RRw, VRSLST), vfp_sp_ldstmdb), @@ -9910,13 +15761,13 @@ static const struct asm_opcode insns[] = #undef ARM_VARIANT #define ARM_VARIANT &fpu_vfp_ext_v1 /* VFP V1 (Double precision). */ /* Moves and type conversions. */ - cCE(fcpyd, eb00b40, 2, (RVD, RVD), rd_rm), + cCE(fcpyd, eb00b40, 2, (RVD, RVD), vfp_dp_rd_rm), cCE(fcvtds, eb70ac0, 2, (RVD, RVS), vfp_dp_sp_cvt), cCE(fcvtsd, eb70bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), - cCE(fmdhr, e200b10, 2, (RVD, RR), rn_rd), - cCE(fmdlr, e000b10, 2, (RVD, RR), rn_rd), - cCE(fmrdh, e300b10, 2, (RR, RVD), rd_rn), - cCE(fmrdl, e100b10, 2, (RR, RVD), rd_rn), + cCE(fmdhr, e200b10, 2, (RVD, RR), vfp_dp_rn_rd), + cCE(fmdlr, e000b10, 2, (RVD, RR), vfp_dp_rn_rd), + cCE(fmrdh, e300b10, 2, (RR, RVD), vfp_dp_rd_rn), + cCE(fmrdl, e100b10, 2, (RR, RVD), vfp_dp_rd_rn), cCE(fsitod, eb80bc0, 2, (RVD, RVS), vfp_dp_sp_cvt), cCE(fuitod, eb80b40, 2, (RVD, RVS), vfp_dp_sp_cvt), cCE(ftosid, ebd0b40, 2, (RVS, RVD), vfp_sp_dp_cvt), @@ -9925,8 +15776,8 @@ static const struct asm_opcode insns[] = cCE(ftouizd, ebc0bc0, 2, (RVS, RVD), vfp_sp_dp_cvt), /* Memory operations. */ - cCE(fldd, d100b00, 2, (RVD, ADDR), vfp_dp_ldst), - cCE(fstd, d000b00, 2, (RVD, ADDR), vfp_dp_ldst), + cCE(fldd, d100b00, 2, (RVD, ADDRGLDC), vfp_dp_ldst), + cCE(fstd, d000b00, 2, (RVD, ADDRGLDC), vfp_dp_ldst), cCE(fldmiad, c900b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), cCE(fldmfdd, c900b00, 2, (RRw, VRDLST), vfp_dp_ldstmia), cCE(fldmdbd, d300b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), @@ -9937,34 +15788,347 @@ static const struct asm_opcode insns[] = cCE(fstmfdd, d200b00, 2, (RRw, VRDLST), vfp_dp_ldstmdb), /* Monadic operations. */ - cCE(fabsd, eb00bc0, 2, (RVD, RVD), rd_rm), - cCE(fnegd, eb10b40, 2, (RVD, RVD), rd_rm), - cCE(fsqrtd, eb10bc0, 2, (RVD, RVD), rd_rm), + cCE(fabsd, eb00bc0, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fnegd, eb10b40, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fsqrtd, eb10bc0, 2, (RVD, RVD), vfp_dp_rd_rm), /* Dyadic operations. */ - cCE(faddd, e300b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fsubd, e300b40, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fmuld, e200b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fdivd, e800b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fmacd, e000b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fmscd, e100b00, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fnmuld, e200b40, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fnmacd, e000b40, 3, (RVD, RVD, RVD), rd_rn_rm), - cCE(fnmscd, e100b40, 3, (RVD, RVD, RVD), rd_rn_rm), + cCE(faddd, e300b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fsubd, e300b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fmuld, e200b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fdivd, e800b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fmacd, e000b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fmscd, e100b00, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fnmuld, e200b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fnmacd, e000b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), + cCE(fnmscd, e100b40, 3, (RVD, RVD, RVD), vfp_dp_rd_rn_rm), /* Comparisons. */ - cCE(fcmpd, eb40b40, 2, (RVD, RVD), rd_rm), - cCE(fcmpzd, eb50b40, 1, (RVD), rd), - cCE(fcmped, eb40bc0, 2, (RVD, RVD), rd_rm), - cCE(fcmpezd, eb50bc0, 1, (RVD), rd), + cCE(fcmpd, eb40b40, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fcmpzd, eb50b40, 1, (RVD), vfp_dp_rd), + cCE(fcmped, eb40bc0, 2, (RVD, RVD), vfp_dp_rd_rm), + cCE(fcmpezd, eb50bc0, 1, (RVD), vfp_dp_rd), #undef ARM_VARIANT #define ARM_VARIANT &fpu_vfp_ext_v2 cCE(fmsrr, c400a10, 3, (VRSLST, RR, RR), vfp_sp2_from_reg2), cCE(fmrrs, c500a10, 3, (RR, RR, VRSLST), vfp_reg2_from_sp2), - cCE(fmdrr, c400b10, 3, (RVD, RR, RR), rm_rd_rn), - cCE(fmrrd, c500b10, 3, (RR, RR, RVD), rd_rn_rm), + cCE(fmdrr, c400b10, 3, (RVD, RR, RR), vfp_dp_rm_rd_rn), + cCE(fmrrd, c500b10, 3, (RR, RR, RVD), vfp_dp_rd_rn_rm), +/* Instructions which may belong to either the Neon or VFP instruction sets. + Individual encoder functions perform additional architecture checks. */ +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_vfp_ext_v1xd +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_vfp_ext_v1xd + /* These mnemonics are unique to VFP. */ + NCE(vsqrt, 0, 2, (RVSD, RVSD), vfp_nsyn_sqrt), + NCE(vdiv, 0, 3, (RVSD, RVSD, RVSD), vfp_nsyn_div), + nCE(vnmul, vnmul, 3, (RVSD, RVSD, RVSD), vfp_nsyn_nmul), + nCE(vnmla, vnmla, 3, (RVSD, RVSD, RVSD), vfp_nsyn_nmul), + nCE(vnmls, vnmls, 3, (RVSD, RVSD, RVSD), vfp_nsyn_nmul), + nCE(vcmp, vcmp, 2, (RVSD, RVSD_I0), vfp_nsyn_cmp), + nCE(vcmpe, vcmpe, 2, (RVSD, RVSD_I0), vfp_nsyn_cmp), + NCE(vpush, 0, 1, (VRSDLST), vfp_nsyn_push), + NCE(vpop, 0, 1, (VRSDLST), vfp_nsyn_pop), + NCE(vcvtz, 0, 2, (RVSD, RVSD), vfp_nsyn_cvtz), + + /* Mnemonics shared by Neon and VFP. */ + nCEF(vmul, vmul, 3, (RNSDQ, oRNSDQ, RNSDQ_RNSC), neon_mul), + nCEF(vmla, vmla, 3, (RNSDQ, oRNSDQ, RNSDQ_RNSC), neon_mac_maybe_scalar), + nCEF(vmls, vmls, 3, (RNSDQ, oRNSDQ, RNSDQ_RNSC), neon_mac_maybe_scalar), + + nCEF(vadd, vadd, 3, (RNSDQ, oRNSDQ, RNSDQ), neon_addsub_if_i), + nCEF(vsub, vsub, 3, (RNSDQ, oRNSDQ, RNSDQ), neon_addsub_if_i), + + NCEF(vabs, 1b10300, 2, (RNSDQ, RNSDQ), neon_abs_neg), + NCEF(vneg, 1b10380, 2, (RNSDQ, RNSDQ), neon_abs_neg), + + NCE(vldm, c900b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vldmia, c900b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vldmdb, d100b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vstm, c800b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vstmia, c800b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vstmdb, d000b00, 2, (RRw, VRSDLST), neon_ldm_stm), + NCE(vldr, d100b00, 2, (RVSD, ADDRGLDC), neon_ldr_str), + NCE(vstr, d000b00, 2, (RVSD, ADDRGLDC), neon_ldr_str), + + nCEF(vcvt, vcvt, 3, (RNSDQ, RNSDQ, oI32b), neon_cvt), + + /* NOTE: All VMOV encoding is special-cased! */ + NCE(vmov, 0, 1, (VMOV), neon_mov), + NCE(vmovq, 0, 1, (VMOV), neon_mov), + +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_neon_ext_v1 +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_neon_ext_v1 + /* Data processing with three registers of the same length. */ + /* integer ops, valid types S8 S16 S32 U8 U16 U32. */ + NUF(vaba, 0000710, 3, (RNDQ, RNDQ, RNDQ), neon_dyadic_i_su), + NUF(vabaq, 0000710, 3, (RNQ, RNQ, RNQ), neon_dyadic_i_su), + NUF(vhadd, 0000000, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i_su), + NUF(vhaddq, 0000000, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i_su), + NUF(vrhadd, 0000100, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i_su), + NUF(vrhaddq, 0000100, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i_su), + NUF(vhsub, 0000200, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i_su), + NUF(vhsubq, 0000200, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i_su), + /* integer ops, valid types S8 S16 S32 S64 U8 U16 U32 U64. */ + NUF(vqadd, 0000010, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i64_su), + NUF(vqaddq, 0000010, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i64_su), + NUF(vqsub, 0000210, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_i64_su), + NUF(vqsubq, 0000210, 3, (RNQ, oRNQ, RNQ), neon_dyadic_i64_su), + NUF(vrshl, 0000500, 3, (RNDQ, oRNDQ, RNDQ), neon_rshl), + NUF(vrshlq, 0000500, 3, (RNQ, oRNQ, RNQ), neon_rshl), + NUF(vqrshl, 0000510, 3, (RNDQ, oRNDQ, RNDQ), neon_rshl), + NUF(vqrshlq, 0000510, 3, (RNQ, oRNQ, RNQ), neon_rshl), + /* If not immediate, fall back to neon_dyadic_i64_su. + shl_imm should accept I8 I16 I32 I64, + qshl_imm should accept S8 S16 S32 S64 U8 U16 U32 U64. */ + nUF(vshl, vshl, 3, (RNDQ, oRNDQ, RNDQ_I63b), neon_shl_imm), + nUF(vshlq, vshl, 3, (RNQ, oRNQ, RNDQ_I63b), neon_shl_imm), + nUF(vqshl, vqshl, 3, (RNDQ, oRNDQ, RNDQ_I63b), neon_qshl_imm), + nUF(vqshlq, vqshl, 3, (RNQ, oRNQ, RNDQ_I63b), neon_qshl_imm), + /* Logic ops, types optional & ignored. */ + nUF(vand, vand, 2, (RNDQ, NILO), neon_logic), + nUF(vandq, vand, 2, (RNQ, NILO), neon_logic), + nUF(vbic, vbic, 2, (RNDQ, NILO), neon_logic), + nUF(vbicq, vbic, 2, (RNQ, NILO), neon_logic), + nUF(vorr, vorr, 2, (RNDQ, NILO), neon_logic), + nUF(vorrq, vorr, 2, (RNQ, NILO), neon_logic), + nUF(vorn, vorn, 2, (RNDQ, NILO), neon_logic), + nUF(vornq, vorn, 2, (RNQ, NILO), neon_logic), + nUF(veor, veor, 3, (RNDQ, oRNDQ, RNDQ), neon_logic), + nUF(veorq, veor, 3, (RNQ, oRNQ, RNQ), neon_logic), + /* Bitfield ops, untyped. */ + NUF(vbsl, 1100110, 3, (RNDQ, RNDQ, RNDQ), neon_bitfield), + NUF(vbslq, 1100110, 3, (RNQ, RNQ, RNQ), neon_bitfield), + NUF(vbit, 1200110, 3, (RNDQ, RNDQ, RNDQ), neon_bitfield), + NUF(vbitq, 1200110, 3, (RNQ, RNQ, RNQ), neon_bitfield), + NUF(vbif, 1300110, 3, (RNDQ, RNDQ, RNDQ), neon_bitfield), + NUF(vbifq, 1300110, 3, (RNQ, RNQ, RNQ), neon_bitfield), + /* Int and float variants, types S8 S16 S32 U8 U16 U32 F32. */ + nUF(vabd, vabd, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_if_su), + nUF(vabdq, vabd, 3, (RNQ, oRNQ, RNQ), neon_dyadic_if_su), + nUF(vmax, vmax, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_if_su), + nUF(vmaxq, vmax, 3, (RNQ, oRNQ, RNQ), neon_dyadic_if_su), + nUF(vmin, vmin, 3, (RNDQ, oRNDQ, RNDQ), neon_dyadic_if_su), + nUF(vminq, vmin, 3, (RNQ, oRNQ, RNQ), neon_dyadic_if_su), + /* Comparisons. Types S8 S16 S32 U8 U16 U32 F32. Non-immediate versions fall + back to neon_dyadic_if_su. */ + nUF(vcge, vcge, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp), + nUF(vcgeq, vcge, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp), + nUF(vcgt, vcgt, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp), + nUF(vcgtq, vcgt, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp), + nUF(vclt, vclt, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp_inv), + nUF(vcltq, vclt, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp_inv), + nUF(vcle, vcle, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_cmp_inv), + nUF(vcleq, vcle, 3, (RNQ, oRNQ, RNDQ_I0), neon_cmp_inv), + /* Comparison. Type I8 I16 I32 F32. */ + nUF(vceq, vceq, 3, (RNDQ, oRNDQ, RNDQ_I0), neon_ceq), + nUF(vceqq, vceq, 3, (RNQ, oRNQ, RNDQ_I0), neon_ceq), + /* As above, D registers only. */ + nUF(vpmax, vpmax, 3, (RND, oRND, RND), neon_dyadic_if_su_d), + nUF(vpmin, vpmin, 3, (RND, oRND, RND), neon_dyadic_if_su_d), + /* Int and float variants, signedness unimportant. */ + nUF(vmlaq, vmla, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_mac_maybe_scalar), + nUF(vmlsq, vmls, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_mac_maybe_scalar), + nUF(vpadd, vpadd, 3, (RND, oRND, RND), neon_dyadic_if_i_d), + /* Add/sub take types I8 I16 I32 I64 F32. */ + nUF(vaddq, vadd, 3, (RNQ, oRNQ, RNQ), neon_addsub_if_i), + nUF(vsubq, vsub, 3, (RNQ, oRNQ, RNQ), neon_addsub_if_i), + /* vtst takes sizes 8, 16, 32. */ + NUF(vtst, 0000810, 3, (RNDQ, oRNDQ, RNDQ), neon_tst), + NUF(vtstq, 0000810, 3, (RNQ, oRNQ, RNQ), neon_tst), + /* VMUL takes I8 I16 I32 F32 P8. */ + nUF(vmulq, vmul, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_mul), + /* VQD{R}MULH takes S16 S32. */ + nUF(vqdmulh, vqdmulh, 3, (RNDQ, oRNDQ, RNDQ_RNSC), neon_qdmulh), + nUF(vqdmulhq, vqdmulh, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_qdmulh), + nUF(vqrdmulh, vqrdmulh, 3, (RNDQ, oRNDQ, RNDQ_RNSC), neon_qdmulh), + nUF(vqrdmulhq, vqrdmulh, 3, (RNQ, oRNQ, RNDQ_RNSC), neon_qdmulh), + NUF(vacge, 0000e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute), + NUF(vacgeq, 0000e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute), + NUF(vacgt, 0200e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute), + NUF(vacgtq, 0200e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute), + NUF(vaclt, 0200e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute_inv), + NUF(vacltq, 0200e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute_inv), + NUF(vacle, 0000e10, 3, (RNDQ, oRNDQ, RNDQ), neon_fcmp_absolute_inv), + NUF(vacleq, 0000e10, 3, (RNQ, oRNQ, RNQ), neon_fcmp_absolute_inv), + NUF(vrecps, 0000f10, 3, (RNDQ, oRNDQ, RNDQ), neon_step), + NUF(vrecpsq, 0000f10, 3, (RNQ, oRNQ, RNQ), neon_step), + NUF(vrsqrts, 0200f10, 3, (RNDQ, oRNDQ, RNDQ), neon_step), + NUF(vrsqrtsq, 0200f10, 3, (RNQ, oRNQ, RNQ), neon_step), + + /* Two address, int/float. Types S8 S16 S32 F32. */ + NUF(vabsq, 1b10300, 2, (RNQ, RNQ), neon_abs_neg), + NUF(vnegq, 1b10380, 2, (RNQ, RNQ), neon_abs_neg), + + /* Data processing with two registers and a shift amount. */ + /* Right shifts, and variants with rounding. + Types accepted S8 S16 S32 S64 U8 U16 U32 U64. */ + NUF(vshr, 0800010, 3, (RNDQ, oRNDQ, I64z), neon_rshift_round_imm), + NUF(vshrq, 0800010, 3, (RNQ, oRNQ, I64z), neon_rshift_round_imm), + NUF(vrshr, 0800210, 3, (RNDQ, oRNDQ, I64z), neon_rshift_round_imm), + NUF(vrshrq, 0800210, 3, (RNQ, oRNQ, I64z), neon_rshift_round_imm), + NUF(vsra, 0800110, 3, (RNDQ, oRNDQ, I64), neon_rshift_round_imm), + NUF(vsraq, 0800110, 3, (RNQ, oRNQ, I64), neon_rshift_round_imm), + NUF(vrsra, 0800310, 3, (RNDQ, oRNDQ, I64), neon_rshift_round_imm), + NUF(vrsraq, 0800310, 3, (RNQ, oRNQ, I64), neon_rshift_round_imm), + /* Shift and insert. Sizes accepted 8 16 32 64. */ + NUF(vsli, 1800510, 3, (RNDQ, oRNDQ, I63), neon_sli), + NUF(vsliq, 1800510, 3, (RNQ, oRNQ, I63), neon_sli), + NUF(vsri, 1800410, 3, (RNDQ, oRNDQ, I64), neon_sri), + NUF(vsriq, 1800410, 3, (RNQ, oRNQ, I64), neon_sri), + /* QSHL{U} immediate accepts S8 S16 S32 S64 U8 U16 U32 U64. */ + NUF(vqshlu, 1800610, 3, (RNDQ, oRNDQ, I63), neon_qshlu_imm), + NUF(vqshluq, 1800610, 3, (RNQ, oRNQ, I63), neon_qshlu_imm), + /* Right shift immediate, saturating & narrowing, with rounding variants. + Types accepted S16 S32 S64 U16 U32 U64. */ + NUF(vqshrn, 0800910, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow), + NUF(vqrshrn, 0800950, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow), + /* As above, unsigned. Types accepted S16 S32 S64. */ + NUF(vqshrun, 0800810, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow_u), + NUF(vqrshrun, 0800850, 3, (RND, RNQ, I32z), neon_rshift_sat_narrow_u), + /* Right shift narrowing. Types accepted I16 I32 I64. */ + NUF(vshrn, 0800810, 3, (RND, RNQ, I32z), neon_rshift_narrow), + NUF(vrshrn, 0800850, 3, (RND, RNQ, I32z), neon_rshift_narrow), + /* Special case. Types S8 S16 S32 U8 U16 U32. Handles max shift variant. */ + nUF(vshll, vshll, 3, (RNQ, RND, I32), neon_shll), + /* CVT with optional immediate for fixed-point variant. */ + nUF(vcvtq, vcvt, 3, (RNQ, RNQ, oI32b), neon_cvt), + + nUF(vmvn, vmvn, 2, (RNDQ, RNDQ_IMVNb), neon_mvn), + nUF(vmvnq, vmvn, 2, (RNQ, RNDQ_IMVNb), neon_mvn), + + /* Data processing, three registers of different lengths. */ + /* Dyadic, long insns. Types S8 S16 S32 U8 U16 U32. */ + NUF(vabal, 0800500, 3, (RNQ, RND, RND), neon_abal), + NUF(vabdl, 0800700, 3, (RNQ, RND, RND), neon_dyadic_long), + NUF(vaddl, 0800000, 3, (RNQ, RND, RND), neon_dyadic_long), + NUF(vsubl, 0800200, 3, (RNQ, RND, RND), neon_dyadic_long), + /* If not scalar, fall back to neon_dyadic_long. + Vector types as above, scalar types S16 S32 U16 U32. */ + nUF(vmlal, vmlal, 3, (RNQ, RND, RND_RNSC), neon_mac_maybe_scalar_long), + nUF(vmlsl, vmlsl, 3, (RNQ, RND, RND_RNSC), neon_mac_maybe_scalar_long), + /* Dyadic, widening insns. Types S8 S16 S32 U8 U16 U32. */ + NUF(vaddw, 0800100, 3, (RNQ, oRNQ, RND), neon_dyadic_wide), + NUF(vsubw, 0800300, 3, (RNQ, oRNQ, RND), neon_dyadic_wide), + /* Dyadic, narrowing insns. Types I16 I32 I64. */ + NUF(vaddhn, 0800400, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + NUF(vraddhn, 1800400, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + NUF(vsubhn, 0800600, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + NUF(vrsubhn, 1800600, 3, (RND, RNQ, RNQ), neon_dyadic_narrow), + /* Saturating doubling multiplies. Types S16 S32. */ + nUF(vqdmlal, vqdmlal, 3, (RNQ, RND, RND_RNSC), neon_mul_sat_scalar_long), + nUF(vqdmlsl, vqdmlsl, 3, (RNQ, RND, RND_RNSC), neon_mul_sat_scalar_long), + nUF(vqdmull, vqdmull, 3, (RNQ, RND, RND_RNSC), neon_mul_sat_scalar_long), + /* VMULL. Vector types S8 S16 S32 U8 U16 U32 P8, scalar types + S16 S32 U16 U32. */ + nUF(vmull, vmull, 3, (RNQ, RND, RND_RNSC), neon_vmull), + + /* Extract. Size 8. */ + NUF(vext, 0b00000, 4, (RNDQ, oRNDQ, RNDQ, I15), neon_ext), + NUF(vextq, 0b00000, 4, (RNQ, oRNQ, RNQ, I15), neon_ext), + + /* Two registers, miscellaneous. */ + /* Reverse. Sizes 8 16 32 (must be < size in opcode). */ + NUF(vrev64, 1b00000, 2, (RNDQ, RNDQ), neon_rev), + NUF(vrev64q, 1b00000, 2, (RNQ, RNQ), neon_rev), + NUF(vrev32, 1b00080, 2, (RNDQ, RNDQ), neon_rev), + NUF(vrev32q, 1b00080, 2, (RNQ, RNQ), neon_rev), + NUF(vrev16, 1b00100, 2, (RNDQ, RNDQ), neon_rev), + NUF(vrev16q, 1b00100, 2, (RNQ, RNQ), neon_rev), + /* Vector replicate. Sizes 8 16 32. */ + nCE(vdup, vdup, 2, (RNDQ, RR_RNSC), neon_dup), + nCE(vdupq, vdup, 2, (RNQ, RR_RNSC), neon_dup), + /* VMOVL. Types S8 S16 S32 U8 U16 U32. */ + NUF(vmovl, 0800a10, 2, (RNQ, RND), neon_movl), + /* VMOVN. Types I16 I32 I64. */ + nUF(vmovn, vmovn, 2, (RND, RNQ), neon_movn), + /* VQMOVN. Types S16 S32 S64 U16 U32 U64. */ + nUF(vqmovn, vqmovn, 2, (RND, RNQ), neon_qmovn), + /* VQMOVUN. Types S16 S32 S64. */ + nUF(vqmovun, vqmovun, 2, (RND, RNQ), neon_qmovun), + /* VZIP / VUZP. Sizes 8 16 32. */ + NUF(vzip, 1b20180, 2, (RNDQ, RNDQ), neon_zip_uzp), + NUF(vzipq, 1b20180, 2, (RNQ, RNQ), neon_zip_uzp), + NUF(vuzp, 1b20100, 2, (RNDQ, RNDQ), neon_zip_uzp), + NUF(vuzpq, 1b20100, 2, (RNQ, RNQ), neon_zip_uzp), + /* VQABS / VQNEG. Types S8 S16 S32. */ + NUF(vqabs, 1b00700, 2, (RNDQ, RNDQ), neon_sat_abs_neg), + NUF(vqabsq, 1b00700, 2, (RNQ, RNQ), neon_sat_abs_neg), + NUF(vqneg, 1b00780, 2, (RNDQ, RNDQ), neon_sat_abs_neg), + NUF(vqnegq, 1b00780, 2, (RNQ, RNQ), neon_sat_abs_neg), + /* Pairwise, lengthening. Types S8 S16 S32 U8 U16 U32. */ + NUF(vpadal, 1b00600, 2, (RNDQ, RNDQ), neon_pair_long), + NUF(vpadalq, 1b00600, 2, (RNQ, RNQ), neon_pair_long), + NUF(vpaddl, 1b00200, 2, (RNDQ, RNDQ), neon_pair_long), + NUF(vpaddlq, 1b00200, 2, (RNQ, RNQ), neon_pair_long), + /* Reciprocal estimates. Types U32 F32. */ + NUF(vrecpe, 1b30400, 2, (RNDQ, RNDQ), neon_recip_est), + NUF(vrecpeq, 1b30400, 2, (RNQ, RNQ), neon_recip_est), + NUF(vrsqrte, 1b30480, 2, (RNDQ, RNDQ), neon_recip_est), + NUF(vrsqrteq, 1b30480, 2, (RNQ, RNQ), neon_recip_est), + /* VCLS. Types S8 S16 S32. */ + NUF(vcls, 1b00400, 2, (RNDQ, RNDQ), neon_cls), + NUF(vclsq, 1b00400, 2, (RNQ, RNQ), neon_cls), + /* VCLZ. Types I8 I16 I32. */ + NUF(vclz, 1b00480, 2, (RNDQ, RNDQ), neon_clz), + NUF(vclzq, 1b00480, 2, (RNQ, RNQ), neon_clz), + /* VCNT. Size 8. */ + NUF(vcnt, 1b00500, 2, (RNDQ, RNDQ), neon_cnt), + NUF(vcntq, 1b00500, 2, (RNQ, RNQ), neon_cnt), + /* Two address, untyped. */ + NUF(vswp, 1b20000, 2, (RNDQ, RNDQ), neon_swp), + NUF(vswpq, 1b20000, 2, (RNQ, RNQ), neon_swp), + /* VTRN. Sizes 8 16 32. */ + nUF(vtrn, vtrn, 2, (RNDQ, RNDQ), neon_trn), + nUF(vtrnq, vtrn, 2, (RNQ, RNQ), neon_trn), + + /* Table lookup. Size 8. */ + NUF(vtbl, 1b00800, 3, (RND, NRDLST, RND), neon_tbl_tbx), + NUF(vtbx, 1b00840, 3, (RND, NRDLST, RND), neon_tbl_tbx), + +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_vfp_v3_or_neon_ext +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_vfp_v3_or_neon_ext + /* Neon element/structure load/store. */ + nUF(vld1, vld1, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst1, vst1, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vld2, vld2, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst2, vst2, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vld3, vld3, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst3, vst3, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vld4, vld4, 2, (NSTRLST, ADDR), neon_ldx_stx), + nUF(vst4, vst4, 2, (NSTRLST, ADDR), neon_ldx_stx), + +#undef THUMB_VARIANT +#define THUMB_VARIANT &fpu_vfp_ext_v3 +#undef ARM_VARIANT +#define ARM_VARIANT &fpu_vfp_ext_v3 + cCE(fconsts, eb00a00, 2, (RVS, I255), vfp_sp_const), + cCE(fconstd, eb00b00, 2, (RVD, I255), vfp_dp_const), + cCE(fshtos, eba0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(fshtod, eba0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(fsltos, eba0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(fsltod, eba0bc0, 2, (RVD, I32), vfp_dp_conv_32), + cCE(fuhtos, ebb0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(fuhtod, ebb0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(fultos, ebb0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(fultod, ebb0bc0, 2, (RVD, I32), vfp_dp_conv_32), + cCE(ftoshs, ebe0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(ftoshd, ebe0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(ftosls, ebe0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(ftosld, ebe0bc0, 2, (RVD, I32), vfp_dp_conv_32), + cCE(ftouhs, ebf0a40, 2, (RVS, I16z), vfp_sp_conv_16), + cCE(ftouhd, ebf0b40, 2, (RVD, I16z), vfp_dp_conv_16), + cCE(ftouls, ebf0ac0, 2, (RVS, I32), vfp_sp_conv_32), + cCE(ftould, ebf0bc0, 2, (RVD, I32), vfp_dp_conv_32), + +#undef THUMB_VARIANT #undef ARM_VARIANT #define ARM_VARIANT &arm_cext_xscale /* Intel XScale extensions. */ cCE(mia, e200010, 3, (RXA, RRnpc, RRnpc), xsc_mia), @@ -9996,7 +16160,7 @@ static const struct asm_opcode insns[] = cCE(tinsrb, e600010, 3, (RIWR, RR, I7), iwmmxt_tinsr), cCE(tinsrh, e600050, 3, (RIWR, RR, I7), iwmmxt_tinsr), cCE(tinsrw, e600090, 3, (RIWR, RR, I7), iwmmxt_tinsr), - cCE(tmcr, e000110, 2, (RIWC, RR), rn_rd), + cCE(tmcr, e000110, 2, (RIWC_RIWG, RR), rn_rd), cCE(tmcrr, c400000, 3, (RIWR, RR, RR), rm_rd_rn), cCE(tmia, e200010, 3, (RIWR, RR, RR), iwmmxt_tmia), cCE(tmiaph, e280010, 3, (RIWR, RR, RR), iwmmxt_tmia), @@ -10007,7 +16171,7 @@ static const struct asm_opcode insns[] = cCE(tmovmskb, e100030, 2, (RR, RIWR), rd_rn), cCE(tmovmskh, e500030, 2, (RR, RIWR), rd_rn), cCE(tmovmskw, e900030, 2, (RR, RIWR), rd_rn), - cCE(tmrc, e100110, 2, (RR, RIWC), rd_rn), + cCE(tmrc, e100110, 2, (RR, RIWC_RIWG), rd_rn), cCE(tmrrc, c500000, 3, (RR, RR, RIWR), rd_rn_rm), cCE(torcb, e13f150, 1, (RR), iwmmxt_tandorc), cCE(torch, e53f150, 1, (RR), iwmmxt_tandorc), @@ -10078,34 +16242,34 @@ static const struct asm_opcode insns[] = cCE(wpackwus, e900080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wpackdss, ef00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wpackdus, ed00080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), - cCE(wrorh, e700040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wrorh, e700040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wrorhg, e700148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wrorw, eb00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wrorw, eb00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wrorwg, eb00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wrord, ef00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wrord, ef00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wrordg, ef00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), cCE(wsadb, e000120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wsadbz, e100120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wsadh, e400120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wsadhz, e500120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wshufh, e0001e0, 3, (RIWR, RIWR, I255), iwmmxt_wshufh), - cCE(wsllh, e500040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsllh, e500040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsllhg, e500148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsllw, e900040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsllw, e900040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsllwg, e900148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wslld, ed00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wslld, ed00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wslldg, ed00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrah, e400040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrah, e400040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrahg, e400148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsraw, e800040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsraw, e800040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrawg, e800148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrad, ec00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrad, ec00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsradg, ec00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrlh, e600040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrlh, e600040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrlhg, e600148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrlw, ea00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrlw, ea00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrlwg, ea00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), - cCE(wsrld, ee00040, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsrld, ee00040, 3, (RIWR, RIWR, RIWR_I32z),iwmmxt_wrwrwr_or_imm5), cCE(wsrldg, ee00148, 3, (RIWR, RIWR, RIWG), rd_rn_rm), cCE(wstrb, c000000, 2, (RIWR, ADDR), iwmmxt_wldstbh), cCE(wstrh, c400000, 2, (RIWR, ADDR), iwmmxt_wldstbh), @@ -10141,16 +16305,76 @@ static const struct asm_opcode insns[] = cCE(wxor, e100000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), cCE(wzero, e300000, 1, (RIWR), iwmmxt_wzero), +#undef ARM_VARIANT +#define ARM_VARIANT &arm_cext_iwmmxt2 /* Intel Wireless MMX technology, version 2. */ + cCE(torvscb, e13f190, 1, (RR), iwmmxt_tandorc), + cCE(torvsch, e53f190, 1, (RR), iwmmxt_tandorc), + cCE(torvscw, e93f190, 1, (RR), iwmmxt_tandorc), + cCE(wabsb, e2001c0, 2, (RIWR, RIWR), rd_rn), + cCE(wabsh, e6001c0, 2, (RIWR, RIWR), rd_rn), + cCE(wabsw, ea001c0, 2, (RIWR, RIWR), rd_rn), + cCE(wabsdiffb, e1001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wabsdiffh, e5001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wabsdiffw, e9001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddbhusl, e2001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddbhusm, e6001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddhc, e600180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddwc, ea00180, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(waddsubhx, ea001a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wavg4, e400000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wavg4r, e500000, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddsn, ee00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddsx, eb00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddun, ec00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmaddux, e900100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmerge, e000080, 4, (RIWR, RIWR, RIWR, I7), iwmmxt_wmerge), + cCE(wmiabb, e0000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiabt, e1000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiatb, e2000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiatt, e3000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiabbn, e4000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiabtn, e5000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiatbn, e6000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiattn, e7000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbb, e800120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbt, e900120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawtb, ea00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawtt, eb00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbbn, ec00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawbtn, ed00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawtbn, ee00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmiawttn, ef00120, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulsmr, ef00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulumr, ed00100, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwumr, ec000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwsmr, ee000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwum, ed000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwsm, ef000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wmulwl, eb000c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabb, e8000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabt, e9000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiatb, ea000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiatt, eb000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabbn, ec000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiabtn, ed000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiatbn, ee000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmiattn, ef000a0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulm, e100080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulmr, e300080, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulwm, ec000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wqmulwmr, ee000e0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + cCE(wsubaddhx, ed001c0, 3, (RIWR, RIWR, RIWR), rd_rn_rm), + #undef ARM_VARIANT #define ARM_VARIANT &arm_cext_maverick /* Cirrus Maverick instructions. */ - cCE(cfldrs, c100400, 2, (RMF, ADDR), rd_cpaddr), - cCE(cfldrd, c500400, 2, (RMD, ADDR), rd_cpaddr), - cCE(cfldr32, c100500, 2, (RMFX, ADDR), rd_cpaddr), - cCE(cfldr64, c500500, 2, (RMDX, ADDR), rd_cpaddr), - cCE(cfstrs, c000400, 2, (RMF, ADDR), rd_cpaddr), - cCE(cfstrd, c400400, 2, (RMD, ADDR), rd_cpaddr), - cCE(cfstr32, c000500, 2, (RMFX, ADDR), rd_cpaddr), - cCE(cfstr64, c400500, 2, (RMDX, ADDR), rd_cpaddr), + cCE(cfldrs, c100400, 2, (RMF, ADDRGLDC), rd_cpaddr), + cCE(cfldrd, c500400, 2, (RMD, ADDRGLDC), rd_cpaddr), + cCE(cfldr32, c100500, 2, (RMFX, ADDRGLDC), rd_cpaddr), + cCE(cfldr64, c500500, 2, (RMDX, ADDRGLDC), rd_cpaddr), + cCE(cfstrs, c000400, 2, (RMF, ADDRGLDC), rd_cpaddr), + cCE(cfstrd, c400400, 2, (RMD, ADDRGLDC), rd_cpaddr), + cCE(cfstr32, c000500, 2, (RMFX, ADDRGLDC), rd_cpaddr), + cCE(cfstr64, c400500, 2, (RMDX, ADDRGLDC), rd_cpaddr), cCE(cfmvsr, e000450, 2, (RMF, RR), rn_rd), cCE(cfmvrs, e100450, 2, (RR, RMF), rd_rn), cCE(cfmvdlr, e000410, 2, (RMD, RR), rn_rd), @@ -10235,6 +16459,10 @@ static const struct asm_opcode insns[] = #undef UE #undef UF #undef UT +#undef NUF +#undef nUF +#undef NCE +#undef nCE #undef OPS0 #undef OPS1 #undef OPS2 @@ -10428,7 +16656,10 @@ md_convert_frag (bfd *abfd, segT asec ATTRIBUTE_UNUSED, fragS *fragp) insn = THUMB_OP32 (opcode); insn |= (old_op & 0xf0) << 4; put_thumb32_insn (buf, insn); - reloc_type = BFD_RELOC_ARM_T32_IMMEDIATE; + if (opcode == T_MNEM_add_pc) + reloc_type = BFD_RELOC_ARM_T32_IMM12; + else + reloc_type = BFD_RELOC_ARM_T32_ADD_IMM; } else reloc_type = BFD_RELOC_ARM_THUMB_ADD; @@ -10445,7 +16676,10 @@ md_convert_frag (bfd *abfd, segT asec ATTRIBUTE_UNUSED, fragS *fragp) insn |= (old_op & 0xf0) << 4; insn |= (old_op & 0xf) << 16; put_thumb32_insn (buf, insn); - reloc_type = BFD_RELOC_ARM_T32_IMMEDIATE; + if (insn & (1 << 20)) + reloc_type = BFD_RELOC_ARM_T32_ADD_IMM; + else + reloc_type = BFD_RELOC_ARM_T32_IMMEDIATE; } else reloc_type = BFD_RELOC_ARM_THUMB_ADD; @@ -10479,16 +16713,42 @@ relax_immediate (fragS *fragp, int size, int shift) offset = fragp->fr_offset; /* Force misaligned offsets to 32-bit variant. */ if (offset & low) - return -4; + return 4; if (offset & ~mask) return 4; return 2; } +/* Get the address of a symbol during relaxation. */ +static addressT +relaxed_symbol_addr(fragS *fragp, long stretch) +{ + fragS *sym_frag; + addressT addr; + symbolS *sym; + + sym = fragp->fr_symbol; + sym_frag = symbol_get_frag (sym); + know (S_GET_SEGMENT (sym) != absolute_section + || sym_frag == &zero_address_frag); + addr = S_GET_VALUE (sym) + fragp->fr_offset; + + /* If frag has yet to be reached on this pass, assume it will + move by STRETCH just as we did. If this is not so, it will + be because some frag between grows, and that will force + another pass. */ + + if (stretch != 0 + && sym_frag->relax_marker != fragp->relax_marker) + addr += stretch; + + return addr; +} + /* Return the size of a relaxable adr pseudo-instruction or PC-relative load. */ static int -relax_adr (fragS *fragp, asection *sec) +relax_adr (fragS *fragp, asection *sec, long stretch) { addressT addr; offsetT val; @@ -10498,14 +16758,12 @@ relax_adr (fragS *fragp, asection *sec) || sec != S_GET_SEGMENT (fragp->fr_symbol)) return 4; - val = S_GET_VALUE(fragp->fr_symbol) + fragp->fr_offset; + val = relaxed_symbol_addr(fragp, stretch); addr = fragp->fr_address + fragp->fr_fix; addr = (addr + 4) & ~3; - /* Fix the insn as the 4-byte version if the target address is not - sufficiently aligned. This is prevents an infinite loop when two - instructions have contradictory range/alignment requirements. */ + /* Force misaligned targets to 32-bit variant. */ if (val & 3) - return -4; + return 4; val -= addr; if (val < 0 || val > 1020) return 4; @@ -10532,7 +16790,7 @@ relax_addsub (fragS *fragp, asection *sec) size of the offset field in the narrow instruction. */ static int -relax_branch (fragS *fragp, asection *sec, int bits) +relax_branch (fragS *fragp, asection *sec, int bits, long stretch) { addressT addr; offsetT val; @@ -10543,7 +16801,7 @@ relax_branch (fragS *fragp, asection *sec, int bits) || sec != S_GET_SEGMENT (fragp->fr_symbol)) return 4; - val = S_GET_VALUE(fragp->fr_symbol) + fragp->fr_offset; + val = relaxed_symbol_addr(fragp, stretch); addr = fragp->fr_address + fragp->fr_fix + 4; val -= addr; @@ -10559,7 +16817,7 @@ relax_branch (fragS *fragp, asection *sec, int bits) the current size of the frag should change. */ int -arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) +arm_relax_frag (asection *sec, fragS *fragp, long stretch) { int oldsize; int newsize; @@ -10568,7 +16826,7 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) switch (fragp->fr_subtype) { case T_MNEM_ldr_pc2: - newsize = relax_adr(fragp, sec); + newsize = relax_adr(fragp, sec, stretch); break; case T_MNEM_ldr_pc: case T_MNEM_ldr_sp: @@ -10588,7 +16846,7 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) newsize = relax_immediate(fragp, 5, 0); break; case T_MNEM_adr: - newsize = relax_adr(fragp, sec); + newsize = relax_adr(fragp, sec, stretch); break; case T_MNEM_mov: case T_MNEM_movs: @@ -10597,10 +16855,10 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) newsize = relax_immediate(fragp, 8, 0); break; case T_MNEM_b: - newsize = relax_branch(fragp, sec, 11); + newsize = relax_branch(fragp, sec, 11, stretch); break; case T_MNEM_bcond: - newsize = relax_branch(fragp, sec, 8); + newsize = relax_branch(fragp, sec, 8, stretch); break; case T_MNEM_add_sp: case T_MNEM_add_pc: @@ -10619,14 +16877,18 @@ arm_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) default: abort(); } - if (newsize < 0) + + fragp->fr_var = newsize; + /* Freeze wide instructions that are at or before the same location as + in the previous pass. This avoids infinite loops. + Don't freeze them unconditionally because targets may be artificialy + misaligned by the expansion of preceeding frags. */ + if (stretch <= 0 && newsize > 2) { - fragp->fr_var = -newsize; md_convert_frag (sec->owner, sec, fragp); frag_wane(fragp); - return -(newsize + oldsize); } - fragp->fr_var = newsize; + return newsize - oldsize; } @@ -10636,12 +16898,22 @@ valueT md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) { -#ifdef OBJ_ELF - return size; -#else - /* Round all sects to multiple of 4. */ - return (size + 3) & ~3; +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) + if (OUTPUT_FLAVOR == bfd_target_aout_flavour) + { + /* For a.out, force the section size to be aligned. If we don't do + this, BFD will align it for us, but it will not write out the + final bytes of the section. This may be a bug in BFD, but it is + easier to fix it here since that is how the other a.out targets + work. */ + int align; + + align = bfd_get_section_alignment (stdoutput, segment); + size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); + } #endif + + return size; } /* This is called from HANDLE_ALIGN in write.c. Fill in the contents @@ -10893,7 +17165,7 @@ finish_unwind_opcodes (void) if (unwind.fp_used) { - /* Adjust sp as neccessary. */ + /* Adjust sp as necessary. */ unwind.pending_offset += unwind.fp_offset - unwind.frame_size; flush_pending_unwind (); @@ -11141,18 +17413,6 @@ create_unwind_entry (int have_data) return 0; } -/* Convert REGNAME to a DWARF-2 register number. */ - -int -tc_arm_regname_to_dw2regnum (const char *regname) -{ - int reg = arm_reg_parse ((char **) ®name, REG_TYPE_RN); - - if (reg == FAIL) - return -1; - - return reg; -} /* Initialize the DWARF-2 unwind information for this procedure. */ @@ -11163,6 +17423,31 @@ tc_arm_frame_initial_instructions (void) } #endif /* OBJ_ELF */ +/* Convert REGNAME to a DWARF-2 register number. */ + +int +tc_arm_regname_to_dw2regnum (char *regname) +{ + int reg = arm_reg_parse (®name, REG_TYPE_RN); + + if (reg == FAIL) + return -1; + + return reg; +} + +#ifdef TE_PE +void +tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size) +{ + expressionS expr; + + expr.X_op = O_secrel; + expr.X_add_symbol = symbol; + expr.X_add_number = 0; + emit_expr (&expr, size); +} +#endif /* MD interface: Symbol and relocation handling. */ @@ -11179,10 +17464,16 @@ md_pcrel_from_section (fixS * fixP, segT seg) /* If this is pc-relative and we are going to emit a relocation then we just want to put out any pipeline compensation that the linker - will need. Otherwise we want to use the calculated base. */ + will need. Otherwise we want to use the calculated base. + For WinCE we skip the bias for externals as well, since this + is how the MS ARM-CE assembler behaves and we want to be compatible. */ if (fixP->fx_pcrel && ((fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != seg) - || arm_force_relocation (fixP))) + || (arm_force_relocation (fixP) +#ifdef TE_WINCE + && !S_IS_EXTERNAL (fixP->fx_addsy) +#endif + ))) base = 0; switch (fixP->fx_r_type) @@ -11219,6 +17510,17 @@ md_pcrel_from_section (fixS * fixP, segT seg) case BFD_RELOC_ARM_PCREL_BLX: case BFD_RELOC_ARM_PLT32: #ifdef TE_WINCE + /* When handling fixups immediately, because we have already + discovered the value of a symbol, or the address of the frag involved + we must account for the offset by +8, as the OS loader will never see the reloc. + see fixup_segment() in write.c + The S_IS_EXTERNAL test handles the case of global symbols. + Those need the calculated base, not just the pipe compensation the linker will need. */ + if (fixP->fx_pcrel + && fixP->fx_addsy != NULL + && (S_GET_SEGMENT (fixP->fx_addsy) == seg) + && (S_IS_EXTERNAL (fixP->fx_addsy) || !arm_force_relocation (fixP))) + return base + 8; return base; #else return base + 8; @@ -11406,11 +17708,11 @@ negate_data_op (unsigned long * instruction, /* Like negate_data_op, but for Thumb-2. */ static unsigned int -thumb32_negate_data_op (offsetT *instruction, offsetT value) +thumb32_negate_data_op (offsetT *instruction, unsigned int value) { int op, new_inst; int rd; - offsetT negated, inverted; + unsigned int negated, inverted; negated = encode_thumb32_immediate (-value); inverted = encode_thumb32_immediate (~value); @@ -11471,7 +17773,7 @@ thumb32_negate_data_op (offsetT *instruction, offsetT value) return FAIL; } - if (value == FAIL) + if (value == (unsigned int)FAIL) return FAIL; *instruction &= T2_OPCODE_MASK; @@ -11528,6 +17830,7 @@ md_apply_fix (fixS * fixP, assert (fixP->fx_r_type <= BFD_RELOC_UNUSED); /* Note whether this will delete the relocation. */ + if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) fixP->fx_done = 1; @@ -11676,7 +17979,7 @@ md_apply_fix (fixS * fixP, as_bad_where (fixP->fx_file, fixP->fx_line, _("invalid literal constant: pool needs to be closer")); else - as_bad (_("bad immediate value for half-word offset (%ld)"), + as_bad (_("bad immediate value for 8-bit offset (%ld)"), (long) value); break; } @@ -11835,6 +18138,7 @@ md_apply_fix (fixS * fixP, break; case BFD_RELOC_ARM_T32_IMMEDIATE: + case BFD_RELOC_ARM_T32_ADD_IMM: case BFD_RELOC_ARM_T32_IMM12: case BFD_RELOC_ARM_T32_ADD_PC12: /* We claim that this fixup has been processed here, @@ -11855,15 +18159,21 @@ md_apply_fix (fixS * fixP, newval <<= 16; newval |= md_chars_to_number (buf+2, THUMB_SIZE); - /* FUTURE: Implement analogue of negate_data_op for T32. */ - if (fixP->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE) + newimm = FAIL; + if (fixP->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE + || fixP->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM) { newimm = encode_thumb32_immediate (value); if (newimm == (unsigned int) FAIL) newimm = thumb32_negate_data_op (&newval, value); } - else + if (fixP->fx_r_type != BFD_RELOC_ARM_T32_IMMEDIATE + && newimm == (unsigned int) FAIL) { + /* Turn add/sum into addw/subw. */ + if (fixP->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM) + newval = (newval & 0xfeffffff) | 0x02000000; + /* 12 bit immediate for addw/subw. */ if (value < 0) { @@ -11977,18 +18287,34 @@ md_apply_fix (fixS * fixP, } break; - case BFD_RELOC_THUMB_PCREL_BRANCH7: /* CZB */ - /* CZB can only branch forward. */ - if (value & ~0x7e) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("branch out of range")); + case BFD_RELOC_THUMB_PCREL_BRANCH7: /* CBZ */ + /* CBZ can only branch forward. */ - if (fixP->fx_done || !seg->use_rela_p) + /* Attempts to use CBZ to branch to the next instruction + (which, strictly speaking, are prohibited) will be turned into + no-ops. + + FIXME: It may be better to remove the instruction completely and + perform relaxation. */ + if (value == -2) { newval = md_chars_to_number (buf, THUMB_SIZE); - newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); + newval = 0xbf00; /* NOP encoding T1 */ md_number_to_chars (buf, newval, THUMB_SIZE); } + else + { + if (value & ~0x7e) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("branch out of range")); + + if (fixP->fx_done || !seg->use_rela_p) + { + newval = md_chars_to_number (buf, THUMB_SIZE); + newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); + md_number_to_chars (buf, newval, THUMB_SIZE); + } + } break; case BFD_RELOC_THUMB_PCREL_BRANCH9: /* Conditional branch. */ @@ -12129,8 +18455,15 @@ md_apply_fix (fixS * fixP, case BFD_RELOC_ARM_ROSEGREL32: case BFD_RELOC_ARM_SBREL32: case BFD_RELOC_32_PCREL: +#ifdef TE_PE + case BFD_RELOC_32_SECREL: +#endif if (fixP->fx_done || !seg->use_rela_p) - md_number_to_chars (buf, value, 4); +#ifdef TE_WINCE + /* For WinCE we only do this for pcrel fixups. */ + if (fixP->fx_done || fixP->fx_pcrel) +#endif + md_number_to_chars (buf, value, 4); break; #ifdef OBJ_ELF @@ -12165,8 +18498,6 @@ md_apply_fix (fixS * fixP, newval = get_thumb32_insn (buf); newval &= 0xff7fff00; newval |= (value >> 2) | (sign ? INDEX_UP : 0); - if (value == 0) - newval &= ~WRITE_BACK; if (fixP->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM || fixP->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM_S2) md_number_to_chars (buf, newval, INSN_SIZE); @@ -12358,6 +18689,216 @@ md_apply_fix (fixS * fixP, fixP->fx_done = 0; return; + case BFD_RELOC_ARM_MOVW: + case BFD_RELOC_ARM_MOVT: + case BFD_RELOC_ARM_THUMB_MOVW: + case BFD_RELOC_ARM_THUMB_MOVT: + if (fixP->fx_done || !seg->use_rela_p) + { + /* REL format relocations are limited to a 16-bit addend. */ + if (!fixP->fx_done) + { + if (value < -0x1000 || value > 0xffff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("offset too big")); + } + else if (fixP->fx_r_type == BFD_RELOC_ARM_MOVT + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT) + { + value >>= 16; + } + + if (fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVW + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT) + { + newval = get_thumb32_insn (buf); + newval &= 0xfbf08f00; + newval |= (value & 0xf000) << 4; + newval |= (value & 0x0800) << 15; + newval |= (value & 0x0700) << 4; + newval |= (value & 0x00ff); + put_thumb32_insn (buf, newval); + } + else + { + newval = md_chars_to_number (buf, 4); + newval &= 0xfff0f000; + newval |= value & 0x0fff; + newval |= (value & 0xf000) << 4; + md_number_to_chars (buf, newval, 4); + } + } + return; + + case BFD_RELOC_ARM_ALU_PC_G0_NC: + case BFD_RELOC_ARM_ALU_PC_G0: + case BFD_RELOC_ARM_ALU_PC_G1_NC: + case BFD_RELOC_ARM_ALU_PC_G1: + case BFD_RELOC_ARM_ALU_PC_G2: + case BFD_RELOC_ARM_ALU_SB_G0_NC: + case BFD_RELOC_ARM_ALU_SB_G0: + case BFD_RELOC_ARM_ALU_SB_G1_NC: + case BFD_RELOC_ARM_ALU_SB_G1: + case BFD_RELOC_ARM_ALU_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma encoded_addend; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend can be + expressed as an 8-bit constant plus a rotation. */ + encoded_addend = encode_arm_immediate (addend_abs); + if (encoded_addend == (unsigned int) FAIL) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("the offset 0x%08lX is not representable"), + (unsigned long) addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is positive, use an ADD instruction. + Otherwise use a SUB. Take care not to destroy the S bit. */ + insn &= 0xff1fffff; + if (value < 0) + insn |= 1 << 22; + else + insn |= 1 << 23; + + /* Place the encoded addend into the first 12 bits of the + instruction. */ + insn &= 0xfffff000; + insn |= encoded_addend; + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + + case BFD_RELOC_ARM_LDR_PC_G0: + case BFD_RELOC_ARM_LDR_PC_G1: + case BFD_RELOC_ARM_LDR_PC_G2: + case BFD_RELOC_ARM_LDR_SB_G0: + case BFD_RELOC_ARM_LDR_SB_G1: + case BFD_RELOC_ARM_LDR_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend can be + encoded in 12 bits. */ + if (addend_abs >= 0x1000) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (only 12 bits available for the magnitude)"), + (unsigned long) addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is negative, clear bit 23 of the instruction. + Otherwise set it. */ + if (value < 0) + insn &= ~(1 << 23); + else + insn |= 1 << 23; + + /* Place the absolute value of the addend into the first 12 bits + of the instruction. */ + insn &= 0xfffff000; + insn |= addend_abs; + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + + case BFD_RELOC_ARM_LDRS_PC_G0: + case BFD_RELOC_ARM_LDRS_PC_G1: + case BFD_RELOC_ARM_LDRS_PC_G2: + case BFD_RELOC_ARM_LDRS_SB_G0: + case BFD_RELOC_ARM_LDRS_SB_G1: + case BFD_RELOC_ARM_LDRS_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend can be + encoded in 8 bits. */ + if (addend_abs >= 0x100) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (only 8 bits available for the magnitude)"), + (unsigned long) addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is negative, clear bit 23 of the instruction. + Otherwise set it. */ + if (value < 0) + insn &= ~(1 << 23); + else + insn |= 1 << 23; + + /* Place the first four bits of the absolute value of the addend + into the first 4 bits of the instruction, and the remaining + four into bits 8 .. 11. */ + insn &= 0xfffff0f0; + insn |= (addend_abs & 0xf) | ((addend_abs & 0xf0) << 4); + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + + case BFD_RELOC_ARM_LDC_PC_G0: + case BFD_RELOC_ARM_LDC_PC_G1: + case BFD_RELOC_ARM_LDC_PC_G2: + case BFD_RELOC_ARM_LDC_SB_G0: + case BFD_RELOC_ARM_LDC_SB_G1: + case BFD_RELOC_ARM_LDC_SB_G2: + assert (!fixP->fx_done); + if (!seg->use_rela_p) + { + bfd_vma insn; + bfd_vma addend_abs = abs (value); + + /* Check that the absolute value of the addend is a multiple of + four and, when divided by four, fits in 8 bits. */ + if (addend_abs & 0x3) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (must be word-aligned)"), + (unsigned long) addend_abs); + + if ((addend_abs >> 2) > 0xff) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("bad offset 0x%08lX (must be an 8-bit number of words)"), + (unsigned long) addend_abs); + + /* Extract the instruction. */ + insn = md_chars_to_number (buf, INSN_SIZE); + + /* If the addend is negative, clear bit 23 of the instruction. + Otherwise set it. */ + if (value < 0) + insn &= ~(1 << 23); + else + insn |= 1 << 23; + + /* Place the addend (divided by four) into the first eight + bits of the instruction. */ + insn &= 0xfffffff0; + insn |= addend_abs >> 2; + + /* Update the instruction. */ + md_number_to_chars (buf, insn, INSN_SIZE); + } + break; + case BFD_RELOC_UNUSED: default: as_bad_where (fixP->fx_file, fixP->fx_line, @@ -12412,6 +18953,34 @@ tc_gen_reloc (asection *section, fixS *fixp) break; } + case BFD_RELOC_ARM_MOVW: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_MOVW_PCREL; + break; + } + + case BFD_RELOC_ARM_MOVT: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_MOVT_PCREL; + break; + } + + case BFD_RELOC_ARM_THUMB_MOVW: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_THUMB_MOVW_PCREL; + break; + } + + case BFD_RELOC_ARM_THUMB_MOVT: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_ARM_THUMB_MOVT_PCREL; + break; + } + case BFD_RELOC_NONE: case BFD_RELOC_ARM_PCREL_BRANCH: case BFD_RELOC_ARM_PCREL_BLX: @@ -12425,6 +18994,9 @@ tc_gen_reloc (asection *section, fixS *fixp) case BFD_RELOC_THUMB_PCREL_BLX: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: +#ifdef TE_PE + case BFD_RELOC_32_SECREL: +#endif code = fixp->fx_r_type; break; @@ -12449,6 +19021,34 @@ tc_gen_reloc (asection *section, fixS *fixp) case BFD_RELOC_ARM_TLS_LDO32: case BFD_RELOC_ARM_PCREL_CALL: case BFD_RELOC_ARM_PCREL_JUMP: + case BFD_RELOC_ARM_ALU_PC_G0_NC: + case BFD_RELOC_ARM_ALU_PC_G0: + case BFD_RELOC_ARM_ALU_PC_G1_NC: + case BFD_RELOC_ARM_ALU_PC_G1: + case BFD_RELOC_ARM_ALU_PC_G2: + case BFD_RELOC_ARM_LDR_PC_G0: + case BFD_RELOC_ARM_LDR_PC_G1: + case BFD_RELOC_ARM_LDR_PC_G2: + case BFD_RELOC_ARM_LDRS_PC_G0: + case BFD_RELOC_ARM_LDRS_PC_G1: + case BFD_RELOC_ARM_LDRS_PC_G2: + case BFD_RELOC_ARM_LDC_PC_G0: + case BFD_RELOC_ARM_LDC_PC_G1: + case BFD_RELOC_ARM_LDC_PC_G2: + case BFD_RELOC_ARM_ALU_SB_G0_NC: + case BFD_RELOC_ARM_ALU_SB_G0: + case BFD_RELOC_ARM_ALU_SB_G1_NC: + case BFD_RELOC_ARM_ALU_SB_G1: + case BFD_RELOC_ARM_ALU_SB_G2: + case BFD_RELOC_ARM_LDR_SB_G0: + case BFD_RELOC_ARM_LDR_SB_G1: + case BFD_RELOC_ARM_LDR_SB_G2: + case BFD_RELOC_ARM_LDRS_SB_G0: + case BFD_RELOC_ARM_LDRS_SB_G1: + case BFD_RELOC_ARM_LDRS_SB_G2: + case BFD_RELOC_ARM_LDC_SB_G0: + case BFD_RELOC_ARM_LDC_SB_G1: + case BFD_RELOC_ARM_LDC_SB_G2: code = fixp->fx_r_type; break; @@ -12579,6 +19179,14 @@ cons_fix_new_arm (fragS * frag, break; } +#ifdef TE_PE + if (exp->X_op == O_secrel) + { + exp->X_op = O_symbol; + type = BFD_RELOC_32_SECREL; + } +#endif + fix_new_exp (frag, where, (int) size, exp, pcrel, type); } @@ -12612,34 +19220,31 @@ arm_force_relocation (struct fix * fixp) if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE + || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM || fixp->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE || fixp->fx_r_type == BFD_RELOC_ARM_T32_IMM12 || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_PC12) return 0; + /* Always leave these relocations for the linker. */ + if ((fixp->fx_r_type >= BFD_RELOC_ARM_ALU_PC_G0_NC + && fixp->fx_r_type <= BFD_RELOC_ARM_LDC_SB_G2) + || fixp->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0) + return 1; + + /* Always generate relocations against function symbols. */ + if (fixp->fx_r_type == BFD_RELOC_32 + && fixp->fx_addsy + && (symbol_get_bfdsym (fixp->fx_addsy)->flags & BSF_FUNCTION)) + return 1; + return generic_force_reloc (fixp); } -#ifdef OBJ_COFF -/* This is a little hack to help the gas/arm/adrl.s test. It prevents - local labels from being added to the output symbol table when they - are used with the ADRL pseudo op. The ADRL relocation should always - be resolved before the binbary is emitted, so it is safe to say that - it is adjustable. */ - -bfd_boolean -arm_fix_adjustable (fixS * fixP) -{ - if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) - return 1; - return 0; -} -#endif - -#ifdef OBJ_ELF -/* Relocations against Thumb function names must be left unadjusted, - so that the linker can use this information to correctly set the - bottom bit of their addresses. The MIPS version of this function +#if defined (OBJ_ELF) || defined (OBJ_COFF) +/* Relocations against function names must be left unadjusted, + so that the linker can use this information to generate interworking + stubs. The MIPS version of this function also prevents relocations that are mips-16 specific, but I do not know why it does this. @@ -12656,6 +19261,10 @@ arm_fix_adjustable (fixS * fixP) if (fixP->fx_addsy == NULL) return 1; + /* Preserve relocations against symbols with function type. */ + if (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_FUNCTION) + return 0; + if (THUMB_IS_FUNC (fixP->fx_addsy) && fixP->fx_subsy == NULL) return 0; @@ -12677,8 +19286,17 @@ arm_fix_adjustable (fixS * fixP) || fixP->fx_r_type == BFD_RELOC_ARM_TARGET2) return 0; + /* Similarly for group relocations. */ + if ((fixP->fx_r_type >= BFD_RELOC_ARM_ALU_PC_G0_NC + && fixP->fx_r_type <= BFD_RELOC_ARM_LDC_SB_G2) + || fixP->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0) + return 0; + return 1; } +#endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */ + +#ifdef OBJ_ELF const char * elf32_arm_target_format (void) @@ -12789,14 +19407,15 @@ arm_adjust_symtab (void) elf_sym = elf_symbol (symbol_get_bfdsym (sym)); bind = ELF_ST_BIND (elf_sym->internal_elf_sym.st_info); - if (! bfd_is_arm_mapping_symbol_name (elf_sym->symbol.name)) + if (! bfd_is_arm_special_symbol_name (elf_sym->symbol.name, + BFD_ARM_SPECIAL_SYM_TYPE_ANY)) { /* If it's a .thumb_func, declare it as so, otherwise tag label as .code 16. */ if (THUMB_IS_FUNC (sym)) elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_TFUNC); - else + else if (EF_ARM_EABI_VERSION (meabi_flags) < EF_ARM_EABI_VER4) elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_16BIT); } @@ -12817,6 +19436,16 @@ set_constant_flonums (void) abort (); } +/* Auto-select Thumb mode if it's the only available instruction set for the + given architecture. */ + +static void +autoselect_thumb_from_cpu_variant (void) +{ + if (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1)) + opcode_select (16); +} + void md_begin (void) { @@ -12894,9 +19523,9 @@ md_begin (void) if (!mfpu_opt) { - if (!mcpu_cpu_opt) + if (mcpu_cpu_opt != NULL) mfpu_opt = &fpu_default; - else if (ARM_CPU_HAS_FEATURE (*mcpu_fpu_opt, arm_ext_v5)) + else if (mcpu_fpu_opt != NULL && ARM_CPU_HAS_FEATURE (*mcpu_fpu_opt, arm_ext_v5)) mfpu_opt = &fpu_arch_vfp_v2; else mfpu_opt = &fpu_arch_fpa; @@ -12917,6 +19546,8 @@ md_begin (void) ARM_MERGE_FEATURE_SETS (cpu_variant, *mcpu_cpu_opt, *mfpu_opt); + autoselect_thumb_from_cpu_variant (); + arm_arch_used = thumb_arch_used = arm_arch_none; #if defined OBJ_COFF || defined OBJ_ELF @@ -12992,7 +19623,9 @@ md_begin (void) #endif /* Record the CPU type as well. */ - if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt)) + if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt2)) + mach = bfd_mach_arm_iWMMXt2; + else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_iwmmxt)) mach = bfd_mach_arm_iWMMXt; else if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_cext_xscale)) mach = bfd_mach_arm_XScale; @@ -13362,13 +19995,16 @@ static const struct arm_cpu_option_table arm_cpus[] = {"arm1156t2f-s", ARM_ARCH_V6T2, FPU_ARCH_VFP_V2, NULL}, {"arm1176jz-s", ARM_ARCH_V6ZK, FPU_NONE, NULL}, {"arm1176jzf-s", ARM_ARCH_V6ZK, FPU_ARCH_VFP_V2, NULL}, - {"cortex-a8", ARM_ARCH_V7A, FPU_ARCH_VFP_V2, NULL}, + {"cortex-a8", ARM_ARCH_V7A, ARM_FEATURE(0, FPU_VFP_V3 + | FPU_NEON_EXT_V1), + NULL}, {"cortex-r4", ARM_ARCH_V7R, FPU_NONE, NULL}, {"cortex-m3", ARM_ARCH_V7M, FPU_NONE, NULL}, /* ??? XSCALE is really an architecture. */ {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2, NULL}, /* ??? iwmmxt is not a processor. */ {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP_V2, NULL}, + {"iwmmxt2", ARM_ARCH_IWMMXT2,FPU_ARCH_VFP_V2, NULL}, {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2, NULL}, /* Maverick */ {"ep9312", ARM_FEATURE(ARM_AEXT_V4T, ARM_CEXT_MAVERICK), FPU_ARCH_MAVERICK, "ARM920T"}, @@ -13413,11 +20049,17 @@ static const struct arm_arch_option_table arm_archs[] = {"armv6zt2", ARM_ARCH_V6ZT2, FPU_ARCH_VFP}, {"armv6zkt2", ARM_ARCH_V6ZKT2, FPU_ARCH_VFP}, {"armv7", ARM_ARCH_V7, FPU_ARCH_VFP}, + /* The official spelling of the ARMv7 profile variants is the dashed form. + Accept the non-dashed form for compatibility with old toolchains. */ {"armv7a", ARM_ARCH_V7A, FPU_ARCH_VFP}, {"armv7r", ARM_ARCH_V7R, FPU_ARCH_VFP}, {"armv7m", ARM_ARCH_V7M, FPU_ARCH_VFP}, + {"armv7-a", ARM_ARCH_V7A, FPU_ARCH_VFP}, + {"armv7-r", ARM_ARCH_V7R, FPU_ARCH_VFP}, + {"armv7-m", ARM_ARCH_V7M, FPU_ARCH_VFP}, {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP}, {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP}, + {"iwmmxt2", ARM_ARCH_IWMMXT2,FPU_ARCH_VFP}, {NULL, ARM_ARCH_NONE, ARM_ARCH_NONE} }; @@ -13433,6 +20075,7 @@ static const struct arm_option_cpu_value_table arm_extensions[] = {"maverick", ARM_FEATURE (0, ARM_CEXT_MAVERICK)}, {"xscale", ARM_FEATURE (0, ARM_CEXT_XSCALE)}, {"iwmmxt", ARM_FEATURE (0, ARM_CEXT_IWMMXT)}, + {"iwmmxt2", ARM_FEATURE (0, ARM_CEXT_IWMMXT2)}, {NULL, ARM_ARCH_NONE} }; @@ -13452,6 +20095,7 @@ static const struct arm_option_cpu_value_table arm_fpus[] = {"softvfp+vfp", FPU_ARCH_VFP_V2}, {"vfp", FPU_ARCH_VFP_V2}, {"vfp9", FPU_ARCH_VFP_V2}, + {"vfp3", FPU_ARCH_VFP_V3}, {"vfp10", FPU_ARCH_VFP_V2}, {"vfp10-r0", FPU_ARCH_VFP_V1}, {"vfpxd", FPU_ARCH_VFP_V1xD}, @@ -13460,6 +20104,7 @@ static const struct arm_option_cpu_value_table arm_fpus[] = {"arm1136jfs", FPU_ARCH_VFP_V2}, {"arm1136jf-s", FPU_ARCH_VFP_V2}, {"maverick", FPU_ARCH_MAVERICK}, + {"neon", FPU_ARCH_VFP_V3_PLUS_NEON_V1}, {NULL, ARM_ARCH_NONE} }; @@ -13855,7 +20500,13 @@ aeabi_set_public_attributes (void) ARM_MERGE_FEATURE_SETS (flags, arm_arch_used, thumb_arch_used); ARM_MERGE_FEATURE_SETS (flags, flags, *mfpu_opt); ARM_MERGE_FEATURE_SETS (flags, flags, selected_cpu); - + /*Allow the user to override the reported architecture. */ + if (object_arch) + { + ARM_CLEAR_FEATURE (flags, flags, arm_arch_any); + ARM_MERGE_FEATURE_SETS (flags, flags, *object_arch); + } + tmp = flags; arch = 0; for (p = cpu_arch_ver; p->val; p++) @@ -13881,57 +20532,56 @@ aeabi_set_public_attributes (void) for (i = 0; p[i]; i++) p[i] = TOUPPER (p[i]); } - elf32_arm_add_eabi_attr_string (stdoutput, 5, p); + bfd_elf_add_proc_attr_string (stdoutput, 5, p); } /* Tag_CPU_arch. */ - elf32_arm_add_eabi_attr_int (stdoutput, 6, arch); + bfd_elf_add_proc_attr_int (stdoutput, 6, arch); /* Tag_CPU_arch_profile. */ if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a)) - elf32_arm_add_eabi_attr_int (stdoutput, 7, 'A'); + bfd_elf_add_proc_attr_int (stdoutput, 7, 'A'); else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7r)) - elf32_arm_add_eabi_attr_int (stdoutput, 7, 'R'); + bfd_elf_add_proc_attr_int (stdoutput, 7, 'R'); else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7m)) - elf32_arm_add_eabi_attr_int (stdoutput, 7, 'M'); + bfd_elf_add_proc_attr_int (stdoutput, 7, 'M'); /* Tag_ARM_ISA_use. */ if (ARM_CPU_HAS_FEATURE (arm_arch_used, arm_arch_full)) - elf32_arm_add_eabi_attr_int (stdoutput, 8, 1); + bfd_elf_add_proc_attr_int (stdoutput, 8, 1); /* Tag_THUMB_ISA_use. */ if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_full)) - elf32_arm_add_eabi_attr_int (stdoutput, 9, + bfd_elf_add_proc_attr_int (stdoutput, 9, ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_t2) ? 2 : 1); /* Tag_VFP_arch. */ - if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_arch_vfp_v2) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_arch_vfp_v2)) - elf32_arm_add_eabi_attr_int (stdoutput, 10, 2); - else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_arch_vfp_v1) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_arch_vfp_v1)) - elf32_arm_add_eabi_attr_int (stdoutput, 10, 1); + if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v3) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v3)) + bfd_elf_add_proc_attr_int (stdoutput, 10, 3); + else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v2) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v2)) + bfd_elf_add_proc_attr_int (stdoutput, 10, 2); + else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1) + || ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1xd) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1xd)) + bfd_elf_add_proc_attr_int (stdoutput, 10, 1); /* Tag_WMMX_arch. */ if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_cext_iwmmxt) || ARM_CPU_HAS_FEATURE (arm_arch_used, arm_cext_iwmmxt)) - elf32_arm_add_eabi_attr_int (stdoutput, 11, 1); + bfd_elf_add_proc_attr_int (stdoutput, 11, 1); + /* Tag_NEON_arch. */ + if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_neon_ext_v1) + || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_neon_ext_v1)) + bfd_elf_add_proc_attr_int (stdoutput, 12, 1); } -/* Add the .ARM.attributes section. */ +/* Add the default contents for the .ARM.attributes section. */ void arm_md_end (void) { - segT s; - char *p; - addressT addr; - offsetT size; - if (EF_ARM_EABI_VERSION (meabi_flags) < EF_ARM_EABI_VER4) return; aeabi_set_public_attributes (); - size = elf32_arm_eabi_attr_size (stdoutput); - s = subseg_new (".ARM.attributes", 0); - bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA); - addr = frag_now_fix (); - p = frag_more (size); - elf32_arm_set_eabi_attr_contents (stdoutput, (bfd_byte *)p, size); } +#endif /* OBJ_ELF */ /* Parse a .cpu directive. */ @@ -14009,6 +20659,37 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED) } +/* Parse a .object_arch directive. */ + +static void +s_arm_object_arch (int ignored ATTRIBUTE_UNUSED) +{ + const struct arm_arch_option_table *opt; + char saved_char; + char *name; + + name = input_line_pointer; + while (*input_line_pointer && !ISSPACE(*input_line_pointer)) + input_line_pointer++; + saved_char = *input_line_pointer; + *input_line_pointer = 0; + + /* Skip the first "all" entry. */ + for (opt = arm_archs + 1; opt->name != NULL; opt++) + if (streq (opt->name, name)) + { + object_arch = &opt->value; + *input_line_pointer = saved_char; + demand_empty_rest_of_line (); + return; + } + + as_bad (_("unknown architecture `%s'\n"), name); + *input_line_pointer = saved_char; + ignore_rest_of_line (); +} + + /* Parse a .fpu directive. */ static void @@ -14038,5 +20719,10 @@ s_arm_fpu (int ignored ATTRIBUTE_UNUSED) *input_line_pointer = saved_char; ignore_rest_of_line (); } -#endif /* OBJ_ELF */ +/* Copy symbol information. */ +void +arm_copy_symbol_attributes (symbolS *dest, symbolS *src) +{ + ARM_GET_FLAG (dest) = ARM_GET_FLAG (src); +} diff --git a/contrib/binutils/gas/config/tc-arm.h b/contrib/binutils/gas/config/tc-arm.h index f2615770c47..d6dee9b1a9a 100644 --- a/contrib/binutils/gas/config/tc-arm.h +++ b/contrib/binutils/gas/config/tc-arm.h @@ -1,6 +1,6 @@ /* This file is tc-arm.h Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -66,6 +66,8 @@ struct fix; # if defined TE_PE # if defined TE_EPOC # define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little") +# elif defined TE_WINCE +# define TARGET_FORMAT (target_big_endian ? "pe-arm-wince-big" : "pe-arm-wince-little") # else # define TARGET_FORMAT (target_big_endian ? "pe-arm-big" : "pe-arm-little") # endif @@ -98,6 +100,7 @@ extern int arm_optimize_expr (expressionS *, operatorT, expressionS *); #ifdef OBJ_ELF #define md_end arm_md_end extern void arm_md_end (void); +bfd_boolean arm_is_eabi (void); #endif /* NOTE: The fake label creation in stabs.c:s_stab_generic() has @@ -120,12 +123,30 @@ extern void arm_md_end (void); #define ARM_IS_THUMB(s) (ARM_GET_FLAG (s) & ARM_FLAG_THUMB) #define ARM_IS_INTERWORK(s) (ARM_GET_FLAG (s) & ARM_FLAG_INTERWORK) +#ifdef OBJ_ELF + +/* For ELF objects THUMB_IS_FUNC is inferred from + ARM_IS_TUMB and the function type. */ +#define THUMB_IS_FUNC(s) \ + ((arm_is_eabi () \ + && (ARM_IS_THUMB (s)) \ + && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) \ + || (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)) + +#else #define THUMB_IS_FUNC(s) (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC) +#endif #define ARM_SET_THUMB(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_THUMB) : ARM_RESET_FLAG (s, ARM_FLAG_THUMB)) #define ARM_SET_INTERWORK(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_INTERWORK) : ARM_RESET_FLAG (s, ARM_FLAG_INTERWORK)) #define THUMB_SET_FUNC(s,t) ((t) ? ARM_SET_FLAG (s, THUMB_FLAG_FUNC) : ARM_RESET_FLAG (s, THUMB_FLAG_FUNC)) +void arm_copy_symbol_attributes (symbolS *, symbolS *); +#ifndef TC_COPY_SYMBOL_ATTRIBUTES +#define TC_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ + (arm_copy_symbol_attributes (DEST, SRC)) +#endif + #define TC_START_LABEL(C,STR) (c == ':' || (c == '/' && arm_data_in_code ())) #define tc_canonicalize_symbol_name(str) arm_canonicalize_symbol_name (str); #define obj_adjust_symtab() arm_adjust_symtab () @@ -146,7 +167,6 @@ extern void arm_md_end (void); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT32 \ || (FIX)->fx_r_type == BFD_RELOC_32 \ || TC_FORCE_RELOCATION (FIX)) @@ -175,14 +195,27 @@ extern void arm_md_end (void); goto LABEL; \ } +#define DWARF2_LINE_MIN_INSN_LENGTH 2 + +/* The lr register is r14. */ +#define DWARF2_DEFAULT_RETURN_COLUMN 14 + +/* Registers are generally saved at negative offsets to the CFA. */ +#define DWARF2_CIE_DATA_ALIGNMENT (-4) + #ifdef OBJ_ELF -# define DWARF2_LINE_MIN_INSN_LENGTH 2 # define obj_frob_symbol(sym, punt) armelf_frob_symbol ((sym), & (punt)) # define md_elf_section_change_hook() arm_elf_change_section () # define md_elf_section_type(str, len) arm_elf_section_type (str, len) # define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" # define TC_SEGMENT_INFO_TYPE struct arm_segment_info_type +/* This is not really an alignment operation, but it's something we + need to do at the same time: whenever we are figuring out the + alignment for data, we should check whether a $d symbol is + necessary. */ +# define md_cons_align(nbytes) mapping_state (MAP_DATA) + enum mstate { MAP_UNDEFINED = 0, /* Must be zero, for seginfo in new sections. */ @@ -191,6 +224,8 @@ enum mstate MAP_THUMB }; +void mapping_state (enum mstate); + struct arm_segment_info_type { enum mstate mapstate; @@ -200,12 +235,6 @@ struct arm_segment_info_type /* We want .cfi_* pseudo-ops for generating unwind info. */ #define TARGET_USE_CFIPOP 1 -/* The lr register is r14. */ -#define DWARF2_DEFAULT_RETURN_COLUMN 14 - -/* Registers are generally saved at negative offsets to the CFA. */ -#define DWARF2_CIE_DATA_ALIGNMENT -4 - /* CFI hooks. */ #define tc_regname_to_dw2regnum tc_arm_regname_to_dw2regnum #define tc_cfi_frame_initial_instructions tc_arm_frame_initial_instructions @@ -244,5 +273,14 @@ extern void arm_init_frag (struct frag *); extern void arm_handle_align (struct frag *); extern bfd_boolean arm_fix_adjustable (struct fix *); extern int arm_elf_section_type (const char *, size_t); -extern int tc_arm_regname_to_dw2regnum (const char *regname); +extern int tc_arm_regname_to_dw2regnum (char *regname); extern void tc_arm_frame_initial_instructions (void); + +#ifdef TE_PE + +#define O_secrel O_md1 + +#define TC_DWARF2_EMIT_OFFSET tc_pe_dwarf2_emit_offset +void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int); + +#endif /* TE_PE */ diff --git a/contrib/binutils/gas/config/tc-cr16.c b/contrib/binutils/gas/config/tc-cr16.c new file mode 100644 index 00000000000..2c4c6a47684 --- /dev/null +++ b/contrib/binutils/gas/config/tc-cr16.c @@ -0,0 +1,2444 @@ +/* tc-cr16.c -- Assembler code for the CR16 CPU core. + Copyright 2007 Free Software Foundation, Inc. + + Contributed by M R Swami Reddy + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "as.h" +#include "safe-ctype.h" +#include "dwarf2dbg.h" +#include "opcode/cr16.h" +#include "elf/cr16.h" + + +/* Word is considered here as a 16-bit unsigned short int. */ +#define WORD_SHIFT 16 + +/* Register is 2-byte size. */ +#define REG_SIZE 2 + +/* Maximum size of a single instruction (in words). */ +#define INSN_MAX_SIZE 3 + +/* Maximum bits which may be set in a `mask16' operand. */ +#define MAX_REGS_IN_MASK16 8 + +/* Assign a number NUM, shifted by SHIFT bytes, into a location + pointed by index BYTE of array 'output_opcode'. */ +#define CR16_PRINT(BYTE, NUM, SHIFT) output_opcode[BYTE] |= (NUM << SHIFT) + +/* Operand errors. */ +typedef enum + { + OP_LEGAL = 0, /* Legal operand. */ + OP_OUT_OF_RANGE, /* Operand not within permitted range. */ + OP_NOT_EVEN /* Operand is Odd number, should be even. */ + } +op_err; + +/* Opcode mnemonics hash table. */ +static struct hash_control *cr16_inst_hash; +/* CR16 registers hash table. */ +static struct hash_control *reg_hash; +/* CR16 register pair hash table. */ +static struct hash_control *regp_hash; +/* CR16 processor registers hash table. */ +static struct hash_control *preg_hash; +/* CR16 processor registers 32 bit hash table. */ +static struct hash_control *pregp_hash; +/* Current instruction we're assembling. */ +const inst *instruction; + + +static int code_label = 0; + +/* Global variables. */ + +/* Array to hold an instruction encoding. */ +long output_opcode[2]; + +/* Nonzero means a relocatable symbol. */ +int relocatable; + +/* A copy of the original instruction (used in error messages). */ +char ins_parse[MAX_INST_LEN]; + +/* The current processed argument number. */ +int cur_arg_num; + +/* Generic assembler global variables which must be defined by all targets. */ + +/* Characters which always start a comment. */ +const char comment_chars[] = "#"; + +/* Characters which start a comment at the beginning of a line. */ +const char line_comment_chars[] = "#"; + +/* This array holds machine specific line separator characters. */ +const char line_separator_chars[] = ";"; + +/* Chars that can be used to separate mant from exp in floating point nums. */ +const char EXP_CHARS[] = "eE"; + +/* Chars that mean this number is a floating point constant as in 0f12.456 */ +const char FLT_CHARS[] = "f'"; + +/* Target-specific multicharacter options, not const-declared at usage. */ +const char *md_shortopts = ""; +struct option md_longopts[] = +{ + {NULL, no_argument, NULL, 0} +}; +size_t md_longopts_size = sizeof (md_longopts); + +static void +l_cons (int nbytes) +{ + int c; + expressionS exp; + +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif + + if (is_it_end_of_statement ()) + { + demand_empty_rest_of_line (); + return; + } + +#ifdef TC_ADDRESS_BYTES + if (nbytes == 0) + nbytes = TC_ADDRESS_BYTES (); +#endif + +#ifdef md_cons_align + md_cons_align (nbytes); +#endif + + c = 0; + do + { + unsigned int bits_available = BITS_PER_CHAR * nbytes; + char *hold = input_line_pointer; + + expression (&exp); + + if (*input_line_pointer == ':') + { + /* Bitfields. */ + long value = 0; + + for (;;) + { + unsigned long width; + + if (*input_line_pointer != ':') + { + input_line_pointer = hold; + break; + } + if (exp.X_op == O_absent) + { + as_warn (_("using a bit field width of zero")); + exp.X_add_number = 0; + exp.X_op = O_constant; + } + + if (exp.X_op != O_constant) + { + *input_line_pointer = '\0'; + as_bad (_("field width \"%s\" too complex for a bitfield"), hold); + *input_line_pointer = ':'; + demand_empty_rest_of_line (); + return; + } + + if ((width = exp.X_add_number) > + (unsigned int)(BITS_PER_CHAR * nbytes)) + { + as_warn (_("field width %lu too big to fit in %d bytes: truncated to %d bits"), width, nbytes, (BITS_PER_CHAR * nbytes)); + width = BITS_PER_CHAR * nbytes; + } /* Too big. */ + + + if (width > bits_available) + { + /* FIXME-SOMEDAY: backing up and reparsing is wasteful. */ + input_line_pointer = hold; + exp.X_add_number = value; + break; + } + + /* Skip ':'. */ + hold = ++input_line_pointer; + + expression (&exp); + if (exp.X_op != O_constant) + { + char cache = *input_line_pointer; + + *input_line_pointer = '\0'; + as_bad (_("field value \"%s\" too complex for a bitfield"), hold); + *input_line_pointer = cache; + demand_empty_rest_of_line (); + return; + } + + value |= ((~(-1 << width) & exp.X_add_number) + << ((BITS_PER_CHAR * nbytes) - bits_available)); + + if ((bits_available -= width) == 0 + || is_it_end_of_statement () + || *input_line_pointer != ',') + break; + + hold = ++input_line_pointer; + expression (&exp); + } + + exp.X_add_number = value; + exp.X_op = O_constant; + exp.X_unsigned = 1; + } + + if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c')) + code_label = 1; + emit_expr (&exp, (unsigned int) nbytes); + ++c; + if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c')) + { + input_line_pointer +=3; + break; + } + } + while ((*input_line_pointer++ == ',')); + + /* Put terminator back into stream. */ + input_line_pointer--; + + demand_empty_rest_of_line (); +} + + +/* This table describes all the machine specific pseudo-ops + the assembler has to support. The fields are: + *** Pseudo-op name without dot. + *** Function to call to execute this pseudo-op. + *** Integer arg to pass to the function. */ + +const pseudo_typeS md_pseudo_table[] = +{ + /* In CR16 machine, align is in bytes (not a ptwo boundary). */ + {"align", s_align_bytes, 0}, + {"long", l_cons, 4 }, + {0, 0, 0} +}; + +/* CR16 relaxation table. */ +const relax_typeS md_relax_table[] = +{ + /* bCC */ + {0xfa, -0x100, 2, 1}, /* 8 */ + {0xfffe, -0x10000, 4, 2}, /* 16 */ + {0xfffffe, -0x1000000, 6, 0}, /* 24 */ +}; + +/* Return the bit size for a given operand. */ + +static int +get_opbits (operand_type op) +{ + if (op < MAX_OPRD) + return cr16_optab[op].bit_size; + + return 0; +} + +/* Return the argument type of a given operand. */ + +static argtype +get_optype (operand_type op) +{ + if (op < MAX_OPRD) + return cr16_optab[op].arg_type; + else + return nullargs; +} + +/* Return the flags of a given operand. */ + +static int +get_opflags (operand_type op) +{ + if (op < MAX_OPRD) + return cr16_optab[op].flags; + + return 0; +} + +/* Get the cc code. */ + +static int +get_cc (char *cc_name) +{ + unsigned int i; + + for (i = 0; i < cr16_num_cc; i++) + if (strcmp (cc_name, cr16_b_cond_tab[i]) == 0) + return i; + + return -1; +} + +/* Get the core processor register 'reg_name'. */ + +static reg +get_register (char *reg_name) +{ + const reg_entry *reg; + + reg = (const reg_entry *) hash_find (reg_hash, reg_name); + + if (reg != NULL) + return reg->value.reg_val; + + return nullregister; +} +/* Get the core processor register-pair 'reg_name'. */ + +static reg +get_register_pair (char *reg_name) +{ + const reg_entry *reg; + char tmp_rp[16]="\0"; + + /* Add '(' and ')' to the reg pair, if its not present. */ + if (reg_name[0] != '(') + { + tmp_rp[0] = '('; + strcat (tmp_rp, reg_name); + strcat (tmp_rp,")"); + reg = (const reg_entry *) hash_find (regp_hash, tmp_rp); + } + else + reg = (const reg_entry *) hash_find (regp_hash, reg_name); + + if (reg != NULL) + return reg->value.reg_val; + + return nullregister; +} + +/* Get the index register 'reg_name'. */ + +static reg +get_index_register (char *reg_name) +{ + const reg_entry *reg; + + reg = (const reg_entry *) hash_find (reg_hash, reg_name); + + if ((reg != NULL) + && ((reg->value.reg_val == 12) || (reg->value.reg_val == 13))) + return reg->value.reg_val; + + return nullregister; +} +/* Get the core processor index register-pair 'reg_name'. */ + +static reg +get_index_register_pair (char *reg_name) +{ + const reg_entry *reg; + + reg = (const reg_entry *) hash_find (regp_hash, reg_name); + + if (reg != NULL) + { + if ((reg->value.reg_val != 1) || (reg->value.reg_val != 7) + || (reg->value.reg_val != 9) || (reg->value.reg_val > 10)) + return reg->value.reg_val; + + as_bad (_("Unknown register pair - index relative mode: `%d'"), reg->value.reg_val); + } + + return nullregister; +} + +/* Get the processor register 'preg_name'. */ + +static preg +get_pregister (char *preg_name) +{ + const reg_entry *preg; + + preg = (const reg_entry *) hash_find (preg_hash, preg_name); + + if (preg != NULL) + return preg->value.preg_val; + + return nullpregister; +} + +/* Get the processor register 'preg_name 32 bit'. */ + +static preg +get_pregisterp (char *preg_name) +{ + const reg_entry *preg; + + preg = (const reg_entry *) hash_find (pregp_hash, preg_name); + + if (preg != NULL) + return preg->value.preg_val; + + return nullpregister; +} + + +/* Round up a section size to the appropriate boundary. */ + +valueT +md_section_align (segT seg, valueT val) +{ + /* Round .text section to a multiple of 2. */ + if (seg == text_section) + return (val + 1) & ~1; + return val; +} + +/* Parse an operand that is machine-specific (remove '*'). */ + +void +md_operand (expressionS * exp) +{ + char c = *input_line_pointer; + + switch (c) + { + case '*': + input_line_pointer++; + expression (exp); + break; + default: + break; + } +} + +/* Reset global variables before parsing a new instruction. */ + +static void +reset_vars (char *op) +{ + cur_arg_num = relocatable = 0; + memset (& output_opcode, '\0', sizeof (output_opcode)); + + /* Save a copy of the original OP (used in error messages). */ + strncpy (ins_parse, op, sizeof ins_parse - 1); + ins_parse [sizeof ins_parse - 1] = 0; +} + +/* This macro decides whether a particular reloc is an entry in a + switch table. It is used when relaxing, because the linker needs + to know about all such entries so that it can adjust them if + necessary. */ + +#define SWITCH_TABLE(fix) \ + ( (fix)->fx_addsy != NULL \ + && (fix)->fx_subsy != NULL \ + && S_GET_SEGMENT ((fix)->fx_addsy) == \ + S_GET_SEGMENT ((fix)->fx_subsy) \ + && S_GET_SEGMENT (fix->fx_addsy) != undefined_section \ + && ( (fix)->fx_r_type == BFD_RELOC_CR16_NUM8 \ + || (fix)->fx_r_type == BFD_RELOC_CR16_NUM16 \ + || (fix)->fx_r_type == BFD_RELOC_CR16_NUM32 \ + || (fix)->fx_r_type == BFD_RELOC_CR16_NUM32a)) + +/* See whether we need to force a relocation into the output file. + This is used to force out switch and PC relative relocations when + relaxing. */ + +int +cr16_force_relocation (fixS *fix) +{ + /* REVISIT: Check if the "SWITCH_TABLE (fix)" should be added + if (generic_force_reloc (fix) || SWITCH_TABLE (fix)) */ + if (generic_force_reloc (fix)) + return 1; + + return 0; +} + +/* Record a fixup for a cons expression. */ + +void +cr16_cons_fix_new (fragS *frag, int offset, int len, expressionS *exp) +{ + int rtype; + switch (len) + { + default: rtype = BFD_RELOC_NONE; break; + case 1: rtype = BFD_RELOC_CR16_NUM8 ; break; + case 2: rtype = BFD_RELOC_CR16_NUM16; break; + case 4: + if (code_label) + { + rtype = BFD_RELOC_CR16_NUM32a; + code_label = 0; + } + else + rtype = BFD_RELOC_CR16_NUM32; + break; + } + + fix_new_exp (frag, offset, len, exp, 0, rtype); +} + +/* Generate a relocation entry for a fixup. */ + +arelent * +tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS * fixP) +{ + arelent * reloc; + + reloc = xmalloc (sizeof (arelent)); + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); + reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; + reloc->addend = fixP->fx_offset; + + if (fixP->fx_subsy != NULL) + { + if (SWITCH_TABLE (fixP)) + { + /* Keep the current difference in the addend. */ + reloc->addend = (S_GET_VALUE (fixP->fx_addsy) + - S_GET_VALUE (fixP->fx_subsy) + fixP->fx_offset); + + switch (fixP->fx_r_type) + { + case BFD_RELOC_CR16_NUM8: + fixP->fx_r_type = BFD_RELOC_CR16_NUM8; + break; + case BFD_RELOC_CR16_NUM16: + fixP->fx_r_type = BFD_RELOC_CR16_NUM16; + break; + case BFD_RELOC_CR16_NUM32: + fixP->fx_r_type = BFD_RELOC_CR16_NUM32; + break; + case BFD_RELOC_CR16_NUM32a: + fixP->fx_r_type = BFD_RELOC_CR16_NUM32a; + break; + default: + abort (); + break; + } + } + else + { + /* We only resolve difference expressions in the same section. */ + as_bad_where (fixP->fx_file, fixP->fx_line, + _("can't resolve `%s' {%s section} - `%s' {%s section}"), + fixP->fx_addsy ? S_GET_NAME (fixP->fx_addsy) : "0", + segment_name (fixP->fx_addsy + ? S_GET_SEGMENT (fixP->fx_addsy) + : absolute_section), + S_GET_NAME (fixP->fx_subsy), + segment_name (S_GET_SEGMENT (fixP->fx_addsy))); + } + } + + assert ((int) fixP->fx_r_type > 0); + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); + + if (reloc->howto == NULL) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("internal error: reloc %d (`%s') not supported by object file format"), + fixP->fx_r_type, + bfd_get_reloc_code_name (fixP->fx_r_type)); + return NULL; + } + assert (!fixP->fx_pcrel == !reloc->howto->pc_relative); + + return reloc; +} + +/* Prepare machine-dependent frags for relaxation. */ + +int +md_estimate_size_before_relax (fragS *fragp, asection *seg) +{ + /* If symbol is undefined or located in a different section, + select the largest supported relocation. */ + relax_substateT subtype; + relax_substateT rlx_state[] = {0, 2}; + + for (subtype = 0; subtype < ARRAY_SIZE (rlx_state); subtype += 2) + { + if (fragp->fr_subtype == rlx_state[subtype] + && (!S_IS_DEFINED (fragp->fr_symbol) + || seg != S_GET_SEGMENT (fragp->fr_symbol))) + { + fragp->fr_subtype = rlx_state[subtype + 1]; + break; + } + } + + if (fragp->fr_subtype >= ARRAY_SIZE (md_relax_table)) + abort (); + + return md_relax_table[fragp->fr_subtype].rlx_length; +} + +void +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, fragS *fragP) +{ + /* 'opcode' points to the start of the instruction, whether + we need to change the instruction's fixed encoding. */ + bfd_reloc_code_real_type reloc = BFD_RELOC_NONE; + + subseg_change (sec, 0); + + fix_new (fragP, fragP->fr_fix, + bfd_get_reloc_size (bfd_reloc_type_lookup (stdoutput, reloc)), + fragP->fr_symbol, fragP->fr_offset, 1, reloc); + fragP->fr_var = 0; + fragP->fr_fix += md_relax_table[fragP->fr_subtype].rlx_length; +} + +/* Process machine-dependent command line options. Called once for + each option on the command line that the machine-independent part of + GAS does not understand. */ + +int +md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED) +{ + return 0; +} + +/* Machine-dependent usage-output. */ + +void +md_show_usage (FILE *stream ATTRIBUTE_UNUSED) +{ + return; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + int i; + LITTLENUM_TYPE words[4]; + char *t; + + switch (type) + { + case 'f': + prec = 2; + break; + + case 'd': + prec = 4; + break; + + default: + *sizeP = 0; + return _("bad call to md_atof"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * 2; + + if (! target_big_endian) + { + for (i = prec - 1; i >= 0; i--) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + else + { + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + + return NULL; +} + +/* Apply a fixS (fixup of an instruction or data that we didn't have + enough info to complete immediately) to the data in a frag. + Since linkrelax is nonzero and TC_LINKRELAX_FIXUP is defined to disable + relaxation of debug sections, this function is called only when + fixuping relocations of debug sections. */ + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg) +{ + valueT val = * valP; + char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; + fixP->fx_offset = 0; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_CR16_NUM8: + bfd_put_8 (stdoutput, (unsigned char) val, buf); + break; + case BFD_RELOC_CR16_NUM16: + bfd_put_16 (stdoutput, val, buf); + break; + case BFD_RELOC_CR16_NUM32: + bfd_put_32 (stdoutput, val, buf); + break; + case BFD_RELOC_CR16_NUM32a: + bfd_put_32 (stdoutput, val, buf); + break; + default: + /* We shouldn't ever get here because linkrelax is nonzero. */ + abort (); + break; + } + + fixP->fx_done = 0; + + if (fixP->fx_addsy == NULL + && fixP->fx_pcrel == 0) + fixP->fx_done = 1; + + if (fixP->fx_pcrel == 1 + && fixP->fx_addsy != NULL + && S_GET_SEGMENT (fixP->fx_addsy) == seg) + fixP->fx_done = 1; +} + +/* The location from which a PC relative jump should be calculated, + given a PC relative reloc. */ + +long +md_pcrel_from (fixS *fixp) +{ + return fixp->fx_frag->fr_address + fixp->fx_where; +} + +static void +initialise_reg_hash_table (struct hash_control ** hash_table, + const reg_entry * register_table, + const unsigned int num_entries) +{ + const reg_entry * reg; + const char *hashret; + + if ((* hash_table = hash_new ()) == NULL) + as_fatal (_("Virtual memory exhausted")); + + for (reg = register_table; + reg < (register_table + num_entries); + reg++) + { + hashret = hash_insert (* hash_table, reg->name, (char *) reg); + if (hashret) + as_fatal (_("Internal Error: Can't hash %s: %s"), + reg->name, hashret); + } +} + +/* This function is called once, at assembler startup time. This should + set up all the tables, etc that the MD part of the assembler needs. */ + +void +md_begin (void) +{ + int i = 0; + + /* Set up a hash table for the instructions. */ + if ((cr16_inst_hash = hash_new ()) == NULL) + as_fatal (_("Virtual memory exhausted")); + + while (cr16_instruction[i].mnemonic != NULL) + { + const char *hashret; + const char *mnemonic = cr16_instruction[i].mnemonic; + + hashret = hash_insert (cr16_inst_hash, mnemonic, + (char *)(cr16_instruction + i)); + + if (hashret != NULL && *hashret != '\0') + as_fatal (_("Can't hash `%s': %s\n"), cr16_instruction[i].mnemonic, + *hashret == 0 ? _("(unknown reason)") : hashret); + + /* Insert unique names into hash table. The CR16 instruction set + has many identical opcode names that have different opcodes based + on the operands. This hash table then provides a quick index to + the first opcode with a particular name in the opcode table. */ + do + { + ++i; + } + while (cr16_instruction[i].mnemonic != NULL + && streq (cr16_instruction[i].mnemonic, mnemonic)); + } + + /* Initialize reg_hash hash table. */ + initialise_reg_hash_table (& reg_hash, cr16_regtab, NUMREGS); + /* Initialize regp_hash hash table. */ + initialise_reg_hash_table (& regp_hash, cr16_regptab, NUMREGPS); + /* Initialize preg_hash hash table. */ + initialise_reg_hash_table (& preg_hash, cr16_pregtab, NUMPREGS); + /* Initialize pregp_hash hash table. */ + initialise_reg_hash_table (& pregp_hash, cr16_pregptab, NUMPREGPS); + + /* Set linkrelax here to avoid fixups in most sections. */ + linkrelax = 1; +} + +/* Process constants (immediate/absolute) + and labels (jump targets/Memory locations). */ + +static void +process_label_constant (char *str, ins * cr16_ins) +{ + char *saved_input_line_pointer; + int symbol_with_at = 0; + int symbol_with_s = 0; + int symbol_with_m = 0; + int symbol_with_l = 0; + argument *cur_arg = cr16_ins->arg + cur_arg_num; /* Current argument. */ + + saved_input_line_pointer = input_line_pointer; + input_line_pointer = str; + + expression (&cr16_ins->exp); + + switch (cr16_ins->exp.X_op) + { + case O_big: + case O_absent: + /* Missing or bad expr becomes absolute 0. */ + as_bad (_("missing or invalid displacement expression `%s' taken as 0"), + str); + cr16_ins->exp.X_op = O_constant; + cr16_ins->exp.X_add_number = 0; + cr16_ins->exp.X_add_symbol = NULL; + cr16_ins->exp.X_op_symbol = NULL; + /* Fall through. */ + + case O_constant: + cur_arg->X_op = O_constant; + cur_arg->constant = cr16_ins->exp.X_add_number; + break; + + case O_symbol: + case O_subtract: + case O_add: + cur_arg->X_op = O_symbol; + cr16_ins->rtype = BFD_RELOC_NONE; + relocatable = 1; + + if (strneq (input_line_pointer, "@c", 2)) + symbol_with_at = 1; + + if (strneq (input_line_pointer, "@l", 2) + || strneq (input_line_pointer, ":l", 2)) + symbol_with_l = 1; + + if (strneq (input_line_pointer, "@m", 2) + || strneq (input_line_pointer, ":m", 2)) + symbol_with_m = 1; + + if (strneq (input_line_pointer, "@s", 2) + || strneq (input_line_pointer, ":s", 2)) + symbol_with_s = 1; + + switch (cur_arg->type) + { + case arg_cr: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + { + if (cur_arg->size == 20) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; + else + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20a; + } + break; + + case arg_crp: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + switch (instruction->size) + { + case 1: + switch (cur_arg->size) + { + case 0: + cr16_ins->rtype = BFD_RELOC_CR16_REGREL0; + break; + case 4: + if (IS_INSN_MNEMONIC ("loadb") || IS_INSN_MNEMONIC ("storb")) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL4; + else + cr16_ins->rtype = BFD_RELOC_CR16_REGREL4a; + break; + default: break; + } + break; + case 2: + cr16_ins->rtype = BFD_RELOC_CR16_REGREL16; + break; + case 3: + if (cur_arg->size == 20) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; + else + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20a; + break; + default: + break; + } + break; + + case arg_idxr: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; + break; + + case arg_idxrp: + if (IS_INSN_TYPE (LD_STOR_INS) || IS_INSN_TYPE (CSTBIT_INS)) + switch (instruction->size) + { + case 1: cr16_ins->rtype = BFD_RELOC_CR16_REGREL0; break; + case 2: cr16_ins->rtype = BFD_RELOC_CR16_REGREL14; break; + case 3: cr16_ins->rtype = BFD_RELOC_CR16_REGREL20; break; + default: break; + } + break; + + case arg_c: + if (IS_INSN_MNEMONIC ("bal")) + cr16_ins->rtype = BFD_RELOC_CR16_DISP24; + else if (IS_INSN_TYPE (BRANCH_INS)) + { + if (symbol_with_s) + cr16_ins->rtype = BFD_RELOC_CR16_DISP8; + else if (symbol_with_m) + cr16_ins->rtype = BFD_RELOC_CR16_DISP16; + else + cr16_ins->rtype = BFD_RELOC_CR16_DISP24; + } + else if (IS_INSN_TYPE (STOR_IMM_INS) || IS_INSN_TYPE (LD_STOR_INS) + || IS_INSN_TYPE (CSTBIT_INS)) + { + if (symbol_with_s) + as_bad (_("operand %d: illegal use expression: `%s`"), cur_arg_num + 1, str); + if (symbol_with_m) + cr16_ins->rtype = BFD_RELOC_CR16_ABS20; + else /* Default to (symbol_with_l) */ + cr16_ins->rtype = BFD_RELOC_CR16_ABS24; + } + else if (IS_INSN_TYPE (BRANCH_NEQ_INS)) + cr16_ins->rtype = BFD_RELOC_CR16_DISP4; + break; + + case arg_ic: + if (IS_INSN_TYPE (ARITH_INS)) + { + if (symbol_with_s) + cr16_ins->rtype = BFD_RELOC_CR16_IMM4; + else if (symbol_with_m) + cr16_ins->rtype = BFD_RELOC_CR16_IMM20; + else if (symbol_with_at) + cr16_ins->rtype = BFD_RELOC_CR16_IMM32a; + else /* Default to (symbol_with_l) */ + cr16_ins->rtype = BFD_RELOC_CR16_IMM32; + } + else if (IS_INSN_TYPE (ARITH_BYTE_INS)) + { + cr16_ins->rtype = BFD_RELOC_CR16_IMM16; + } + break; + default: + break; + } + break; + + default: + cur_arg->X_op = cr16_ins->exp.X_op; + break; + } + + input_line_pointer = saved_input_line_pointer; + return; +} + +/* Retrieve the opcode image of a given register. + If the register is illegal for the current instruction, + issue an error. */ + +static int +getreg_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + int is_procreg = 0; /* Nonzero means argument should be processor reg. */ + + /* Check whether the register is in registers table. */ + if (r < MAX_REG) + reg = cr16_regtab + r; + else /* Register not found. */ + { + as_bad (_("Unknown register: `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register is illegal. */ +#define IMAGE_ERR \ + as_bad (_("Illegal register (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_R_REGTYPE: + if (! is_procreg) + return reg->image; + else + IMAGE_ERR; + + case CR16_P_REGTYPE: + return reg->image; + break; + + default: + IMAGE_ERR; + } + + return 0; +} + +/* Parsing different types of operands + -> constants Immediate/Absolute/Relative numbers + -> Labels Relocatable symbols + -> (reg pair base) Register pair base + -> (rbase) Register base + -> disp(rbase) Register relative + -> [rinx]disp(reg pair) Register index with reg pair mode + -> disp(rbase,ridx,scl) Register index mode. */ + +static void +set_operand (char *operand, ins * cr16_ins) +{ + char *operandS; /* Pointer to start of sub-opearand. */ + char *operandE; /* Pointer to end of sub-opearand. */ + + argument *cur_arg = &cr16_ins->arg[cur_arg_num]; /* Current argument. */ + + /* Initialize pointers. */ + operandS = operandE = operand; + + switch (cur_arg->type) + { + case arg_ic: /* Case $0x18. */ + operandS++; + case arg_c: /* Case 0x18. */ + /* Set constant. */ + process_label_constant (operandS, cr16_ins); + + if (cur_arg->type != arg_ic) + cur_arg->type = arg_c; + break; + + case arg_icr: /* Case $0x18(r1). */ + operandS++; + case arg_cr: /* Case 0x18(r1). */ + /* Set displacement constant. */ + while (*operandE != '(') + operandE++; + *operandE = '\0'; + process_label_constant (operandS, cr16_ins); + operandS = operandE; + case arg_rbase: /* Case (r1) or (r1,r0). */ + operandS++; + /* Set register base. */ + while (*operandE != ')') + operandE++; + *operandE = '\0'; + if ((cur_arg->r = get_register (operandS)) == nullregister) + as_bad (_("Illegal register `%s' in Instruction `%s'"), + operandS, ins_parse); + + /* set the arg->rp, if reg is "r12" or "r13" or "14" or "15" */ + if ((cur_arg->type != arg_rbase) + && ((getreg_image (cur_arg->r) == 12) + || (getreg_image (cur_arg->r) == 13) + || (getreg_image (cur_arg->r) == 14) + || (getreg_image (cur_arg->r) == 15))) + { + cur_arg->type = arg_crp; + cur_arg->rp = cur_arg->r; + } + break; + + case arg_crp: /* Case 0x18(r1,r0). */ + /* Set displacement constant. */ + while (*operandE != '(') + operandE++; + *operandE = '\0'; + process_label_constant (operandS, cr16_ins); + operandS = operandE; + operandS++; + /* Set register pair base. */ + while (*operandE != ')') + operandE++; + *operandE = '\0'; + if ((cur_arg->rp = get_register_pair (operandS)) == nullregister) + as_bad (_("Illegal register pair `%s' in Instruction `%s'"), + operandS, ins_parse); + break; + + case arg_idxr: + /* Set register pair base. */ + if ((strchr (operandS,'(') != NULL)) + { + while ((*operandE != '(') && (! ISSPACE (*operandE))) + operandE++; + if ((cur_arg->rp = get_index_register_pair (operandE)) == nullregister) + as_bad (_("Illegal register pair `%s' in Instruction `%s'"), + operandS, ins_parse); + *operandE++ = '\0'; + cur_arg->type = arg_idxrp; + } + else + cur_arg->rp = -1; + + operandE = operandS; + /* Set displacement constant. */ + while (*operandE != ']') + operandE++; + process_label_constant (++operandE, cr16_ins); + *operandE++ = '\0'; + operandE = operandS; + + /* Set index register . */ + operandS = strchr (operandE,'['); + if (operandS != NULL) + { /* Eliminate '[', detach from rest of operand. */ + *operandS++ = '\0'; + + operandE = strchr (operandS, ']'); + + if (operandE == NULL) + as_bad (_("unmatched '['")); + else + { /* Eliminate ']' and make sure it was the last thing + in the string. */ + *operandE = '\0'; + if (*(operandE + 1) != '\0') + as_bad (_("garbage after index spec ignored")); + } + } + + if ((cur_arg->i_r = get_index_register (operandS)) == nullregister) + as_bad (_("Illegal register `%s' in Instruction `%s'"), + operandS, ins_parse); + *operandE = '\0'; + *operandS = '\0'; + break; + + default: + break; + } +} + +/* Parse a single operand. + operand - Current operand to parse. + cr16_ins - Current assembled instruction. */ + +static void +parse_operand (char *operand, ins * cr16_ins) +{ + int ret_val; + argument *cur_arg = cr16_ins->arg + cur_arg_num; /* Current argument. */ + + /* Initialize the type to NULL before parsing. */ + cur_arg->type = nullargs; + + /* Check whether this is a condition code . */ + if ((IS_INSN_MNEMONIC ("b")) && ((ret_val = get_cc (operand)) != -1)) + { + cur_arg->type = arg_cc; + cur_arg->cc = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Check whether this is a general processor register. */ + if ((ret_val = get_register (operand)) != nullregister) + { + cur_arg->type = arg_r; + cur_arg->r = ret_val; + cur_arg->X_op = 0; + return; + } + + /* Check whether this is a general processor register pair. */ + if ((operand[0] == '(') + && ((ret_val = get_register_pair (operand)) != nullregister)) + { + cur_arg->type = arg_rp; + cur_arg->rp = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Check whether the operand is a processor register. + For "lprd" and "sprd" instruction, only 32 bit + processor registers used. */ + if (!(IS_INSN_MNEMONIC ("lprd") || (IS_INSN_MNEMONIC ("sprd"))) + && ((ret_val = get_pregister (operand)) != nullpregister)) + { + cur_arg->type = arg_pr; + cur_arg->pr = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Check whether this is a processor register - 32 bit. */ + if ((ret_val = get_pregisterp (operand)) != nullpregister) + { + cur_arg->type = arg_prp; + cur_arg->prp = ret_val; + cur_arg->X_op = O_register; + return; + } + + /* Deal with special characters. */ + switch (operand[0]) + { + case '$': + if (strchr (operand, '(') != NULL) + cur_arg->type = arg_icr; + else + cur_arg->type = arg_ic; + goto set_params; + break; + + case '(': + cur_arg->type = arg_rbase; + goto set_params; + break; + + case '[': + cur_arg->type = arg_idxr; + goto set_params; + break; + + default: + break; + } + + if (strchr (operand, '(') != NULL) + { + if (strchr (operand, ',') != NULL + && (strchr (operand, ',') > strchr (operand, '('))) + cur_arg->type = arg_crp; + else + cur_arg->type = arg_cr; + } + else + cur_arg->type = arg_c; + +/* Parse an operand according to its type. */ + set_params: + cur_arg->constant = 0; + set_operand (operand, cr16_ins); +} + +/* Parse the various operands. Each operand is then analyzed to fillup + the fields in the cr16_ins data structure. */ + +static void +parse_operands (ins * cr16_ins, char *operands) +{ + char *operandS; /* Operands string. */ + char *operandH, *operandT; /* Single operand head/tail pointers. */ + int allocated = 0; /* Indicates a new operands string was allocated.*/ + char *operand[MAX_OPERANDS];/* Separating the operands. */ + int op_num = 0; /* Current operand number we are parsing. */ + int bracket_flag = 0; /* Indicates a bracket '(' was found. */ + int sq_bracket_flag = 0; /* Indicates a square bracket '[' was found. */ + + /* Preprocess the list of registers, if necessary. */ + operandS = operandH = operandT = operands; + + while (*operandT != '\0') + { + if (*operandT == ',' && bracket_flag != 1 && sq_bracket_flag != 1) + { + *operandT++ = '\0'; + operand[op_num++] = strdup (operandH); + operandH = operandT; + continue; + } + + if (*operandT == ' ') + as_bad (_("Illegal operands (whitespace): `%s'"), ins_parse); + + if (*operandT == '(') + bracket_flag = 1; + else if (*operandT == '[') + sq_bracket_flag = 1; + + if (*operandT == ')') + { + if (bracket_flag) + bracket_flag = 0; + else + as_fatal (_("Missing matching brackets : `%s'"), ins_parse); + } + else if (*operandT == ']') + { + if (sq_bracket_flag) + sq_bracket_flag = 0; + else + as_fatal (_("Missing matching brackets : `%s'"), ins_parse); + } + + if (bracket_flag == 1 && *operandT == ')') + bracket_flag = 0; + else if (sq_bracket_flag == 1 && *operandT == ']') + sq_bracket_flag = 0; + + operandT++; + } + + /* Adding the last operand. */ + operand[op_num++] = strdup (operandH); + cr16_ins->nargs = op_num; + + /* Verifying correct syntax of operands (all brackets should be closed). */ + if (bracket_flag || sq_bracket_flag) + as_fatal (_("Missing matching brackets : `%s'"), ins_parse); + + /* Now we parse each operand separately. */ + for (op_num = 0; op_num < cr16_ins->nargs; op_num++) + { + cur_arg_num = op_num; + parse_operand (operand[op_num], cr16_ins); + free (operand[op_num]); + } + + if (allocated) + free (operandS); +} + +/* Get the trap index in dispatch table, given its name. + This routine is used by assembling the 'excp' instruction. */ + +static int +gettrap (char *s) +{ + const trap_entry *trap; + + for (trap = cr16_traps; trap < (cr16_traps + NUMTRAPS); trap++) + if (strcasecmp (trap->name, s) == 0) + return trap->entry; + + /* To make compatable with CR16 4.1 tools, the below 3-lines of + * code added. Refer: Development Tracker item #123 */ + for (trap = cr16_traps; trap < (cr16_traps + NUMTRAPS); trap++) + if (trap->entry == (unsigned int) atoi (s)) + return trap->entry; + + as_bad (_("Unknown exception: `%s'"), s); + return 0; +} + +/* Top level module where instruction parsing starts. + cr16_ins - data structure holds some information. + operands - holds the operands part of the whole instruction. */ + +static void +parse_insn (ins *insn, char *operands) +{ + int i; + + /* Handle instructions with no operands. */ + for (i = 0; cr16_no_op_insn[i] != NULL; i++) + { + if (streq (cr16_no_op_insn[i], instruction->mnemonic)) + { + insn->nargs = 0; + return; + } + } + + /* Handle 'excp' instructions. */ + if (IS_INSN_MNEMONIC ("excp")) + { + insn->nargs = 1; + insn->arg[0].type = arg_ic; + insn->arg[0].constant = gettrap (operands); + insn->arg[0].X_op = O_constant; + return; + } + + if (operands != NULL) + parse_operands (insn, operands); +} + +/* bCC instruction requires special handling. */ +static char * +get_b_cc (char * op) +{ + unsigned int i; + char op1[5]; + + for (i = 1; i < strlen (op); i++) + op1[i-1] = op[i]; + + op1[i-1] = '\0'; + + for (i = 0; i < cr16_num_cc ; i++) + if (streq (op1, cr16_b_cond_tab[i])) + return (char *) cr16_b_cond_tab[i]; + + return NULL; +} + +/* bCC instruction requires special handling. */ +static int +is_bcc_insn (char * op) +{ + if (!(streq (op, "bal") || streq (op, "beq0b") || streq (op, "bnq0b") + || streq (op, "beq0w") || streq (op, "bnq0w"))) + if ((op[0] == 'b') && (get_b_cc (op) != NULL)) + return 1; + return 0; +} + +/* Cinv instruction requires special handling. */ + +static int +check_cinv_options (char * operand) +{ + char *p = operand; + int i_used = 0, u_used = 0, d_used = 0; + + while (*++p != ']') + { + if (*p == ',' || *p == ' ') + continue; + + else if (*p == 'i') + i_used = 1; + else if (*p == 'u') + u_used = 1; + else if (*p == 'd') + d_used = 1; + else + as_bad (_("Illegal `cinv' parameter: `%c'"), *p); + } + + return 0; +} + +/* Retrieve the opcode image of a given register pair. + If the register is illegal for the current instruction, + issue an error. */ + +static int +getregp_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + + /* Check whether the register is in registers table. */ + if (r < MAX_REG) + reg = cr16_regptab + r; + /* Register not found. */ + else + { + as_bad (_("Unknown register pair: `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define RPAIR_IMAGE_ERR \ + as_bad (_("Illegal register pair (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_RP_REGTYPE: + return reg->image; + default: + RPAIR_IMAGE_ERR; + } + + return 0; +} + +/* Retrieve the opcode image of a given index register pair. + If the register is illegal for the current instruction, + issue an error. */ + +static int +getidxregp_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + + /* Check whether the register is in registers table. */ + if (r < MAX_REG) + reg = cr16_regptab + r; + /* Register not found. */ + else + { + as_bad (_("Unknown register pair: `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define IDX_RPAIR_IMAGE_ERR \ + as_bad (_("Illegal index register pair (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + + if (reg->type == CR16_RP_REGTYPE) + { + switch (reg->image) + { + case 0: return 0; break; + case 2: return 1; break; + case 4: return 2; break; + case 6: return 3; break; + case 8: return 4; break; + case 10: return 5; break; + case 3: return 6; break; + case 5: return 7; break; + default: + break; + } + } + + IDX_RPAIR_IMAGE_ERR; + return 0; +} + +/* Retrieve the opcode image of a given processort register. + If the register is illegal for the current instruction, + issue an error. */ +static int +getprocreg_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + + /* Check whether the register is in registers table. */ + if (r < MAX_PREG) + reg = &cr16_pregtab[r - MAX_REG]; + /* Register not found. */ + else + { + as_bad (_("Unknown processor register : `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define PROCREG_IMAGE_ERR \ + as_bad (_("Illegal processor register (`%s') in Instruction: `%s'"), \ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_P_REGTYPE: + return reg->image; + default: + PROCREG_IMAGE_ERR; + } + + return 0; +} + +/* Retrieve the opcode image of a given processort register. + If the register is illegal for the current instruction, + issue an error. */ +static int +getprocregp_image (reg r) +{ + const reg_entry *reg; + char *reg_name; + int pregptab_disp = 0; + + /* Check whether the register is in registers table. */ + if (r < MAX_PREG) + { + r = r - MAX_REG; + switch (r) + { + case 4: pregptab_disp = 1; break; + case 6: pregptab_disp = 2; break; + case 8: + case 9: + case 10: + pregptab_disp = 3; break; + case 12: + pregptab_disp = 4; break; + case 14: + pregptab_disp = 5; break; + default: break; + } + reg = &cr16_pregptab[r - pregptab_disp]; + } + /* Register not found. */ + else + { + as_bad (_("Unknown processor register (32 bit) : `%d'"), r); + return 0; + } + + reg_name = reg->name; + +/* Issue a error message when register pair is illegal. */ +#define PROCREGP_IMAGE_ERR \ + as_bad (_("Illegal 32 bit - processor register (`%s') in Instruction: `%s'"),\ + reg_name, ins_parse); \ + break; + + switch (reg->type) + { + case CR16_P_REGTYPE: + return reg->image; + default: + PROCREGP_IMAGE_ERR; + } + + return 0; +} + +/* Routine used to represent integer X using NBITS bits. */ + +static long +getconstant (long x, int nbits) +{ + /* The following expression avoids overflow if + 'nbits' is the number of bits in 'bfd_vma'. */ + return (x & ((((1 << (nbits - 1)) - 1) << 1) | 1)); +} + +/* Print a constant value to 'output_opcode': + ARG holds the operand's type and value. + SHIFT represents the location of the operand to be print into. + NBITS determines the size (in bits) of the constant. */ + +static void +print_constant (int nbits, int shift, argument *arg) +{ + unsigned long mask = 0; + + long constant = getconstant (arg->constant, nbits); + + switch (nbits) + { + case 32: + case 28: + /* mask the upper part of the constant, that is, the bits + going to the lowest byte of output_opcode[0]. + The upper part of output_opcode[1] is always filled, + therefore it is always masked with 0xFFFF. */ + mask = (1 << (nbits - 16)) - 1; + /* Divide the constant between two consecutive words : + 0 1 2 3 + +---------+---------+---------+---------+ + | | X X X X | x X x X | | + +---------+---------+---------+---------+ + output_opcode[0] output_opcode[1] */ + + CR16_PRINT (0, (constant >> WORD_SHIFT) & mask, 0); + CR16_PRINT (1, (constant & 0xFFFF), WORD_SHIFT); + break; + + case 21: + if ((nbits == 21) && (IS_INSN_TYPE (LD_STOR_INS))) nbits = 20; + case 24: + case 22: + case 20: + /* mask the upper part of the constant, that is, the bits + going to the lowest byte of output_opcode[0]. + The upper part of output_opcode[1] is always filled, + therefore it is always masked with 0xFFFF. */ + mask = (1 << (nbits - 16)) - 1; + /* Divide the constant between two consecutive words : + 0 1 2 3 + +---------+---------+---------+---------+ + | | X X X X | - X - X | | + +---------+---------+---------+---------+ + output_opcode[0] output_opcode[1] */ + + if ((instruction->size > 2) && (shift == WORD_SHIFT)) + { + if (arg->type == arg_idxrp) + { + CR16_PRINT (0, ((constant >> WORD_SHIFT) & mask) << 8, 0); + CR16_PRINT (1, (constant & 0xFFFF), WORD_SHIFT); + } + else + { + CR16_PRINT (0, (((((constant >> WORD_SHIFT) & mask) << 8) & 0x0f00) | ((((constant >> WORD_SHIFT) & mask) >> 4) & 0xf)),0); + CR16_PRINT (1, (constant & 0xFFFF), WORD_SHIFT); + } + } + else + CR16_PRINT (0, constant, shift); + break; + + case 14: + if (arg->type == arg_idxrp) + { + if (instruction->size == 2) + { + CR16_PRINT (0, ((constant)&0xf), shift); // 0-3 bits + CR16_PRINT (0, ((constant>>4)&0x3), (shift+20)); // 4-5 bits + CR16_PRINT (0, ((constant>>6)&0x3), (shift+14)); // 6-7 bits + CR16_PRINT (0, ((constant>>8)&0x3f), (shift+8)); // 8-13 bits + } + else + CR16_PRINT (0, constant, shift); + } + break; + + case 16: + case 12: + /* When instruction size is 3 and 'shift' is 16, a 16-bit constant is + always filling the upper part of output_opcode[1]. If we mistakenly + write it to output_opcode[0], the constant prefix (that is, 'match') + will be overriden. + 0 1 2 3 + +---------+---------+---------+---------+ + | 'match' | | X X X X | | + +---------+---------+---------+---------+ + output_opcode[0] output_opcode[1] */ + + if ((instruction->size > 2) && (shift == WORD_SHIFT)) + CR16_PRINT (1, constant, WORD_SHIFT); + else + CR16_PRINT (0, constant, shift); + break; + + case 8: + CR16_PRINT (0, ((constant/2)&0xf), shift); + CR16_PRINT (0, ((constant/2)>>4), (shift+8)); + break; + + default: + CR16_PRINT (0, constant, shift); + break; + } +} + +/* Print an operand to 'output_opcode', which later on will be + printed to the object file: + ARG holds the operand's type, size and value. + SHIFT represents the printing location of operand. + NBITS determines the size (in bits) of a constant operand. */ + +static void +print_operand (int nbits, int shift, argument *arg) +{ + switch (arg->type) + { + case arg_cc: + CR16_PRINT (0, arg->cc, shift); + break; + + case arg_r: + CR16_PRINT (0, getreg_image (arg->r), shift); + break; + + case arg_rp: + CR16_PRINT (0, getregp_image (arg->rp), shift); + break; + + case arg_pr: + CR16_PRINT (0, getprocreg_image (arg->pr), shift); + break; + + case arg_prp: + CR16_PRINT (0, getprocregp_image (arg->prp), shift); + break; + + case arg_idxrp: + /* 16 12 8 6 0 + +-----------------------------+ + | r_index | disp | rp_base | + +-----------------------------+ */ + + if (instruction->size == 3) + { + CR16_PRINT (0, getidxregp_image (arg->rp), 0); + if (getreg_image (arg->i_r) == 12) + CR16_PRINT (0, 0, 3); + else + CR16_PRINT (0, 1, 3); + } + else + { + CR16_PRINT (0, getidxregp_image (arg->rp), 16); + if (getreg_image (arg->i_r) == 12) + CR16_PRINT (0, 0, 19); + else + CR16_PRINT (0, 1, 19); + } + print_constant (nbits, shift, arg); + break; + + case arg_idxr: + if (getreg_image (arg->i_r) == 12) + if (IS_INSN_MNEMONIC ("cbitb") || IS_INSN_MNEMONIC ("sbitb") + || IS_INSN_MNEMONIC ("tbitb")) + CR16_PRINT (0, 0, 23); + else CR16_PRINT (0, 0, 24); + else + if (IS_INSN_MNEMONIC ("cbitb") || IS_INSN_MNEMONIC ("sbitb") + || IS_INSN_MNEMONIC ("tbitb")) + CR16_PRINT (0, 1, 23); + else CR16_PRINT (0, 1, 24); + + print_constant (nbits, shift, arg); + break; + + case arg_ic: + case arg_c: + print_constant (nbits, shift, arg); + break; + + case arg_rbase: + CR16_PRINT (0, getreg_image (arg->r), shift); + break; + + case arg_cr: + print_constant (nbits, shift , arg); + /* Add the register argument to the output_opcode. */ + CR16_PRINT (0, getreg_image (arg->r), (shift+16)); + break; + + case arg_crp: + print_constant (nbits, shift , arg); + if (instruction->size > 1) + CR16_PRINT (0, getregp_image (arg->rp), (shift + 16)); + else if (IS_INSN_TYPE (LD_STOR_INS) || (IS_INSN_TYPE (CSTBIT_INS))) + { + if (instruction->size == 2) + CR16_PRINT (0, getregp_image (arg->rp), (shift - 8)); + else if (instruction->size == 1) + CR16_PRINT (0, getregp_image (arg->rp), 16); + } + else + CR16_PRINT (0, getregp_image (arg->rp), shift); + break; + + default: + break; + } +} + +/* Retrieve the number of operands for the current assembled instruction. */ + +static int +get_number_of_operands (void) +{ + int i; + + for (i = 0; instruction->operands[i].op_type && i < MAX_OPERANDS; i++) + ; + return i; +} + +/* Verify that the number NUM can be represented in BITS bits (that is, + within its permitted range), based on the instruction's FLAGS. + If UPDATE is nonzero, update the value of NUM if necessary. + Return OP_LEGAL upon success, actual error type upon failure. */ + +static op_err +check_range (long *num, int bits, int unsigned flags, int update) +{ + long min, max; + int retval = OP_LEGAL; + long value = *num; + + if (bits == 0 && value > 0) return OP_OUT_OF_RANGE; + + /* For hosts witah longs bigger than 32-bits make sure that the top + bits of a 32-bit negative value read in by the parser are set, + so that the correct comparisons are made. */ + if (value & 0x80000000) + value |= (-1L << 31); + + + /* Verify operand value is even. */ + if (flags & OP_EVEN) + { + if (value % 2) + return OP_NOT_EVEN; + } + + if (flags & OP_DEC) + { + value -= 1; + if (update) + *num = value; + } + + if (flags & OP_SHIFT) + { + value >>= 1; + if (update) + *num = value; + } + else if (flags & OP_SHIFT_DEC) + { + value = (value >> 1) - 1; + if (update) + *num = value; + } + + if (flags & OP_ABS20) + { + if (value > 0xEFFFF) + return OP_OUT_OF_RANGE; + } + + if (flags & OP_ESC) + { + if (value == 0xB || value == 0x9) + return OP_OUT_OF_RANGE; + else if (value == -1) + { + if (update) + *num = 9; + return retval; + } + } + + if (flags & OP_ESC1) + { + if (value > 13) + return OP_OUT_OF_RANGE; + } + + if (flags & OP_SIGNED) + { + max = (1 << (bits - 1)) - 1; + min = - (1 << (bits - 1)); + if ((value > max) || (value < min)) + retval = OP_OUT_OF_RANGE; + } + else if (flags & OP_UNSIGNED) + { + max = ((((1 << (bits - 1)) - 1) << 1) | 1); + min = 0; + if (((unsigned long) value > (unsigned long) max) + || ((unsigned long) value < (unsigned long) min)) + retval = OP_OUT_OF_RANGE; + } + else if (flags & OP_NEG) + { + max = - 1; + min = - ((1 << (bits - 1))-1); + if ((value > max) || (value < min)) + retval = OP_OUT_OF_RANGE; + } + return retval; +} + +/* Bunch of error checkings. + The checks are made after a matching instruction was found. */ + +static void +warn_if_needed (ins *insn) +{ + /* If the post-increment address mode is used and the load/store + source register is the same as rbase, the result of the + instruction is undefined. */ + if (IS_INSN_TYPE (LD_STOR_INS_INC)) + { + /* Enough to verify that one of the arguments is a simple reg. */ + if ((insn->arg[0].type == arg_r) || (insn->arg[1].type == arg_r)) + if (insn->arg[0].r == insn->arg[1].r) + as_bad (_("Same src/dest register is used (`r%d'), result is undefined"), insn->arg[0].r); + } + + if (IS_INSN_MNEMONIC ("pop") + || IS_INSN_MNEMONIC ("push") + || IS_INSN_MNEMONIC ("popret")) + { + unsigned int count = insn->arg[0].constant, reg_val; + + /* Check if count operand caused to save/retrive the RA twice + to generate warning message. */ + if (insn->nargs > 2) + { + reg_val = getreg_image (insn->arg[1].r); + + if ( ((reg_val == 9) && (count > 7)) + || ((reg_val == 10) && (count > 6)) + || ((reg_val == 11) && (count > 5)) + || ((reg_val == 12) && (count > 4)) + || ((reg_val == 13) && (count > 2)) + || ((reg_val == 14) && (count > 0))) + as_warn (_("RA register is saved twice.")); + + /* Check if the third operand is "RA" or "ra" */ + if (!(((insn->arg[2].r) == ra) || ((insn->arg[2].r) == RA))) + as_bad (_("`%s' Illegal use of registers."), ins_parse); + } + + if (insn->nargs > 1) + { + reg_val = getreg_image (insn->arg[1].r); + + /* If register is a register pair ie r12/r13/r14 in operand1, then + the count constant should be validated. */ + if (((reg_val == 11) && (count > 7)) + || ((reg_val == 12) && (count > 6)) + || ((reg_val == 13) && (count > 4)) + || ((reg_val == 14) && (count > 2)) + || ((reg_val == 15) && (count > 0))) + as_bad (_("`%s' Illegal count-register combination."), ins_parse); + } + else + { + /* Check if the operand is "RA" or "ra" */ + if (!(((insn->arg[0].r) == ra) || ((insn->arg[0].r) == RA))) + as_bad (_("`%s' Illegal use of register."), ins_parse); + } + } + + /* Some instruction assume the stack pointer as rptr operand. + Issue an error when the register to be loaded is also SP. */ + if (instruction->flags & NO_SP) + { + if (getreg_image (insn->arg[1].r) == getreg_image (sp)) + as_bad (_("`%s' has undefined result"), ins_parse); + } + + /* If the rptr register is specified as one of the registers to be loaded, + the final contents of rptr are undefined. Thus, we issue an error. */ + if (instruction->flags & NO_RPTR) + { + if ((1 << getreg_image (insn->arg[0].r)) & insn->arg[1].constant) + as_bad (_("Same src/dest register is used (`r%d'),result is undefined"), + getreg_image (insn->arg[0].r)); + } +} + +/* In some cases, we need to adjust the instruction pointer although a + match was already found. Here, we gather all these cases. + Returns 1 if instruction pointer was adjusted, otherwise 0. */ + +static int +adjust_if_needed (ins *insn ATTRIBUTE_UNUSED) +{ + int ret_value = 0; + + if ((IS_INSN_TYPE (CSTBIT_INS)) || (IS_INSN_TYPE (LD_STOR_INS))) + { + if ((instruction->operands[0].op_type == abs24) + && ((insn->arg[0].constant) > 0xF00000)) + { + insn->arg[0].constant &= 0xFFFFF; + instruction--; + ret_value = 1; + } + } + + return ret_value; +} + +/* Assemble a single instruction: + INSN is already parsed (that is, all operand values and types are set). + For instruction to be assembled, we need to find an appropriate template in + the instruction table, meeting the following conditions: + 1: Has the same number of operands. + 2: Has the same operand types. + 3: Each operand size is sufficient to represent the instruction's values. + Returns 1 upon success, 0 upon failure. */ + +static int +assemble_insn (char *mnemonic, ins *insn) +{ + /* Type of each operand in the current template. */ + argtype cur_type[MAX_OPERANDS]; + /* Size (in bits) of each operand in the current template. */ + unsigned int cur_size[MAX_OPERANDS]; + /* Flags of each operand in the current template. */ + unsigned int cur_flags[MAX_OPERANDS]; + /* Instruction type to match. */ + unsigned int ins_type; + /* Boolean flag to mark whether a match was found. */ + int match = 0; + int i; + /* Nonzero if an instruction with same number of operands was found. */ + int found_same_number_of_operands = 0; + /* Nonzero if an instruction with same argument types was found. */ + int found_same_argument_types = 0; + /* Nonzero if a constant was found within the required range. */ + int found_const_within_range = 0; + /* Argument number of an operand with invalid type. */ + int invalid_optype = -1; + /* Argument number of an operand with invalid constant value. */ + int invalid_const = -1; + /* Operand error (used for issuing various constant error messages). */ + op_err op_error, const_err = OP_LEGAL; + +/* Retrieve data (based on FUNC) for each operand of a given instruction. */ +#define GET_CURRENT_DATA(FUNC, ARRAY) \ + for (i = 0; i < insn->nargs; i++) \ + ARRAY[i] = FUNC (instruction->operands[i].op_type) + +#define GET_CURRENT_TYPE GET_CURRENT_DATA (get_optype, cur_type) +#define GET_CURRENT_SIZE GET_CURRENT_DATA (get_opbits, cur_size) +#define GET_CURRENT_FLAGS GET_CURRENT_DATA (get_opflags, cur_flags) + + /* Instruction has no operands -> only copy the constant opcode. */ + if (insn->nargs == 0) + { + output_opcode[0] = BIN (instruction->match, instruction->match_bits); + return 1; + } + + /* In some case, same mnemonic can appear with different instruction types. + For example, 'storb' is supported with 3 different types : + LD_STOR_INS, LD_STOR_INS_INC, STOR_IMM_INS. + We assume that when reaching this point, the instruction type was + pre-determined. We need to make sure that the type stays the same + during a search for matching instruction. */ + ins_type = CR16_INS_TYPE (instruction->flags); + + while (/* Check that match is still not found. */ + match != 1 + /* Check we didn't get to end of table. */ + && instruction->mnemonic != NULL + /* Check that the actual mnemonic is still available. */ + && IS_INSN_MNEMONIC (mnemonic) + /* Check that the instruction type wasn't changed. */ + && IS_INSN_TYPE (ins_type)) + { + /* Check whether number of arguments is legal. */ + if (get_number_of_operands () != insn->nargs) + goto next_insn; + found_same_number_of_operands = 1; + + /* Initialize arrays with data of each operand in current template. */ + GET_CURRENT_TYPE; + GET_CURRENT_SIZE; + GET_CURRENT_FLAGS; + + /* Check for type compatibility. */ + for (i = 0; i < insn->nargs; i++) + { + if (cur_type[i] != insn->arg[i].type) + { + if (invalid_optype == -1) + invalid_optype = i + 1; + goto next_insn; + } + } + found_same_argument_types = 1; + + for (i = 0; i < insn->nargs; i++) + { + /* If 'bal' instruction size is '2' and reg operand is not 'ra' + then goto next instruction. */ + if (IS_INSN_MNEMONIC ("bal") && (i == 0) + && (instruction->size == 2) && (insn->arg[i].rp != 14)) + goto next_insn; + + /* If 'storb' instruction with 'sp' reg and 16-bit disp of + * reg-pair, leads to undifined trap, so this should use + * 20-bit disp of reg-pair. */ + if (IS_INSN_MNEMONIC ("storb") && (instruction->size == 2) + && (insn->arg[i].r == 15) && (insn->arg[i + 1].type == arg_crp)) + goto next_insn; + + /* Only check range - don't update the constant's value, since the + current instruction may not be the last we try to match. + The constant's value will be updated later, right before printing + it to the object file. */ + if ((insn->arg[i].X_op == O_constant) + && (op_error = check_range (&insn->arg[i].constant, cur_size[i], + cur_flags[i], 0))) + { + if (invalid_const == -1) + { + invalid_const = i + 1; + const_err = op_error; + } + goto next_insn; + } + /* For symbols, we make sure the relocation size (which was already + determined) is sufficient. */ + else if ((insn->arg[i].X_op == O_symbol) + && ((bfd_reloc_type_lookup (stdoutput, insn->rtype))->bitsize + > cur_size[i])) + goto next_insn; + } + found_const_within_range = 1; + + /* If we got till here -> Full match is found. */ + match = 1; + break; + +/* Try again with next instruction. */ +next_insn: + instruction++; + } + + if (!match) + { + /* We haven't found a match - instruction can't be assembled. */ + if (!found_same_number_of_operands) + as_bad (_("Incorrect number of operands")); + else if (!found_same_argument_types) + as_bad (_("Illegal type of operand (arg %d)"), invalid_optype); + else if (!found_const_within_range) + { + switch (const_err) + { + case OP_OUT_OF_RANGE: + as_bad (_("Operand out of range (arg %d)"), invalid_const); + break; + case OP_NOT_EVEN: + as_bad (_("Operand has odd displacement (arg %d)"), invalid_const); + break; + default: + as_bad (_("Illegal operand (arg %d)"), invalid_const); + break; + } + } + + return 0; + } + else + /* Full match - print the encoding to output file. */ + { + /* Make further checkings (such that couldn't be made earlier). + Warn the user if necessary. */ + warn_if_needed (insn); + + /* Check whether we need to adjust the instruction pointer. */ + if (adjust_if_needed (insn)) + /* If instruction pointer was adjusted, we need to update + the size of the current template operands. */ + GET_CURRENT_SIZE; + + for (i = 0; i < insn->nargs; i++) + { + int j = instruction->flags & REVERSE_MATCH ? + i == 0 ? 1 : + i == 1 ? 0 : i : + i; + + /* This time, update constant value before printing it. */ + if ((insn->arg[j].X_op == O_constant) + && (check_range (&insn->arg[j].constant, cur_size[j], + cur_flags[j], 1) != OP_LEGAL)) + as_fatal (_("Illegal operand (arg %d)"), j+1); + } + + /* First, copy the instruction's opcode. */ + output_opcode[0] = BIN (instruction->match, instruction->match_bits); + + for (i = 0; i < insn->nargs; i++) + { + /* For BAL (ra),disp17 instuction only. And also set the + DISP24a relocation type. */ + if (IS_INSN_MNEMONIC ("bal") && (instruction->size == 2) && i == 0) + { + insn->rtype = BFD_RELOC_CR16_DISP24a; + continue; + } + cur_arg_num = i; + print_operand (cur_size[i], instruction->operands[i].shift, + &insn->arg[i]); + } + } + + return 1; +} + +/* Print the instruction. + Handle also cases where the instruction is relaxable/relocatable. */ + +static void +print_insn (ins *insn) +{ + unsigned int i, j, insn_size; + char *this_frag; + unsigned short words[4]; + int addr_mod; + + /* Arrange the insn encodings in a WORD size array. */ + for (i = 0, j = 0; i < 2; i++) + { + words[j++] = (output_opcode[i] >> 16) & 0xFFFF; + words[j++] = output_opcode[i] & 0xFFFF; + } + + insn_size = instruction->size; + this_frag = frag_more (insn_size * 2); + + /* Handle relocation. */ + if ((relocatable) && (insn->rtype != BFD_RELOC_NONE)) + { + reloc_howto_type *reloc_howto; + int size; + + reloc_howto = bfd_reloc_type_lookup (stdoutput, insn->rtype); + + if (!reloc_howto) + abort (); + + size = bfd_get_reloc_size (reloc_howto); + + if (size < 1 || size > 4) + abort (); + + fix_new_exp (frag_now, this_frag - frag_now->fr_literal, + size, &insn->exp, reloc_howto->pc_relative, + insn->rtype); + } + + /* Verify a 2-byte code alignment. */ + addr_mod = frag_now_fix () & 1; + if (frag_now->has_code && frag_now->insn_addr != addr_mod) + as_bad (_("instruction address is not a multiple of 2")); + frag_now->insn_addr = addr_mod; + frag_now->has_code = 1; + + /* Write the instruction encoding to frag. */ + for (i = 0; i < insn_size; i++) + { + md_number_to_chars (this_frag, (valueT) words[i], 2); + this_frag += 2; + } +} + +/* This is the guts of the machine-dependent assembler. OP points to a + machine dependent instruction. This function is supposed to emit + the frags/bytes it assembles to. */ + +void +md_assemble (char *op) +{ + ins cr16_ins; + char *param, param1[32]; + char c; + + /* Reset global variables for a new instruction. */ + reset_vars (op); + + /* Strip the mnemonic. */ + for (param = op; *param != 0 && !ISSPACE (*param); param++) + ; + c = *param; + *param++ = '\0'; + + /* bCC instuctions and adjust the mnemonic by adding extra white spaces. */ + if (is_bcc_insn (op)) + { + strcpy (param1, get_b_cc (op)); + op = "b"; + strcat (param1,","); + strcat (param1, param); + param = (char *) ¶m1; + } + + /* Checking the cinv options and adjust the mnemonic by removing the + extra white spaces. */ + if (streq ("cinv", op)) + { + /* Validate the cinv options. */ + check_cinv_options (param); + strcat (op, param); + } + + /* MAPPING - SHIFT INSN, if imm4/imm16 positive values + lsh[b/w] imm4/imm6, reg ==> ashu[b/w] imm4/imm16, reg + as CR16 core doesn't support lsh[b/w] right shift operaions. */ + if ((streq ("lshb", op) || streq ("lshw", op) || streq ("lshd", op)) + && (param [0] == '$')) + { + strcpy (param1, param); + /* Find the instruction. */ + instruction = (const inst *) hash_find (cr16_inst_hash, op); + parse_operands (&cr16_ins, param1); + if (((&cr16_ins)->arg[0].type == arg_ic) + && ((&cr16_ins)->arg[0].constant >= 0)) + { + if (streq ("lshb", op)) + op = "ashub"; + else if (streq ("lshd", op)) + op = "ashud"; + else + op = "ashuw"; + } + } + + /* Find the instruction. */ + instruction = (const inst *) hash_find (cr16_inst_hash, op); + if (instruction == NULL) + { + as_bad (_("Unknown opcode: `%s'"), op); + return; + } + + /* Tie dwarf2 debug info to the address at the start of the insn. */ + dwarf2_emit_insn (0); + + /* Parse the instruction's operands. */ + parse_insn (&cr16_ins, param); + + /* Assemble the instruction - return upon failure. */ + if (assemble_insn (op, &cr16_ins) == 0) + return; + + /* Print the instruction. */ + print_insn (&cr16_ins); +} diff --git a/contrib/binutils/gas/config/tc-cr16.h b/contrib/binutils/gas/config/tc-cr16.h new file mode 100644 index 00000000000..6d06151eb16 --- /dev/null +++ b/contrib/binutils/gas/config/tc-cr16.h @@ -0,0 +1,73 @@ +/* tc-cr16.h -- Header file for tc-cr16.c, the CR16 GAS port. + Copyright 2007 Free Software Foundation, Inc. + + Contributed by M R Swami Reddy + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef TC_CR16_H +#define TC_CR16_H + +#define TC_CR16 1 + +#define TARGET_BYTES_BIG_ENDIAN 0 + +#define TARGET_FORMAT "elf32-cr16" +#define TARGET_ARCH bfd_arch_cr16 + +#define WORKING_DOT_WORD +#define LOCAL_LABEL_PREFIX '.' + +#define md_undefined_symbol(s) 0 +#define md_number_to_chars number_to_chars_littleendian + +/* We do relaxing in the assembler as well as the linker. */ +extern const struct relax_type md_relax_table[]; +#define TC_GENERIC_RELAX_TABLE md_relax_table + +/* We do not want to adjust any relocations to make implementation of + linker relaxations easier. */ +#define tc_fix_adjustable(fixP) 0 + +/* We need to force out some relocations when relaxing. */ +#define TC_FORCE_RELOCATION(FIXP) cr16_force_relocation (FIXP) +extern int cr16_force_relocation (struct fix *); + +/* Fixup debug sections since we will never relax them. */ +#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC) + +/* CR16 instructions, with operands included, are a multiple + of two bytes long. */ +#define DWARF2_LINE_MIN_INSN_LENGTH 2 + +extern void cr16_cons_fix_new (struct frag *, int, int, struct expressionS *); +/* This is called by emit_expr when creating a reloc for a cons. + We could use the definition there, except that we want to handle + the CR16 reloc type specially, rather than the BFD_RELOC type. */ +#define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP) \ + cr16_cons_fix_new (FRAG, OFF, LEN, EXP) + +/* Give an error if a frag containing code is not aligned to a 2-byte + boundary. */ +#define md_frag_check(FRAGP) \ + if ((FRAGP)->has_code \ + && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0) \ + as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line, \ + _("instruction address is not a multiple of 2")); + +#endif /* TC_CR16_H */ diff --git a/contrib/binutils/gas/config/tc-i386.c b/contrib/binutils/gas/config/tc-i386.c index be384bc99a7..296fdcdde41 100644 --- a/contrib/binutils/gas/config/tc-i386.c +++ b/contrib/binutils/gas/config/tc-i386.c @@ -1,6 +1,6 @@ -/* i386.c -- Assemble code for the Intel 80386 +/* tc-i386.c -- Assemble code for the Intel 80386 Copyright 1989, 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 GAS, the GNU Assembler. @@ -32,7 +32,6 @@ #include "subsegs.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" -#include "opcode/i386.h" #include "elf/x86-64.h" #ifndef REGISTER_WARNINGS @@ -63,54 +62,39 @@ #endif #endif -static INLINE unsigned int mode_from_disp_size PARAMS ((unsigned int)); -static INLINE int fits_in_signed_byte PARAMS ((offsetT)); -static INLINE int fits_in_unsigned_byte PARAMS ((offsetT)); -static INLINE int fits_in_unsigned_word PARAMS ((offsetT)); -static INLINE int fits_in_signed_word PARAMS ((offsetT)); -static INLINE int fits_in_unsigned_long PARAMS ((offsetT)); -static INLINE int fits_in_signed_long PARAMS ((offsetT)); -static int smallest_imm_type PARAMS ((offsetT)); -static offsetT offset_in_range PARAMS ((offsetT, int)); -static int add_prefix PARAMS ((unsigned int)); -static void set_code_flag PARAMS ((int)); -static void set_16bit_gcc_code_flag PARAMS ((int)); -static void set_intel_syntax PARAMS ((int)); -static void set_cpu_arch PARAMS ((int)); +static void set_code_flag (int); +static void set_16bit_gcc_code_flag (int); +static void set_intel_syntax (int); +static void set_cpu_arch (int); #ifdef TE_PE -static void pe_directive_secrel PARAMS ((int)); +static void pe_directive_secrel (int); #endif -static void signed_cons PARAMS ((int)); -static char *output_invalid PARAMS ((int c)); -static int i386_operand PARAMS ((char *operand_string)); -static int i386_intel_operand PARAMS ((char *operand_string, int got_a_float)); -static const reg_entry *parse_register PARAMS ((char *reg_string, - char **end_op)); -static char *parse_insn PARAMS ((char *, char *)); -static char *parse_operands PARAMS ((char *, const char *)); -static void swap_operands PARAMS ((void)); -static void optimize_imm PARAMS ((void)); -static void optimize_disp PARAMS ((void)); -static int match_template PARAMS ((void)); -static int check_string PARAMS ((void)); -static int process_suffix PARAMS ((void)); -static int check_byte_reg PARAMS ((void)); -static int check_long_reg PARAMS ((void)); -static int check_qword_reg PARAMS ((void)); -static int check_word_reg PARAMS ((void)); -static int finalize_imm PARAMS ((void)); -static int process_operands PARAMS ((void)); -static const seg_entry *build_modrm_byte PARAMS ((void)); -static void output_insn PARAMS ((void)); -static void output_branch PARAMS ((void)); -static void output_jump PARAMS ((void)); -static void output_interseg_jump PARAMS ((void)); -static void output_imm PARAMS ((fragS *insn_start_frag, - offsetT insn_start_off)); -static void output_disp PARAMS ((fragS *insn_start_frag, - offsetT insn_start_off)); +static void signed_cons (int); +static char *output_invalid (int c); +static int i386_operand (char *); +static int i386_intel_operand (char *, int); +static const reg_entry *parse_register (char *, char **); +static char *parse_insn (char *, char *); +static char *parse_operands (char *, const char *); +static void swap_operands (void); +static void swap_2_operands (int, int); +static void optimize_imm (void); +static void optimize_disp (void); +static int match_template (void); +static int check_string (void); +static int process_suffix (void); +static int check_byte_reg (void); +static int check_long_reg (void); +static int check_qword_reg (void); +static int check_word_reg (void); +static int finalize_imm (void); +static int process_operands (void); +static const seg_entry *build_modrm_byte (void); +static void output_insn (void); +static void output_imm (fragS *, offsetT); +static void output_disp (fragS *, offsetT); #ifndef I386COFF -static void s_bss PARAMS ((int)); +static void s_bss (int); #endif #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) static void handle_large_common (int small ATTRIBUTE_UNUSED); @@ -271,8 +255,9 @@ static i386_insn i; /* Possible templates for current insn. */ static const templates *current_templates; -/* Per instruction expressionS buffers: 2 displacements & 2 immediate max. */ -static expressionS disp_expressions[2], im_expressions[2]; +/* Per instruction expressionS buffers: max displacements & immediates. */ +static expressionS disp_expressions[MAX_MEMORY_OPERANDS]; +static expressionS im_expressions[MAX_IMMEDIATE_OPERANDS]; /* Current operand we are working on. */ static int this_operand; @@ -305,6 +290,9 @@ static int intel_syntax = 0; /* 1 if register prefix % not required. */ static int allow_naked_reg = 0; +/* Register prefix used for error message. */ +static const char *register_prefix = "%"; + /* Used in 16 bit gcc mode to add an l suffix to call, ret, enter, leave, push, and pop instructions so that gcc has the same stack frame as in 32 bit mode. */ @@ -323,6 +311,21 @@ static const char *cpu_sub_arch_name = NULL; /* CPU feature flags. */ static unsigned int cpu_arch_flags = CpuUnknownFlags | CpuNo64; +/* If we have selected a cpu we are generating instructions for. */ +static int cpu_arch_tune_set = 0; + +/* Cpu we are generating instructions for. */ +static enum processor_type cpu_arch_tune = PROCESSOR_UNKNOWN; + +/* CPU feature flags of cpu we are generating instructions for. */ +static unsigned int cpu_arch_tune_flags = 0; + +/* CPU instruction set architecture used. */ +static enum processor_type cpu_arch_isa = PROCESSOR_UNKNOWN; + +/* CPU feature flags of instruction set architecture used. */ +static unsigned int cpu_arch_isa_flags = 0; + /* If set, conditional jumps are not automatically promoted to handle larger than a byte offset. */ static unsigned int no_cond_jump_promotion = 0; @@ -415,35 +418,106 @@ const relax_typeS md_relax_table[] = {0, 0, 4, 0} }; -static const arch_entry cpu_arch[] = { - {"i8086", Cpu086 }, - {"i186", Cpu086|Cpu186 }, - {"i286", Cpu086|Cpu186|Cpu286 }, - {"i386", Cpu086|Cpu186|Cpu286|Cpu386 }, - {"i486", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486 }, - {"i586", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586 }, - {"i686", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 }, - {"pentium", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586 }, - {"pentiumpro",Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 }, - {"pentiumii", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX }, - {"pentiumiii",Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX|CpuMMX2|CpuSSE }, - {"pentium4", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2 }, - {"prescott", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuPNI }, - {"k6", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX }, - {"k6_2", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX|Cpu3dnow }, - {"athlon", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuAthlon|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA }, - {"sledgehammer",Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuAthlon|CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2 }, - {"opteron", Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuAthlon|CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2 }, - {".mmx", CpuMMX }, - {".sse", CpuMMX|CpuMMX2|CpuSSE }, - {".sse2", CpuMMX|CpuMMX2|CpuSSE|CpuSSE2 }, - {".sse3", CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3 }, - {".3dnow", CpuMMX|Cpu3dnow }, - {".3dnowa", CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA }, - {".padlock", CpuPadLock }, - {".pacifica", CpuSVME }, - {".svme", CpuSVME }, - {NULL, 0 } +static const arch_entry cpu_arch[] = +{ + {"generic32", PROCESSOR_GENERIC32, + Cpu186|Cpu286|Cpu386}, + {"generic64", PROCESSOR_GENERIC64, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2}, + {"i8086", PROCESSOR_UNKNOWN, + 0}, + {"i186", PROCESSOR_UNKNOWN, + Cpu186}, + {"i286", PROCESSOR_UNKNOWN, + Cpu186|Cpu286}, + {"i386", PROCESSOR_GENERIC32, + Cpu186|Cpu286|Cpu386}, + {"i486", PROCESSOR_I486, + Cpu186|Cpu286|Cpu386|Cpu486}, + {"i586", PROCESSOR_PENTIUM, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586}, + {"i686", PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686}, + {"pentium", PROCESSOR_PENTIUM, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586}, + {"pentiumpro",PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686}, + {"pentiumii", PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX}, + {"pentiumiii",PROCESSOR_PENTIUMPRO, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuMMX|CpuMMX2|CpuSSE}, + {"pentium4", PROCESSOR_PENTIUM4, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2}, + {"prescott", PROCESSOR_NOCONA, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"nocona", PROCESSOR_NOCONA, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"yonah", PROCESSOR_CORE, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"core", PROCESSOR_CORE, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {"merom", PROCESSOR_CORE2, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3}, + {"core2", PROCESSOR_CORE2, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuMMX + |CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3}, + {"k6", PROCESSOR_K6, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX}, + {"k6_2", PROCESSOR_K6, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuK6|CpuMMX|Cpu3dnow}, + {"athlon", PROCESSOR_ATHLON, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA}, + {"sledgehammer", PROCESSOR_K8, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2}, + {"opteron", PROCESSOR_K8, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2}, + {"k8", PROCESSOR_K8, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6 + |CpuSledgehammer|CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2}, + {"amdfam10", PROCESSOR_AMDFAM10, + Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuK6|CpuSledgehammer + |CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a + |CpuABM}, + {".mmx", PROCESSOR_UNKNOWN, + CpuMMX}, + {".sse", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE}, + {".sse2", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2}, + {".sse3", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3}, + {".ssse3", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3}, + {".sse4.1", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1}, + {".sse4.2", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4}, + {".sse4", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4}, + {".3dnow", PROCESSOR_UNKNOWN, + CpuMMX|Cpu3dnow}, + {".3dnowa", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|Cpu3dnow|Cpu3dnowA}, + {".padlock", PROCESSOR_UNKNOWN, + CpuPadLock}, + {".pacifica", PROCESSOR_UNKNOWN, + CpuSVME}, + {".svme", PROCESSOR_UNKNOWN, + CpuSVME}, + {".sse4a", PROCESSOR_UNKNOWN, + CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a}, + {".abm", PROCESSOR_UNKNOWN, + CpuABM} }; const pseudo_typeS md_pseudo_table[] = @@ -473,7 +547,7 @@ const pseudo_typeS md_pseudo_table[] = #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) {"largecomm", handle_large_common, 0}, #else - {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0}, + {"file", (void (*) (int)) dwarf2_directive_file, 0}, {"loc", dwarf2_directive_loc, 0}, {"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0}, #endif @@ -493,9 +567,7 @@ static struct hash_control *op_hash; static struct hash_control *reg_hash; void -i386_align_code (fragP, count) - fragS *fragP; - int count; +i386_align_code (fragS *fragP, int count) { /* Various efficient no-op patterns for aligning code labels. Note: Don't try to assemble the instructions in the comments. @@ -503,7 +575,7 @@ i386_align_code (fragP, count) static const char f32_1[] = {0x90}; /* nop */ static const char f32_2[] = - {0x89,0xf6}; /* movl %esi,%esi */ + {0x66,0x90}; /* xchg %ax,%ax */ static const char f32_3[] = {0x8d,0x76,0x00}; /* leal 0(%esi),%esi */ static const char f32_4[] = @@ -563,13 +635,141 @@ i386_align_code (fragP, count) f32_1, f32_2, f16_3, f16_4, f16_5, f16_6, f16_7, f16_8, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15 }; + /* nopl (%[re]ax) */ + static const char alt_3[] = + {0x0f,0x1f,0x00}; + /* nopl 0(%[re]ax) */ + static const char alt_4[] = + {0x0f,0x1f,0x40,0x00}; + /* nopl 0(%[re]ax,%[re]ax,1) */ + static const char alt_5[] = + {0x0f,0x1f,0x44,0x00,0x00}; + /* nopw 0(%[re]ax,%[re]ax,1) */ + static const char alt_6[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00}; + /* nopl 0L(%[re]ax) */ + static const char alt_7[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; + /* nopl 0L(%[re]ax,%[re]ax,1) */ + static const char alt_8[] = + {0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* nopw 0L(%[re]ax,%[re]ax,1) */ + static const char alt_9[] = + {0x66,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_10[] = + {0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_11[] = + {0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_12[] = + {0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_13[] = + {0x66, + 0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_14[] = + {0x66, + 0x66, + 0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* data16 + data16 + data16 + data16 + data16 + nopw %cs:0L(%[re]ax,%[re]ax,1) */ + static const char alt_long_15[] = + {0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + /* nopl 0(%[re]ax,%[re]ax,1) + nopw 0(%[re]ax,%[re]ax,1) */ + static const char alt_short_11[] = + {0x0f,0x1f,0x44,0x00,0x00, + 0x66,0x0f,0x1f,0x44,0x00,0x00}; + /* nopw 0(%[re]ax,%[re]ax,1) + nopw 0(%[re]ax,%[re]ax,1) */ + static const char alt_short_12[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00, + 0x66,0x0f,0x1f,0x44,0x00,0x00}; + /* nopw 0(%[re]ax,%[re]ax,1) + nopl 0L(%[re]ax) */ + static const char alt_short_13[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00, + 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; + /* nopl 0L(%[re]ax) + nopl 0L(%[re]ax) */ + static const char alt_short_14[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00, + 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; + /* nopl 0L(%[re]ax) + nopl 0L(%[re]ax,%[re]ax,1) */ + static const char alt_short_15[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00, + 0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; + static const char *const alt_short_patt[] = { + f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, + alt_9, alt_10, alt_short_11, alt_short_12, alt_short_13, + alt_short_14, alt_short_15 + }; + static const char *const alt_long_patt[] = { + f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, + alt_9, alt_10, alt_long_11, alt_long_12, alt_long_13, + alt_long_14, alt_long_15 + }; if (count <= 0 || count > 15) return; - /* The recommended way to pad 64bit code is to use NOPs preceded by - maximally four 0x66 prefixes. Balance the size of nops. */ - if (flag_code == CODE_64BIT) + /* We need to decide which NOP sequence to use for 32bit and + 64bit. When -mtune= is used: + + 1. For PROCESSOR_I486, PROCESSOR_PENTIUM and PROCESSOR_GENERIC32, + f32_patt will be used. + 2. For PROCESSOR_K8 and PROCESSOR_AMDFAM10 in 64bit, NOPs with + 0x66 prefix will be used. + 3. For PROCESSOR_CORE2, alt_long_patt will be used. + 4. For PROCESSOR_PENTIUMPRO, PROCESSOR_PENTIUM4, PROCESSOR_NOCONA, + PROCESSOR_CORE, PROCESSOR_CORE2, PROCESSOR_K6, PROCESSOR_ATHLON + and PROCESSOR_GENERIC64, alt_short_patt will be used. + + When -mtune= isn't used, alt_short_patt will be used if + cpu_arch_isa_flags has Cpu686. Otherwise, f32_patt will be used. + + When -march= or .arch is used, we can't use anything beyond + cpu_arch_isa_flags. */ + + if (flag_code == CODE_16BIT) + { + memcpy (fragP->fr_literal + fragP->fr_fix, + f16_patt[count - 1], count); + if (count > 8) + /* Adjust jump offset. */ + fragP->fr_literal[fragP->fr_fix + 1] = count - 2; + } + else if (flag_code == CODE_64BIT && cpu_arch_tune == PROCESSOR_K8) { int i; int nnops = (count + 3) / 4; @@ -577,6 +777,8 @@ i386_align_code (fragP, count) int remains = count - nnops * len; int pos = 0; + /* The recommended way to pad 64bit code is to use NOPs preceded + by maximally four 0x66 prefixes. Balance the size of nops. */ for (i = 0; i < remains; i++) { memset (fragP->fr_literal + fragP->fr_fix + pos, 0x66, len); @@ -591,57 +793,121 @@ i386_align_code (fragP, count) } } else - if (flag_code == CODE_16BIT) - { - memcpy (fragP->fr_literal + fragP->fr_fix, - f16_patt[count - 1], count); - if (count > 8) - /* Adjust jump offset. */ - fragP->fr_literal[fragP->fr_fix + 1] = count - 2; - } - else + { + const char *const *patt = NULL; + + if (cpu_arch_isa == PROCESSOR_UNKNOWN) + { + /* PROCESSOR_UNKNOWN means that all ISAs may be used. */ + switch (cpu_arch_tune) + { + case PROCESSOR_UNKNOWN: + /* We use cpu_arch_isa_flags to check if we SHOULD + optimize for Cpu686. */ + if ((cpu_arch_isa_flags & Cpu686) != 0) + patt = alt_short_patt; + else + patt = f32_patt; + break; + case PROCESSOR_CORE2: + patt = alt_long_patt; + break; + case PROCESSOR_PENTIUMPRO: + case PROCESSOR_PENTIUM4: + case PROCESSOR_NOCONA: + case PROCESSOR_CORE: + case PROCESSOR_K6: + case PROCESSOR_ATHLON: + case PROCESSOR_K8: + case PROCESSOR_GENERIC64: + case PROCESSOR_AMDFAM10: + patt = alt_short_patt; + break; + case PROCESSOR_I486: + case PROCESSOR_PENTIUM: + case PROCESSOR_GENERIC32: + patt = f32_patt; + break; + } + } + else + { + switch (cpu_arch_tune) + { + case PROCESSOR_UNKNOWN: + /* When cpu_arch_isa is net, cpu_arch_tune shouldn't be + PROCESSOR_UNKNOWN. */ + abort (); + break; + + case PROCESSOR_I486: + case PROCESSOR_PENTIUM: + case PROCESSOR_PENTIUMPRO: + case PROCESSOR_PENTIUM4: + case PROCESSOR_NOCONA: + case PROCESSOR_CORE: + case PROCESSOR_K6: + case PROCESSOR_ATHLON: + case PROCESSOR_K8: + case PROCESSOR_AMDFAM10: + case PROCESSOR_GENERIC32: + /* We use cpu_arch_isa_flags to check if we CAN optimize + for Cpu686. */ + if ((cpu_arch_isa_flags & Cpu686) != 0) + patt = alt_short_patt; + else + patt = f32_patt; + break; + case PROCESSOR_CORE2: + if ((cpu_arch_isa_flags & Cpu686) != 0) + patt = alt_long_patt; + else + patt = f32_patt; + break; + case PROCESSOR_GENERIC64: + patt = alt_short_patt; + break; + } + } + memcpy (fragP->fr_literal + fragP->fr_fix, - f32_patt[count - 1], count); + patt[count - 1], count); + } fragP->fr_var = count; } static INLINE unsigned int -mode_from_disp_size (t) - unsigned int t; +mode_from_disp_size (unsigned int t) { return (t & Disp8) ? 1 : (t & (Disp16 | Disp32 | Disp32S)) ? 2 : 0; } static INLINE int -fits_in_signed_byte (num) - offsetT num; +fits_in_signed_byte (offsetT num) { return (num >= -128) && (num <= 127); } static INLINE int -fits_in_unsigned_byte (num) - offsetT num; +fits_in_unsigned_byte (offsetT num) { return (num & 0xff) == num; } static INLINE int -fits_in_unsigned_word (num) - offsetT num; +fits_in_unsigned_word (offsetT num) { return (num & 0xffff) == num; } static INLINE int -fits_in_signed_word (num) - offsetT num; +fits_in_signed_word (offsetT num) { return (-32768 <= num) && (num <= 32767); } + static INLINE int -fits_in_signed_long (num) - offsetT num ATTRIBUTE_UNUSED; +fits_in_signed_long (offsetT num ATTRIBUTE_UNUSED) { #ifndef BFD64 return 1; @@ -650,9 +916,9 @@ fits_in_signed_long (num) || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); #endif } /* fits_in_signed_long() */ + static INLINE int -fits_in_unsigned_long (num) - offsetT num ATTRIBUTE_UNUSED; +fits_in_unsigned_long (offsetT num ATTRIBUTE_UNUSED) { #ifndef BFD64 return 1; @@ -661,11 +927,10 @@ fits_in_unsigned_long (num) #endif } /* fits_in_unsigned_long() */ -static int -smallest_imm_type (num) - offsetT num; +static unsigned int +smallest_imm_type (offsetT num) { - if (cpu_arch_flags != (Cpu086 | Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64)) + if (cpu_arch_flags != (Cpu186 | Cpu286 | Cpu386 | Cpu486 | CpuNo64)) { /* This code is disabled on the 486 because all the Imm1 forms in the opcode table are slower on the i486. They're the @@ -689,9 +954,7 @@ smallest_imm_type (num) } static offsetT -offset_in_range (val, size) - offsetT val; - int size; +offset_in_range (offsetT val, int size) { addressT mask; @@ -726,8 +989,7 @@ offset_in_range (val, size) class already exists, 1 if non rep/repne added, 2 if rep/repne added. */ static int -add_prefix (prefix) - unsigned int prefix; +add_prefix (unsigned int prefix) { int ret = 1; unsigned int q; @@ -735,9 +997,9 @@ add_prefix (prefix) if (prefix >= REX_OPCODE && prefix < REX_OPCODE + 16 && flag_code == CODE_64BIT) { - if ((i.prefix[REX_PREFIX] & prefix & REX_MODE64) - || ((i.prefix[REX_PREFIX] & (REX_EXTX | REX_EXTY | REX_EXTZ)) - && (prefix & (REX_EXTX | REX_EXTY | REX_EXTZ)))) + if ((i.prefix[REX_PREFIX] & prefix & REX_W) + || ((i.prefix[REX_PREFIX] & (REX_R | REX_X | REX_B)) + && (prefix & (REX_R | REX_X | REX_B)))) ret = 0; q = REX_PREFIX; } @@ -794,8 +1056,7 @@ add_prefix (prefix) } static void -set_code_flag (value) - int value; +set_code_flag (int value) { flag_code = value; cpu_arch_flags &= ~(Cpu64 | CpuNo64); @@ -812,8 +1073,7 @@ set_code_flag (value) } static void -set_16bit_gcc_code_flag (new_code_flag) - int new_code_flag; +set_16bit_gcc_code_flag (int new_code_flag) { flag_code = new_code_flag; cpu_arch_flags &= ~(Cpu64 | CpuNo64); @@ -822,8 +1082,7 @@ set_16bit_gcc_code_flag (new_code_flag) } static void -set_intel_syntax (syntax_flag) - int syntax_flag; +set_intel_syntax (int syntax_flag) { /* Find out if register prefixing is specified. */ int ask_naked_reg = 0; @@ -854,11 +1113,11 @@ set_intel_syntax (syntax_flag) identifier_chars['%'] = intel_syntax && allow_naked_reg ? '%' : 0; identifier_chars['$'] = intel_syntax ? '$' : 0; + register_prefix = allow_naked_reg ? "" : "%"; } static void -set_cpu_arch (dummy) - int dummy ATTRIBUTE_UNUSED; +set_cpu_arch (int dummy ATTRIBUTE_UNUSED) { SKIP_WHITESPACE (); @@ -866,9 +1125,9 @@ set_cpu_arch (dummy) { char *string = input_line_pointer; int e = get_symbol_end (); - int i; + unsigned int i; - for (i = 0; cpu_arch[i].name; i++) + for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) { if (strcmp (string, cpu_arch[i].name) == 0) { @@ -877,7 +1136,15 @@ set_cpu_arch (dummy) cpu_arch_name = cpu_arch[i].name; cpu_sub_arch_name = NULL; cpu_arch_flags = (cpu_arch[i].flags - | (flag_code == CODE_64BIT ? Cpu64 : CpuNo64)); + | (flag_code == CODE_64BIT + ? Cpu64 : CpuNo64)); + cpu_arch_isa = cpu_arch[i].type; + cpu_arch_isa_flags = cpu_arch[i].flags; + if (!cpu_arch_tune_set) + { + cpu_arch_tune = cpu_arch_isa; + cpu_arch_tune_flags = cpu_arch_isa_flags; + } break; } if ((cpu_arch_flags | cpu_arch[i].flags) != cpu_arch_flags) @@ -890,7 +1157,7 @@ set_cpu_arch (dummy) return; } } - if (!cpu_arch[i].name) + if (i >= ARRAY_SIZE (cpu_arch)) as_bad (_("no such architecture: `%s'"), string); *input_line_pointer = e; @@ -976,10 +1243,9 @@ md_begin () reg_hash = hash_new (); { const reg_entry *regtab; + unsigned int regtab_size = i386_regtab_size; - for (regtab = i386_regtab; - regtab < i386_regtab + sizeof (i386_regtab) / sizeof (i386_regtab[0]); - regtab++) + for (regtab = i386_regtab; regtab_size--; regtab++) { hash_err = hash_insert (reg_hash, regtab->reg_name, (PTR) regtab); if (hash_err) @@ -1034,6 +1300,7 @@ md_begin () #endif digit_chars['-'] = '-'; mnemonic_chars['-'] = '-'; + mnemonic_chars['.'] = '.'; identifier_chars['_'] = '_'; identifier_chars['.'] = '.'; @@ -1063,8 +1330,7 @@ md_begin () } void -i386_print_statistics (file) - FILE *file; +i386_print_statistics (FILE *file) { hash_print_statistics (file, "i386 opcode", op_hash); hash_print_statistics (file, "i386 register", reg_hash); @@ -1073,16 +1339,13 @@ i386_print_statistics (file) #ifdef DEBUG386 /* Debugging routines for md_assemble. */ -static void pi PARAMS ((char *, i386_insn *)); -static void pte PARAMS ((template *)); -static void pt PARAMS ((unsigned int)); -static void pe PARAMS ((expressionS *)); -static void ps PARAMS ((symbolS *)); +static void pte (template *); +static void pt (unsigned int); +static void pe (expressionS *); +static void ps (symbolS *); static void -pi (line, x) - char *line; - i386_insn *x; +pi (char *line, i386_insn *x) { unsigned int i; @@ -1097,10 +1360,10 @@ pi (line, x) fprintf (stdout, " sib: base %x index %x scale %x\n", x->sib.base, x->sib.index, x->sib.scale); fprintf (stdout, " rex: 64bit %x extX %x extY %x extZ %x\n", - (x->rex & REX_MODE64) != 0, - (x->rex & REX_EXTX) != 0, - (x->rex & REX_EXTY) != 0, - (x->rex & REX_EXTZ) != 0); + (x->rex & REX_W) != 0, + (x->rex & REX_R) != 0, + (x->rex & REX_X) != 0, + (x->rex & REX_B) != 0); for (i = 0; i < x->operands; i++) { fprintf (stdout, " #%d: ", i + 1); @@ -1117,8 +1380,7 @@ pi (line, x) } static void -pte (t) - template *t; +pte (template *t) { unsigned int i; fprintf (stdout, " %d operands ", t->operands); @@ -1139,8 +1401,7 @@ pte (t) } static void -pe (e) - expressionS *e; +pe (expressionS *e) { fprintf (stdout, " operation %d\n", e->X_op); fprintf (stdout, " add_number %ld (%lx)\n", @@ -1160,8 +1421,7 @@ pe (e) } static void -ps (s) - symbolS *s; +ps (symbolS *s) { fprintf (stdout, "%s type %s%s", S_GET_NAME (s), @@ -1226,9 +1486,9 @@ pt (t) static bfd_reloc_code_real_type reloc (unsigned int size, - int pcrel, - int sign, - bfd_reloc_code_real_type other) + int pcrel, + int sign, + bfd_reloc_code_real_type other) { if (other != NO_RELOC) { @@ -1237,26 +1497,26 @@ reloc (unsigned int size, if (size == 8) switch (other) { - case BFD_RELOC_X86_64_GOT32: - return BFD_RELOC_X86_64_GOT64; - break; - case BFD_RELOC_X86_64_PLTOFF64: - return BFD_RELOC_X86_64_PLTOFF64; - break; - case BFD_RELOC_X86_64_GOTPC32: - other = BFD_RELOC_X86_64_GOTPC64; - break; - case BFD_RELOC_X86_64_GOTPCREL: - other = BFD_RELOC_X86_64_GOTPCREL64; - break; - case BFD_RELOC_X86_64_TPOFF32: - other = BFD_RELOC_X86_64_TPOFF64; - break; - case BFD_RELOC_X86_64_DTPOFF32: - other = BFD_RELOC_X86_64_DTPOFF64; - break; - default: - break; + case BFD_RELOC_X86_64_GOT32: + return BFD_RELOC_X86_64_GOT64; + break; + case BFD_RELOC_X86_64_PLTOFF64: + return BFD_RELOC_X86_64_PLTOFF64; + break; + case BFD_RELOC_X86_64_GOTPC32: + other = BFD_RELOC_X86_64_GOTPC64; + break; + case BFD_RELOC_X86_64_GOTPCREL: + other = BFD_RELOC_X86_64_GOTPCREL64; + break; + case BFD_RELOC_X86_64_TPOFF32: + other = BFD_RELOC_X86_64_TPOFF64; + break; + case BFD_RELOC_X86_64_DTPOFF32: + other = BFD_RELOC_X86_64_DTPOFF64; + break; + default: + break; } /* Sign-checking 4-byte relocations in 16-/32-bit code is pointless. */ @@ -1275,7 +1535,7 @@ reloc (unsigned int size, else if ((reloc->complain_on_overflow == complain_overflow_signed && !sign) || (reloc->complain_on_overflow == complain_overflow_unsigned - && sign > 0)) + && sign > 0)) as_bad (_("relocated field and relocation type differ in signedness")); else return other; @@ -1324,8 +1584,7 @@ reloc (unsigned int size, some cases we force the original symbol to be used. */ int -tc_i386_fix_adjustable (fixP) - fixS *fixP ATTRIBUTE_UNUSED; +tc_i386_fix_adjustable (fixS *fixP ATTRIBUTE_UNUSED) { #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (!IS_ELF) @@ -1378,11 +1637,8 @@ tc_i386_fix_adjustable (fixP) return 1; } -static int intel_float_operand PARAMS ((const char *mnemonic)); - static int -intel_float_operand (mnemonic) - const char *mnemonic; +intel_float_operand (const char *mnemonic) { /* Note that the value returned is meaningful only for opcodes with (memory) operands, hence the code here is free to improperly handle opcodes that @@ -1465,16 +1721,29 @@ md_assemble (line) if (line == NULL) return; + /* The order of the immediates should be reversed + for 2 immediates extrq and insertq instructions */ + if ((i.imm_operands == 2) + && ((strcmp (mnemonic, "extrq") == 0) + || (strcmp (mnemonic, "insertq") == 0))) + { + swap_2_operands (0, 1); + /* "extrq" and insertq" are the only two instructions whose operands + have to be reversed even though they have two immediate operands. + */ + if (intel_syntax) + swap_operands (); + } + /* Now we've parsed the mnemonic into a set of templates, and have the operands at hand. */ /* All intel opcodes have reversed operands except for "bound" and "enter". We also don't reverse intersegment "jmp" and "call" instructions with 2 immediate operands so that the immediate segment - precedes the offset, as it does when in AT&T mode. "enter" and the - intersegment "jmp" and "call" instructions are the only ones that - have two immediate operands. */ - if (intel_syntax && i.operands > 1 + precedes the offset, as it does when in AT&T mode. */ + if (intel_syntax + && i.operands > 1 && (strcmp (mnemonic, "bound") != 0) && (strcmp (mnemonic, "invlpga") != 0) && !((i.types[0] & Imm) && (i.types[1] & Imm))) @@ -1502,7 +1771,7 @@ md_assemble (line) /* Undo SYSV386_COMPAT brokenness when in Intel mode. See i386.h */ if (SYSV386_COMPAT && (i.tm.base_opcode & 0xfffffde0) == 0xdce0) - i.tm.base_opcode ^= FloatR; + i.tm.base_opcode ^= Opcode_FloatR; /* Zap movzx and movsx suffix. The suffix may have been set from "word ptr" or "byte ptr" on the source operand, but we'll use @@ -1556,9 +1825,9 @@ md_assemble (line) { expressionS *exp; - if ((i.tm.cpu_flags & CpuPNI) && i.operands > 0) + if ((i.tm.cpu_flags & CpuSSE3) && i.operands > 0) { - /* These Intel Prescott New Instructions have the fixed + /* Streaming SIMD extensions 3 Instructions have the fixed operands with an opcode suffix which is coded in the same place as an 8-bit immediate field would be. Here we check those operands and remove them afterwards. */ @@ -1566,8 +1835,11 @@ md_assemble (line) for (x = 0; x < i.operands; x++) if (i.op[x].regs->reg_num != x) - as_bad (_("can't use register '%%%s' as operand %d in '%s'."), - i.op[x].regs->reg_name, x + 1, i.tm.name); + as_bad (_("can't use register '%s%s' as operand %d in '%s'."), + register_prefix, + i.op[x].regs->reg_name, + x + 1, + i.tm.name); i.operands = 0; } @@ -1616,7 +1888,7 @@ md_assemble (line) } if ((i.tm.opcode_modifier & Rex64) != 0) - i.rex |= REX_MODE64; + i.rex |= REX_W; /* For 8 bit registers we need an empty rex prefix. Also if the instruction already has a prefix, we need to convert old @@ -1640,8 +1912,9 @@ md_assemble (line) { /* In case it is "hi" register, give up. */ if (i.op[x].regs->reg_num > 3) - as_bad (_("can't encode register '%%%s' in an instruction requiring REX prefix."), - i.op[x].regs->reg_name); + as_bad (_("can't encode register '%s%s' in an " + "instruction requiring REX prefix."), + register_prefix, i.op[x].regs->reg_name); /* Otherwise it is equivalent to the extended register. Since the encoding doesn't change this is merely @@ -1660,9 +1933,7 @@ md_assemble (line) } static char * -parse_insn (line, mnemonic) - char *line; - char *mnemonic; +parse_insn (char *line, char *mnemonic) { char *l = line; char *token_start = l; @@ -1832,9 +2103,9 @@ parse_insn (line, mnemonic) { if (!((t->cpu_flags & ~(Cpu64 | CpuNo64)) & ~(cpu_arch_flags & ~(Cpu64 | CpuNo64)))) - supported |= 1; + supported |= 1; if (!(t->cpu_flags & (flag_code == CODE_64BIT ? CpuNo64 : Cpu64))) - supported |= 2; + supported |= 2; } if (!(supported & 2)) { @@ -1867,7 +2138,7 @@ parse_insn (line, mnemonic) if (t >= current_templates->end) { as_bad (_("expecting string instruction after `%s'"), - expecting_string_instruction); + expecting_string_instruction); return NULL; } for (override.start = t; t < current_templates->end; ++t) @@ -1881,9 +2152,7 @@ parse_insn (line, mnemonic) } static char * -parse_operands (l, mnemonic) - char *l; - const char *mnemonic; +parse_operands (char *l, const char *mnemonic) { char *token_start; @@ -2001,24 +2270,12 @@ parse_operands (l, mnemonic) } static void -swap_operands () +swap_2_operands (int xchg1, int xchg2) { union i386_op temp_op; unsigned int temp_type; enum bfd_reloc_code_real temp_reloc; - int xchg1 = 0; - int xchg2 = 0; - if (i.operands == 2) - { - xchg1 = 0; - xchg2 = 1; - } - else if (i.operands == 3) - { - xchg1 = 0; - xchg2 = 2; - } temp_type = i.types[xchg2]; i.types[xchg2] = i.types[xchg1]; i.types[xchg1] = temp_type; @@ -2028,6 +2285,22 @@ swap_operands () temp_reloc = i.reloc[xchg2]; i.reloc[xchg2] = i.reloc[xchg1]; i.reloc[xchg1] = temp_reloc; +} + +static void +swap_operands (void) +{ + switch (i.operands) + { + case 4: + swap_2_operands (1, i.operands - 2); + case 3: + case 2: + swap_2_operands (0, i.operands - 1); + break; + default: + abort (); + } if (i.mem_operands == 2) { @@ -2041,7 +2314,7 @@ swap_operands () /* Try to ensure constant immediates are represented in the smallest opcode possible. */ static void -optimize_imm () +optimize_imm (void) { char guess_suffix = 0; int op; @@ -2131,8 +2404,10 @@ optimize_imm () unsigned int mask, allowed = 0; const template *t; - for (t = current_templates->start; t < current_templates->end; ++t) - allowed |= t->operand_types[op]; + for (t = current_templates->start; + t < current_templates->end; + ++t) + allowed |= t->operand_types[op]; switch (guess_suffix) { case QWORD_MNEM_SUFFIX: @@ -2151,8 +2426,8 @@ optimize_imm () mask = 0; break; } - if (mask & allowed) - i.types[op] &= mask; + if (mask & allowed) + i.types[op] &= mask; } break; } @@ -2161,7 +2436,7 @@ optimize_imm () /* Try to use the smallest displacement type too. */ static void -optimize_disp () +optimize_disp (void) { int op; @@ -2225,13 +2500,20 @@ optimize_disp () } static int -match_template () +match_template (void) { /* Points to template once we've found it. */ const template *t; - unsigned int overlap0, overlap1, overlap2; + unsigned int overlap0, overlap1, overlap2, overlap3; unsigned int found_reverse_match; int suffix_check; + unsigned int operand_types [MAX_OPERANDS]; + int addr_prefix_disp; + unsigned int j; + +#if MAX_OPERANDS != 4 +# error "MAX_OPERANDS must be 4." +#endif #define MATCH(overlap, given, template) \ ((overlap & ~JumpAbsolute) \ @@ -2249,7 +2531,11 @@ match_template () overlap0 = 0; overlap1 = 0; overlap2 = 0; + overlap3 = 0; found_reverse_match = 0; + for (j = 0; j < MAX_OPERANDS; j++) + operand_types [j] = 0; + addr_prefix_disp = -1; suffix_check = (i.suffix == BYTE_MNEM_SUFFIX ? No_bSuf : (i.suffix == WORD_MNEM_SUFFIX @@ -2265,6 +2551,8 @@ match_template () for (t = current_templates->start; t < current_templates->end; t++) { + addr_prefix_disp = -1; + /* Must have right number of operands. */ if (i.operands != t->operands) continue; @@ -2275,6 +2563,9 @@ match_template () && (t->opcode_modifier & IgnoreSize))) continue; + for (j = 0; j < MAX_OPERANDS; j++) + operand_types [j] = t->operand_types [j]; + /* In general, don't allow 64-bit operands in 32-bit mode. */ if (i.suffix == QWORD_MNEM_SUFFIX && flag_code != CODE_64BIT @@ -2282,8 +2573,8 @@ match_template () ? (!(t->opcode_modifier & IgnoreSize) && !intel_float_operand (t->name)) : intel_float_operand (t->name) != 2) - && (!(t->operand_types[0] & (RegMMX | RegXMM)) - || !(t->operand_types[t->operands > 1] & (RegMMX | RegXMM))) + && (!(operand_types[0] & (RegMMX | RegXMM)) + || !(operand_types[t->operands > 1] & (RegMMX | RegXMM))) && (t->base_opcode != 0x0fc7 || t->extension_opcode != 1 /* cmpxchg8b */)) continue; @@ -2297,66 +2588,142 @@ match_template () break; } - overlap0 = i.types[0] & t->operand_types[0]; + /* Address size prefix will turn Disp64/Disp32/Disp16 operand + into Disp32/Disp16/Disp32 operand. */ + if (i.prefix[ADDR_PREFIX] != 0) + { + unsigned int DispOn = 0, DispOff = 0; + + switch (flag_code) + { + case CODE_16BIT: + DispOn = Disp32; + DispOff = Disp16; + break; + case CODE_32BIT: + DispOn = Disp16; + DispOff = Disp32; + break; + case CODE_64BIT: + DispOn = Disp32; + DispOff = Disp64; + break; + } + + for (j = 0; j < MAX_OPERANDS; j++) + { + /* There should be only one Disp operand. */ + if ((operand_types[j] & DispOff)) + { + addr_prefix_disp = j; + operand_types[j] |= DispOn; + operand_types[j] &= ~DispOff; + break; + } + } + } + + overlap0 = i.types[0] & operand_types[0]; switch (t->operands) { case 1: - if (!MATCH (overlap0, i.types[0], t->operand_types[0])) + if (!MATCH (overlap0, i.types[0], operand_types[0])) continue; break; case 2: + /* xchg %eax, %eax is a special case. It is an aliase for nop + only in 32bit mode and we can use opcode 0x90. In 64bit + mode, we can't use 0x90 for xchg %eax, %eax since it should + zero-extend %eax to %rax. */ + if (flag_code == CODE_64BIT + && t->base_opcode == 0x90 + && i.types [0] == (Acc | Reg32) + && i.types [1] == (Acc | Reg32)) + continue; case 3: - overlap1 = i.types[1] & t->operand_types[1]; - if (!MATCH (overlap0, i.types[0], t->operand_types[0]) - || !MATCH (overlap1, i.types[1], t->operand_types[1]) + case 4: + overlap1 = i.types[1] & operand_types[1]; + if (!MATCH (overlap0, i.types[0], operand_types[0]) + || !MATCH (overlap1, i.types[1], operand_types[1]) /* monitor in SSE3 is a very special case. The first - register and the second register may have differnet - sizes. */ + register and the second register may have different + sizes. The same applies to crc32 in SSE4.2. */ || !((t->base_opcode == 0x0f01 && t->extension_opcode == 0xc8) + || t->base_opcode == 0xf20f38f1 || CONSISTENT_REGISTER_MATCH (overlap0, i.types[0], - t->operand_types[0], + operand_types[0], overlap1, i.types[1], - t->operand_types[1]))) + operand_types[1]))) { /* Check if other direction is valid ... */ if ((t->opcode_modifier & (D | FloatD)) == 0) continue; /* Try reversing direction of operands. */ - overlap0 = i.types[0] & t->operand_types[1]; - overlap1 = i.types[1] & t->operand_types[0]; - if (!MATCH (overlap0, i.types[0], t->operand_types[1]) - || !MATCH (overlap1, i.types[1], t->operand_types[0]) + overlap0 = i.types[0] & operand_types[1]; + overlap1 = i.types[1] & operand_types[0]; + if (!MATCH (overlap0, i.types[0], operand_types[1]) + || !MATCH (overlap1, i.types[1], operand_types[0]) || !CONSISTENT_REGISTER_MATCH (overlap0, i.types[0], - t->operand_types[1], + operand_types[1], overlap1, i.types[1], - t->operand_types[0])) + operand_types[0])) { /* Does not match either direction. */ continue; } /* found_reverse_match holds which of D or FloatDR we've found. */ - found_reverse_match = t->opcode_modifier & (D | FloatDR); + if ((t->opcode_modifier & D)) + found_reverse_match = Opcode_D; + else if ((t->opcode_modifier & FloatD)) + found_reverse_match = Opcode_FloatD; + else + found_reverse_match = 0; + if ((t->opcode_modifier & FloatR)) + found_reverse_match |= Opcode_FloatR; } - /* Found a forward 2 operand match here. */ - else if (t->operands == 3) + else { - /* Here we make use of the fact that there are no - reverse match 3 operand instructions, and all 3 - operand instructions only need to be checked for - register consistency between operands 2 and 3. */ - overlap2 = i.types[2] & t->operand_types[2]; - if (!MATCH (overlap2, i.types[2], t->operand_types[2]) - || !CONSISTENT_REGISTER_MATCH (overlap1, i.types[1], - t->operand_types[1], - overlap2, i.types[2], - t->operand_types[2])) + /* Found a forward 2 operand match here. */ + switch (t->operands) + { + case 4: + overlap3 = i.types[3] & operand_types[3]; + case 3: + overlap2 = i.types[2] & operand_types[2]; + break; + } - continue; + switch (t->operands) + { + case 4: + if (!MATCH (overlap3, i.types[3], operand_types[3]) + || !CONSISTENT_REGISTER_MATCH (overlap2, + i.types[2], + operand_types[2], + overlap3, + i.types[3], + operand_types[3])) + continue; + case 3: + /* Here we make use of the fact that there are no + reverse match 3 operand instructions, and all 3 + operand instructions only need to be checked for + register consistency between operands 2 and 3. */ + if (!MATCH (overlap2, i.types[2], operand_types[2]) + || !CONSISTENT_REGISTER_MATCH (overlap1, + i.types[1], + operand_types[1], + overlap2, + i.types[2], + operand_types[2])) + continue; + break; + } } - /* Found either forward/reverse 2 or 3 operand match here: + /* Found either forward/reverse 2, 3 or 4 operand match here: slip through to break. */ } if (t->cpu_flags & ~cpu_arch_flags) @@ -2380,7 +2747,7 @@ match_template () { if (!intel_syntax && ((i.types[0] & JumpAbsolute) - != (t->operand_types[0] & JumpAbsolute))) + != (operand_types[0] & JumpAbsolute))) { as_warn (_("indirect %s without `*'"), t->name); } @@ -2396,6 +2763,11 @@ match_template () /* Copy the template we found. */ i.tm = *t; + + if (addr_prefix_disp != -1) + i.tm.operand_types[addr_prefix_disp] + = operand_types[addr_prefix_disp]; + if (found_reverse_match) { /* If we found a reverse match we must alter the opcode @@ -2404,15 +2776,15 @@ match_template () i.tm.base_opcode ^= found_reverse_match; - i.tm.operand_types[0] = t->operand_types[1]; - i.tm.operand_types[1] = t->operand_types[0]; + i.tm.operand_types[0] = operand_types[1]; + i.tm.operand_types[1] = operand_types[0]; } return 1; } static int -check_string () +check_string (void) { int mem_op = (i.types[0] & AnyMem) ? 0 : 1; if ((i.tm.operand_types[mem_op] & EsSeg) != 0) @@ -2465,19 +2837,44 @@ process_suffix (void) { /* We take i.suffix from the last register operand specified, Destination register type is more significant than source - register type. */ - int op; - - for (op = i.operands; --op >= 0;) - if ((i.types[op] & Reg) - && !(i.tm.operand_types[op] & InOutPortReg)) - { - i.suffix = ((i.types[op] & Reg8) ? BYTE_MNEM_SUFFIX : - (i.types[op] & Reg16) ? WORD_MNEM_SUFFIX : - (i.types[op] & Reg64) ? QWORD_MNEM_SUFFIX : + register type. crc32 in SSE4.2 prefers source register + type. */ + if (i.tm.base_opcode == 0xf20f38f1) + { + if ((i.types[0] & Reg)) + i.suffix = ((i.types[0] & Reg16) ? WORD_MNEM_SUFFIX : LONG_MNEM_SUFFIX); - break; - } + } + else if (i.tm.base_opcode == 0xf20f38f0) + { + if ((i.types[0] & Reg8)) + i.suffix = BYTE_MNEM_SUFFIX; + } + + if (!i.suffix) + { + int op; + + if (i.tm.base_opcode == 0xf20f38f1 + || i.tm.base_opcode == 0xf20f38f0) + { + /* We have to know the operand size for crc32. */ + as_bad (_("ambiguous memory operand size for `%s`"), + i.tm.name); + return 0; + } + + for (op = i.operands; --op >= 0;) + if ((i.types[op] & Reg) + && !(i.tm.operand_types[op] & InOutPortReg)) + { + i.suffix = ((i.types[op] & Reg8) ? BYTE_MNEM_SUFFIX : + (i.types[op] & Reg16) ? WORD_MNEM_SUFFIX : + (i.types[op] & Reg64) ? QWORD_MNEM_SUFFIX : + LONG_MNEM_SUFFIX); + break; + } + } } else if (i.suffix == BYTE_MNEM_SUFFIX) { @@ -2515,9 +2912,9 @@ process_suffix (void) else if (intel_syntax && !i.suffix && ((i.tm.operand_types[0] & JumpAbsolute) - || (i.tm.opcode_modifier & (JumpByte|JumpInterSegment)) - || (i.tm.base_opcode == 0x0f01 /* [ls][gi]dt */ - && i.tm.extension_opcode <= 3))) + || (i.tm.opcode_modifier & (JumpByte|JumpInterSegment)) + || (i.tm.base_opcode == 0x0f01 /* [ls][gi]dt */ + && i.tm.extension_opcode <= 3))) { switch (flag_code) { @@ -2544,19 +2941,20 @@ process_suffix (void) { if (i.tm.opcode_modifier & W) { - as_bad (_("no instruction mnemonic suffix given and no register operands; can't size instruction")); + as_bad (_("no instruction mnemonic suffix given and " + "no register operands; can't size instruction")); return 0; } } else { - unsigned int suffixes = ~i.tm.opcode_modifier - & (No_bSuf - | No_wSuf - | No_lSuf - | No_sSuf - | No_xSuf - | No_qSuf); + unsigned int suffixes = (~i.tm.opcode_modifier + & (No_bSuf + | No_wSuf + | No_lSuf + | No_sSuf + | No_xSuf + | No_qSuf)); if ((i.tm.opcode_modifier & W) || ((suffixes & (suffixes - 1)) @@ -2615,7 +3013,15 @@ process_suffix (void) if (i.suffix == QWORD_MNEM_SUFFIX && flag_code == CODE_64BIT && (i.tm.opcode_modifier & NoRex64) == 0) - i.rex |= REX_MODE64; + { + /* Special case for xchg %rax,%rax. It is NOP and doesn't + need rex64. */ + if (i.operands != 2 + || i.types [0] != (Acc | Reg64) + || i.types [1] != (Acc | Reg64) + || i.tm.base_opcode != 0x90) + i.rex |= REX_W; + } /* Size floating point instruction. */ if (i.suffix == LONG_MNEM_SUFFIX) @@ -2648,6 +3054,10 @@ check_byte_reg (void) || i.tm.base_opcode == 0xfbf)) continue; + /* crc32 doesn't generate this warning. */ + if (i.tm.base_opcode == 0xf20f38f0) + continue; + if ((i.types[op] & WordReg) && i.op[op].regs->reg_num < 4) { /* Prohibit these changes in the 64bit mode, since the @@ -2655,18 +3065,20 @@ check_byte_reg (void) if (flag_code == CODE_64BIT && (i.tm.operand_types[op] & InOutPortReg) == 0) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } #if REGISTER_WARNINGS if (!quiet_warnings && (i.tm.operand_types[op] & InOutPortReg) == 0) - as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"), + as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"), + register_prefix, (i.op[op].regs + (i.types[op] & Reg16 ? REGNAM_AL - REGNAM_AX : REGNAM_AL - REGNAM_EAX))->reg_name, + register_prefix, i.op[op].regs->reg_name, i.suffix); #endif @@ -2678,7 +3090,8 @@ check_byte_reg (void) | Control | Debug | Test | FloatReg | FloatAcc)) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2689,7 +3102,7 @@ check_byte_reg (void) } static int -check_long_reg () +check_long_reg (void) { int op; @@ -2699,7 +3112,8 @@ check_long_reg () if ((i.types[op] & Reg8) != 0 && (i.tm.operand_types[op] & (Reg16 | Reg32 | Acc)) != 0) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2714,15 +3128,17 @@ check_long_reg () lowering is more complicated. */ if (flag_code == CODE_64BIT) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } #if REGISTER_WARNINGS else - as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"), + as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"), + register_prefix, (i.op[op].regs + REGNAM_EAX - REGNAM_AX)->reg_name, + register_prefix, i.op[op].regs->reg_name, i.suffix); #endif @@ -2731,8 +3147,8 @@ check_long_reg () else if ((i.types[op] & Reg64) != 0 && (i.tm.operand_types[op] & (Reg32 | Acc)) != 0) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } @@ -2740,7 +3156,7 @@ check_long_reg () } static int -check_qword_reg () +check_qword_reg (void) { int op; @@ -2750,7 +3166,8 @@ check_qword_reg () if ((i.types[op] & Reg8) != 0 && (i.tm.operand_types[op] & (Reg16 | Reg32 | Acc)) != 0) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2763,8 +3180,8 @@ check_qword_reg () { /* Prohibit these changes in the 64bit mode, since the lowering is more complicated. */ - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } @@ -2772,7 +3189,7 @@ check_qword_reg () } static int -check_word_reg () +check_word_reg (void) { int op; for (op = i.operands; --op >= 0;) @@ -2781,7 +3198,8 @@ check_word_reg () if ((i.types[op] & Reg8) != 0 && (i.tm.operand_types[op] & (Reg16 | Reg32 | Acc)) != 0) { - as_bad (_("`%%%s' not allowed with `%s%c'"), + as_bad (_("`%s%s' not allowed with `%s%c'"), + register_prefix, i.op[op].regs->reg_name, i.tm.name, i.suffix); @@ -2796,15 +3214,17 @@ check_word_reg () lowering is more complicated. */ if (flag_code == CODE_64BIT) { - as_bad (_("Incorrect register `%%%s' used with `%c' suffix"), - i.op[op].regs->reg_name, + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, i.suffix); return 0; } else #if REGISTER_WARNINGS - as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"), + as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"), + register_prefix, (i.op[op].regs + REGNAM_AX - REGNAM_EAX)->reg_name, + register_prefix, i.op[op].regs->reg_name, i.suffix); #endif @@ -2813,7 +3233,7 @@ check_word_reg () } static int -finalize_imm () +finalize_imm (void) { unsigned int overlap0, overlap1, overlap2; @@ -2844,7 +3264,8 @@ finalize_imm () && overlap0 != Imm16 && overlap0 != Imm32S && overlap0 != Imm32 && overlap0 != Imm64) { - as_bad (_("no instruction mnemonic suffix given; can't determine immediate size")); + as_bad (_("no instruction mnemonic suffix given; " + "can't determine immediate size")); return 0; } } @@ -2877,7 +3298,9 @@ finalize_imm () && overlap1 != Imm16 && overlap1 != Imm32S && overlap1 != Imm32 && overlap1 != Imm64) { - as_bad (_("no instruction mnemonic suffix given; can't determine immediate size %x %c"),overlap1, i.suffix); + as_bad (_("no instruction mnemonic suffix given; " + "can't determine immediate size %x %c"), + overlap1, i.suffix); return 0; } } @@ -2891,7 +3314,7 @@ finalize_imm () } static int -process_operands () +process_operands (void) { /* Default segment register this instruction will use for memory accesses. 0 means unknown. This is only for optimizing out @@ -2901,40 +3324,90 @@ process_operands () /* The imul $imm, %reg instruction is converted into imul $imm, %reg, %reg, and the clr %reg instruction is converted into xor %reg, %reg. */ - if (i.tm.opcode_modifier & regKludge) + if (i.tm.opcode_modifier & RegKludge) { - unsigned int first_reg_op = (i.types[0] & Reg) ? 0 : 1; - /* Pretend we saw the extra register operand. */ - assert (i.op[first_reg_op + 1].regs == 0); - i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs; - i.types[first_reg_op + 1] = i.types[first_reg_op]; - i.reg_operands = 2; + if ((i.tm.cpu_flags & CpuSSE4_1)) + { + /* The first operand in instruction blendvpd, blendvps and + pblendvb in SSE4.1 is implicit and must be xmm0. */ + assert (i.operands == 3 + && i.reg_operands >= 2 + && i.types[0] == RegXMM); + if (i.op[0].regs->reg_num != 0) + { + if (intel_syntax) + as_bad (_("the last operand of `%s' must be `%sxmm0'"), + i.tm.name, register_prefix); + else + as_bad (_("the first operand of `%s' must be `%sxmm0'"), + i.tm.name, register_prefix); + return 0; + } + i.op[0] = i.op[1]; + i.op[1] = i.op[2]; + i.types[0] = i.types[1]; + i.types[1] = i.types[2]; + i.operands--; + i.reg_operands--; + + /* We need to adjust fields in i.tm since they are used by + build_modrm_byte. */ + i.tm.operand_types [0] = i.tm.operand_types [1]; + i.tm.operand_types [1] = i.tm.operand_types [2]; + i.tm.operands--; + } + else + { + unsigned int first_reg_op = (i.types[0] & Reg) ? 0 : 1; + /* Pretend we saw the extra register operand. */ + assert (i.reg_operands == 1 + && i.op[first_reg_op + 1].regs == 0); + i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs; + i.types[first_reg_op + 1] = i.types[first_reg_op]; + i.operands++; + i.reg_operands++; + } } if (i.tm.opcode_modifier & ShortForm) { - /* The register or float register operand is in operand 0 or 1. */ - unsigned int op = (i.types[0] & (Reg | FloatReg)) ? 0 : 1; - /* Register goes in low 3 bits of opcode. */ - i.tm.base_opcode |= i.op[op].regs->reg_num; - if ((i.op[op].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; - if (!quiet_warnings && (i.tm.opcode_modifier & Ugh) != 0) + if (i.types[0] & (SReg2 | SReg3)) { - /* Warn about some common errors, but press on regardless. - The first case can be generated by gcc (<= 2.8.1). */ - if (i.operands == 2) + if (i.tm.base_opcode == POP_SEG_SHORT + && i.op[0].regs->reg_num == 1) { - /* Reversed arguments on faddp, fsubp, etc. */ - as_warn (_("translating to `%s %%%s,%%%s'"), i.tm.name, - i.op[1].regs->reg_name, - i.op[0].regs->reg_name); + as_bad (_("you can't `pop %%cs'")); + return 0; } - else + i.tm.base_opcode |= (i.op[0].regs->reg_num << 3); + if ((i.op[0].regs->reg_flags & RegRex) != 0) + i.rex |= REX_B; + } + else + { + /* The register or float register operand is in operand 0 or 1. */ + unsigned int op = (i.types[0] & (Reg | FloatReg)) ? 0 : 1; + /* Register goes in low 3 bits of opcode. */ + i.tm.base_opcode |= i.op[op].regs->reg_num; + if ((i.op[op].regs->reg_flags & RegRex) != 0) + i.rex |= REX_B; + if (!quiet_warnings && (i.tm.opcode_modifier & Ugh) != 0) { - /* Extraneous `l' suffix on fp insn. */ - as_warn (_("translating to `%s %%%s'"), i.tm.name, - i.op[0].regs->reg_name); + /* Warn about some common errors, but press on regardless. + The first case can be generated by gcc (<= 2.8.1). */ + if (i.operands == 2) + { + /* Reversed arguments on faddp, fsubp, etc. */ + as_warn (_("translating to `%s %s%s,%s%s'"), i.tm.name, + register_prefix, i.op[1].regs->reg_name, + register_prefix, i.op[0].regs->reg_name); + } + else + { + /* Extraneous `l' suffix on fp insn. */ + as_warn (_("translating to `%s %s%s'"), i.tm.name, + register_prefix, i.op[0].regs->reg_name); + } } } } @@ -2946,19 +3419,7 @@ process_operands () default_seg = build_modrm_byte (); } - else if (i.tm.opcode_modifier & (Seg2ShortForm | Seg3ShortForm)) - { - if (i.tm.base_opcode == POP_SEG_SHORT - && i.op[0].regs->reg_num == 1) - { - as_bad (_("you can't `pop %%cs'")); - return 0; - } - i.tm.base_opcode |= (i.op[0].regs->reg_num << 3); - if ((i.op[0].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; - } - else if ((i.tm.base_opcode & ~(D | W)) == MOV_AX_DISP32) + else if ((i.tm.base_opcode & ~0x3) == MOV_AX_DISP32) { default_seg = &ds; } @@ -2988,7 +3449,7 @@ process_operands () } static const seg_entry * -build_modrm_byte () +build_modrm_byte (void) { const seg_entry *default_seg = 0; @@ -2997,11 +3458,33 @@ build_modrm_byte () if (i.reg_operands == 2) { unsigned int source, dest; - source = ((i.types[0] - & (Reg | RegMMX | RegXMM - | SReg2 | SReg3 - | Control | Debug | Test)) - ? 0 : 1); + + switch (i.operands) + { + case 2: + source = 0; + break; + case 3: + /* When there are 3 operands, one of them may be immediate, + which may be the first or the last operand. Otherwise, + the first operand must be shift count register (cl). */ + assert (i.imm_operands == 1 + || (i.imm_operands == 0 + && (i.types[0] & ShiftCount))); + source = (i.types[0] & (Imm | ShiftCount)) ? 1 : 0; + break; + case 4: + /* When there are 4 operands, the first two must be immediate + operands. The source operand will be the 3rd one. */ + assert (i.imm_operands == 2 + && (i.types[0] & Imm) + && (i.types[1] & Imm)); + source = 2; + break; + default: + abort (); + } + dest = source + 1; i.rm.mode = 3; @@ -3011,29 +3494,29 @@ build_modrm_byte () destination operand, then we assume the source operand may sometimes be a memory operand and so we need to store the destination in the i.rm.reg field. */ - if ((i.tm.operand_types[dest] & AnyMem) == 0) + if ((i.tm.operand_types[dest] & (AnyMem | RegMem)) == 0) { i.rm.reg = i.op[dest].regs->reg_num; i.rm.regmem = i.op[source].regs->reg_num; if ((i.op[dest].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTX; + i.rex |= REX_R; if ((i.op[source].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; } else { i.rm.reg = i.op[source].regs->reg_num; i.rm.regmem = i.op[dest].regs->reg_num; if ((i.op[dest].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; if ((i.op[source].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTX; + i.rex |= REX_R; } - if (flag_code != CODE_64BIT && (i.rex & (REX_EXTX | REX_EXTZ))) + if (flag_code != CODE_64BIT && (i.rex & (REX_R | REX_B))) { if (!((i.types[0] | i.types[1]) & Control)) abort (); - i.rex &= ~(REX_EXTX | REX_EXTZ); + i.rex &= ~(REX_R | REX_B); add_prefix (LOCK_PREFIX_OPCODE); } } @@ -3042,9 +3525,12 @@ build_modrm_byte () if (i.mem_operands) { unsigned int fake_zero_displacement = 0; - unsigned int op = ((i.types[0] & AnyMem) - ? 0 - : (i.types[1] & AnyMem) ? 1 : 2); + unsigned int op; + + for (op = 0; op < i.operands; op++) + if ((i.types[op] & AnyMem)) + break; + assert (op < i.operands); default_seg = &ds; @@ -3065,9 +3551,11 @@ build_modrm_byte () i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING; i.sib.base = NO_BASE_REGISTER; i.sib.index = NO_INDEX_REGISTER; - i.types[op] = ((i.prefix[ADDR_PREFIX] == 0) ? Disp32S : Disp32); + i.types[op] = ((i.prefix[ADDR_PREFIX] == 0) + ? Disp32S : Disp32); } - else if ((flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0)) + else if ((flag_code == CODE_16BIT) + ^ (i.prefix[ADDR_PREFIX] != 0)) { i.rm.regmem = NO_BASE_REGISTER_16; i.types[op] = Disp16; @@ -3090,7 +3578,7 @@ build_modrm_byte () else i.types[op] |= Disp32S; if ((i.index_reg->reg_flags & RegRex) != 0) - i.rex |= REX_EXTY; + i.rex |= REX_X; } } /* RIP addressing for 64bit mode. */ @@ -3099,7 +3587,7 @@ build_modrm_byte () i.rm.regmem = NO_BASE_REGISTER; i.types[op] &= ~ Disp; i.types[op] |= Disp32S; - i.flags[op] = Operand_PCrel; + i.flags[op] |= Operand_PCrel; if (! i.disp_operands) fake_zero_displacement = 1; } @@ -3137,11 +3625,13 @@ build_modrm_byte () { if (flag_code == CODE_64BIT && (i.types[op] & Disp)) - i.types[op] = (i.types[op] & Disp8) | (i.prefix[ADDR_PREFIX] == 0 ? Disp32S : Disp32); + i.types[op] = ((i.types[op] & Disp8) + | (i.prefix[ADDR_PREFIX] == 0 + ? Disp32S : Disp32)); i.rm.regmem = i.base_reg->reg_num; if ((i.base_reg->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; i.sib.base = i.base_reg->reg_num; /* x86-64 ignores REX prefix bit here to avoid decoder complications. */ @@ -3178,7 +3668,7 @@ build_modrm_byte () i.sib.index = i.index_reg->reg_num; i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING; if ((i.index_reg->reg_flags & RegRex) != 0) - i.rex |= REX_EXTY; + i.rex |= REX_X; } if (i.disp_operands @@ -3211,31 +3701,28 @@ build_modrm_byte () registers are coded into the i.rm.reg field. */ if (i.reg_operands) { - unsigned int op = - ((i.types[0] - & (Reg | RegMMX | RegXMM - | SReg2 | SReg3 - | Control | Debug | Test)) - ? 0 - : ((i.types[1] - & (Reg | RegMMX | RegXMM - | SReg2 | SReg3 - | Control | Debug | Test)) - ? 1 - : 2)); + unsigned int op; + + for (op = 0; op < i.operands; op++) + if ((i.types[op] & (Reg | RegMMX | RegXMM + | SReg2 | SReg3 + | Control | Debug | Test))) + break; + assert (op < i.operands); + /* If there is an extension opcode to put here, the register number must be put into the regmem field. */ if (i.tm.extension_opcode != None) { i.rm.regmem = i.op[op].regs->reg_num; if ((i.op[op].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTZ; + i.rex |= REX_B; } else { i.rm.reg = i.op[op].regs->reg_num; if ((i.op[op].regs->reg_flags & RegRex) != 0) - i.rex |= REX_EXTX; + i.rex |= REX_R; } /* Now, if no memory operand has set i.rm.mode = 0, 1, 2 we @@ -3253,7 +3740,7 @@ build_modrm_byte () } static void -output_branch () +output_branch (void) { char *p; int code16; @@ -3331,7 +3818,7 @@ output_branch () } static void -output_jump () +output_jump (void) { char *p; int size; @@ -3397,7 +3884,7 @@ output_jump () } static void -output_interseg_jump () +output_interseg_jump (void) { char *p; int size; @@ -3461,7 +3948,7 @@ output_interseg_jump () } static void -output_insn () +output_insn (void) { fragS *insn_start_frag; offsetT insn_start_off; @@ -3488,10 +3975,12 @@ output_insn () unsigned char *q; unsigned int prefix; - /* All opcodes on i386 have either 1 or 2 bytes. Merom New - Instructions have 3 bytes. We may use one more higher byte - to specify a prefix the instruction requires. */ - if ((i.tm.cpu_flags & CpuMNI) != 0) + /* All opcodes on i386 have either 1 or 2 bytes. SSSE3 and + SSE4 instructions have 3 bytes. We may use one more higher + byte to specify a prefix the instruction requires. Exclude + instructions which are in both SSE4 and ABM. */ + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + && (i.tm.cpu_flags & CpuABM) == 0) { if (i.tm.base_opcode & 0xff000000) { @@ -3504,7 +3993,7 @@ output_insn () prefix = (i.tm.base_opcode >> 16) & 0xff; if ((i.tm.cpu_flags & CpuPadLock) != 0) { -check_prefix: + check_prefix: if (prefix != REPE_PREFIX_OPCODE || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE) add_prefix (prefix); @@ -3532,7 +4021,8 @@ check_prefix: } else { - if ((i.tm.cpu_flags & CpuMNI) != 0) + if ((i.tm.cpu_flags & (CpuSSSE3 | CpuSSE4)) != 0 + && (i.tm.cpu_flags & CpuABM) == 0) { p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; @@ -3586,10 +4076,42 @@ check_prefix: #endif /* DEBUG386 */ } +/* Return the size of the displacement operand N. */ + +static int +disp_size (unsigned int n) +{ + int size = 4; + if (i.types[n] & (Disp8 | Disp16 | Disp64)) + { + size = 2; + if (i.types[n] & Disp8) + size = 1; + if (i.types[n] & Disp64) + size = 8; + } + return size; +} + +/* Return the size of the immediate operand N. */ + +static int +imm_size (unsigned int n) +{ + int size = 4; + if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64)) + { + size = 2; + if (i.types[n] & (Imm8 | Imm8S)) + size = 1; + if (i.types[n] & Imm64) + size = 8; + } + return size; +} + static void -output_disp (insn_start_frag, insn_start_off) - fragS *insn_start_frag; - offsetT insn_start_off; +output_disp (fragS *insn_start_frag, offsetT insn_start_off) { char *p; unsigned int n; @@ -3600,18 +4122,9 @@ output_disp (insn_start_frag, insn_start_off) { if (i.op[n].disps->X_op == O_constant) { - int size; + int size = disp_size (n); offsetT val; - size = 4; - if (i.types[n] & (Disp8 | Disp16 | Disp64)) - { - size = 2; - if (i.types[n] & Disp8) - size = 1; - if (i.types[n] & Disp64) - size = 8; - } val = offset_in_range (i.op[n].disps->X_add_number, size); p = frag_more (size); @@ -3620,45 +4133,32 @@ output_disp (insn_start_frag, insn_start_off) else { enum bfd_reloc_code_real reloc_type; - int size = 4; - int sign = 0; + int size = disp_size (n); + int sign = (i.types[n] & Disp32S) != 0; int pcrel = (i.flags[n] & Operand_PCrel) != 0; + /* We can't have 8 bit displacement here. */ + assert ((i.types[n] & Disp8) == 0); + /* The PC relative address is computed relative to the instruction boundary, so in case immediate fields follows, we need to adjust the value. */ if (pcrel && i.imm_operands) { - int imm_size = 4; unsigned int n1; + int sz = 0; for (n1 = 0; n1 < i.operands; n1++) if (i.types[n1] & Imm) { - if (i.types[n1] & (Imm8 | Imm8S | Imm16 | Imm64)) - { - imm_size = 2; - if (i.types[n1] & (Imm8 | Imm8S)) - imm_size = 1; - if (i.types[n1] & Imm64) - imm_size = 8; - } - break; + /* Only one immediate is allowed for PC + relative address. */ + assert (sz == 0); + sz = imm_size (n1); + i.op[n].disps->X_add_number -= sz; } /* We should find the immediate. */ - if (n1 == i.operands) - abort (); - i.op[n].disps->X_add_number -= imm_size; - } - - if (i.types[n] & Disp32S) - sign = 1; - - if (i.types[n] & (Disp16 | Disp64)) - { - size = 2; - if (i.types[n] & Disp64) - size = 8; + assert (sz != 0); } p = frag_more (size); @@ -3712,9 +4212,7 @@ output_disp (insn_start_frag, insn_start_off) } static void -output_imm (insn_start_frag, insn_start_off) - fragS *insn_start_frag; - offsetT insn_start_off; +output_imm (fragS *insn_start_frag, offsetT insn_start_off) { char *p; unsigned int n; @@ -3725,18 +4223,9 @@ output_imm (insn_start_frag, insn_start_off) { if (i.op[n].imms->X_op == O_constant) { - int size; + int size = imm_size (n); offsetT val; - size = 4; - if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64)) - { - size = 2; - if (i.types[n] & (Imm8 | Imm8S)) - size = 1; - else if (i.types[n] & Imm64) - size = 8; - } val = offset_in_range (i.op[n].imms->X_add_number, size); p = frag_more (size); @@ -3749,21 +4238,15 @@ output_imm (insn_start_frag, insn_start_off) non-absolute imms). Try to support other sizes ... */ enum bfd_reloc_code_real reloc_type; - int size = 4; - int sign = 0; + int size = imm_size (n); + int sign; if ((i.types[n] & (Imm32S)) && (i.suffix == QWORD_MNEM_SUFFIX || (!i.suffix && (i.tm.opcode_modifier & No_lSuf)))) sign = 1; - if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64)) - { - size = 2; - if (i.types[n] & (Imm8 | Imm8S)) - size = 1; - if (i.types[n] & Imm64) - size = 8; - } + else + sign = 0; p = frag_more (size); reloc_type = reloc (size, 0, sign, i.reloc[n]); @@ -3857,10 +4340,8 @@ static enum bfd_reloc_code_real got_reloc = NO_RELOC; static int cons_sign = -1; void -x86_cons_fix_new (fragS *frag, - unsigned int off, - unsigned int len, - expressionS *exp) +x86_cons_fix_new (fragS *frag, unsigned int off, unsigned int len, + expressionS *exp) { enum bfd_reloc_code_real r = reloc (len, 0, cons_sign, got_reloc); @@ -3891,8 +4372,8 @@ x86_cons_fix_new (fragS *frag, input line. Otherwise return NULL. */ static char * lex_got (enum bfd_reloc_code_real *reloc, - int *adjust, - unsigned int *types) + int *adjust, + unsigned int *types) { /* Some of the relocations depend on the size of what field is to be relocated. But in our callers i386_immediate and i386_displacement @@ -3904,23 +4385,57 @@ lex_got (enum bfd_reloc_code_real *reloc, const enum bfd_reloc_code_real rel[2]; const unsigned int types64; } gotrel[] = { - { "PLTOFF", { 0, BFD_RELOC_X86_64_PLTOFF64 }, Imm64 }, - { "PLT", { BFD_RELOC_386_PLT32, BFD_RELOC_X86_64_PLT32 }, Imm32|Imm32S|Disp32 }, - { "GOTPLT", { 0, BFD_RELOC_X86_64_GOTPLT64 }, Imm64|Disp64 }, - { "GOTOFF", { BFD_RELOC_386_GOTOFF, BFD_RELOC_X86_64_GOTOFF64 }, Imm64|Disp64 }, - { "GOTPCREL", { 0, BFD_RELOC_X86_64_GOTPCREL }, Imm32|Imm32S|Disp32 }, - { "TLSGD", { BFD_RELOC_386_TLS_GD, BFD_RELOC_X86_64_TLSGD }, Imm32|Imm32S|Disp32 }, - { "TLSLDM", { BFD_RELOC_386_TLS_LDM, 0 }, 0 }, - { "TLSLD", { 0, BFD_RELOC_X86_64_TLSLD }, Imm32|Imm32S|Disp32 }, - { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32, BFD_RELOC_X86_64_GOTTPOFF }, Imm32|Imm32S|Disp32 }, - { "TPOFF", { BFD_RELOC_386_TLS_LE_32, BFD_RELOC_X86_64_TPOFF32 }, Imm32|Imm32S|Imm64|Disp32|Disp64 }, - { "NTPOFF", { BFD_RELOC_386_TLS_LE, 0 }, 0 }, - { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32, BFD_RELOC_X86_64_DTPOFF32 }, Imm32|Imm32S|Imm64|Disp32|Disp64 }, - { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE, 0 }, 0 }, - { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE, 0 }, 0 }, - { "GOT", { BFD_RELOC_386_GOT32, BFD_RELOC_X86_64_GOT32 }, Imm32|Imm32S|Disp32|Imm64 }, - { "TLSDESC", { BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_X86_64_GOTPC32_TLSDESC }, Imm32|Imm32S|Disp32 }, - { "TLSCALL", { BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_TLSDESC_CALL }, Imm32|Imm32S|Disp32 } + { "PLTOFF", { 0, + BFD_RELOC_X86_64_PLTOFF64 }, + Imm64 }, + { "PLT", { BFD_RELOC_386_PLT32, + BFD_RELOC_X86_64_PLT32 }, + Imm32 | Imm32S | Disp32 }, + { "GOTPLT", { 0, + BFD_RELOC_X86_64_GOTPLT64 }, + Imm64 | Disp64 }, + { "GOTOFF", { BFD_RELOC_386_GOTOFF, + BFD_RELOC_X86_64_GOTOFF64 }, + Imm64 | Disp64 }, + { "GOTPCREL", { 0, + BFD_RELOC_X86_64_GOTPCREL }, + Imm32 | Imm32S | Disp32 }, + { "TLSGD", { BFD_RELOC_386_TLS_GD, + BFD_RELOC_X86_64_TLSGD }, + Imm32 | Imm32S | Disp32 }, + { "TLSLDM", { BFD_RELOC_386_TLS_LDM, + 0 }, + 0 }, + { "TLSLD", { 0, + BFD_RELOC_X86_64_TLSLD }, + Imm32 | Imm32S | Disp32 }, + { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32, + BFD_RELOC_X86_64_GOTTPOFF }, + Imm32 | Imm32S | Disp32 }, + { "TPOFF", { BFD_RELOC_386_TLS_LE_32, + BFD_RELOC_X86_64_TPOFF32 }, + Imm32 | Imm32S | Imm64 | Disp32 | Disp64 }, + { "NTPOFF", { BFD_RELOC_386_TLS_LE, + 0 }, + 0 }, + { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32, + BFD_RELOC_X86_64_DTPOFF32 }, + Imm32 | Imm32S | Imm64 | Disp32 | Disp64 }, + { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE, + 0 }, + 0 }, + { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE, + 0 }, + 0 }, + { "GOT", { BFD_RELOC_386_GOT32, + BFD_RELOC_X86_64_GOT32 }, + Imm32 | Imm32S | Disp32 | Imm64 }, + { "TLSDESC", { BFD_RELOC_386_TLS_GOTDESC, + BFD_RELOC_X86_64_GOTPC32_TLSDESC }, + Imm32 | Imm32S | Disp32 }, + { "TLSCALL", { BFD_RELOC_386_TLS_DESC_CALL, + BFD_RELOC_X86_64_TLSDESC_CALL }, + Imm32 | Imm32S | Disp32 } }; char *cp; unsigned int j; @@ -3951,7 +4466,7 @@ lex_got (enum bfd_reloc_code_real *reloc, if (types) { if (flag_code != CODE_64BIT) - *types = Imm32|Disp32; + *types = Imm32 | Disp32; else *types = gotrel[j].types64; } @@ -3959,9 +4474,6 @@ lex_got (enum bfd_reloc_code_real *reloc, if (GOT_symbol == NULL) GOT_symbol = symbol_find_or_make (GLOBAL_OFFSET_TABLE_NAME); - /* Replace the relocation token with ' ', so that - errors like foo@GOTOFF1 will be detected. */ - /* The length of the first part of our input line. */ first = cp - input_line_pointer; @@ -3977,9 +4489,12 @@ lex_got (enum bfd_reloc_code_real *reloc, be necessary, but be safe. */ tmpbuf = xmalloc (first + second + 2); memcpy (tmpbuf, input_line_pointer, first); - tmpbuf[first] = ' '; - memcpy (tmpbuf + first + 1, past_reloc, second); - tmpbuf[first + second + 1] = '\0'; + if (second != 0 && *past_reloc != ' ') + /* Replace the relocation token with ' ', so that + errors like foo@GOTOFF1 will be detected. */ + tmpbuf[first++] = ' '; + memcpy (tmpbuf + first, past_reloc, second); + tmpbuf[first + second] = '\0'; return tmpbuf; } @@ -3994,9 +4509,7 @@ lex_got (enum bfd_reloc_code_real *reloc, } void -x86_cons (exp, size) - expressionS *exp; - int size; +x86_cons (expressionS *exp, int size) { if (size == 4 || (object_64bit && size == 8)) { @@ -4058,11 +4571,8 @@ pe_directive_secrel (dummy) } #endif -static int i386_immediate PARAMS ((char *)); - static int -i386_immediate (imm_start) - char *imm_start; +i386_immediate (char *imm_start) { char *save_input_line_pointer; char *gotfree_input_line; @@ -4072,7 +4582,8 @@ i386_immediate (imm_start) if (i.imm_operands == MAX_IMMEDIATE_OPERANDS) { - as_bad (_("only 1 or 2 immediate operands are allowed")); + as_bad (_("at most %d immediate operands are allowed"), + MAX_IMMEDIATE_OPERANDS); return 0; } @@ -4114,9 +4625,10 @@ i386_immediate (imm_start) /* Size it properly later. */ i.types[this_operand] |= Imm64; /* If BFD64, sign extend val. */ - if (!use_rela_relocations) - if ((exp->X_add_number & ~(((addressT) 2 << 31) - 1)) == 0) - exp->X_add_number = (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); + if (!use_rela_relocations + && (exp->X_add_number & ~(((addressT) 2 << 31) - 1)) == 0) + exp->X_add_number + = (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); } #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) else if (OUTPUT_FLAVOR == bfd_target_aout_flavour @@ -4131,6 +4643,11 @@ i386_immediate (imm_start) return 0; } #endif + else if (!intel_syntax && exp->X_op == O_register) + { + as_bad (_("illegal immediate register operand %s"), imm_start); + return 0; + } else { /* This is an address. The size of the address will be @@ -4143,11 +4660,8 @@ i386_immediate (imm_start) return 1; } -static char *i386_scale PARAMS ((char *)); - static char * -i386_scale (scale) - char *scale; +i386_scale (char *scale) { offsetT val; char *save = input_line_pointer; @@ -4194,12 +4708,8 @@ i386_scale (scale) return scale; } -static int i386_displacement PARAMS ((char *, char *)); - static int -i386_displacement (disp_start, disp_end) - char *disp_start; - char *disp_end; +i386_displacement (char *disp_start, char *disp_end) { expressionS *exp; segT exp_seg = 0; @@ -4208,6 +4718,13 @@ i386_displacement (disp_start, disp_end) int bigdisp, override; unsigned int types = Disp; + if (i.disp_operands == MAX_MEMORY_OPERANDS) + { + as_bad (_("at most %d displacement operands are allowed"), + MAX_MEMORY_OPERANDS); + return 0; + } + if ((i.types[this_operand] & JumpAbsolute) || !(current_templates->start->opcode_modifier & (Jump | JumpDword))) { @@ -4224,9 +4741,9 @@ i386_displacement (disp_start, disp_end) if (flag_code == CODE_64BIT) { if (!bigdisp) - bigdisp = (override || i.suffix == WORD_MNEM_SUFFIX) - ? Disp16 - : Disp32S | Disp32; + bigdisp = ((override || i.suffix == WORD_MNEM_SUFFIX) + ? Disp16 + : Disp32S | Disp32); else if (!override) bigdisp = Disp64 | Disp32S | Disp32; } @@ -4374,14 +4891,11 @@ i386_displacement (disp_start, disp_end) return 1; } -static int i386_index_check PARAMS ((const char *)); - /* Make sure the memory operand we've been dealt is valid. Return 1 on success, 0 on a failure. */ static int -i386_index_check (operand_string) - const char *operand_string; +i386_index_check (const char *operand_string) { int ok; #if INFER_ADDR_PREFIX @@ -4403,9 +4917,9 @@ i386_index_check (operand_string) else if (flag_code == CODE_64BIT) RegXX = i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32; else - RegXX = (flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0) - ? Reg16 - : Reg32; + RegXX = ((flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0) + ? Reg16 + : Reg32); if (!i.base_reg || !(i.base_reg->reg_type & Acc) || !(i.base_reg->reg_type & RegXX) @@ -4414,17 +4928,17 @@ i386_index_check (operand_string) ok = 0; } else if (flag_code == CODE_64BIT) - { - unsigned RegXX = (i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32); + { + unsigned RegXX = (i.prefix[ADDR_PREFIX] == 0 ? Reg64 : Reg32); - if ((i.base_reg - && ((i.base_reg->reg_type & RegXX) == 0) - && (i.base_reg->reg_type != BaseIndex - || i.index_reg)) - || (i.index_reg - && ((i.index_reg->reg_type & (RegXX | BaseIndex)) - != (RegXX | BaseIndex)))) - ok = 0; + if ((i.base_reg + && ((i.base_reg->reg_type & RegXX) == 0) + && (i.base_reg->reg_type != BaseIndex + || i.index_reg)) + || (i.index_reg + && ((i.index_reg->reg_type & (RegXX | BaseIndex)) + != (RegXX | BaseIndex)))) + ok = 0; } else { @@ -4466,8 +4980,9 @@ i386_index_check (operand_string) FIXME. There doesn't seem to be any real need for separate Disp16 and Disp32 flags. The same goes for Imm16 and Imm32. Removing them would probably clean up the code quite a lot. */ - if (flag_code != CODE_64BIT && (i.types[this_operand] & (Disp16 | Disp32))) - i.types[this_operand] ^= (Disp16 | Disp32); + if (flag_code != CODE_64BIT + && (i.types[this_operand] & (Disp16 | Disp32))) + i.types[this_operand] ^= (Disp16 | Disp32); fudged = 1; goto tryprefix; } @@ -4487,8 +5002,7 @@ i386_index_check (operand_string) on error. */ static int -i386_operand (operand_string) - char *operand_string; +i386_operand (char *operand_string) { const reg_entry *r; char *end_op; @@ -4646,7 +5160,8 @@ i386_operand (operand_string) ++base_string; if (*base_string == ',' - || ((i.base_reg = parse_register (base_string, &end_op)) != NULL)) + || ((i.base_reg = parse_register (base_string, &end_op)) + != NULL)) { displacement_string_end = temp_string; @@ -4666,7 +5181,8 @@ i386_operand (operand_string) if (is_space_char (*base_string)) ++base_string; - if ((i.index_reg = parse_register (base_string, &end_op)) != NULL) + if ((i.index_reg = parse_register (base_string, &end_op)) + != NULL) { base_string = end_op; if (is_space_char (*base_string)) @@ -4679,7 +5195,8 @@ i386_operand (operand_string) } else if (*base_string != ')') { - as_bad (_("expecting `,' or `)' after index register in `%s'"), + as_bad (_("expecting `,' or `)' " + "after index register in `%s'"), operand_string); return 0; } @@ -4703,21 +5220,24 @@ i386_operand (operand_string) ++base_string; if (*base_string != ')') { - as_bad (_("expecting `)' after scale factor in `%s'"), + as_bad (_("expecting `)' " + "after scale factor in `%s'"), operand_string); return 0; } } else if (!i.index_reg) { - as_bad (_("expecting index register or scale factor after `,'; got '%c'"), + as_bad (_("expecting index register or scale factor " + "after `,'; got '%c'"), *base_string); return 0; } } else if (*base_string != ')') { - as_bad (_("expecting `,' or `)' after base register in `%s'"), + as_bad (_("expecting `,' or `)' " + "after base register in `%s'"), operand_string); return 0; } @@ -4933,7 +5453,8 @@ md_convert_frag (abfd, sec, fragP) { if (no_cond_jump_promotion && TYPE_FROM_RELAX_STATE (fragP->fr_subtype) != UNCOND_JUMP) - as_warn_where (fragP->fr_file, fragP->fr_line, _("long jump required")); + as_warn_where (fragP->fr_file, fragP->fr_line, + _("long jump required")); switch (fragP->fr_subtype) { @@ -4984,8 +5505,8 @@ md_convert_frag (abfd, sec, fragP) if (DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype) == 4 && object_64bit && ((addressT) (displacement_from_opcode_start - extension - + ((addressT) 1 << 31)) - > (((addressT) 2 << 31) - 1))) + + ((addressT) 1 << 31)) + > (((addressT) 2 << 31) - 1))) { as_bad_where (fragP->fr_file, fragP->fr_line, _("jump target out of range")); @@ -5250,16 +5771,17 @@ md_atof (type, litP, sizeP) return 0; } -static char output_invalid_buf[8]; +static char output_invalid_buf[sizeof (unsigned char) * 2 + 6]; static char * -output_invalid (c) - int c; +output_invalid (int c) { if (ISPRINT (c)) - sprintf (output_invalid_buf, "'%c'", c); + snprintf (output_invalid_buf, sizeof (output_invalid_buf), + "'%c'", c); else - sprintf (output_invalid_buf, "(0x%x)", (unsigned) c); + snprintf (output_invalid_buf, sizeof (output_invalid_buf), + "(0x%x)", (unsigned char) c); return output_invalid_buf; } @@ -5310,14 +5832,16 @@ parse_real_register (char *reg_string, char **end_op) ++s; if (*s >= '0' && *s <= '7') { - r = &i386_float_regtab[*s - '0']; + int fpr = *s - '0'; ++s; if (is_space_char (*s)) ++s; if (*s == ')') { *end_op = s + 1; - return r; + r = hash_find (reg_hash, "st(0)"); + know (r); + return r + fpr; } } /* We have "%st(" then garbage. */ @@ -5359,7 +5883,8 @@ parse_register (char *reg_string, char **end_op) const expressionS *e = symbol_get_value_expression (symbolP); know (e->X_op == O_register); - know (e->X_add_number >= 0 && (valueT) e->X_add_number < ARRAY_SIZE (i386_regtab)); + know (e->X_add_number >= 0 + && (valueT) e->X_add_number < i386_regtab_size); r = i386_regtab + e->X_add_number; *end_op = input_line_pointer; } @@ -5417,22 +5942,27 @@ const char *md_shortopts = "qn"; #define OPTION_32 (OPTION_MD_BASE + 0) #define OPTION_64 (OPTION_MD_BASE + 1) #define OPTION_DIVIDE (OPTION_MD_BASE + 2) +#define OPTION_MARCH (OPTION_MD_BASE + 3) +#define OPTION_MTUNE (OPTION_MD_BASE + 4) -struct option md_longopts[] = { +struct option md_longopts[] = +{ {"32", no_argument, NULL, OPTION_32}, -#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) {"64", no_argument, NULL, OPTION_64}, #endif {"divide", no_argument, NULL, OPTION_DIVIDE}, + {"march", required_argument, NULL, OPTION_MARCH}, + {"mtune", required_argument, NULL, OPTION_MTUNE}, {NULL, no_argument, NULL, 0} }; size_t md_longopts_size = sizeof (md_longopts); int -md_parse_option (c, arg) - int c; - char *arg ATTRIBUTE_UNUSED; +md_parse_option (int c, char *arg) { + unsigned int i; + switch (c) { case 'n': @@ -5462,14 +5992,18 @@ md_parse_option (c, arg) /* -s: On i386 Solaris, this tells the native assembler to use .stab instead of .stab.excl. We always use .stab anyhow. */ break; - +#endif +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) case OPTION_64: { const char **list, **l; list = bfd_target_list (); for (l = list; *l != NULL; l++) - if (strcmp (*l, "elf64-x86-64") == 0) + if (CONST_STRNEQ (*l, "elf64-x86-64") + || strcmp (*l, "coff-x86-64") == 0 + || strcmp (*l, "pe-x86-64") == 0 + || strcmp (*l, "pei-x86-64") == 0) { default_arch = "x86_64"; break; @@ -5502,6 +6036,44 @@ md_parse_option (c, arg) #endif break; + case OPTION_MARCH: + if (*arg == '.') + as_fatal (_("Invalid -march= option: `%s'"), arg); + for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + { + if (strcmp (arg, cpu_arch [i].name) == 0) + { + cpu_arch_isa = cpu_arch[i].type; + cpu_arch_isa_flags = cpu_arch[i].flags; + if (!cpu_arch_tune_set) + { + cpu_arch_tune = cpu_arch_isa; + cpu_arch_tune_flags = cpu_arch_isa_flags; + } + break; + } + } + if (i >= ARRAY_SIZE (cpu_arch)) + as_fatal (_("Invalid -march= option: `%s'"), arg); + break; + + case OPTION_MTUNE: + if (*arg == '.') + as_fatal (_("Invalid -mtune= option: `%s'"), arg); + for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + { + if (strcmp (arg, cpu_arch [i].name) == 0) + { + cpu_arch_tune_set = 1; + cpu_arch_tune = cpu_arch [i].type; + cpu_arch_tune_flags = cpu_arch[i].flags; + break; + } + } + if (i >= ARRAY_SIZE (cpu_arch)) + as_fatal (_("Invalid -mtune= option: `%s'"), arg); + break; + default: return 0; } @@ -5525,6 +6097,10 @@ md_show_usage (stream) fprintf (stream, _("\ -s ignored\n")); #endif +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) + fprintf (stream, _("\ + --32/--64 generate 32bit/64bit code\n")); +#endif #ifdef SVR4_COMMENT_CHARS fprintf (stream, _("\ --divide do not treat `/' as a comment character\n")); @@ -5532,20 +6108,61 @@ md_show_usage (stream) fprintf (stream, _("\ --divide ignored\n")); #endif + fprintf (stream, _("\ + -march=CPU/-mtune=CPU generate code/optimize for CPU, where CPU is one of:\n\ + i386, i486, pentium, pentiumpro, pentium4, nocona,\n\ + core, core2, k6, athlon, k8, generic32, generic64\n")); + } +#if defined(TE_PEP) +const char * +x86_64_target_format (void) +{ + if (strcmp (default_arch, "x86_64") == 0) + { + set_code_flag (CODE_64BIT); + return COFF_TARGET_FORMAT; + } + else if (strcmp (default_arch, "i386") == 0) + { + set_code_flag (CODE_32BIT); + return "coff-i386"; + } + + as_fatal (_("Unknown architecture")); + return NULL; +} +#endif + #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) /* Pick the target format to use. */ const char * -i386_target_format () +i386_target_format (void) { if (!strcmp (default_arch, "x86_64")) - set_code_flag (CODE_64BIT); + { + set_code_flag (CODE_64BIT); + if (cpu_arch_isa_flags == 0) + cpu_arch_isa_flags = Cpu186|Cpu286|Cpu386|Cpu486 + |Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2 + |CpuSSE|CpuSSE2; + if (cpu_arch_tune_flags == 0) + cpu_arch_tune_flags = Cpu186|Cpu286|Cpu386|Cpu486 + |Cpu586|Cpu686|CpuP4|CpuMMX|CpuMMX2 + |CpuSSE|CpuSSE2; + } else if (!strcmp (default_arch, "i386")) - set_code_flag (CODE_32BIT); + { + set_code_flag (CODE_32BIT); + if (cpu_arch_isa_flags == 0) + cpu_arch_isa_flags = Cpu186|Cpu286|Cpu386; + if (cpu_arch_tune_flags == 0) + cpu_arch_tune_flags = Cpu186|Cpu286|Cpu386; + } else as_fatal (_("Unknown architecture")); switch (OUTPUT_FLAVOR) @@ -5566,7 +6183,7 @@ i386_target_format () object_64bit = 1; use_rela_relocations = 1; } - return flag_code == CODE_64BIT ? "elf64-x86-64" : ELF_TARGET_FORMAT; + return flag_code == CODE_64BIT ? ELF_TARGET_FORMAT64 : ELF_TARGET_FORMAT; } #endif default: @@ -5578,7 +6195,8 @@ i386_target_format () #endif /* OBJ_MAYBE_ more than one */ #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) -void i386_elf_emit_arch_note () +void +i386_elf_emit_arch_note (void) { if (IS_ELF && cpu_arch_name != NULL) { @@ -5669,8 +6287,7 @@ md_section_align (segment, size) size, since the offset is always the last part of the insn. */ long -md_pcrel_from (fixP) - fixS *fixP; +md_pcrel_from (fixS *fixP) { return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } @@ -5678,8 +6295,7 @@ md_pcrel_from (fixP) #ifndef I386COFF static void -s_bss (ignore) - int ignore ATTRIBUTE_UNUSED; +s_bss (int ignore ATTRIBUTE_UNUSED) { int temp; @@ -5695,8 +6311,7 @@ s_bss (ignore) #endif void -i386_validate_fix (fixp) - fixS *fixp; +i386_validate_fix (fixS *fixp) { if (fixp->fx_subsy && fixp->fx_subsy == GOT_symbol) { @@ -6045,8 +6660,8 @@ struct intel_parser_s int got_a_float; /* Whether the operand is a float. */ int op_modifier; /* Operand modifier. */ int is_mem; /* 1 if operand is memory reference. */ - int in_offset; /* >=1 if parsing operand of offset. */ - int in_bracket; /* >=1 if parsing operand in brackets. */ + int in_offset; /* >=1 if parsing operand of offset. */ + int in_bracket; /* >=1 if parsing operand in brackets. */ const reg_entry *reg; /* Last register reference found. */ char *disp; /* Displacement string being built. */ char *next_operand; /* Resume point when splitting operands. */ @@ -6085,22 +6700,19 @@ static struct intel_token cur_token, prev_token; #define T_SHR 15 /* Prototypes for intel parser functions. */ -static int intel_match_token PARAMS ((int code)); -static void intel_get_token PARAMS ((void)); -static void intel_putback_token PARAMS ((void)); -static int intel_expr PARAMS ((void)); -static int intel_e04 PARAMS ((void)); -static int intel_e05 PARAMS ((void)); -static int intel_e06 PARAMS ((void)); -static int intel_e09 PARAMS ((void)); -static int intel_bracket_expr PARAMS ((void)); -static int intel_e10 PARAMS ((void)); -static int intel_e11 PARAMS ((void)); +static int intel_match_token (int); +static void intel_putback_token (void); +static void intel_get_token (void); +static int intel_expr (void); +static int intel_e04 (void); +static int intel_e05 (void); +static int intel_e06 (void); +static int intel_e09 (void); +static int intel_e10 (void); +static int intel_e11 (void); static int -i386_intel_operand (operand_string, got_a_float) - char *operand_string; - int got_a_float; +i386_intel_operand (char *operand_string, int got_a_float) { int ret; char *p; @@ -6190,7 +6802,7 @@ i386_intel_operand (operand_string, got_a_float) ret = i386_immediate (intel_parser.disp); if (intel_parser.next_operand && this_operand >= MAX_OPERANDS - 1) - ret = 0; + ret = 0; if (!ret || !intel_parser.next_operand) break; intel_parser.op_string = intel_parser.next_operand; @@ -6210,7 +6822,7 @@ i386_intel_operand (operand_string, got_a_float) expr' cmpOp e04 expr' | Empty */ static int -intel_expr () +intel_expr (void) { /* XXX Implement the comparison operators. */ return intel_e04 (); @@ -6221,7 +6833,7 @@ intel_expr () e04' addOp e05 e04' | Empty */ static int -intel_e04 () +intel_e04 (void) { int nregs = -1; @@ -6250,7 +6862,7 @@ intel_e04 () e05' binOp e06 e05' | Empty */ static int -intel_e05 () +intel_e05 (void) { int nregs = ~NUM_ADDRESS_REGS; @@ -6259,7 +6871,9 @@ intel_e05 () if (!intel_e06()) return 0; - if (cur_token.code == '&' || cur_token.code == '|' || cur_token.code == '^') + if (cur_token.code == '&' + || cur_token.code == '|' + || cur_token.code == '^') { char str[2]; @@ -6285,7 +6899,7 @@ intel_e05 () e06' mulOp e09 e06' | Empty */ static int -intel_e06 () +intel_e06 (void) { int nregs = ~NUM_ADDRESS_REGS; @@ -6294,7 +6908,9 @@ intel_e06 () if (!intel_e09()) return 0; - if (cur_token.code == '*' || cur_token.code == '/' || cur_token.code == '%') + if (cur_token.code == '*' + || cur_token.code == '/' + || cur_token.code == '%') { char str[2]; @@ -6309,7 +6925,7 @@ intel_e06 () else break; - intel_match_token (cur_token.code); + intel_match_token (cur_token.code); if (nregs < 0) nregs = ~nregs; @@ -6331,7 +6947,7 @@ intel_e06 () | : e10 e09' | Empty */ static int -intel_e09 () +intel_e09 (void) { int nregs = ~NUM_ADDRESS_REGS; int in_offset = 0; @@ -6545,7 +7161,7 @@ intel_e09 () } static int -intel_bracket_expr () +intel_bracket_expr (void) { int was_offset = intel_parser.op_modifier & (1 << T_OFFSET); const char *start = intel_parser.op_string; @@ -6581,7 +7197,7 @@ intel_bracket_expr () intel_parser.op_modifier &= ~was_offset; } else - strcat (intel_parser.disp, "["); + strcat (intel_parser.disp, "["); /* Add a '+' to the displacement string if necessary. */ if (*intel_parser.disp != '\0' @@ -6606,7 +7222,8 @@ intel_bracket_expr () /* Defer the warning until all of the operand was parsed. */ intel_parser.is_mem = -1; else if (!quiet_warnings) - as_warn (_("`[%.*s]' taken to mean just `%.*s'"), len, start, len, start); + as_warn (_("`[%.*s]' taken to mean just `%.*s'"), + len, start, len, start); } } intel_parser.op_modifier |= was_offset; @@ -6621,7 +7238,7 @@ intel_bracket_expr () e10' [ expr ] e10' | Empty */ static int -intel_e10 () +intel_e10 (void) { if (!intel_e11 ()) return 0; @@ -6651,7 +7268,7 @@ intel_e10 () | id | constant */ static int -intel_e11 () +intel_e11 (void) { switch (cur_token.code) { @@ -6696,7 +7313,8 @@ intel_e11 () { if (!(reg->reg_type & (SReg2 | SReg3))) { - as_bad (_("`%s' is not a valid segment register"), reg->reg_name); + as_bad (_("`%s' is not a valid segment register"), + reg->reg_name); return 0; } else if (i.seg[i.mem_operands]) @@ -6886,7 +7504,8 @@ intel_e11 () /* Get the next token to check for register scaling. */ intel_match_token (cur_token.code); - /* Check if this constant is a scaling factor for an index register. */ + /* Check if this constant is a scaling factor for an + index register. */ if (cur_token.code == '*') { if (intel_match_token ('*') && cur_token.code == T_REG) @@ -6895,14 +7514,17 @@ intel_e11 () if (!intel_parser.in_bracket) { - as_bad (_("Register scaling only allowed in memory operands")); + as_bad (_("Register scaling only allowed " + "in memory operands")); return 0; } - if (reg->reg_type & Reg16) /* Disallow things like [1*si]. */ - reg = i386_regtab + REGNAM_AX + 4; /* sp is invalid as index */ + /* Disallow things like [1*si]. + sp and esp are invalid as index. */ + if (reg->reg_type & Reg16) + reg = i386_regtab + REGNAM_AX + 4; else if (i.index_reg) - reg = i386_regtab + REGNAM_EAX + 4; /* esp is invalid as index */ + reg = i386_regtab + REGNAM_EAX + 4; /* The constant is followed by `* reg', so it must be a valid scale. */ @@ -6952,8 +7574,7 @@ intel_e11 () /* Match the given token against cur_token. If they match, read the next token from the operand string. */ static int -intel_match_token (code) - int code; +intel_match_token (int code) { if (cur_token.code == code) { @@ -6969,7 +7590,7 @@ intel_match_token (code) /* Read a new token from intel_parser.op_string and store it in cur_token. */ static void -intel_get_token () +intel_get_token (void) { char *end_op; const reg_entry *reg; @@ -7154,7 +7775,7 @@ intel_get_token () /* Put cur_token back into the token stream and make cur_token point to prev_token. */ static void -intel_putback_token () +intel_putback_token (void) { if (cur_token.code != T_NIL) { @@ -7170,7 +7791,7 @@ intel_putback_token () } int -tc_x86_regname_to_dw2regnum (const char *regname) +tc_x86_regname_to_dw2regnum (char *regname) { unsigned int regnum; unsigned int regnames_count; @@ -7281,16 +7902,16 @@ x86_64_section_letter (int letter, char **ptr_msg) return SHF_X86_64_LARGE; *ptr_msg = _("Bad .section directive: want a,l,w,x,M,S,G,T in string"); - } + } else - *ptr_msg = _("Bad .section directive: want a,w,x,M,S,G,T in string"); + *ptr_msg = _("Bad .section directive: want a,w,x,M,S,G,T in string"); return -1; } int x86_64_section_word (char *str, size_t len) { - if (len == 5 && flag_code == CODE_64BIT && strncmp (str, "large", 5) == 0) + if (len == 5 && flag_code == CODE_64BIT && CONST_STRNEQ (str, "large")) return SHF_X86_64_LARGE; return -1; diff --git a/contrib/binutils/gas/config/tc-i386.h b/contrib/binutils/gas/config/tc-i386.h index 98517041dad..51638b08033 100644 --- a/contrib/binutils/gas/config/tc-i386.h +++ b/contrib/binutils/gas/config/tc-i386.h @@ -1,6 +1,6 @@ /* tc-i386.h -- Header file for tc-i386.c Copyright 1989, 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 GAS, the GNU Assembler. @@ -23,6 +23,8 @@ #ifndef TC_I386 #define TC_I386 1 +#include "opcodes/i386-opc.h" + struct fix; #define TARGET_BYTES_BIG_ENDIAN 0 @@ -55,6 +57,7 @@ extern unsigned long i386_mach (void); #ifdef TE_FreeBSD #define ELF_TARGET_FORMAT "elf32-i386-freebsd" +#define ELF_TARGET_FORMAT64 "elf64-x86-64-freebsd" #elif defined (TE_VXWORKS) #define ELF_TARGET_FORMAT "elf32-i386-vxworks" #endif @@ -63,9 +66,13 @@ extern unsigned long i386_mach (void); #define ELF_TARGET_FORMAT "elf32-i386" #endif +#ifndef ELF_TARGET_FORMAT64 +#define ELF_TARGET_FORMAT64 "elf64-x86-64" +#endif + #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) -extern const char *i386_target_format PARAMS ((void)); +extern const char *i386_target_format (void); #define TARGET_FORMAT i386_target_format () #else #ifdef OBJ_ELF @@ -78,7 +85,7 @@ extern const char *i386_target_format PARAMS ((void)); #if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF)) #define md_end i386_elf_emit_arch_note -extern void i386_elf_emit_arch_note PARAMS ((void)); +extern void i386_elf_emit_arch_note (void); #endif #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 @@ -91,18 +98,16 @@ extern const char extra_symbol_chars[]; extern const char *i386_comment_chars; #define tc_comment_chars i386_comment_chars -#define MAX_OPERANDS 3 /* max operands per insn */ -#define MAX_IMMEDIATE_OPERANDS 2/* max immediates per insn (lcall, ljmp) */ -#define MAX_MEMORY_OPERANDS 2 /* max memory refs per insn (string ops) */ - /* Prefixes will be emitted in the order defined below. WAIT_PREFIX must be the first prefix since FWAIT is really is an - instruction, and so must come before any prefixes. */ + instruction, and so must come before any prefixes. + The preferred prefix order is SEG_PREFIX, ADDR_PREFIX, DATA_PREFIX, + LOCKREP_PREFIX. */ #define WAIT_PREFIX 0 -#define LOCKREP_PREFIX 1 +#define SEG_PREFIX 1 #define ADDR_PREFIX 2 #define DATA_PREFIX 3 -#define SEG_PREFIX 4 +#define LOCKREP_PREFIX 4 #define REX_PREFIX 5 /* must come last. */ #define MAX_PREFIXES 6 /* max prefixes per opcode */ @@ -111,21 +116,6 @@ extern const char *i386_comment_chars; #define IMMEDIATE_PREFIX '$' #define ABSOLUTE_PREFIX '*' -#define TWO_BYTE_OPCODE_ESCAPE 0x0f -#define NOP_OPCODE (char) 0x90 - -/* register numbers */ -#define EBP_REG_NUM 5 -#define ESP_REG_NUM 4 - -/* modrm_byte.regmem for twobyte escape */ -#define ESCAPE_TO_TWO_BYTE_ADDRESSING ESP_REG_NUM -/* index_base_byte.index for no index register addressing */ -#define NO_INDEX_REGISTER ESP_REG_NUM -/* index_base_byte.base for no base register addressing */ -#define NO_BASE_REGISTER EBP_REG_NUM -#define NO_BASE_REGISTER_16 6 - /* these are the instruction mnemonic suffixes. */ #define WORD_MNEM_SUFFIX 'w' #define BYTE_MNEM_SUFFIX 'b' @@ -135,184 +125,8 @@ extern const char *i386_comment_chars; /* Intel Syntax */ #define LONG_DOUBLE_MNEM_SUFFIX 'x' -/* modrm.mode = REGMEM_FIELD_HAS_REG when a register is in there */ -#define REGMEM_FIELD_HAS_REG 0x3/* always = 0x3 */ -#define REGMEM_FIELD_HAS_MEM (~REGMEM_FIELD_HAS_REG) - #define END_OF_INSN '\0' -typedef struct -{ - /* instruction name sans width suffix ("mov" for movl insns) */ - char *name; - - /* how many operands */ - unsigned int operands; - - /* base_opcode is the fundamental opcode byte without optional - prefix(es). */ - unsigned int base_opcode; - - /* extension_opcode is the 3 bit extension for group insns. - This field is also used to store the 8-bit opcode suffix for the - AMD 3DNow! instructions. - If this template has no extension opcode (the usual case) use None */ - unsigned int extension_opcode; -#define None 0xffff /* If no extension_opcode is possible. */ - - /* cpu feature flags */ - unsigned int cpu_flags; -#define Cpu086 0x1 /* Any old cpu will do, 0 does the same */ -#define Cpu186 0x2 /* i186 or better required */ -#define Cpu286 0x4 /* i286 or better required */ -#define Cpu386 0x8 /* i386 or better required */ -#define Cpu486 0x10 /* i486 or better required */ -#define Cpu586 0x20 /* i585 or better required */ -#define Cpu686 0x40 /* i686 or better required */ -#define CpuP4 0x80 /* Pentium4 or better required */ -#define CpuK6 0x100 /* AMD K6 or better required*/ -#define CpuAthlon 0x200 /* AMD Athlon or better required*/ -#define CpuSledgehammer 0x400 /* Sledgehammer or better required */ -#define CpuMMX 0x800 /* MMX support required */ -#define CpuMMX2 0x1000 /* extended MMX support (with SSE or 3DNow!Ext) required */ -#define CpuSSE 0x2000 /* Streaming SIMD extensions required */ -#define CpuSSE2 0x4000 /* Streaming SIMD extensions 2 required */ -#define Cpu3dnow 0x8000 /* 3dnow! support required */ -#define Cpu3dnowA 0x10000 /* 3dnow!Extensions support required */ -#define CpuSSE3 0x20000 /* Streaming SIMD extensions 3 required */ -#define CpuPNI CpuSSE3 /* Prescott New Instructions required */ -#define CpuPadLock 0x40000 /* VIA PadLock required */ -#define CpuSVME 0x80000 /* AMD Secure Virtual Machine Ext-s required */ -#define CpuVMX 0x100000 /* VMX Instructions required */ -#define CpuMNI 0x200000 /* Merom New Instructions required */ - - /* These flags are set by gas depending on the flag_code. */ -#define Cpu64 0x4000000 /* 64bit support required */ -#define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ - - /* The default value for unknown CPUs - enable all features to avoid problems. */ -#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ - |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuPNI|CpuVMX \ - |Cpu3dnow|Cpu3dnowA|CpuK6|CpuAthlon|CpuPadLock|CpuSVME|CpuMNI) - - /* the bits in opcode_modifier are used to generate the final opcode from - the base_opcode. These bits also are used to detect alternate forms of - the same instruction */ - unsigned int opcode_modifier; - - /* opcode_modifier bits: */ -#define W 0x1 /* set if operands can be words or dwords - encoded the canonical way */ -#define D 0x2 /* D = 0 if Reg --> Regmem; - D = 1 if Regmem --> Reg: MUST BE 0x2 */ -#define Modrm 0x4 -#define FloatR 0x8 /* src/dest swap for floats: MUST BE 0x8 */ -#define ShortForm 0x10 /* register is in low 3 bits of opcode */ -#define FloatMF 0x20 /* FP insn memory format bit, sized by 0x4 */ -#define Jump 0x40 /* special case for jump insns. */ -#define JumpDword 0x80 /* call and jump */ -#define JumpByte 0x100 /* loop and jecxz */ -#define JumpInterSegment 0x200 /* special case for intersegment leaps/calls */ -#define FloatD 0x400 /* direction for float insns: MUST BE 0x400 */ -#define Seg2ShortForm 0x800 /* encoding of load segment reg insns */ -#define Seg3ShortForm 0x1000 /* fs/gs segment register insns. */ -#define Size16 0x2000 /* needs size prefix if in 32-bit mode */ -#define Size32 0x4000 /* needs size prefix if in 16-bit mode */ -#define Size64 0x8000 /* needs size prefix if in 16-bit mode */ -#define IgnoreSize 0x10000 /* instruction ignores operand size prefix */ -#define DefaultSize 0x20000 /* default insn size depends on mode */ -#define No_bSuf 0x40000 /* b suffix on instruction illegal */ -#define No_wSuf 0x80000 /* w suffix on instruction illegal */ -#define No_lSuf 0x100000 /* l suffix on instruction illegal */ -#define No_sSuf 0x200000 /* s suffix on instruction illegal */ -#define No_qSuf 0x400000 /* q suffix on instruction illegal */ -#define No_xSuf 0x800000 /* x suffix on instruction illegal */ -#define FWait 0x1000000 /* instruction needs FWAIT */ -#define IsString 0x2000000 /* quick test for string instructions */ -#define regKludge 0x4000000 /* fake an extra reg operand for clr, imul */ -#define IsPrefix 0x8000000 /* opcode is a prefix */ -#define ImmExt 0x10000000 /* instruction has extension in 8 bit imm */ -#define NoRex64 0x20000000 /* instruction don't need Rex64 prefix. */ -#define Rex64 0x40000000 /* instruction require Rex64 prefix. */ -#define Ugh 0x80000000 /* deprecated fp insn, gets a warning */ - - /* operand_types[i] describes the type of operand i. This is made - by OR'ing together all of the possible type masks. (e.g. - 'operand_types[i] = Reg|Imm' specifies that operand i can be - either a register or an immediate operand. */ - unsigned int operand_types[3]; - - /* operand_types[i] bits */ - /* register */ -#define Reg8 0x1 /* 8 bit reg */ -#define Reg16 0x2 /* 16 bit reg */ -#define Reg32 0x4 /* 32 bit reg */ -#define Reg64 0x8 /* 64 bit reg */ - /* immediate */ -#define Imm8 0x10 /* 8 bit immediate */ -#define Imm8S 0x20 /* 8 bit immediate sign extended */ -#define Imm16 0x40 /* 16 bit immediate */ -#define Imm32 0x80 /* 32 bit immediate */ -#define Imm32S 0x100 /* 32 bit immediate sign extended */ -#define Imm64 0x200 /* 64 bit immediate */ -#define Imm1 0x400 /* 1 bit immediate */ - /* memory */ -#define BaseIndex 0x800 - /* Disp8,16,32 are used in different ways, depending on the - instruction. For jumps, they specify the size of the PC relative - displacement, for baseindex type instructions, they specify the - size of the offset relative to the base register, and for memory - offset instructions such as `mov 1234,%al' they specify the size of - the offset relative to the segment base. */ -#define Disp8 0x1000 /* 8 bit displacement */ -#define Disp16 0x2000 /* 16 bit displacement */ -#define Disp32 0x4000 /* 32 bit displacement */ -#define Disp32S 0x8000 /* 32 bit signed displacement */ -#define Disp64 0x10000 /* 64 bit displacement */ - /* specials */ -#define InOutPortReg 0x20000 /* register to hold in/out port addr = dx */ -#define ShiftCount 0x40000 /* register to hold shift cound = cl */ -#define Control 0x80000 /* Control register */ -#define Debug 0x100000 /* Debug register */ -#define Test 0x200000 /* Test register */ -#define FloatReg 0x400000 /* Float register */ -#define FloatAcc 0x800000 /* Float stack top %st(0) */ -#define SReg2 0x1000000 /* 2 bit segment register */ -#define SReg3 0x2000000 /* 3 bit segment register */ -#define Acc 0x4000000 /* Accumulator %al or %ax or %eax */ -#define JumpAbsolute 0x8000000 -#define RegMMX 0x10000000 /* MMX register */ -#define RegXMM 0x20000000 /* XMM registers in PIII */ -#define EsSeg 0x40000000 /* String insn operand with fixed es segment */ - - /* InvMem is for instructions with a modrm byte that only allow a - general register encoding in the i.tm.mode and i.tm.regmem fields, - eg. control reg moves. They really ought to support a memory form, - but don't, so we add an InvMem flag to the register operand to - indicate that it should be encoded in the i.tm.regmem field. */ -#define InvMem 0x80000000 - -#define Reg (Reg8|Reg16|Reg32|Reg64) /* gen'l register */ -#define WordReg (Reg16|Reg32|Reg64) -#define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc) -#define Imm (Imm8|Imm8S|Imm16|Imm32S|Imm32|Imm64) /* gen'l immediate */ -#define EncImm (Imm8|Imm16|Imm32|Imm32S) /* Encodable gen'l immediate */ -#define Disp (Disp8|Disp16|Disp32|Disp32S|Disp64) /* General displacement */ -#define AnyMem (Disp8|Disp16|Disp32|Disp32S|BaseIndex|InvMem) /* General memory */ - /* The following aliases are defined because the opcode table - carefully specifies the allowed memory types for each instruction. - At the moment we can only tell a memory reference size by the - instruction suffix, so there's not much point in defining Mem8, - Mem16, Mem32 and Mem64 opcode modifiers - We might as well just use - the suffix directly to check memory operands. */ -#define LLongMem AnyMem /* 64 bits (or more) */ -#define LongMem AnyMem /* 32 bit memory ref */ -#define ShortMem AnyMem /* 16 bit memory ref */ -#define WordMem AnyMem /* 16 or 32 bit memory ref */ -#define ByteMem AnyMem /* 8 bit memory ref */ -} -template; - /* 'templates' is for grouping together 'template' structures for opcodes of the same name. This is only used for storing the insns in the grand @@ -327,25 +141,6 @@ typedef struct } templates; -/* these are for register name --> number & type hash lookup */ -typedef struct -{ - char *reg_name; - unsigned int reg_type; - unsigned int reg_flags; -#define RegRex 0x1 /* Extended register. */ -#define RegRex64 0x2 /* Extended 8 bit register. */ - unsigned int reg_num; -} -reg_entry; - -typedef struct -{ - char *seg_name; - unsigned int seg_prefix; -} -seg_entry; - /* 386 operand encoding bytes: see 386 book for details of this. */ typedef struct { @@ -357,16 +152,6 @@ modrm_byte; /* x86-64 extension prefix. */ typedef int rex_byte; -#define REX_OPCODE 0x40 - -/* Indicates 64 bit operand size. */ -#define REX_MODE64 8 -/* High extension to reg field of modrm byte. */ -#define REX_EXTX 4 -/* High extension to SIB index field. */ -#define REX_EXTY 2 -/* High extension to base field of modrm or SIB, or reg field of opcode. */ -#define REX_EXTZ 1 /* 386 opcode byte to code indirect addressing. */ typedef struct @@ -377,11 +162,30 @@ typedef struct } sib_byte; -/* x86 arch names and features */ +enum processor_type +{ + PROCESSOR_UNKNOWN, + PROCESSOR_I486, + PROCESSOR_PENTIUM, + PROCESSOR_PENTIUMPRO, + PROCESSOR_PENTIUM4, + PROCESSOR_NOCONA, + PROCESSOR_CORE, + PROCESSOR_CORE2, + PROCESSOR_K6, + PROCESSOR_ATHLON, + PROCESSOR_K8, + PROCESSOR_GENERIC32, + PROCESSOR_GENERIC64, + PROCESSOR_AMDFAM10 +}; + +/* x86 arch names, types and features */ typedef struct { - const char *name; /* arch name */ - unsigned int flags; /* cpu feature flags */ + const char *name; /* arch name */ + enum processor_type type; /* arch type */ + unsigned int flags; /* cpu feature flags */ } arch_entry; @@ -393,22 +197,22 @@ arch_entry; #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && !defined (LEX_AT) #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES) -extern void x86_cons PARAMS ((expressionS *, int)); +extern void x86_cons (expressionS *, int); #endif #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP) extern void x86_cons_fix_new - PARAMS ((fragS *, unsigned int, unsigned int, expressionS *)); + (fragS *, unsigned int, unsigned int, expressionS *); #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ #define NO_RELOC BFD_RELOC_NONE -void i386_validate_fix PARAMS ((struct fix *)); +void i386_validate_fix (struct fix *); #define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) i386_validate_fix(FIX) #define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) -extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); +extern int tc_i386_fix_adjustable (struct fix *); /* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 @@ -432,7 +236,6 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \ || (FIX)->fx_r_type == BFD_RELOC_386_GOT32 \ || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \ @@ -460,7 +263,7 @@ if ((n) \ #define MAX_MEM_FOR_RS_ALIGN_CODE 15 -extern void i386_align_code PARAMS ((fragS *, int)); +extern void i386_align_code (fragS *, int); #define HANDLE_ALIGN(fragP) \ if (fragP->fr_type == rs_align_code) \ @@ -468,16 +271,18 @@ if (fragP->fr_type == rs_align_code) \ - fragP->fr_address \ - fragP->fr_fix)); -void i386_print_statistics PARAMS ((FILE *)); +void i386_print_statistics (FILE *); #define tc_print_statistics i386_print_statistics #define md_number_to_chars number_to_chars_littleendian #ifdef SCO_ELF #define tc_init_after_args() sco_id () -extern void sco_id PARAMS ((void)); +extern void sco_id (void); #endif +#define WORKING_DOT_WORD 1 + /* We want .cfi_* pseudo-ops for generating unwind info. */ #define TARGET_USE_CFIPOP 1 @@ -488,17 +293,17 @@ extern int x86_cie_data_alignment; #define DWARF2_CIE_DATA_ALIGNMENT x86_cie_data_alignment #define tc_regname_to_dw2regnum tc_x86_regname_to_dw2regnum -extern int tc_x86_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int tc_x86_regname_to_dw2regnum (char *); #define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions -extern void tc_x86_frame_initial_instructions PARAMS ((void)); +extern void tc_x86_frame_initial_instructions (void); #define md_elf_section_type(str,len) i386_elf_section_type (str, len) -extern int i386_elf_section_type PARAMS ((const char *, size_t len)); +extern int i386_elf_section_type (const char *, size_t); /* Support for SHF_X86_64_LARGE */ -extern int x86_64_section_word PARAMS ((char *, size_t)); -extern int x86_64_section_letter PARAMS ((int letter, char **ptr_msg)); +extern int x86_64_section_word (char *, size_t); +extern int x86_64_section_letter (int, char **); #define md_elf_section_letter(LETTER, PTR_MSG) x86_64_section_letter (LETTER, PTR_MSG) #define md_elf_section_word(STR, LEN) x86_64_section_word (STR, LEN) diff --git a/contrib/binutils/gas/config/tc-ia64.c b/contrib/binutils/gas/config/tc-ia64.c index 426b60f589a..5ed9ba82ad2 100644 --- a/contrib/binutils/gas/config/tc-ia64.c +++ b/contrib/binutils/gas/config/tc-ia64.c @@ -1,5 +1,5 @@ /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture. - 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. Contributed by David Mosberger-Tang @@ -5634,7 +5634,7 @@ declare_register_set (prefix, num_regs, base_regnum) for (i = 0; i < num_regs; ++i) { - sprintf (name, "%s%u", prefix, i); + snprintf (name, sizeof (name), "%s%u", prefix, i); declare_register (name, base_regnum + i); } } @@ -6691,7 +6691,7 @@ emit_one_bundle () int addr_mod; first = (md.curr_slot + NUM_SLOTS - md.num_slots_in_use) % NUM_SLOTS; - know (first >= 0 & first < NUM_SLOTS); + know (first >= 0 && first < NUM_SLOTS); n = MIN (3, md.num_slots_in_use); /* Determine template: user user_template if specified, best match @@ -6971,7 +6971,8 @@ emit_one_bundle () else as_fatal ("emit_one_bundle: unexpected dynamic op"); - sprintf (mnemonic, "%s.%c", idesc->name, "?imbfxx"[insn_unit]); + snprintf (mnemonic, sizeof (mnemonic), "%s.%c", + idesc->name, "?imbfxx"[insn_unit]); opnd1 = idesc->operands[0]; opnd2 = idesc->operands[1]; ia64_free_opcode (idesc); @@ -7066,7 +7067,6 @@ emit_one_bundle () fix = fix_new_exp (frag_now, frag_now_fix () - 16 + i, 8, &ifix->expr, ifix->is_pcrel, ifix->code); fix->tc_fix_data.opnd = ifix->opnd; - fix->fx_plt = (fix->fx_r_type == BFD_RELOC_IA64_PLTOFF22); fix->fx_file = md.slot[curr].src_file; fix->fx_line = md.slot[curr].src_line; } @@ -10544,12 +10544,15 @@ check_dependencies (idesc) int certain = (matchtype == 1 && CURR_SLOT.qp_regno == 0); if (path != 0) - sprintf (pathmsg, " when entry is at label '%s'", + snprintf (pathmsg, sizeof (pathmsg), + " when entry is at label '%s'", md.entry_labels[path - 1]); if (matchtype == 1 && rs->index >= 0) - sprintf (indexmsg, ", specific resource number is %d", + snprintf (indexmsg, sizeof (indexmsg), + ", specific resource number is %d", rs->index); - sprintf (msg, "Use of '%s' %s %s dependency '%s' (%s)%s%s", + snprintf (msg, sizeof (msg), + "Use of '%s' %s %s dependency '%s' (%s)%s%s", idesc->name, (certain ? "violates" : "may violate"), dv_mode[dep->mode], dep->name, @@ -11862,7 +11865,7 @@ struct alias { char *file; /* The file where the directive is seen. */ unsigned int line; /* The line number the directive is at. */ - const char *name; /* The orignale name of the symbol. */ + const char *name; /* The original name of the symbol. */ }; /* Called for .alias and .secalias directives. If SECTION is 1, it is diff --git a/contrib/binutils/gas/config/tc-ia64.h b/contrib/binutils/gas/config/tc-ia64.h index c17494beb16..b851b9f37eb 100644 --- a/contrib/binutils/gas/config/tc-ia64.h +++ b/contrib/binutils/gas/config/tc-ia64.h @@ -1,5 +1,5 @@ /* tc-ia64.h -- Header file for tc-ia64.c. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by David Mosberger-Tang @@ -315,5 +315,5 @@ typedef struct unwind_record #define TC_FORCE_RELOCATION_LOCAL(FIX) \ ((FIX)->fx_r_type != BFD_RELOC_UNUSED \ && (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ + || (FIX)->fx_r_type == BFD_RELOC_IA64_PLTOFF22 \ || TC_FORCE_RELOCATION (FIX))) diff --git a/contrib/binutils/gas/config/tc-mep.c b/contrib/binutils/gas/config/tc-mep.c new file mode 100644 index 00000000000..b3b17d3c7a1 --- /dev/null +++ b/contrib/binutils/gas/config/tc-mep.c @@ -0,0 +1,1886 @@ +/* tc-mep.c -- Assembler for the Toshiba Media Processor. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation. + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include +#include "as.h" +#include "dwarf2dbg.h" +#include "subsegs.h" +#include "symcat.h" +#include "opcodes/mep-desc.h" +#include "opcodes/mep-opc.h" +#include "cgen.h" +#include "elf/common.h" +#include "elf/mep.h" +#include "libbfd.h" +#include "xregex.h" + +/* Structure to hold all of the different components describing + an individual instruction. */ +typedef struct +{ + const CGEN_INSN * insn; + const CGEN_INSN * orig_insn; + CGEN_FIELDS fields; +#if CGEN_INT_INSN_P + CGEN_INSN_INT buffer [1]; +#define INSN_VALUE(buf) (*(buf)) +#else + unsigned char buffer [CGEN_MAX_INSN_SIZE]; +#define INSN_VALUE(buf) (buf) +#endif + char * addr; + fragS * frag; + int num_fixups; + fixS * fixups [GAS_CGEN_MAX_FIXUPS]; + int indices [MAX_OPERAND_INSTANCES]; +} mep_insn; + +static int mode = CORE; /* Start in core mode. */ +static int pluspresent = 0; +static int allow_disabled_registers = 0; +static int library_flag = 0; + +/* We're going to need to store all of the instructions along with + their fixups so that we can parallelization grouping rules. */ + +static mep_insn saved_insns[MAX_SAVED_FIXUP_CHAINS]; +static int num_insns_saved = 0; + +const char comment_chars[] = "#"; +const char line_comment_chars[] = ";#"; +const char line_separator_chars[] = ";"; +const char EXP_CHARS[] = "eE"; +const char FLT_CHARS[] = "dD"; + +static void mep_switch_to_vliw_mode (int); +static void mep_switch_to_core_mode (int); +static void mep_s_vtext (int); +static void mep_noregerr (int); + +/* The target specific pseudo-ops which we support. */ +const pseudo_typeS md_pseudo_table[] = +{ + { "word", cons, 4 }, + { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, + { "vliw", mep_switch_to_vliw_mode, 0 }, + { "core", mep_switch_to_core_mode, 0 }, + { "vtext", mep_s_vtext, 0 }, + { "noregerr", mep_noregerr, 0 }, + { NULL, NULL, 0 } +}; + +/* Relocations against symbols are done in two + parts, with a HI relocation and a LO relocation. Each relocation + has only 16 bits of space to store an addend. This means that in + order for the linker to handle carries correctly, it must be able + to locate both the HI and the LO relocation. This means that the + relocations must appear in order in the relocation table. + + In order to implement this, we keep track of each unmatched HI + relocation. We then sort them so that they immediately precede the + corresponding LO relocation. */ + +struct mep_hi_fixup +{ + struct mep_hi_fixup * next; /* Next HI fixup. */ + fixS * fixp; /* This fixup. */ + segT seg; /* The section this fixup is in. */ +}; + +/* The list of unmatched HI relocs. */ +static struct mep_hi_fixup * mep_hi_fixup_list; + + +#define OPTION_EB (OPTION_MD_BASE + 0) +#define OPTION_EL (OPTION_MD_BASE + 1) +#define OPTION_CONFIG (OPTION_MD_BASE + 2) +#define OPTION_AVERAGE (OPTION_MD_BASE + 3) +#define OPTION_NOAVERAGE (OPTION_MD_BASE + 4) +#define OPTION_MULT (OPTION_MD_BASE + 5) +#define OPTION_NOMULT (OPTION_MD_BASE + 6) +#define OPTION_DIV (OPTION_MD_BASE + 7) +#define OPTION_NODIV (OPTION_MD_BASE + 8) +#define OPTION_BITOPS (OPTION_MD_BASE + 9) +#define OPTION_NOBITOPS (OPTION_MD_BASE + 10) +#define OPTION_LEADZ (OPTION_MD_BASE + 11) +#define OPTION_NOLEADZ (OPTION_MD_BASE + 12) +#define OPTION_ABSDIFF (OPTION_MD_BASE + 13) +#define OPTION_NOABSDIFF (OPTION_MD_BASE + 14) +#define OPTION_MINMAX (OPTION_MD_BASE + 15) +#define OPTION_NOMINMAX (OPTION_MD_BASE + 16) +#define OPTION_CLIP (OPTION_MD_BASE + 17) +#define OPTION_NOCLIP (OPTION_MD_BASE + 18) +#define OPTION_SATUR (OPTION_MD_BASE + 19) +#define OPTION_NOSATUR (OPTION_MD_BASE + 20) +#define OPTION_COP32 (OPTION_MD_BASE + 21) +#define OPTION_REPEAT (OPTION_MD_BASE + 25) +#define OPTION_NOREPEAT (OPTION_MD_BASE + 26) +#define OPTION_DEBUG (OPTION_MD_BASE + 27) +#define OPTION_NODEBUG (OPTION_MD_BASE + 28) +#define OPTION_LIBRARY (OPTION_MD_BASE + 29) + +struct option md_longopts[] = { + { "EB", no_argument, NULL, OPTION_EB}, + { "EL", no_argument, NULL, OPTION_EL}, + { "mconfig", required_argument, NULL, OPTION_CONFIG}, + { "maverage", no_argument, NULL, OPTION_AVERAGE}, + { "mno-average", no_argument, NULL, OPTION_NOAVERAGE}, + { "mmult", no_argument, NULL, OPTION_MULT}, + { "mno-mult", no_argument, NULL, OPTION_NOMULT}, + { "mdiv", no_argument, NULL, OPTION_DIV}, + { "mno-div", no_argument, NULL, OPTION_NODIV}, + { "mbitops", no_argument, NULL, OPTION_BITOPS}, + { "mno-bitops", no_argument, NULL, OPTION_NOBITOPS}, + { "mleadz", no_argument, NULL, OPTION_LEADZ}, + { "mno-leadz", no_argument, NULL, OPTION_NOLEADZ}, + { "mabsdiff", no_argument, NULL, OPTION_ABSDIFF}, + { "mno-absdiff", no_argument, NULL, OPTION_NOABSDIFF}, + { "mminmax", no_argument, NULL, OPTION_MINMAX}, + { "mno-minmax", no_argument, NULL, OPTION_NOMINMAX}, + { "mclip", no_argument, NULL, OPTION_CLIP}, + { "mno-clip", no_argument, NULL, OPTION_NOCLIP}, + { "msatur", no_argument, NULL, OPTION_SATUR}, + { "mno-satur", no_argument, NULL, OPTION_NOSATUR}, + { "mcop32", no_argument, NULL, OPTION_COP32}, + { "mdebug", no_argument, NULL, OPTION_DEBUG}, + { "mno-debug", no_argument, NULL, OPTION_NODEBUG}, + { "mlibrary", no_argument, NULL, OPTION_LIBRARY}, + { NULL, 0, NULL, 0 } }; +size_t md_longopts_size = sizeof (md_longopts); + +const char * md_shortopts = ""; +static int optbits = 0; +static int optbitset = 0; + +int +md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +{ + int i, idx; + switch (c) + { + case OPTION_EB: + target_big_endian = 1; + break; + case OPTION_EL: + target_big_endian = 0; + break; + case OPTION_CONFIG: + idx = 0; + for (i=1; mep_config_map[i].name; i++) + if (strcmp (mep_config_map[i].name, arg) == 0) + { + idx = i; + break; + } + if (!idx) + { + fprintf (stderr, "Error: unknown configuration %s\n", arg); + return 0; + } + mep_config_index = idx; + target_big_endian = mep_config_map[idx].big_endian; + break; + case OPTION_AVERAGE: + optbits |= 1 << CGEN_INSN_OPTIONAL_AVE_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_AVE_INSN; + break; + case OPTION_NOAVERAGE: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_AVE_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_AVE_INSN; + break; + case OPTION_MULT: + optbits |= 1 << CGEN_INSN_OPTIONAL_MUL_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_MUL_INSN; + break; + case OPTION_NOMULT: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_MUL_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_MUL_INSN; + break; + case OPTION_DIV: + optbits |= 1 << CGEN_INSN_OPTIONAL_DIV_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_DIV_INSN; + break; + case OPTION_NODIV: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_DIV_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_DIV_INSN; + break; + case OPTION_BITOPS: + optbits |= 1 << CGEN_INSN_OPTIONAL_BIT_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_BIT_INSN; + break; + case OPTION_NOBITOPS: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_BIT_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_BIT_INSN; + break; + case OPTION_LEADZ: + optbits |= 1 << CGEN_INSN_OPTIONAL_LDZ_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_LDZ_INSN; + break; + case OPTION_NOLEADZ: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_LDZ_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_LDZ_INSN; + break; + case OPTION_ABSDIFF: + optbits |= 1 << CGEN_INSN_OPTIONAL_ABS_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_ABS_INSN; + break; + case OPTION_NOABSDIFF: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_ABS_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_ABS_INSN; + break; + case OPTION_MINMAX: + optbits |= 1 << CGEN_INSN_OPTIONAL_MINMAX_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_MINMAX_INSN; + break; + case OPTION_NOMINMAX: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_MINMAX_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_MINMAX_INSN; + break; + case OPTION_CLIP: + optbits |= 1 << CGEN_INSN_OPTIONAL_CLIP_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_CLIP_INSN; + break; + case OPTION_NOCLIP: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_CLIP_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_CLIP_INSN; + break; + case OPTION_SATUR: + optbits |= 1 << CGEN_INSN_OPTIONAL_SAT_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_SAT_INSN; + break; + case OPTION_NOSATUR: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_SAT_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_SAT_INSN; + break; + case OPTION_COP32: + optbits |= 1 << CGEN_INSN_OPTIONAL_CP_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_CP_INSN; + break; + case OPTION_DEBUG: + optbits |= 1 << CGEN_INSN_OPTIONAL_DEBUG_INSN; + optbitset |= 1 << CGEN_INSN_OPTIONAL_DEBUG_INSN; + break; + case OPTION_NODEBUG: + optbits &= ~(1 << CGEN_INSN_OPTIONAL_DEBUG_INSN); + optbitset |= 1 << CGEN_INSN_OPTIONAL_DEBUG_INSN; + break; + case OPTION_LIBRARY: + library_flag = EF_MEP_LIBRARY; + break; + case OPTION_REPEAT: + case OPTION_NOREPEAT: + break; + default: + return 0; + } + return 1; +} + +void +md_show_usage (FILE *stream) +{ + fprintf (stream, _("MeP specific command line options:\n\ + -EB assemble for a big endian system (default)\n\ + -EL assemble for a little endian system\n\ + -mconfig= specify a chip configuration to use\n\ + -maverage -mno-average -mmult -mno-mult -mdiv -mno-div\n\ + -mbitops -mno-bitops -mleadz -mno-leadz -mabsdiff -mno-absdiff\n\ + -mminmax -mno-minmax -mclip -mno-clip -msatur -mno-satur -mcop32\n\ + enable/disable the given opcodes\n\ +\n\ + If -mconfig is given, the other -m options modify it. Otherwise,\n\ + if no -m options are given, all core opcodes are enabled;\n\ + if any enabling -m options are given, only those are enabled;\n\ + if only disabling -m options are given, only those are disabled.\n\ +")); + if (mep_config_map[1].name) + { + int i; + fprintf (stream, " -mconfig=STR specify the configuration to use\n"); + fprintf (stream, " Configurations:"); + for (i=0; mep_config_map[i].name; i++) + fprintf (stream, " %s", mep_config_map[i].name); + fprintf (stream, "\n"); + } +} + + + +static void +mep_check_for_disabled_registers (mep_insn *insn) +{ + static int initted = 0; + static int has_mul_div = 0; + static int has_cop = 0; + static int has_debug = 0; + unsigned int b, r; + + if (allow_disabled_registers) + return; + +#if !CGEN_INT_INSN_P + if (target_big_endian) + b = insn->buffer[0] * 256 + insn->buffer[1]; + else + b = insn->buffer[1] * 256 + insn->buffer[0]; +#else + b = insn->buffer[0]; +#endif + + if ((b & 0xfffff00e) == 0x7008 /* stc */ + || (b & 0xfffff00e) == 0x700a /* ldc */) + { + if (!initted) + { + initted = 1; + if ((MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_MUL_INSN)) + || (MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_DIV_INSN))) + has_mul_div = 1; + if (MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_DEBUG_INSN)) + has_debug = 1; + if (MEP_OMASK & (1 << CGEN_INSN_OPTIONAL_CP_INSN)) + has_cop = 1; + } + + r = ((b & 0x00f0) >> 4) | ((b & 0x0001) << 4); + switch (r) + { + case 7: /* $hi */ + case 8: /* $lo */ + if (!has_mul_div) + as_bad ("$hi and $lo are disabled when MUL and DIV are off"); + break; + case 12: /* $mb0 */ + case 13: /* $me0 */ + case 14: /* $mb1 */ + case 15: /* $me1 */ + if (!has_cop) + as_bad ("$mb0, $me0, $mb1, and $me1 are disabled when COP is off"); + break; + case 24: /* $dbg */ + case 25: /* $depc */ + if (!has_debug) + as_bad ("$dbg and $depc are disabled when DEBUG is off"); + break; + } + } +} + +static int +mep_machine (void) +{ + switch (MEP_CPU) + { + default: break; + case EF_MEP_CPU_C2: return bfd_mach_mep; + case EF_MEP_CPU_C3: return bfd_mach_mep; + case EF_MEP_CPU_C4: return bfd_mach_mep; + case EF_MEP_CPU_H1: return bfd_mach_mep_h1; + } + + return bfd_mach_mep; +} + +/* The MeP version of the cgen parse_operand function. The only difference + from the standard version is that we want to avoid treating '$foo' and + '($foo...)' as references to a symbol called '$foo'. The chances are + that '$foo' is really a misspelt register. */ + +static const char * +mep_parse_operand (CGEN_CPU_DESC cd, enum cgen_parse_operand_type want, + const char **strP, int opindex, int opinfo, + enum cgen_parse_operand_result *resultP, bfd_vma *valueP) +{ + if (want == CGEN_PARSE_OPERAND_INTEGER || want == CGEN_PARSE_OPERAND_ADDRESS) + { + const char *next; + + next = *strP; + while (*next == '(') + next++; + if (*next == '$') + return "Not a valid literal"; + } + return gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, + resultP, valueP); +} + +void +md_begin () +{ + /* Initialize the `cgen' interface. */ + + /* If the user specifies no options, we default to allowing + everything. If the user specifies any enabling options, we + default to allowing only what is specified. If the user + specifies only disabling options, we only disable what is + specified. If the user specifies options and a config, the + options modify the config. */ + if (optbits && mep_config_index == 0) + MEP_OMASK = optbits; + else + MEP_OMASK = (MEP_OMASK & ~optbitset) | optbits; + + /* Set the machine number and endian. */ + gas_cgen_cpu_desc = mep_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0, + CGEN_CPU_OPEN_ENDIAN, + target_big_endian + ? CGEN_ENDIAN_BIG + : CGEN_ENDIAN_LITTLE, + CGEN_CPU_OPEN_ISAS, 0, + CGEN_CPU_OPEN_END); + mep_cgen_init_asm (gas_cgen_cpu_desc); + + /* This is a callback from cgen to gas to parse operands. */ + cgen_set_parse_operand_fn (gas_cgen_cpu_desc, mep_parse_operand); + + /* Identify the architecture. */ + bfd_default_set_arch_mach (stdoutput, bfd_arch_mep, mep_machine ()); + + /* Store the configuration number and core. */ + bfd_set_private_flags (stdoutput, MEP_CPU | MEP_CONFIG | library_flag); + + /* Initialize the array we'll be using to store fixups. */ + gas_cgen_initialize_saved_fixups_array(); +} + +/* Variant of mep_cgen_assemble_insn. Assemble insn STR of cpu CD as a + coprocessor instruction, if possible, into FIELDS, BUF, and INSN. */ + +static const CGEN_INSN * +mep_cgen_assemble_cop_insn (CGEN_CPU_DESC cd, + const char *str, + CGEN_FIELDS *fields, + CGEN_INSN_BYTES_PTR buf, + const struct cgen_insn *pinsn) +{ + const char *start; + CGEN_INSN_LIST *ilist; + const char *errmsg = NULL; + + /* The instructions are stored in hashed lists. */ + ilist = CGEN_ASM_LOOKUP_INSN (gas_cgen_cpu_desc, + CGEN_INSN_MNEMONIC (pinsn)); + + start = str; + for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) + { + const CGEN_INSN *insn = ilist->insn; + if (strcmp (CGEN_INSN_MNEMONIC (ilist->insn), + CGEN_INSN_MNEMONIC (pinsn)) == 0 + && MEP_INSN_COP_P (ilist->insn) + && mep_cgen_insn_supported (cd, insn)) + { + str = start; + + /* skip this insn if str doesn't look right lexically */ + if (CGEN_INSN_RX (insn) != NULL && + regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) + continue; + + /* Allow parse/insert handlers to obtain length of insn. */ + CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); + + errmsg = CGEN_PARSE_FN (cd, insn) (cd, insn, & str, fields); + if (errmsg != NULL) + continue; + + errmsg = CGEN_INSERT_FN (cd, insn) (cd, insn, fields, buf, + (bfd_vma) 0); + if (errmsg != NULL) + continue; + + return insn; + } + } + return pinsn; +} + +static void +mep_save_insn (mep_insn insn) +{ + /* Consider change MAX_SAVED_FIXUP_CHAINS to MAX_PARALLEL_INSNS. */ + if (num_insns_saved < 0 || num_insns_saved >= MAX_SAVED_FIXUP_CHAINS) + { + as_fatal("index into saved_insns[] out of bounds."); + return; + } + saved_insns[num_insns_saved] = insn; + gas_cgen_save_fixups(num_insns_saved); + num_insns_saved++; +} + +static void +mep_check_parallel32_scheduling (void) +{ + int insn0iscopro, insn1iscopro, insn0length, insn1length; + + /* More than two instructions means that either someone is referring to + an internally parallel core or an internally parallel coprocessor, + neither of which are supported at this time. */ + if ( num_insns_saved > 2 ) + as_fatal("Internally paralled cores and coprocessors not supported."); + + /* If there are no insns saved, that's ok. Just return. This will + happen when mep_process_saved_insns is called when the end of the + source file is reached and there are no insns left to be processed. */ + if (num_insns_saved == 0) + return; + + /* Check some of the attributes of the first insn. */ + insn0iscopro = MEP_INSN_COP_P (saved_insns[0].insn); + insn0length = CGEN_FIELDS_BITSIZE (& saved_insns[0].fields); + + if (num_insns_saved == 2) + { + /* Check some of the attributes of the first insn. */ + insn1iscopro = MEP_INSN_COP_P (saved_insns[1].insn); + insn1length = CGEN_FIELDS_BITSIZE (& saved_insns[1].fields); + + if ((insn0iscopro && !insn1iscopro) + || (insn1iscopro && !insn0iscopro)) + { + /* We have one core and one copro insn. If their sizes + add up to 32, then the combination is valid. */ + if (insn0length + insn1length == 32) + return; + else + as_bad ("core and copro insn lengths must total 32 bits."); + } + else + as_bad ("vliw group must consist of 1 core and 1 copro insn."); + } + else + { + /* If we arrive here, we have one saved instruction. There are a + number of possible cases: + + 1. The instruction is a 32 bit core or coprocessor insn and + can be executed by itself. Valid. + + 2. The instrucion is a core instruction for which a cop nop + exists. In this case, insert the cop nop into the saved + insn array after the core insn and return. Valid. + + 3. The instruction is a coprocessor insn for which a core nop + exists. In this case, move the coprocessor insn to the + second element of the array and put the nop in the first + element then return. Valid. + + 4. The instruction is a core or coprocessor instruction for + which there is no matching coprocessor or core nop to use + to form a valid vliw insn combination. In this case, we + we have to abort. */ + + if (insn0length > 32) + as_fatal ("Cannot use 48- or 64-bit insns with a 32 bit datapath."); + + if (insn0length == 32) + return; + + /* Insn is smaller than datapath. If there are no matching + nops for this insn, then terminate assembly. */ + if (CGEN_INSN_ATTR_VALUE (saved_insns[0].insn, + CGEN_INSN_VLIW32_NO_MATCHING_NOP)) + as_fatal ("No valid nop."); + + /* At this point we know that we have a single 16-bit insn that has + a matching nop. We have to assemble it and put it into the saved + insn and fixup chain arrays. */ + + if (insn0iscopro) + { + char *errmsg; + mep_insn insn; + + /* Move the insn and it's fixups to the second element of the + saved insns arrary and insert a 16 bit core nope into the + first element. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "nop", + &insn.fields, insn.buffer, + &errmsg); + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Move the insn in element 0 to element 1 and insert the + nop into element 0. Move the fixups in element 0 to + element 1 and save the current fixups to element 0. + Really there aren't any fixups at this point because we're + inserting a nop but we might as well be general so that + if there's ever a need to insert a general insn, we'll + have an example. */ + saved_insns[1] = saved_insns[0]; + saved_insns[0] = insn; + num_insns_saved++; + gas_cgen_swap_fixups (0); + gas_cgen_save_fixups (1); + } + else + { + char * errmsg; + mep_insn insn; + int insn_num = saved_insns[0].insn->base->num; + + /* Use 32 bit branches and skip the nop. */ + if (insn_num == MEP_INSN_BSR12 + || insn_num == MEP_INSN_BEQZ + || insn_num == MEP_INSN_BNEZ) + return; + + /* Insert a 16-bit coprocessor nop. Note that at the time */ + /* this was done, no 16-bit coprocessor nop was defined. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop16", + &insn.fields, insn.buffer, + &errmsg); + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Now put the insn and fixups into the arrays. */ + mep_save_insn (insn); + } + } +} + +static void +mep_check_parallel64_scheduling (void) +{ + int insn0iscopro, insn1iscopro, insn0length, insn1length; + + /* More than two instructions means that someone is referring to an + internally parallel core or an internally parallel coprocessor. */ + /* These are not currently supported. */ + if (num_insns_saved > 2) + as_fatal ("Internally parallel cores of coprocessors not supported."); + + /* If there are no insns saved, that's ok. Just return. This will + happen when mep_process_saved_insns is called when the end of the + source file is reached and there are no insns left to be processed. */ + if (num_insns_saved == 0) + return; + + /* Check some of the attributes of the first insn. */ + insn0iscopro = MEP_INSN_COP_P (saved_insns[0].insn); + insn0length = CGEN_FIELDS_BITSIZE (& saved_insns[0].fields); + + if (num_insns_saved == 2) + { + /* Check some of the attributes of the first insn. */ + insn1iscopro = MEP_INSN_COP_P (saved_insns[1].insn); + insn1length = CGEN_FIELDS_BITSIZE (& saved_insns[1].fields); + + if ((insn0iscopro && !insn1iscopro) + || (insn1iscopro && !insn0iscopro)) + { + /* We have one core and one copro insn. If their sizes + add up to 64, then the combination is valid. */ + if (insn0length + insn1length == 64) + return; + else + as_bad ("core and copro insn lengths must total 64 bits."); + } + else + as_bad ("vliw group must consist of 1 core and 1 copro insn."); + } + else + { + /* If we arrive here, we have one saved instruction. There are a + number of possible cases: + + 1. The instruction is a 64 bit coprocessor insn and can be + executed by itself. Valid. + + 2. The instrucion is a core instruction for which a cop nop + exists. In this case, insert the cop nop into the saved + insn array after the core insn and return. Valid. + + 3. The instruction is a coprocessor insn for which a core nop + exists. In this case, move the coprocessor insn to the + second element of the array and put the nop in the first + element then return. Valid. + + 4. The instruction is a core or coprocessor instruction for + which there is no matching coprocessor or core nop to use + to form a valid vliw insn combination. In this case, we + we have to abort. */ + + /* If the insn is 64 bits long, it can run alone. The size check + is done indepependantly of whether the insn is core or copro + in case 64 bit coprocessor insns are added later. */ + if (insn0length == 64) + return; + + /* Insn is smaller than datapath. If there are no matching + nops for this insn, then terminate assembly. */ + if (CGEN_INSN_ATTR_VALUE (saved_insns[0].insn, + CGEN_INSN_VLIW64_NO_MATCHING_NOP)) + as_fatal ("No valid nop."); + + if (insn0iscopro) + { + char *errmsg; + mep_insn insn; + int i; + + /* Initialize the insn buffer. */ + for (i = 0; i < 64; i++) + insn.buffer[i] = '\0'; + + /* We have a coprocessor insn. At this point in time there + are is 32-bit core nop. There is only a 16-bit core + nop. The idea is to allow for a relatively arbitrary + coprocessor to be specified. We aren't looking at + trying to cover future changes in the core at this time + since it is assumed that the core will remain fairly + static. If there ever are 32 or 48 bit core nops added, + they will require entries below. */ + + if (insn0length == 48) + { + /* Move the insn and fixups to the second element of the + arrays then assemble and insert a 16 bit core nop. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "nop", + & insn.fields, insn.buffer, + & errmsg); + } + else + { + /* If this is reached, then we have a single coprocessor + insn that is not 48 bits long, but for which the assembler + thinks there is a matching core nop. If a 32-bit core + nop has been added, then make the necessary changes and + handle its assembly and insertion here. Otherwise, + go figure out why either: + + 1. The assembler thinks that there is a 32-bit core nop + to match a 32-bit coprocessor insn, or + 2. The assembler thinks that there is a 48-bit core nop + to match a 16-bit coprocessor insn. */ + + as_fatal ("Assembler expects a non-existent core nop."); + } + + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Move the insn in element 0 to element 1 and insert the + nop into element 0. Move the fixups in element 0 to + element 1 and save the current fixups to element 0. + Really there aren't any fixups at this point because we're + inserting a nop but we might as well be general so that + if there's ever a need to insert a general insn, we'll + have an example. */ + + saved_insns[1] = saved_insns[0]; + saved_insns[0] = insn; + num_insns_saved++; + gas_cgen_swap_fixups(0); + gas_cgen_save_fixups(1); + + } + else + { + char * errmsg; + mep_insn insn; + int i; + + /* Initialize the insn buffer */ + for (i = 0; i < 64; i++) + insn.buffer[i] = '\0'; + + /* We have a core insn. We have to handle all possible nop + lengths. If a coprocessor doesn't have a nop of a certain + length but there exists core insns that when combined with + a nop of that length would fill the datapath, those core + insns will be flagged with the VLIW_NO_CORRESPONDING_NOP + attribute. That will ensure that when used in a way that + requires a nop to be inserted, assembly will terminate + before reaching this section of code. This guarantees + that cases below which would result in the attempted + insertion of nop that doesn't exist will never be entered. */ + if (insn0length == 16) + { + /* Insert 48 bit coprocessor nop. */ + /* Assemble it and put it into the arrays. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop48", + &insn.fields, insn.buffer, + &errmsg); + } + else if (insn0length == 32) + { + /* Insert 32 bit coprocessor nop. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop32", + &insn.fields, insn.buffer, + &errmsg); + } + else if (insn0length == 48) + { + /* Insert 16 bit coprocessor nop. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, "cpnop16", + &insn.fields, insn.buffer, + &errmsg); + } + else + /* Core insn has an invalid length. Something has gone wrong. */ + as_fatal ("Core insn has invalid length! Something is wrong!"); + + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + + /* Now put the insn and fixups into the arrays. */ + mep_save_insn (insn); + } + } +} + +/* The scheduling functions are just filters for invalid combinations. + If there is a violation, they terminate assembly. Otherise they + just fall through. Succesful combinations cause no side effects + other than valid nop insertion. */ + +static void +mep_check_parallel_scheduling (void) +{ + /* This is where we will eventually read the config information + and choose which scheduling checking function to call. */ + if (MEP_VLIW64) + mep_check_parallel64_scheduling (); + else + mep_check_parallel32_scheduling (); +} + +static void +mep_process_saved_insns (void) +{ + int i; + + gas_cgen_save_fixups (MAX_SAVED_FIXUP_CHAINS - 1); + + /* We have to check for valid scheduling here. */ + mep_check_parallel_scheduling (); + + /* If the last call didn't cause assembly to terminate, we have + a valid vliw insn/insn pair saved. Restore this instructions' + fixups and process the insns. */ + for (i = 0;iisas = isas; + + if (mode == VLIW) + { + /* VLIW mode. */ + + int thisInsnIsCopro = 0; + mep_insn insn; + int i; + + /* Initialize the insn buffer */ + + if (! CGEN_INT_INSN_P) + for (i=0; i < CGEN_MAX_INSN_SIZE; i++) + insn.buffer[i]='\0'; + + /* Can't tell core / copro insns apart at parse time! */ + cgen_bitset_union (isas, & MEP_COP_ISA, isas); + + /* Assemble the insn so we can examine its attributes. */ + insn.insn = mep_cgen_assemble_insn (gas_cgen_cpu_desc, str, + &insn.fields, insn.buffer, + &errmsg); + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + mep_check_for_disabled_registers (&insn); + + /* Check to see if it's a coprocessor instruction. */ + thisInsnIsCopro = MEP_INSN_COP_P (insn.insn); + + if (!thisInsnIsCopro) + { + insn.insn = mep_cgen_assemble_cop_insn (gas_cgen_cpu_desc, str, + &insn.fields, insn.buffer, + insn.insn); + thisInsnIsCopro = MEP_INSN_COP_P (insn.insn); + mep_check_for_disabled_registers (&insn); + } + + if (pluspresent) + { + /* A plus was present. */ + /* Check for a + with a core insn and abort if found. */ + if (!thisInsnIsCopro) + { + as_fatal("A core insn cannot be preceeded by a +.\n"); + return; + } + + if (num_insns_saved > 0) + { + /* There are insns in the queue. Add this one. */ + mep_save_insn (insn); + } + else + { + /* There are no insns in the queue and a plus is present. + This is a syntax error. Let's not tolerate this. + We can relax this later if necessary. */ + as_bad (_("Invalid use of parallelization operator.")); + return; + } + } + else + { + /* No plus was present. */ + if (num_insns_saved > 0) + { + /* There are insns saved and we came across an insn without a + leading +. That's the signal to process the saved insns + before proceeding then treat the current insn as the first + in a new vliw group. */ + mep_process_saved_insns (); + num_insns_saved = 0; + /* mep_save_insn (insn); */ + } + mep_save_insn (insn); +#if 0 + else + { + + /* Core Insn. Add it to the beginning of the queue. */ + mep_save_insn (insn); + /* gas_cgen_save_fixups(num_insns_saved); */ + } +#endif + } + + pluspresent = 0; + } + else + { + /* Core mode. */ + + /* Only single instructions are assembled in core mode. */ + mep_insn insn; + + /* If a leading '+' was present, issue an error. + That's not allowed in core mode. */ + if (pluspresent) + { + as_bad (_("Leading plus sign not allowed in core mode")); + return; + } + + insn.insn = mep_cgen_assemble_insn + (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg); + + if (!insn.insn) + { + as_bad ("%s", errmsg); + return; + } + gas_cgen_finish_insn (insn.insn, insn.buffer, + CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL); + mep_check_for_disabled_registers (&insn); + } +} + +valueT +md_section_align (segT segment, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, segment); + return ((size + (1 << align) - 1) & (-1 << align)); +} + + +symbolS * +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) +{ + return 0; +} + +/* Interface to relax_segment. */ + + +const relax_typeS md_relax_table[] = +{ + /* The fields are: + 1) most positive reach of this state, + 2) most negative reach of this state, + 3) how many bytes this mode will have in the variable part of the frag + 4) which index into the table to try if we can't fit into this one. */ + /* Note that we use "beq" because "jmp" has a peculiarity - it cannot + jump to addresses with any bits 27..24 set. So, we use beq as a + 17-bit pc-relative branch to avoid using jmp, just in case. */ + + /* 0 */ { 0, 0, 0, 0 }, /* unused */ + /* 1 */ { 0, 0, 0, 0 }, /* marker for "don't know yet" */ + + /* 2 */ { 2047, -2048, 0, 3 }, /* bsr12 */ + /* 3 */ { 0, 0, 2, 0 }, /* bsr16 */ + + /* 4 */ { 2047, -2048, 0, 5 }, /* bra */ + /* 5 */ { 65535, -65536, 2, 6 }, /* beq $0,$0 */ + /* 6 */ { 0, 0, 2, 0 }, /* jmp24 */ + + /* 7 */ { 65535, -65536, 0, 8 }, /* beqi */ + /* 8 */ { 0, 0, 4, 0 }, /* bnei/jmp */ + + /* 9 */ { 127, -128, 0, 10 }, /* beqz */ + /* 10 */ { 65535, -65536, 2, 11 }, /* beqi */ + /* 11 */ { 0, 0, 4, 0 }, /* bnei/jmp */ + + /* 12 */ { 65535, -65536, 0, 13 }, /* bnei */ + /* 13 */ { 0, 0, 4, 0 }, /* beqi/jmp */ + + /* 14 */ { 127, -128, 0, 15 }, /* bnez */ + /* 15 */ { 65535, -65536, 2, 16 }, /* bnei */ + /* 16 */ { 0, 0, 4, 0 }, /* beqi/jmp */ + + /* 17 */ { 65535, -65536, 0, 13 }, /* bgei */ + /* 18 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* blti */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpeq */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpne */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpat */ + /* 20 */ { 0, 0, 4, 0 }, + /* 19 */ { 65535, -65536, 0, 13 }, /* bcpaf */ + /* 20 */ { 0, 0, 4, 0 } +}; + +/* Pseudo-values for 64 bit "insns" which are combinations of two 32 + bit insns. */ +typedef enum { + MEP_PSEUDO64_NONE, + MEP_PSEUDO64_16BITCC, + MEP_PSEUDO64_32BITCC, +} MepPseudo64Values; + +static struct { + int insn; + int growth; + int insn_for_extern; +} subtype_mappings[] = { + { 0, 0, 0 }, + { 0, 0, 0 }, + { MEP_INSN_BSR12, 0, MEP_INSN_BSR24 }, + { MEP_INSN_BSR24, 2, MEP_INSN_BSR24 }, + { MEP_INSN_BRA, 0, MEP_INSN_BRA }, + { MEP_INSN_BEQ, 2, MEP_INSN_BEQ }, + { MEP_INSN_JMP, 2, MEP_INSN_JMP }, + { MEP_INSN_BEQI, 0, MEP_INSN_BEQI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BEQZ, 0, MEP_INSN_BEQZ }, + { MEP_INSN_BEQI, 2, MEP_INSN_BEQI }, + { -1, 4, MEP_PSEUDO64_16BITCC }, + { MEP_INSN_BNEI, 0, MEP_INSN_BNEI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BNEZ, 0, MEP_INSN_BNEZ }, + { MEP_INSN_BNEI, 2, MEP_INSN_BNEI }, + { -1, 4, MEP_PSEUDO64_16BITCC }, + { MEP_INSN_BGEI, 0, MEP_INSN_BGEI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BLTI, 0, MEP_INSN_BLTI }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPEQ, 0, MEP_INSN_BCPEQ }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPNE, 0, MEP_INSN_BCPNE }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPAT, 0, MEP_INSN_BCPAT }, + { -1, 4, MEP_PSEUDO64_32BITCC }, + { MEP_INSN_BCPAF, 0, MEP_INSN_BCPAF }, + { -1, 4, MEP_PSEUDO64_32BITCC } +}; +#define NUM_MAPPINGS (sizeof (subtype_mappings) / sizeof (subtype_mappings[0])) + +void +mep_prepare_relax_scan (fragS *fragP, offsetT *aim, relax_substateT this_state) +{ + symbolS *symbolP = fragP->fr_symbol; + if (symbolP && !S_IS_DEFINED (symbolP)) + *aim = 0; + /* Adjust for MeP pcrel not being relative to the next opcode. */ + *aim += 2 + md_relax_table[this_state].rlx_length; +} + +static int +insn_to_subtype (int insn) +{ + unsigned int i; + for (i=0; ifr_subtype == 1) + fragP->fr_subtype = insn_to_subtype (fragP->fr_cgen.insn->base->num); + + if (S_GET_SEGMENT (fragP->fr_symbol) != segment) + { + int new_insn; + + new_insn = subtype_mappings[fragP->fr_subtype].insn_for_extern; + fragP->fr_subtype = insn_to_subtype (new_insn); + } + + if (MEP_VLIW && ! MEP_VLIW64 + && (bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)) + { + /* Use 32 bit branches for vliw32 so the vliw word is not split. */ + switch (fragP->fr_cgen.insn->base->num) + { + case MEP_INSN_BSR12: + fragP->fr_subtype = insn_to_subtype + (subtype_mappings[fragP->fr_subtype].insn_for_extern); + break; + case MEP_INSN_BEQZ: + fragP->fr_subtype ++; + break; + case MEP_INSN_BNEZ: + fragP->fr_subtype ++; + break; + } + } + + if (fragP->fr_cgen.insn->base + && fragP->fr_cgen.insn->base->num + != subtype_mappings[fragP->fr_subtype].insn) + { + int new_insn= subtype_mappings[fragP->fr_subtype].insn; + if (new_insn != -1) + { + fragP->fr_cgen.insn = (fragP->fr_cgen.insn + - fragP->fr_cgen.insn->base->num + + new_insn); + } + } + + return subtype_mappings[fragP->fr_subtype].growth; +} + +/* *fragP has been relaxed to its final size, and now needs to have + the bytes inside it modified to conform to the new size. + + Called after relaxation is finished. + fragP->fr_type == rs_machine_dependent. + fragP->fr_subtype is the subtype of what the address relaxed to. */ + +static int +target_address_for (fragS *frag) +{ + int rv = frag->fr_offset; + symbolS *sym = frag->fr_symbol; + + if (sym) + rv += S_GET_VALUE (sym); + + return rv; +} + +void +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + segT sec ATTRIBUTE_UNUSED, + fragS *fragP) +{ + int addend, rn, bit = 0; + int operand; + int where = fragP->fr_opcode - fragP->fr_literal; + int e = target_big_endian ? 0 : 1; + + addend = target_address_for (fragP) - (fragP->fr_address + where); + + if (subtype_mappings[fragP->fr_subtype].insn == -1) + { + fragP->fr_fix += subtype_mappings[fragP->fr_subtype].growth; + switch (subtype_mappings[fragP->fr_subtype].insn_for_extern) + { + case MEP_PSEUDO64_16BITCC: + fragP->fr_opcode[1^e] = ((fragP->fr_opcode[1^e] & 1) ^ 1) | 0x06; + fragP->fr_opcode[2^e] = 0xd8; + fragP->fr_opcode[3^e] = 0x08; + fragP->fr_opcode[4^e] = 0; + fragP->fr_opcode[5^e] = 0; + where += 2; + break; + case MEP_PSEUDO64_32BITCC: + if (fragP->fr_opcode[0^e] & 0x10) + fragP->fr_opcode[1^e] ^= 0x01; + else + fragP->fr_opcode[1^e] ^= 0x04; + fragP->fr_opcode[2^e] = 0; + fragP->fr_opcode[3^e] = 4; + fragP->fr_opcode[4^e] = 0xd8; + fragP->fr_opcode[5^e] = 0x08; + fragP->fr_opcode[6^e] = 0; + fragP->fr_opcode[7^e] = 0; + where += 4; + break; + default: + abort (); + } + fragP->fr_cgen.insn = (fragP->fr_cgen.insn + - fragP->fr_cgen.insn->base->num + + MEP_INSN_JMP); + operand = MEP_OPERAND_PCABS24A2; + } + else + switch (fragP->fr_cgen.insn->base->num) + { + case MEP_INSN_BSR12: + fragP->fr_opcode[0^e] = 0xb0 | ((addend >> 8) & 0x0f); + fragP->fr_opcode[1^e] = 0x01 | (addend & 0xfe); + operand = MEP_OPERAND_PCREL12A2; + break; + + case MEP_INSN_BSR24: + fragP->fr_fix += 2; + fragP->fr_opcode[0^e] = 0xd8 | ((addend >> 5) & 0x07); + fragP->fr_opcode[1^e] = 0x09 | ((addend << 3) & 0xf0); + fragP->fr_opcode[2^e] = 0x00 | ((addend >>16) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 8) & 0xff); + operand = MEP_OPERAND_PCREL24A2; + break; + + case MEP_INSN_BRA: + fragP->fr_opcode[0^e] = 0xb0 | ((addend >> 8) & 0x0f); + fragP->fr_opcode[1^e] = 0x00 | (addend & 0xfe); + operand = MEP_OPERAND_PCREL12A2; + break; + + case MEP_INSN_BEQ: + /* The default relax_frag doesn't change the state if there is no + growth, so we must manually handle converting out-of-range BEQ + instructions to JMP. */ + if (addend <= 65535 && addend >= -65536) + { + fragP->fr_fix += 2; + fragP->fr_opcode[0^e] = 0xe0; + fragP->fr_opcode[1^e] = 0x01; + fragP->fr_opcode[2^e] = 0x00 | ((addend >> 9) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 1) & 0xff); + operand = MEP_OPERAND_PCREL17A2; + break; + } + /* ...FALLTHROUGH... */ + + case MEP_INSN_JMP: + addend = target_address_for (fragP); + fragP->fr_fix += 2; + fragP->fr_opcode[0^e] = 0xd8 | ((addend >> 5) & 0x07); + fragP->fr_opcode[1^e] = 0x08 | ((addend << 3) & 0xf0); + fragP->fr_opcode[2^e] = 0x00 | ((addend >>16) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 8) & 0xff); + operand = MEP_OPERAND_PCABS24A2; + break; + + case MEP_INSN_BNEZ: + bit = 1; + case MEP_INSN_BEQZ: + fragP->fr_opcode[1^e] = bit | (addend & 0xfe); + operand = MEP_OPERAND_PCREL8A2; + break; + + case MEP_INSN_BNEI: + bit = 4; + case MEP_INSN_BEQI: + if (subtype_mappings[fragP->fr_subtype].growth) + { + fragP->fr_fix += subtype_mappings[fragP->fr_subtype].growth; + rn = fragP->fr_opcode[0^e] & 0x0f; + fragP->fr_opcode[0^e] = 0xe0 | rn; + fragP->fr_opcode[1^e] = bit; + } + fragP->fr_opcode[2^e] = 0x00 | ((addend >> 9) & 0xff); + fragP->fr_opcode[3^e] = 0x00 | ((addend >> 1) & 0xff); + operand = MEP_OPERAND_PCREL17A2; + break; + + case MEP_INSN_BLTI: + case MEP_INSN_BGEI: + case MEP_INSN_BCPEQ: + case MEP_INSN_BCPNE: + case MEP_INSN_BCPAT: + case MEP_INSN_BCPAF: + /* No opcode change needed, just operand. */ + fragP->fr_opcode[2^e] = (addend >> 9) & 0xff; + fragP->fr_opcode[3^e] = (addend >> 1) & 0xff; + operand = MEP_OPERAND_PCREL17A2; + break; + + default: + abort (); + } + + if (S_GET_SEGMENT (fragP->fr_symbol) != sec + || operand == MEP_OPERAND_PCABS24A2) + { + assert (fragP->fr_cgen.insn != 0); + gas_cgen_record_fixup (fragP, + where, + fragP->fr_cgen.insn, + (fragP->fr_fix - where) * 8, + cgen_operand_lookup_by_num (gas_cgen_cpu_desc, + operand), + fragP->fr_cgen.opinfo, + fragP->fr_symbol, fragP->fr_offset); + } +} + + +/* Functions concerning relocs. */ + +void +mep_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +{ + /* If we already know the fixup value, adjust it in the same + way that the linker would have done. */ + if (fixP->fx_addsy == 0) + switch (fixP->fx_cgen.opinfo) + { + case BFD_RELOC_MEP_LOW16: + *valP = ((long)(*valP & 0xffff)) << 16 >> 16; + break; + case BFD_RELOC_MEP_HI16U: + *valP >>= 16; + break; + case BFD_RELOC_MEP_HI16S: + *valP = (*valP + 0x8000) >> 16; + break; + } + + /* Now call cgen's md_aply_fix. */ + gas_cgen_md_apply_fix (fixP, valP, seg); +} + +long +md_pcrel_from_section (fixS *fixP, segT sec) +{ + if (fixP->fx_addsy != (symbolS *) NULL + && (! S_IS_DEFINED (fixP->fx_addsy) + || S_GET_SEGMENT (fixP->fx_addsy) != sec)) + /* The symbol is undefined (or is defined but not in this section). + Let the linker figure it out. */ + return 0; + + /* Return the address of the opcode - cgen adjusts for opcode size + itself, to be consistent with the disassembler, which must do + so. */ + return fixP->fx_where + fixP->fx_frag->fr_address; +} + +/* Return the bfd reloc type for OPERAND of INSN at fixup FIXP. + Returns BFD_RELOC_NONE if no reloc type can be found. + *FIXP may be modified if desired. */ + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#define MAP(n) case MEP_OPERAND_##n: return BFD_RELOC_MEP_##n; +#else +#define MAP(n) case MEP_OPERAND_/**/n: return BFD_RELOC_MEP_/**/n; +#endif + +bfd_reloc_code_real_type +md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED, + const CGEN_OPERAND *operand, + fixS *fixP) +{ + enum bfd_reloc_code_real reloc = fixP->fx_cgen.opinfo; + static char printed[MEP_OPERAND_MAX] = { 0 }; + + /* If there's a reloc here, it's because the parser saw a %foo() and + is giving us the correct reloc to use, or because we converted to + a different size reloc below and want to avoid "converting" more + than once. */ + if (reloc && reloc != BFD_RELOC_NONE) + return reloc; + + switch (operand->type) + { + MAP (PCREL8A2); /* beqz */ + MAP (PCREL12A2); /* bsr16 */ + MAP (PCREL17A2); /* beqi */ + MAP (PCREL24A2); /* bsr24 */ + MAP (PCABS24A2); /* jmp */ + MAP (UIMM24); /* mov */ + MAP (ADDR24A4); /* sw/lw */ + + /* The rest of the relocs should be generated by the parser, + for things such as %tprel(), etc. */ + case MEP_OPERAND_SIMM16: +#ifdef OBJ_COMPLEX_RELC + /* coalescing this into RELOC_MEP_16 is actually a bug, + since it's a signed operand. let the relc code handle it. */ + return BFD_RELOC_RELC; +#endif + + case MEP_OPERAND_UIMM16: + case MEP_OPERAND_SDISP16: + case MEP_OPERAND_CODE16: + fixP->fx_where += 2; + /* to avoid doing the above add twice */ + fixP->fx_cgen.opinfo = BFD_RELOC_MEP_16; + return BFD_RELOC_MEP_16; + + default: +#ifdef OBJ_COMPLEX_RELC + /* this is not an error, yet. + pass it to the linker. */ + return BFD_RELOC_RELC; +#endif + if (printed[operand->type]) + return BFD_RELOC_NONE; + printed[operand->type] = 1; + + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Don't know how to relocate plain operands of type %s"), + operand->name); + + /* Print some helpful hints for the user. */ + switch (operand->type) + { + case MEP_OPERAND_UDISP7: + case MEP_OPERAND_UDISP7A2: + case MEP_OPERAND_UDISP7A4: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Perhaps you are missing %%tpoff()?")); + break; + default: + break; + } + return BFD_RELOC_NONE; + } +} + +/* Called while parsing an instruction to create a fixup. + We need to check for HI16 relocs and queue them up for later sorting. */ + +fixS * +mep_cgen_record_fixup_exp (fragS *frag, + int where, + const CGEN_INSN *insn, + int length, + const CGEN_OPERAND *operand, + int opinfo, + expressionS *exp) +{ + fixS * fixP = gas_cgen_record_fixup_exp (frag, where, insn, length, + operand, opinfo, exp); + return fixP; +} + +/* Return BFD reloc type from opinfo field in a fixS. + It's tricky using fx_r_type in mep_frob_file because the values + are BFD_RELOC_UNUSED + operand number. */ +#define FX_OPINFO_R_TYPE(f) ((f)->fx_cgen.opinfo) + +/* Sort any unmatched HI16 relocs so that they immediately precede + the corresponding LO16 reloc. This is called before md_apply_fix and + tc_gen_reloc. */ + +void +mep_frob_file () +{ + struct mep_hi_fixup * l; + + for (l = mep_hi_fixup_list; l != NULL; l = l->next) + { + segment_info_type * seginfo; + int pass; + + assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16 + || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16); + + /* Check quickly whether the next fixup happens to be a matching low. */ + if (l->fixp->fx_next != NULL + && FX_OPINFO_R_TYPE (l->fixp->fx_next) == BFD_RELOC_LO16 + && l->fixp->fx_addsy == l->fixp->fx_next->fx_addsy + && l->fixp->fx_offset == l->fixp->fx_next->fx_offset) + continue; + + /* Look through the fixups for this segment for a matching + `low'. When we find one, move the high just in front of it. + We do this in two passes. In the first pass, we try to find + a unique `low'. In the second pass, we permit multiple + high's relocs for a single `low'. */ + seginfo = seg_info (l->seg); + for (pass = 0; pass < 2; pass++) + { + fixS * f; + fixS * prev; + + prev = NULL; + for (f = seginfo->fix_root; f != NULL; f = f->fx_next) + { + /* Check whether this is a `low' fixup which matches l->fixp. */ + if (FX_OPINFO_R_TYPE (f) == BFD_RELOC_LO16 + && f->fx_addsy == l->fixp->fx_addsy + && f->fx_offset == l->fixp->fx_offset + && (pass == 1 + || prev == NULL + || (FX_OPINFO_R_TYPE (prev) != BFD_RELOC_HI16) + || prev->fx_addsy != f->fx_addsy + || prev->fx_offset != f->fx_offset)) + { + fixS ** pf; + + /* Move l->fixp before f. */ + for (pf = &seginfo->fix_root; + * pf != l->fixp; + pf = & (* pf)->fx_next) + assert (* pf != NULL); + + * pf = l->fixp->fx_next; + + l->fixp->fx_next = f; + if (prev == NULL) + seginfo->fix_root = l->fixp; + else + prev->fx_next = l->fixp; + + break; + } + + prev = f; + } + + if (f != NULL) + break; + + if (pass == 1) + as_warn_where (l->fixp->fx_file, l->fixp->fx_line, + _("Unmatched high relocation")); + } + } +} + +/* See whether we need to force a relocation into the output file. */ + +int +mep_force_relocation (fixS *fixp) +{ + if ( fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + return 1; + + /* Allow branches to global symbols to be resolved at assembly time. + This is consistent with way relaxable branches are handled, since + branches to both global and local symbols are relaxed. It also + corresponds to the assumptions made in md_pcrel_from_section. */ + return S_FORCE_RELOC (fixp->fx_addsy, !fixp->fx_pcrel); +} + +/* Write a value out to the object file, using the appropriate endianness. */ + +void +md_number_to_chars (char *buf, valueT val, int n) +{ + if (target_big_endian) + number_to_chars_bigendian (buf, val, n); + else + number_to_chars_littleendian (buf, val, n); +} + +/* Turn a string in input_line_pointer into a floating point constant + of type type, and store the appropriate bytes in *litP. The number + of LITTLENUMS emitted is stored in *sizeP . An error message is + returned, or NULL on OK. */ + +/* Equal to MAX_PRECISION in atof-ieee.c */ +#define MAX_LITTLENUMS 6 + +char * +md_atof (int type, char *litP, int *sizeP) +{ + int i; + int prec; + LITTLENUM_TYPE words [MAX_LITTLENUMS]; + char * t; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + /* FIXME: Some targets allow other format chars for bigger sizes here. */ + default: + *sizeP = 0; + return _("Bad call to md_atof()"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + * sizeP = prec * sizeof (LITTLENUM_TYPE); + + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], + sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + + return 0; +} + + +bfd_boolean +mep_fix_adjustable (fixS *fixP) +{ + bfd_reloc_code_real_type reloc_type; + + if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) + { + const CGEN_INSN *insn = NULL; + int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED; + const CGEN_OPERAND *operand + = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex); + reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); + } + else + reloc_type = fixP->fx_r_type; + + if (fixP->fx_addsy == NULL) + return 1; + + /* Prevent all adjustments to global symbols. */ + if (S_IS_EXTERNAL (fixP->fx_addsy)) + return 0; + + if (S_IS_WEAK (fixP->fx_addsy)) + return 0; + + /* We need the symbol name for the VTABLE entries */ + if (reloc_type == BFD_RELOC_VTABLE_INHERIT + || reloc_type == BFD_RELOC_VTABLE_ENTRY) + return 0; + + return 1; +} + +int +mep_elf_section_letter (int letter, char **ptrmsg) +{ + if (letter == 'v') + return SHF_MEP_VLIW; + + *ptrmsg = _("Bad .section directive: want a,v,w,x,M,S in string"); + return 0; +} + +flagword +mep_elf_section_flags (flagword flags, int attr, int type ATTRIBUTE_UNUSED) +{ + if (attr & SHF_MEP_VLIW) + flags |= SEC_MEP_VLIW; + return flags; +} + +/* In vliw mode, the default section is .vtext. We have to be able + to switch into .vtext using only the .vtext directive. */ + +static segT +mep_vtext_section (void) +{ + static segT vtext_section; + + if (! vtext_section) + { + flagword applicable = bfd_applicable_section_flags (stdoutput); + vtext_section = subseg_new (VTEXT_SECTION_NAME, 0); + bfd_set_section_flags (stdoutput, vtext_section, + applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC + | SEC_CODE | SEC_READONLY + | SEC_MEP_VLIW)); + } + + return vtext_section; +} + +static void +mep_s_vtext (int ignore ATTRIBUTE_UNUSED) +{ + int temp; + + /* Record previous_section and previous_subsection. */ + obj_elf_section_change_hook (); + + temp = get_absolute_expression (); + subseg_set (mep_vtext_section (), (subsegT) temp); + demand_empty_rest_of_line (); +} + +static void +mep_switch_to_core_mode (int dummy ATTRIBUTE_UNUSED) +{ + mep_process_saved_insns (); + pluspresent = 0; + mode = CORE; +} + +static void +mep_switch_to_vliw_mode (int dummy ATTRIBUTE_UNUSED) +{ + if (! MEP_VLIW) + as_bad (_(".vliw unavailable when VLIW is disabled.")); + mode = VLIW; + /* Switch into .vtext here too. */ + /* mep_s_vtext(); */ +} + +/* This is an undocumented pseudo-op used to disable gas's + "disabled_registers" check. Used for code which checks for those + registers at runtime. */ +static void +mep_noregerr (int i ATTRIBUTE_UNUSED) +{ + allow_disabled_registers = 1; +} + +/* mep_unrecognized_line: This is called when a line that can't be parsed + is encountered. We use it to check for a leading '+' sign which indicates + that the current instruction is a coprocessor instruction that is to be + parallelized with a previous core insn. This function accepts the '+' and + rejects all other characters that might indicate garbage at the beginning + of the line. The '+' character gets lost as the calling loop continues, + so we need to indicate that we saw it. */ + +int +mep_unrecognized_line (int ch) +{ + switch (ch) + { + case '+': + pluspresent = 1; + return 1; /* '+' indicates an instruction to be parallelized. */ + default: + return 0; /* If it's not a '+', the line can't be parsed. */ + } +} + +void +mep_cleanup (void) +{ + /* Take care of any insns left to be parallelized when the file ends. + This is mainly here to handle the case where the file ends with an + insn preceeded by a + or the file ends unexpectedly. */ + if (mode == VLIW) + mep_process_saved_insns (); +} + +int +mep_flush_pending_output (void) +{ + if (mode == VLIW) + { + mep_process_saved_insns (); + pluspresent = 0; + } + + return 1; +} diff --git a/contrib/binutils/gas/config/tc-mep.h b/contrib/binutils/gas/config/tc-mep.h new file mode 100644 index 00000000000..1d48bd4c9a4 --- /dev/null +++ b/contrib/binutils/gas/config/tc-mep.h @@ -0,0 +1,119 @@ +/* tc-mep.h -- Header file for tc-mep.c. + Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#define TC_MEP + +/* Support computed relocations. */ +#define OBJ_COMPLEX_RELC + +/* Support many operands per instruction. */ +#define GAS_CGEN_MAX_FIXUPS 10 + +#define LISTING_HEADER "MEP GAS " + +/* The target BFD architecture. */ +#define TARGET_ARCH bfd_arch_mep + +#define TARGET_FORMAT (target_big_endian ? "elf32-mep" : "elf32-mep-little") + +/* This is the default. */ +#define TARGET_BYTES_BIG_ENDIAN 1 + +/* Permit temporary numeric labels. */ +#define LOCAL_LABELS_FB 1 + +/* .-foo gets turned into PC relative relocs. */ +#define DIFF_EXPR_OK + +/* We don't need to handle .word strangely. */ +#define WORKING_DOT_WORD + +/* Values passed to md_apply_fix don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + +#define MD_APPLY_FIX +#define md_apply_fix mep_apply_fix +extern void mep_apply_fix (struct fix *, valueT *, segT); + +/* Call md_pcrel_from_section(), not md_pcrel_from(). */ +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) +extern long md_pcrel_from_section (struct fix *, segT); + +#define tc_frob_file() mep_frob_file () +extern void mep_frob_file (void); + +#define tc_fix_adjustable(fixP) mep_fix_adjustable (fixP) +extern bfd_boolean mep_fix_adjustable (struct fix *); + +/* After creating a fixup for an instruction operand, we need + to check for HI16 relocs and queue them up for later sorting. */ +#define md_cgen_record_fixup_exp mep_cgen_record_fixup_exp + +/* When relaxing, we need to emit various relocs we otherwise wouldn't. */ +#define TC_FORCE_RELOCATION(fix) mep_force_relocation (fix) +extern int mep_force_relocation (struct fix *); + +#define tc_gen_reloc gas_cgen_tc_gen_reloc + +extern void gas_cgen_md_operand (expressionS *); +#define md_operand(x) gas_cgen_md_operand (x) + +#define md_flush_pending_output() mep_flush_pending_output() +extern int mep_flush_pending_output(void); + +extern const struct relax_type md_relax_table[]; +#define TC_GENERIC_RELAX_TABLE md_relax_table + +/* Account for inserting a jmp after the insn. */ +#define TC_CGEN_MAX_RELAX(insn, len) ((len) + 4) + +extern void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT); +#define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \ + mep_prepare_relax_scan (FRAGP, &AIM, STATE) + +#define skip_whitespace(str) while (*(str) == ' ') ++(str) + +/* Support for core/vliw mode switching. */ +#define CORE 0 +#define VLIW 1 +#define MAX_PARALLEL_INSNS 56 /* From email from Toshiba. */ +#define VTEXT_SECTION_NAME ".vtext" + +/* Needed to process pending instructions when a label is encountered. */ +#define TC_START_LABEL(ch, ptr) ((ch == ':') && mep_flush_pending_output ()) + +#define tc_unrecognized_line(c) mep_unrecognized_line (c) +extern int mep_unrecognized_line (int); +#define md_cleanup mep_cleanup +extern void mep_cleanup (void); + +#define md_elf_section_letter mep_elf_section_letter +extern int mep_elf_section_letter (int, char **); +#define md_elf_section_flags mep_elf_section_flags +extern flagword mep_elf_section_flags (flagword, int, int); + +#define ELF_TC_SPECIAL_SECTIONS \ + { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW }, + +/* The values of the following enum are for use with parinsnum, which + is a variable in md_assemble that keeps track of whether or not the + next instruction is expected to be the first or second instrucion in + a parallelization group. */ +typedef enum exp_par_insn_{FIRST, SECOND} EXP_PAR_INSN; diff --git a/contrib/binutils/gas/config/tc-mips.c b/contrib/binutils/gas/config/tc-mips.c index dc5ff68e3ec..e97193f54b3 100644 --- a/contrib/binutils/gas/config/tc-mips.c +++ b/contrib/binutils/gas/config/tc-mips.c @@ -1,6 +1,6 @@ /* tc-mips.c -- assemble code for a MIPS chip. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus @@ -28,8 +28,6 @@ #include "subsegs.h" #include "safe-ctype.h" -#include - #include "opcode/mips.h" #include "itbl-ops.h" #include "dwarf2dbg.h" @@ -169,7 +167,7 @@ struct mips_cl_insn /* True if this entry cannot be moved from its current position. */ unsigned int fixed_p : 1; - /* True if this instruction occured in a .set noreorder block. */ + /* True if this instruction occurred in a .set noreorder block. */ unsigned int noreorder_p : 1; /* True for mips16 instructions that jump to an absolute address. */ @@ -212,7 +210,9 @@ struct mips_set_options command line options, and based on the default architecture. */ int ase_mips3d; int ase_mdmx; + int ase_smartmips; int ase_dsp; + int ase_dspr2; int ase_mt; /* Whether we are assembling for the mips16 processor. 0 if we are not, 1 if we are, and -1 if the value has not been initialized. @@ -264,7 +264,7 @@ static int file_mips_fp32 = -1; static struct mips_set_options mips_opts = { - ISA_UNKNOWN, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, CPU_UNKNOWN, FALSE + ISA_UNKNOWN, -1, -1, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, CPU_UNKNOWN, FALSE }; /* These variables are filled in with the masks of registers used. @@ -280,6 +280,11 @@ static int file_mips_isa = ISA_UNKNOWN; command line (e.g., by -march). */ static int file_ase_mips16; +#define ISA_SUPPORTS_MIPS16E (mips_opts.isa == ISA_MIPS32 \ + || mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64 \ + || mips_opts.isa == ISA_MIPS64R2) + /* True if -mips3d was passed or implied by arguments passed on the command line (e.g., by -march). */ static int file_ase_mips3d; @@ -288,14 +293,36 @@ static int file_ase_mips3d; command line (e.g., by -march). */ static int file_ase_mdmx; +/* True if -msmartmips was passed or implied by arguments passed on the + command line (e.g., by -march). */ +static int file_ase_smartmips; + +#define ISA_SUPPORTS_SMARTMIPS (mips_opts.isa == ISA_MIPS32 \ + || mips_opts.isa == ISA_MIPS32R2) + /* True if -mdsp was passed or implied by arguments passed on the command line (e.g., by -march). */ static int file_ase_dsp; +#define ISA_SUPPORTS_DSP_ASE (mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64R2) + +#define ISA_SUPPORTS_DSP64_ASE (mips_opts.isa == ISA_MIPS64R2) + +/* True if -mdspr2 was passed or implied by arguments passed on the + command line (e.g., by -march). */ +static int file_ase_dspr2; + +#define ISA_SUPPORTS_DSPR2_ASE (mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64R2) + /* True if -mmt was passed or implied by arguments passed on the command line (e.g., by -march). */ static int file_ase_mt; +#define ISA_SUPPORTS_MT_ASE (mips_opts.isa == ISA_MIPS32R2 \ + || mips_opts.isa == ISA_MIPS64R2) + /* The argument of the -march= flag. The architecture we are assembling. */ static int file_mips_arch = CPU_UNKNOWN; static const char *mips_arch_string; @@ -312,47 +339,66 @@ static int mips_32bitmode = 0; #define ABI_NEEDS_32BIT_REGS(ABI) ((ABI) == O32_ABI) /* Likewise 64-bit registers. */ -#define ABI_NEEDS_64BIT_REGS(ABI) \ - ((ABI) == N32_ABI \ - || (ABI) == N64_ABI \ +#define ABI_NEEDS_64BIT_REGS(ABI) \ + ((ABI) == N32_ABI \ + || (ABI) == N64_ABI \ || (ABI) == O64_ABI) -/* Return true if ISA supports 64 bit gp register instructions. */ -#define ISA_HAS_64BIT_REGS(ISA) ( \ - (ISA) == ISA_MIPS3 \ - || (ISA) == ISA_MIPS4 \ - || (ISA) == ISA_MIPS5 \ - || (ISA) == ISA_MIPS64 \ - || (ISA) == ISA_MIPS64R2 \ - ) +/* Return true if ISA supports 64 bit wide gp registers. */ +#define ISA_HAS_64BIT_REGS(ISA) \ + ((ISA) == ISA_MIPS3 \ + || (ISA) == ISA_MIPS4 \ + || (ISA) == ISA_MIPS5 \ + || (ISA) == ISA_MIPS64 \ + || (ISA) == ISA_MIPS64R2) + +/* Return true if ISA supports 64 bit wide float registers. */ +#define ISA_HAS_64BIT_FPRS(ISA) \ + ((ISA) == ISA_MIPS3 \ + || (ISA) == ISA_MIPS4 \ + || (ISA) == ISA_MIPS5 \ + || (ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64 \ + || (ISA) == ISA_MIPS64R2) /* Return true if ISA supports 64-bit right rotate (dror et al.) instructions. */ -#define ISA_HAS_DROR(ISA) ( \ - (ISA) == ISA_MIPS64R2 \ - ) +#define ISA_HAS_DROR(ISA) \ + ((ISA) == ISA_MIPS64R2) /* Return true if ISA supports 32-bit right rotate (ror et al.) instructions. */ -#define ISA_HAS_ROR(ISA) ( \ - (ISA) == ISA_MIPS32R2 \ - || (ISA) == ISA_MIPS64R2 \ - ) +#define ISA_HAS_ROR(ISA) \ + ((ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64R2 \ + || mips_opts.ase_smartmips) /* Return true if ISA supports ins instructions. */ -#define ISA_HAS_INS(ISA) ( \ - (ISA) == ISA_MIPS32R2 \ - || (ISA) == ISA_MIPS64R2 \ - ) +#define ISA_HAS_INS(ISA) \ + ((ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64R2) + +/* Return true if ISA supports single-precision floats in odd registers. */ +#define ISA_HAS_ODD_SINGLE_FPR(ISA) \ + ((ISA) == ISA_MIPS32 \ + || (ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64 \ + || (ISA) == ISA_MIPS64R2) + +/* Return true if ISA supports move to/from high part of a 64-bit + floating-point register. */ +#define ISA_HAS_MXHC1(ISA) \ + ((ISA) == ISA_MIPS32R2 \ + || (ISA) == ISA_MIPS64R2) #define HAVE_32BIT_GPRS \ - (mips_opts.gp32 || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + (mips_opts.gp32 || !ISA_HAS_64BIT_REGS (mips_opts.isa)) #define HAVE_32BIT_FPRS \ - (mips_opts.fp32 || ! ISA_HAS_64BIT_REGS (mips_opts.isa)) + (mips_opts.fp32 || !ISA_HAS_64BIT_FPRS (mips_opts.isa)) -#define HAVE_64BIT_GPRS (! HAVE_32BIT_GPRS) -#define HAVE_64BIT_FPRS (! HAVE_32BIT_FPRS) +#define HAVE_64BIT_GPRS (!HAVE_32BIT_GPRS) +#define HAVE_64BIT_FPRS (!HAVE_32BIT_FPRS) #define HAVE_NEWABI (mips_abi == N32_ABI || mips_abi == N64_ABI) @@ -392,22 +438,6 @@ static int mips_32bitmode = 0; (strncmp (TARGET_CPU, "mips16", sizeof ("mips16") - 1) == 0 \ || strncmp (TARGET_CANONICAL, "mips-lsi-elf", sizeof ("mips-lsi-elf") - 1) == 0) -/* Return true if the given CPU supports the MIPS3D ASE. */ -#define CPU_HAS_MIPS3D(cpu) ((cpu) == CPU_SB1 \ - ) - -/* Return true if the given CPU supports the MDMX ASE. */ -#define CPU_HAS_MDMX(cpu) (FALSE \ - ) - -/* Return true if the given CPU supports the DSP ASE. */ -#define CPU_HAS_DSP(cpu) (FALSE \ - ) - -/* Return true if the given CPU supports the MT ASE. */ -#define CPU_HAS_MT(cpu) (FALSE \ - ) - /* True if CPU has a dror instruction. */ #define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500) @@ -501,7 +531,7 @@ static int mips_any_noreorder; an mfhi/mflo instruction is read in the next two instructions. */ static int mips_7000_hilo_fix; -/* The size of the small data section. */ +/* The size of objects in the small data section. */ static unsigned int g_switch_value = 8; /* Whether the -G option was used. */ static int g_switch_seen = 0; @@ -1018,6 +1048,8 @@ static void s_cpsetup (int); static void s_cplocal (int); static void s_cprestore (int); static void s_cpreturn (int); +static void s_dtprelword (int); +static void s_dtpreldword (int); static void s_gpvalue (int); static void s_gpword (int); static void s_gpdword (int); @@ -1043,11 +1075,19 @@ static int validate_mips_insn (const struct mips_opcode *); struct mips_cpu_info { const char *name; /* CPU or ISA name. */ - int is_isa; /* Is this an ISA? (If 0, a CPU.) */ + int flags; /* ASEs available, or ISA flag. */ int isa; /* ISA level. */ int cpu; /* CPU number (default CPU if ISA). */ }; +#define MIPS_CPU_IS_ISA 0x0001 /* Is this an ISA? (If 0, a CPU.) */ +#define MIPS_CPU_ASE_SMARTMIPS 0x0002 /* CPU implements SmartMIPS ASE */ +#define MIPS_CPU_ASE_DSP 0x0004 /* CPU implements DSP ASE */ +#define MIPS_CPU_ASE_MT 0x0008 /* CPU implements MT ASE */ +#define MIPS_CPU_ASE_MIPS3D 0x0010 /* CPU implements MIPS-3D ASE */ +#define MIPS_CPU_ASE_MDMX 0x0020 /* CPU implements MDMX ASE */ +#define MIPS_CPU_ASE_DSPR2 0x0040 /* CPU implements DSP R2 ASE */ + static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *); static const struct mips_cpu_info *mips_cpu_info_from_isa (int); static const struct mips_cpu_info *mips_cpu_info_from_arch (int); @@ -1067,8 +1107,7 @@ static const struct mips_cpu_info *mips_cpu_info_from_arch (int); The following pseudo-ops from the Kane and Heinrich MIPS book are not MIPS CPU specific, but are also not specific to the object file format. This file is probably the best place to define them, but - they are not currently supported: .asm0, .endr, .lab, .repeat, - .struct. */ + they are not currently supported: .asm0, .endr, .lab, .struct. */ static const pseudo_typeS mips_pseudo_table[] = { @@ -1084,6 +1123,8 @@ static const pseudo_typeS mips_pseudo_table[] = {"cplocal", s_cplocal, 0}, {"cprestore", s_cprestore, 0}, {"cpreturn", s_cpreturn, 0}, + {"dtprelword", s_dtprelword, 0}, + {"dtpreldword", s_dtpreldword, 0}, {"gpvalue", s_gpvalue, 0}, {"gpword", s_gpword, 0}, {"gpdword", s_gpdword, 0}, @@ -1098,6 +1139,8 @@ static const pseudo_typeS mips_pseudo_table[] = {"half", s_cons, 1}, {"dword", s_cons, 3}, {"weakext", s_mips_weakext, 0}, + {"origin", s_org, 0}, + {"repeat", s_rept, 0}, /* These pseudo-ops are defined in read.c, but must be overridden here for one reason or another. */ @@ -1161,8 +1204,8 @@ struct insn_label_list symbolS *label; }; -static struct insn_label_list *insn_labels; static struct insn_label_list *free_insn_labels; +#define label_list tc_segment_info_data static void mips_clear_insn_labels (void); @@ -1170,12 +1213,19 @@ static inline void mips_clear_insn_labels (void) { register struct insn_label_list **pl; + segment_info_type *si; - for (pl = &free_insn_labels; *pl != NULL; pl = &(*pl)->next) - ; - *pl = insn_labels; - insn_labels = NULL; + if (now_seg) + { + for (pl = &free_insn_labels; *pl != NULL; pl = &(*pl)->next) + ; + + si = seg_info (now_seg); + *pl = si->label_list; + si->label_list = NULL; + } } + static char *expr_end; @@ -1418,13 +1468,302 @@ init_vr4120_conflicts (void) #undef CONFLICT } -/* This function is called once, at assembler startup time. It should - set up all the tables, etc. that the MD part of the assembler will need. */ +struct regname { + const char *name; + unsigned int num; +}; + +#define RTYPE_MASK 0x1ff00 +#define RTYPE_NUM 0x00100 +#define RTYPE_FPU 0x00200 +#define RTYPE_FCC 0x00400 +#define RTYPE_VEC 0x00800 +#define RTYPE_GP 0x01000 +#define RTYPE_CP0 0x02000 +#define RTYPE_PC 0x04000 +#define RTYPE_ACC 0x08000 +#define RTYPE_CCC 0x10000 +#define RNUM_MASK 0x000ff +#define RWARN 0x80000 + +#define GENERIC_REGISTER_NUMBERS \ + {"$0", RTYPE_NUM | 0}, \ + {"$1", RTYPE_NUM | 1}, \ + {"$2", RTYPE_NUM | 2}, \ + {"$3", RTYPE_NUM | 3}, \ + {"$4", RTYPE_NUM | 4}, \ + {"$5", RTYPE_NUM | 5}, \ + {"$6", RTYPE_NUM | 6}, \ + {"$7", RTYPE_NUM | 7}, \ + {"$8", RTYPE_NUM | 8}, \ + {"$9", RTYPE_NUM | 9}, \ + {"$10", RTYPE_NUM | 10}, \ + {"$11", RTYPE_NUM | 11}, \ + {"$12", RTYPE_NUM | 12}, \ + {"$13", RTYPE_NUM | 13}, \ + {"$14", RTYPE_NUM | 14}, \ + {"$15", RTYPE_NUM | 15}, \ + {"$16", RTYPE_NUM | 16}, \ + {"$17", RTYPE_NUM | 17}, \ + {"$18", RTYPE_NUM | 18}, \ + {"$19", RTYPE_NUM | 19}, \ + {"$20", RTYPE_NUM | 20}, \ + {"$21", RTYPE_NUM | 21}, \ + {"$22", RTYPE_NUM | 22}, \ + {"$23", RTYPE_NUM | 23}, \ + {"$24", RTYPE_NUM | 24}, \ + {"$25", RTYPE_NUM | 25}, \ + {"$26", RTYPE_NUM | 26}, \ + {"$27", RTYPE_NUM | 27}, \ + {"$28", RTYPE_NUM | 28}, \ + {"$29", RTYPE_NUM | 29}, \ + {"$30", RTYPE_NUM | 30}, \ + {"$31", RTYPE_NUM | 31} + +#define FPU_REGISTER_NAMES \ + {"$f0", RTYPE_FPU | 0}, \ + {"$f1", RTYPE_FPU | 1}, \ + {"$f2", RTYPE_FPU | 2}, \ + {"$f3", RTYPE_FPU | 3}, \ + {"$f4", RTYPE_FPU | 4}, \ + {"$f5", RTYPE_FPU | 5}, \ + {"$f6", RTYPE_FPU | 6}, \ + {"$f7", RTYPE_FPU | 7}, \ + {"$f8", RTYPE_FPU | 8}, \ + {"$f9", RTYPE_FPU | 9}, \ + {"$f10", RTYPE_FPU | 10}, \ + {"$f11", RTYPE_FPU | 11}, \ + {"$f12", RTYPE_FPU | 12}, \ + {"$f13", RTYPE_FPU | 13}, \ + {"$f14", RTYPE_FPU | 14}, \ + {"$f15", RTYPE_FPU | 15}, \ + {"$f16", RTYPE_FPU | 16}, \ + {"$f17", RTYPE_FPU | 17}, \ + {"$f18", RTYPE_FPU | 18}, \ + {"$f19", RTYPE_FPU | 19}, \ + {"$f20", RTYPE_FPU | 20}, \ + {"$f21", RTYPE_FPU | 21}, \ + {"$f22", RTYPE_FPU | 22}, \ + {"$f23", RTYPE_FPU | 23}, \ + {"$f24", RTYPE_FPU | 24}, \ + {"$f25", RTYPE_FPU | 25}, \ + {"$f26", RTYPE_FPU | 26}, \ + {"$f27", RTYPE_FPU | 27}, \ + {"$f28", RTYPE_FPU | 28}, \ + {"$f29", RTYPE_FPU | 29}, \ + {"$f30", RTYPE_FPU | 30}, \ + {"$f31", RTYPE_FPU | 31} + +#define FPU_CONDITION_CODE_NAMES \ + {"$fcc0", RTYPE_FCC | 0}, \ + {"$fcc1", RTYPE_FCC | 1}, \ + {"$fcc2", RTYPE_FCC | 2}, \ + {"$fcc3", RTYPE_FCC | 3}, \ + {"$fcc4", RTYPE_FCC | 4}, \ + {"$fcc5", RTYPE_FCC | 5}, \ + {"$fcc6", RTYPE_FCC | 6}, \ + {"$fcc7", RTYPE_FCC | 7} + +#define COPROC_CONDITION_CODE_NAMES \ + {"$cc0", RTYPE_FCC | RTYPE_CCC | 0}, \ + {"$cc1", RTYPE_FCC | RTYPE_CCC | 1}, \ + {"$cc2", RTYPE_FCC | RTYPE_CCC | 2}, \ + {"$cc3", RTYPE_FCC | RTYPE_CCC | 3}, \ + {"$cc4", RTYPE_FCC | RTYPE_CCC | 4}, \ + {"$cc5", RTYPE_FCC | RTYPE_CCC | 5}, \ + {"$cc6", RTYPE_FCC | RTYPE_CCC | 6}, \ + {"$cc7", RTYPE_FCC | RTYPE_CCC | 7} + +#define N32N64_SYMBOLIC_REGISTER_NAMES \ + {"$a4", RTYPE_GP | 8}, \ + {"$a5", RTYPE_GP | 9}, \ + {"$a6", RTYPE_GP | 10}, \ + {"$a7", RTYPE_GP | 11}, \ + {"$ta0", RTYPE_GP | 8}, /* alias for $a4 */ \ + {"$ta1", RTYPE_GP | 9}, /* alias for $a5 */ \ + {"$ta2", RTYPE_GP | 10}, /* alias for $a6 */ \ + {"$ta3", RTYPE_GP | 11}, /* alias for $a7 */ \ + {"$t0", RTYPE_GP | 12}, \ + {"$t1", RTYPE_GP | 13}, \ + {"$t2", RTYPE_GP | 14}, \ + {"$t3", RTYPE_GP | 15} + +#define O32_SYMBOLIC_REGISTER_NAMES \ + {"$t0", RTYPE_GP | 8}, \ + {"$t1", RTYPE_GP | 9}, \ + {"$t2", RTYPE_GP | 10}, \ + {"$t3", RTYPE_GP | 11}, \ + {"$t4", RTYPE_GP | 12}, \ + {"$t5", RTYPE_GP | 13}, \ + {"$t6", RTYPE_GP | 14}, \ + {"$t7", RTYPE_GP | 15}, \ + {"$ta0", RTYPE_GP | 12}, /* alias for $t4 */ \ + {"$ta1", RTYPE_GP | 13}, /* alias for $t5 */ \ + {"$ta2", RTYPE_GP | 14}, /* alias for $t6 */ \ + {"$ta3", RTYPE_GP | 15} /* alias for $t7 */ + +/* Remaining symbolic register names */ +#define SYMBOLIC_REGISTER_NAMES \ + {"$zero", RTYPE_GP | 0}, \ + {"$at", RTYPE_GP | 1}, \ + {"$AT", RTYPE_GP | 1}, \ + {"$v0", RTYPE_GP | 2}, \ + {"$v1", RTYPE_GP | 3}, \ + {"$a0", RTYPE_GP | 4}, \ + {"$a1", RTYPE_GP | 5}, \ + {"$a2", RTYPE_GP | 6}, \ + {"$a3", RTYPE_GP | 7}, \ + {"$s0", RTYPE_GP | 16}, \ + {"$s1", RTYPE_GP | 17}, \ + {"$s2", RTYPE_GP | 18}, \ + {"$s3", RTYPE_GP | 19}, \ + {"$s4", RTYPE_GP | 20}, \ + {"$s5", RTYPE_GP | 21}, \ + {"$s6", RTYPE_GP | 22}, \ + {"$s7", RTYPE_GP | 23}, \ + {"$t8", RTYPE_GP | 24}, \ + {"$t9", RTYPE_GP | 25}, \ + {"$k0", RTYPE_GP | 26}, \ + {"$kt0", RTYPE_GP | 26}, \ + {"$k1", RTYPE_GP | 27}, \ + {"$kt1", RTYPE_GP | 27}, \ + {"$gp", RTYPE_GP | 28}, \ + {"$sp", RTYPE_GP | 29}, \ + {"$s8", RTYPE_GP | 30}, \ + {"$fp", RTYPE_GP | 30}, \ + {"$ra", RTYPE_GP | 31} + +#define MIPS16_SPECIAL_REGISTER_NAMES \ + {"$pc", RTYPE_PC | 0} + +#define MDMX_VECTOR_REGISTER_NAMES \ + /* {"$v0", RTYPE_VEC | 0}, clash with REG 2 above */ \ + /* {"$v1", RTYPE_VEC | 1}, clash with REG 3 above */ \ + {"$v2", RTYPE_VEC | 2}, \ + {"$v3", RTYPE_VEC | 3}, \ + {"$v4", RTYPE_VEC | 4}, \ + {"$v5", RTYPE_VEC | 5}, \ + {"$v6", RTYPE_VEC | 6}, \ + {"$v7", RTYPE_VEC | 7}, \ + {"$v8", RTYPE_VEC | 8}, \ + {"$v9", RTYPE_VEC | 9}, \ + {"$v10", RTYPE_VEC | 10}, \ + {"$v11", RTYPE_VEC | 11}, \ + {"$v12", RTYPE_VEC | 12}, \ + {"$v13", RTYPE_VEC | 13}, \ + {"$v14", RTYPE_VEC | 14}, \ + {"$v15", RTYPE_VEC | 15}, \ + {"$v16", RTYPE_VEC | 16}, \ + {"$v17", RTYPE_VEC | 17}, \ + {"$v18", RTYPE_VEC | 18}, \ + {"$v19", RTYPE_VEC | 19}, \ + {"$v20", RTYPE_VEC | 20}, \ + {"$v21", RTYPE_VEC | 21}, \ + {"$v22", RTYPE_VEC | 22}, \ + {"$v23", RTYPE_VEC | 23}, \ + {"$v24", RTYPE_VEC | 24}, \ + {"$v25", RTYPE_VEC | 25}, \ + {"$v26", RTYPE_VEC | 26}, \ + {"$v27", RTYPE_VEC | 27}, \ + {"$v28", RTYPE_VEC | 28}, \ + {"$v29", RTYPE_VEC | 29}, \ + {"$v30", RTYPE_VEC | 30}, \ + {"$v31", RTYPE_VEC | 31} + +#define MIPS_DSP_ACCUMULATOR_NAMES \ + {"$ac0", RTYPE_ACC | 0}, \ + {"$ac1", RTYPE_ACC | 1}, \ + {"$ac2", RTYPE_ACC | 2}, \ + {"$ac3", RTYPE_ACC | 3} + +static const struct regname reg_names[] = { + GENERIC_REGISTER_NUMBERS, + FPU_REGISTER_NAMES, + FPU_CONDITION_CODE_NAMES, + COPROC_CONDITION_CODE_NAMES, + + /* The $txx registers depends on the abi, + these will be added later into the symbol table from + one of the tables below once mips_abi is set after + parsing of arguments from the command line. */ + SYMBOLIC_REGISTER_NAMES, + + MIPS16_SPECIAL_REGISTER_NAMES, + MDMX_VECTOR_REGISTER_NAMES, + MIPS_DSP_ACCUMULATOR_NAMES, + {0, 0} +}; + +static const struct regname reg_names_o32[] = { + O32_SYMBOLIC_REGISTER_NAMES, + {0, 0} +}; + +static const struct regname reg_names_n32n64[] = { + N32N64_SYMBOLIC_REGISTER_NAMES, + {0, 0} +}; + +static int +reg_lookup (char **s, unsigned int types, unsigned int *regnop) +{ + symbolS *symbolP; + char *e; + char save_c; + int reg = -1; + + /* Find end of name. */ + e = *s; + if (is_name_beginner (*e)) + ++e; + while (is_part_of_name (*e)) + ++e; + + /* Terminate name. */ + save_c = *e; + *e = '\0'; + + /* Look for a register symbol. */ + if ((symbolP = symbol_find (*s)) && S_GET_SEGMENT (symbolP) == reg_section) + { + int r = S_GET_VALUE (symbolP); + if (r & types) + reg = r & RNUM_MASK; + else if ((types & RTYPE_VEC) && (r & ~1) == (RTYPE_GP | 2)) + /* Convert GP reg $v0/1 to MDMX reg $v0/1! */ + reg = (r & RNUM_MASK) - 2; + } + /* Else see if this is a register defined in an itbl entry. */ + else if ((types & RTYPE_GP) && itbl_have_entries) + { + char *n = *s; + unsigned long r; + + if (*n == '$') + ++n; + if (itbl_get_reg_val (n, &r)) + reg = r & RNUM_MASK; + } + + /* Advance to next token if a register was recognised. */ + if (reg >= 0) + *s = e; + else if (types & RWARN) + as_warn ("Unrecognized register name `%s'", *s); + + *e = save_c; + if (regnop) + *regnop = reg; + return reg >= 0; +} + +/* This function is called once, at assembler startup time. It should set up + all the tables, etc. that the MD part of the assembler will need. */ void md_begin (void) { - register const char *retval = NULL; + const char *retval = NULL; int i = 0; int broken = 0; @@ -1506,46 +1845,20 @@ md_begin (void) /* We add all the general register names to the symbol table. This helps us detect invalid uses of them. */ - for (i = 0; i < 32; i++) - { - char buf[5]; - - sprintf (buf, "$%d", i); - symbol_table_insert (symbol_new (buf, reg_section, i, + for (i = 0; reg_names[i].name; i++) + symbol_table_insert (symbol_new (reg_names[i].name, reg_section, + reg_names[i].num, // & RNUM_MASK, + &zero_address_frag)); + if (HAVE_NEWABI) + for (i = 0; reg_names_n32n64[i].name; i++) + symbol_table_insert (symbol_new (reg_names_n32n64[i].name, reg_section, + reg_names_n32n64[i].num, // & RNUM_MASK, &zero_address_frag)); - } - symbol_table_insert (symbol_new ("$ra", reg_section, RA, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$fp", reg_section, FP, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$sp", reg_section, SP, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$gp", reg_section, GP, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$at", reg_section, AT, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$kt0", reg_section, KT0, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$kt1", reg_section, KT1, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$zero", reg_section, ZERO, - &zero_address_frag)); - symbol_table_insert (symbol_new ("$pc", reg_section, -1, - &zero_address_frag)); - - /* If we don't add these register names to the symbol table, they - may end up being added as regular symbols by operand(), and then - make it to the object file as undefined in case they're not - regarded as local symbols. They're local in o32, since `$' is a - local symbol prefix, but not in n32 or n64. */ - for (i = 0; i < 8; i++) - { - char buf[6]; - - sprintf (buf, "$fcc%i", i); - symbol_table_insert (symbol_new (buf, reg_section, -1, + else + for (i = 0; reg_names_o32[i].name; i++) + symbol_table_insert (symbol_new (reg_names_o32[i].name, reg_section, + reg_names_o32[i].num, // & RNUM_MASK, &zero_address_frag)); - } mips_no_prev_insn (); @@ -1560,7 +1873,8 @@ md_begin (void) bfd_set_gp_size (stdoutput, g_switch_value); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) +#ifdef OBJ_ELF + if (IS_ELF) { /* On a native system other than VxWorks, sections must be aligned to 16 byte boundaries. When configured for an embedded ELF @@ -1598,9 +1912,7 @@ md_begin (void) bfd_set_section_flags (stdoutput, sec, flags); bfd_set_section_alignment (stdoutput, sec, HAVE_NEWABI ? 3 : 2); -#ifdef OBJ_ELF mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo)); -#endif } else { @@ -1610,7 +1922,6 @@ md_begin (void) bfd_set_section_flags (stdoutput, sec, flags); bfd_set_section_alignment (stdoutput, sec, 3); -#ifdef OBJ_ELF /* Set up the option header. */ { Elf_Internal_Options opthdr; @@ -1627,7 +1938,6 @@ md_begin (void) mips_regmask_frag = frag_more (sizeof (Elf64_External_RegInfo)); } -#endif } if (ECOFF_DEBUGGING) @@ -1637,8 +1947,7 @@ md_begin (void) SEC_HAS_CONTENTS | SEC_READONLY); (void) bfd_set_section_alignment (stdoutput, sec, 2); } -#ifdef OBJ_ELF - else if (OUTPUT_FLAVOR == bfd_target_elf_flavour && mips_flag_pdr) + else if (mips_flag_pdr) { pdr_seg = subseg_new (".pdr", (subsegT) 0); (void) bfd_set_section_flags (stdoutput, pdr_seg, @@ -1646,11 +1955,11 @@ md_begin (void) | SEC_DEBUGGING); (void) bfd_set_section_alignment (stdoutput, pdr_seg, 2); } -#endif subseg_set (seg, subseg); } } +#endif /* OBJ_ELF */ if (! ECOFF_DEBUGGING) md_obj_begin (); @@ -1849,10 +2158,11 @@ reg_needs_delay (unsigned int reg) static void mips_move_labels (void) { + segment_info_type *si = seg_info (now_seg); struct insn_label_list *l; valueT val; - for (l = insn_labels; l != NULL; l = l->next) + for (l = si->label_list; l != NULL; l = l->next) { assert (S_GET_SEGMENT (l->label) == now_seg); symbol_set_frag (l->label, frag_now); @@ -1864,6 +2174,28 @@ mips_move_labels (void) } } +static bfd_boolean +s_is_linkonce (symbolS *sym, segT from_seg) +{ + bfd_boolean linkonce = FALSE; + segT symseg = S_GET_SEGMENT (sym); + + if (symseg != from_seg && !S_IS_LOCAL (sym)) + { + if ((bfd_get_section_flags (stdoutput, symseg) & SEC_LINK_ONCE)) + linkonce = TRUE; +#ifdef OBJ_ELF + /* The GNU toolchain uses an extension for ELF: a section + beginning with the magic string .gnu.linkonce is a + linkonce section. */ + if (strncmp (segment_name (symseg), ".gnu.linkonce", + sizeof ".gnu.linkonce" - 1) == 0) + linkonce = TRUE; +#endif + } + return linkonce; +} + /* Mark instruction labels in mips16 mode. This permits the linker to handle them specially, such as generating jalx instructions when needed. We also make them odd for the duration of the assembly, in @@ -1875,21 +2207,29 @@ mips_move_labels (void) static void mips16_mark_labels (void) { - if (mips_opts.mips16) - { - struct insn_label_list *l; - valueT val; + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l; - for (l = insn_labels; l != NULL; l = l->next) - { -#ifdef OBJ_ELF - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) - S_SET_OTHER (l->label, STO_MIPS16); + if (!mips_opts.mips16) + return; + + for (l = si->label_list; l != NULL; l = l->next) + { + symbolS *label = l->label; + +#if defined(OBJ_ELF) || defined(OBJ_MAYBE_ELF) + if (IS_ELF) + S_SET_OTHER (label, STO_MIPS16); #endif - val = S_GET_VALUE (l->label); - if ((val & 1) == 0) - S_SET_VALUE (l->label, val + 1); - } + if ((S_GET_VALUE (label) & 1) == 0 + /* Don't adjust the address if the label is global or weak, or + in a link-once section, since we'll be emitting symbol reloc + references to it which will be patched up by the linker, and + the final value of the symbol may or may not be MIPS16. */ + && ! S_IS_WEAK (label) + && ! S_IS_EXTERNAL (label) + && ! s_is_linkonce (label, now_seg)) + S_SET_VALUE (label, S_GET_VALUE (label) | 1); } } @@ -2214,9 +2554,10 @@ static void append_insn (struct mips_cl_insn *ip, expressionS *address_expr, bfd_reloc_code_real_type *reloc_type) { - register unsigned long prev_pinfo, pinfo; + unsigned long prev_pinfo, pinfo; relax_stateT prev_insn_frag_type = 0; bfd_boolean relaxed_branch = FALSE; + segment_info_type *si = seg_info (now_seg); /* Mark instruction labels in mips16 mode. */ mips16_mark_labels (); @@ -2479,6 +2820,11 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, reloc_type[0] == BFD_RELOC_16_PCREL_S2, reloc_type[0]); + /* Tag symbols that have a R_MIPS16_26 relocation against them. */ + if (reloc_type[0] == BFD_RELOC_MIPS16_JMP + && ip->fixp[0]->fx_addsy) + *symbol_get_tc (ip->fixp[0]->fx_addsy) = 1; + /* These relocations can have an addend that won't fit in 4 octets for 64bit assembly. */ if (HAVE_64BIT_GPRS @@ -2633,7 +2979,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, whether there is a label on this instruction. If there are any branches to anything other than a label, users must use .set noreorder. */ - || insn_labels != NULL + || si->label_list != NULL /* If the previous instruction is in a variant frag other than this branch's one, we cannot do the swap. This does not apply to the mips16, which uses variant @@ -2740,10 +3086,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, if (mips_opts.mips16 && (pinfo & INSN_UNCOND_BRANCH_DELAY) && (pinfo & (MIPS16_INSN_READ_X | MIPS16_INSN_READ_31)) - && (mips_opts.isa == ISA_MIPS32 - || mips_opts.isa == ISA_MIPS32R2 - || mips_opts.isa == ISA_MIPS64 - || mips_opts.isa == ISA_MIPS64R2)) + && ISA_SUPPORTS_MIPS16E) { /* Convert MIPS16 jr/jalr into a "compact" jump. */ ip->insn_opcode |= 0x0080; @@ -3025,16 +3368,24 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) assert (mo); assert (strcmp (name, mo->name) == 0); - /* Search until we get a match for NAME. It is assumed here that - macros will never generate MDMX or MIPS-3D instructions. */ - while (strcmp (fmt, mo->args) != 0 - || mo->pinfo == INSN_MACRO - || !OPCODE_IS_MEMBER (mo, - (mips_opts.isa - | (file_ase_mips16 ? INSN_MIPS16 : 0)), - mips_opts.arch) - || (mips_opts.arch == CPU_R4650 && (mo->pinfo & FP_D) != 0)) + while (1) { + /* Search until we get a match for NAME. It is assumed here that + macros will never generate MDMX, MIPS-3D, or MT instructions. */ + if (strcmp (fmt, mo->args) == 0 + && mo->pinfo != INSN_MACRO + && OPCODE_IS_MEMBER (mo, + (mips_opts.isa + | (mips_opts.mips16 ? INSN_MIPS16 : 0) + | (mips_opts.ase_dsp ? INSN_DSP : 0) + | ((mips_opts.ase_dsp && ISA_SUPPORTS_DSP64_ASE) + ? INSN_DSP64 : 0) + | (mips_opts.ase_dspr2 ? INSN_DSPR2 : 0) + | (mips_opts.ase_smartmips ? INSN_SMARTMIPS : 0)), + mips_opts.arch) + && (mips_opts.arch != CPU_R4650 || (mo->pinfo & FP_D) == 0)) + break; + ++mo; assert (mo->name); assert (strcmp (name, mo->name) == 0); @@ -3085,6 +3436,10 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) } continue; + case '2': + INSERT_OPERAND (BP, insn, va_arg (args, int)); + continue; + case 't': case 'w': case 'E': @@ -3212,7 +3567,11 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) continue; case 'C': - insn.insn_opcode |= va_arg (args, unsigned long); + INSERT_OPERAND (COPZ, insn, va_arg (args, unsigned long)); + continue; + + case 'k': + INSERT_OPERAND (CACHE, insn, va_arg (args, unsigned long)); continue; default: @@ -3296,7 +3655,7 @@ mips16_macro_build (expressionS *ep, const char *name, const char *fmt, regno = va_arg (args, int); regno = ((regno & 7) << 2) | ((regno & 0x18) >> 3); - insn.insn_opcode |= regno << MIPS16OP_SH_REG32R; + MIPS16_INSERT_OPERAND (REG32R, insn, regno); } continue; @@ -3412,7 +3771,7 @@ macro_build_lui (expressionS *ep, int regnum) if (high_expr.X_op == O_constant) { - /* we can compute the instruction now without a relocation entry */ + /* We can compute the instruction now without a relocation entry. */ high_expr.X_add_number = ((high_expr.X_add_number + 0x8000) >> 16) & 0xffff; *r = BFD_RELOC_UNUSED; @@ -4189,7 +4548,7 @@ add_got_offset_hilo (int dest, expressionS *local, int tmp) static void macro (struct mips_cl_insn *ip) { - register int treg, sreg, dreg, breg; + int treg, sreg, dreg, breg; int tempreg; int mask; int used_at = 0; @@ -4309,6 +4668,22 @@ macro (struct mips_cl_insn *ip) macro_build (NULL, s2, "d,v,t", treg, sreg, AT); break; + case M_BALIGN: + switch (imm_expr.X_add_number) + { + case 0: + macro_build (NULL, "nop", ""); + break; + case 2: + macro_build (NULL, "packrl.ph", "d,s,t", treg, treg, sreg); + break; + default: + macro_build (NULL, "balign", "t,s,2", treg, sreg, + (int)imm_expr.X_add_number); + break; + } + break; + case M_BEQ_I: s = "beq"; goto beq_i; @@ -5849,6 +6224,9 @@ macro (struct mips_cl_insn *ip) case M_SCD_AB: s = "scd"; goto st; + case M_CACHE_AB: + s = "cache"; + goto st; case M_SDC1_AB: if (mips_opts.arch == CPU_R4650) { @@ -5895,6 +6273,8 @@ macro (struct mips_cl_insn *ip) || mask == M_L_DAB || mask == M_S_DAB) fmt = "T,o(b)"; + else if (mask == M_CACHE_AB) + fmt = "k,o(b)"; else if (coproc) fmt = "E,o(b)"; else @@ -6854,7 +7234,7 @@ macro (struct mips_cl_insn *ip) static void macro2 (struct mips_cl_insn *ip) { - register int treg, sreg, dreg, breg; + int treg, sreg, dreg, breg; int tempreg; int mask; int used_at; @@ -7990,6 +8370,10 @@ validate_mips_insn (const struct mips_opcode *opc) case '+': switch (c = *p++) { + case '1': USE_BITS (OP_MASK_UDI1, OP_SH_UDI1); break; + case '2': USE_BITS (OP_MASK_UDI2, OP_SH_UDI2); break; + case '3': USE_BITS (OP_MASK_UDI3, OP_SH_UDI3); break; + case '4': USE_BITS (OP_MASK_UDI4, OP_SH_UDI4); break; case 'A': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break; case 'B': USE_BITS (OP_MASK_INSMSB, OP_SH_INSMSB); break; case 'C': USE_BITS (OP_MASK_EXTMSBD, OP_SH_EXTMSBD); break; @@ -8065,6 +8449,7 @@ validate_mips_insn (const struct mips_opcode *opc) case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break; case '[': break; case ']': break; + case '2': USE_BITS (OP_MASK_BP, OP_SH_BP); break; case '3': USE_BITS (OP_MASK_SA3, OP_SH_SA3); break; case '4': USE_BITS (OP_MASK_SA4, OP_SH_SA4); break; case '5': USE_BITS (OP_MASK_IMM8, OP_SH_IMM8); break; @@ -8096,6 +8481,62 @@ validate_mips_insn (const struct mips_opcode *opc) return 1; } +/* UDI immediates. */ +struct mips_immed { + char type; + unsigned int shift; + unsigned long mask; + const char * desc; +}; + +static const struct mips_immed mips_immed[] = { + { '1', OP_SH_UDI1, OP_MASK_UDI1, 0}, + { '2', OP_SH_UDI2, OP_MASK_UDI2, 0}, + { '3', OP_SH_UDI3, OP_MASK_UDI3, 0}, + { '4', OP_SH_UDI4, OP_MASK_UDI4, 0}, + { 0,0,0,0 } +}; + +/* Check whether an odd floating-point register is allowed. */ +static int +mips_oddfpreg_ok (const struct mips_opcode *insn, int argnum) +{ + const char *s = insn->name; + + if (insn->pinfo == INSN_MACRO) + /* Let a macro pass, we'll catch it later when it is expanded. */ + return 1; + + if (ISA_HAS_ODD_SINGLE_FPR (mips_opts.isa)) + { + /* Allow odd registers for single-precision ops. */ + switch (insn->pinfo & (FP_S | FP_D)) + { + case FP_S: + case 0: + return 1; /* both single precision - ok */ + case FP_D: + return 0; /* both double precision - fail */ + default: + break; + } + + /* Cvt.w.x and cvt.x.w allow an odd register for a 'w' or 's' operand. */ + s = strchr (insn->name, '.'); + if (argnum == 2) + s = s != NULL ? strchr (s + 1, '.') : NULL; + return (s != NULL && (s[1] == 'w' || s[1] == 's')); + } + + /* Single-precision coprocessor loads and moves are OK too. */ + if ((insn->pinfo & FP_S) + && (insn->pinfo & (INSN_COPROC_MEMORY_DELAY | INSN_STORE_MEMORY + | INSN_LOAD_COPROC_DELAY | INSN_COPROC_MOVE_DELAY))) + return 1; + + return 0; +} + /* This routine assembles an instruction into its binary format. As a side effect, it sets one of the global variables imm_reloc or offset_reloc to the type of relocation to do if one of the operands @@ -8116,6 +8557,8 @@ mips_ip (char *str, struct mips_cl_insn *ip) char *s_reset; char save_c = 0; offsetT min_range, max_range; + int argnum; + unsigned int rtype; insn_error = NULL; @@ -8176,11 +8619,18 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (OPCODE_IS_MEMBER (insn, (mips_opts.isa + /* We don't check for mips_opts.mips16 here since + we want to allow jalx if -mips16 was specified + on the command line. */ | (file_ase_mips16 ? INSN_MIPS16 : 0) | (mips_opts.ase_mdmx ? INSN_MDMX : 0) | (mips_opts.ase_dsp ? INSN_DSP : 0) + | ((mips_opts.ase_dsp && ISA_SUPPORTS_DSP64_ASE) + ? INSN_DSP64 : 0) + | (mips_opts.ase_dspr2 ? INSN_DSPR2 : 0) | (mips_opts.ase_mt ? INSN_MT : 0) - | (mips_opts.ase_mips3d ? INSN_MIPS3D : 0)), + | (mips_opts.ase_mips3d ? INSN_MIPS3D : 0) + | (mips_opts.ase_smartmips ? INSN_SMARTMIPS : 0)), mips_opts.arch)) ok = TRUE; else @@ -8295,6 +8745,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) create_insn (ip, insn); insn_error = NULL; + argnum = 1; for (args = insn->args;; ++args) { int is_mdmx; @@ -8308,16 +8759,29 @@ mips_ip (char *str, struct mips_cl_insn *ip) return; break; + case '2': /* dsp 2-bit unsigned immediate in bit 11 */ + my_getExpression (&imm_expr, s); + check_absolute_expr (ip, &imm_expr); + if ((unsigned long) imm_expr.X_add_number != 1 + && (unsigned long) imm_expr.X_add_number != 3) + { + as_bad (_("BALIGN immediate not 1 or 3 (%lu)"), + (unsigned long) imm_expr.X_add_number); + } + INSERT_OPERAND (BP, *ip, imm_expr.X_add_number); + imm_expr.X_op = O_absent; + s = expr_end; + continue; + case '3': /* dsp 3-bit unsigned immediate in bit 21 */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_SA3) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_SA3, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_SA3; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_SA3, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_SA3; + INSERT_OPERAND (SA3, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8327,11 +8791,10 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_SA4) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_SA4, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_SA4; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_SA4, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_SA4; + INSERT_OPERAND (SA4, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8341,11 +8804,10 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_IMM8) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_IMM8, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_IMM8; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_IMM8, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_IMM8; + INSERT_OPERAND (IMM8, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8355,11 +8817,10 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_RS) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_RS, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_RS; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_RS, (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_RS; + INSERT_OPERAND (RS, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8370,7 +8831,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_DSPACC; + INSERT_OPERAND (DSPACC, *ip, regno); continue; } else @@ -8382,12 +8843,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_WRDSP) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_WRDSP, - (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_WRDSP; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_WRDSP, + (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_WRDSP; + INSERT_OPERAND (WRDSP, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8398,7 +8858,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_DSPACC_S; + INSERT_OPERAND (DSPACC_S, *ip, regno); continue; } else @@ -8413,13 +8873,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (imm_expr.X_add_number < min_range || imm_expr.X_add_number > max_range) { - as_warn (_("DSP immediate not in range %ld..%ld (%ld)"), - (long) min_range, (long) max_range, - (long) imm_expr.X_add_number); + as_bad (_("DSP immediate not in range %ld..%ld (%ld)"), + (long) min_range, (long) max_range, + (long) imm_expr.X_add_number); } - imm_expr.X_add_number &= OP_MASK_DSPSFT; - ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number - << OP_SH_DSPSFT); + INSERT_OPERAND (DSPSFT, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8429,12 +8887,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_RDDSP) { - as_warn (_("DSP immediate not in range 0..%d (%lu)"), - OP_MASK_RDDSP, - (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_RDDSP; + as_bad (_("DSP immediate not in range 0..%d (%lu)"), + OP_MASK_RDDSP, + (unsigned long) imm_expr.X_add_number); } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_RDDSP; + INSERT_OPERAND (RDDSP, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8447,13 +8904,11 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (imm_expr.X_add_number < min_range || imm_expr.X_add_number > max_range) { - as_warn (_("DSP immediate not in range %ld..%ld (%ld)"), - (long) min_range, (long) max_range, - (long) imm_expr.X_add_number); + as_bad (_("DSP immediate not in range %ld..%ld (%ld)"), + (long) min_range, (long) max_range, + (long) imm_expr.X_add_number); } - imm_expr.X_add_number &= OP_MASK_DSPSFT_7; - ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number - << OP_SH_DSPSFT_7); + INSERT_OPERAND (DSPSFT_7, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8466,41 +8921,33 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (imm_expr.X_add_number < min_range || imm_expr.X_add_number > max_range) { - as_warn (_("DSP immediate not in range %ld..%ld (%ld)"), - (long) min_range, (long) max_range, - (long) imm_expr.X_add_number); + as_bad (_("DSP immediate not in range %ld..%ld (%ld)"), + (long) min_range, (long) max_range, + (long) imm_expr.X_add_number); } - imm_expr.X_add_number &= OP_MASK_IMM10; - ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number - << OP_SH_IMM10); + INSERT_OPERAND (IMM10, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; - case '!': /* mt 1-bit unsigned immediate in bit 5 */ + case '!': /* MT usermode flag bit. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_MT_U) - { - as_warn (_("MT immediate not in range 0..%d (%lu)"), - OP_MASK_MT_U, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_MT_U; - } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_MT_U; + as_bad (_("MT usermode bit not 0 or 1 (%lu)"), + (unsigned long) imm_expr.X_add_number); + INSERT_OPERAND (MT_U, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; - case '$': /* mt 1-bit unsigned immediate in bit 4 */ + case '$': /* MT load high flag bit. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number & ~OP_MASK_MT_H) - { - as_warn (_("MT immediate not in range 0..%d (%lu)"), - OP_MASK_MT_H, (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= OP_MASK_MT_H; - } - ip->insn_opcode |= imm_expr.X_add_number << OP_SH_MT_H; + as_bad (_("MT load high bit not 0 or 1 (%lu)"), + (unsigned long) imm_expr.X_add_number); + INSERT_OPERAND (MT_H, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8511,7 +8958,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_MTACC_T; + INSERT_OPERAND (MTACC_T, *ip, regno); continue; } else @@ -8524,7 +8971,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) { regno = s[3] - '0'; s += 4; - ip->insn_opcode |= regno << OP_SH_MTACC_D; + INSERT_OPERAND (MTACC_D, *ip, regno); continue; } else @@ -8532,6 +8979,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) break; case ',': + ++argnum; if (*s++ == *args) continue; s--; @@ -8577,6 +9025,34 @@ mips_ip (char *str, struct mips_cl_insn *ip) case '+': /* Opcode extension character. */ switch (*++args) { + case '1': /* UDI immediates. */ + case '2': + case '3': + case '4': + { + const struct mips_immed *imm = mips_immed; + + while (imm->type && imm->type != *args) + ++imm; + if (! imm->type) + internalError (); + my_getExpression (&imm_expr, s); + check_absolute_expr (ip, &imm_expr); + if ((unsigned long) imm_expr.X_add_number & ~imm->mask) + { + as_warn (_("Illegal %s number (%lu, 0x%lx)"), + imm->desc ? imm->desc : ip->insn_mo->name, + (unsigned long) imm_expr.X_add_number, + (unsigned long) imm_expr.X_add_number); + imm_expr.X_add_number &= imm->mask; + } + ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number + << imm->shift); + imm_expr.X_op = O_absent; + s = expr_end; + } + continue; + case 'A': /* ins/ext position, becomes LSB. */ limlo = 0; limhi = 31; @@ -8683,11 +9159,11 @@ do_msbd: s = expr_end; continue; - case 'T': /* Coprocessor register */ + case 'T': /* Coprocessor register. */ /* +T is for disassembly only; never match. */ break; - case 't': /* Coprocessor register number */ + case 't': /* Coprocessor register number. */ if (s[0] == '$' && ISDIGIT (s[1])) { ++s; @@ -8703,7 +9179,7 @@ do_msbd: as_bad (_("Invalid register number (%d)"), regno); else { - ip->insn_opcode |= regno << OP_SH_RT; + INSERT_OPERAND (RT, *ip, regno); continue; } } @@ -8794,8 +9270,9 @@ do_msbd: case 'c': /* break code */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned long) imm_expr.X_add_number > 1023) - as_warn (_("Illegal break code (%lu)"), + if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE) + as_warn (_("Code for %s not in range 0..1023 (%lu)"), + ip->insn_mo->name, (unsigned long) imm_expr.X_add_number); INSERT_OPERAND (CODE, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; @@ -8805,8 +9282,9 @@ do_msbd: case 'q': /* lower break code */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned long) imm_expr.X_add_number > 1023) - as_warn (_("Illegal lower break code (%lu)"), + if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE2) + as_warn (_("Lower code for %s not in range 0..1023 (%lu)"), + ip->insn_mo->name, (unsigned long) imm_expr.X_add_number); INSERT_OPERAND (CODE2, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; @@ -8834,7 +9312,8 @@ do_msbd: my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE20) - as_warn (_("Illegal 20-bit code (%lu)"), + as_warn (_("Code for %s not in range 0..1048575 (%lu)"), + ip->insn_mo->name, (unsigned long) imm_expr.X_add_number); INSERT_OPERAND (CODE20, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; @@ -8844,13 +9323,13 @@ do_msbd: case 'C': /* Coprocessor code */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - if ((unsigned long) imm_expr.X_add_number >= (1 << 25)) + if ((unsigned long) imm_expr.X_add_number > OP_MASK_COPZ) { as_warn (_("Coproccesor code > 25 bits (%lu)"), (unsigned long) imm_expr.X_add_number); - imm_expr.X_add_number &= ((1 << 25) - 1); + imm_expr.X_add_number &= OP_MASK_COPZ; } - ip->insn_opcode |= imm_expr.X_add_number; + INSERT_OPERAND (COPZ, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; @@ -8859,14 +9338,17 @@ do_msbd: my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE19) - as_warn (_("Illegal 19-bit code (%lu)"), - (unsigned long) imm_expr.X_add_number); + { + as_warn (_("Illegal 19-bit code (%lu)"), + (unsigned long) imm_expr.X_add_number); + imm_expr.X_add_number &= OP_MASK_CODE19; + } INSERT_OPERAND (CODE19, *ip, imm_expr.X_add_number); imm_expr.X_op = O_absent; s = expr_end; continue; - case 'P': /* Performance register */ + case 'P': /* Performance register. */ my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); if (imm_expr.X_add_number != 0 && imm_expr.X_add_number != 1) @@ -8877,6 +9359,20 @@ do_msbd: s = expr_end; continue; + case 'G': /* Coprocessor destination register. */ + if (((ip->insn_opcode >> OP_SH_OP) & OP_MASK_OP) == OP_OP_COP0) + ok = reg_lookup (&s, RTYPE_NUM | RTYPE_CP0, ®no); + else + ok = reg_lookup (&s, RTYPE_NUM | RTYPE_GP, ®no); + INSERT_OPERAND (RD, *ip, regno); + if (ok) + { + lastregno = regno; + continue; + } + else + break; + case 'b': /* base register */ case 'd': /* destination register */ case 's': /* source register */ @@ -8885,106 +9381,22 @@ do_msbd: case 'v': /* both dest and source */ case 'w': /* both dest and target */ case 'E': /* coprocessor target register */ - case 'G': /* coprocessor destination register */ case 'K': /* 'rdhwr' destination register */ case 'x': /* ignore register name */ case 'z': /* must be zero register */ case 'U': /* destination register (clo/clz). */ case 'g': /* coprocessor destination register */ - s_reset = s; - if (s[0] == '$') + s_reset = s; + if (*args == 'E' || *args == 'K') + ok = reg_lookup (&s, RTYPE_NUM, ®no); + else + { + ok = reg_lookup (&s, RTYPE_NUM | RTYPE_GP, ®no); + if (regno == AT && ! mips_opts.noat) + as_warn ("Used $at without \".set noat\""); + } + if (ok) { - if (ISDIGIT (s[1])) - { - ++s; - regno = 0; - do - { - regno *= 10; - regno += *s - '0'; - ++s; - } - while (ISDIGIT (*s)); - if (regno > 31) - as_bad (_("Invalid register number (%d)"), regno); - } - else if (*args == 'E' || *args == 'G' || *args == 'K') - goto notreg; - else - { - if (s[1] == 'r' && s[2] == 'a') - { - s += 3; - regno = RA; - } - else if (s[1] == 'f' && s[2] == 'p') - { - s += 3; - regno = FP; - } - else if (s[1] == 's' && s[2] == 'p') - { - s += 3; - regno = SP; - } - else if (s[1] == 'g' && s[2] == 'p') - { - s += 3; - regno = GP; - } - else if (s[1] == 'a' && s[2] == 't') - { - s += 3; - regno = AT; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '0') - { - s += 4; - regno = KT0; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '1') - { - s += 4; - regno = KT1; - } - else if (s[1] == 'z' && s[2] == 'e' && s[3] == 'r' && s[4] == 'o') - { - s += 5; - regno = ZERO; - } - else if (itbl_have_entries) - { - char *p, *n; - unsigned long r; - - p = s + 1; /* advance past '$' */ - n = itbl_get_field (&p); /* n is name */ - - /* See if this is a register defined in an - itbl entry. */ - if (itbl_get_reg_val (n, &r)) - { - /* Get_field advances to the start of - the next field, so we need to back - rack to the end of the last field. */ - if (p) - s = p - 1; - else - s = strchr (s, '\0'); - regno = r; - } - else - goto notreg; - } - else - goto notreg; - } - if (regno == AT - && ! mips_opts.noat - && *args != 'E' - && *args != 'G' - && *args != 'K') - as_warn (_("Used $at without \".set noat\"")); c = *args; if (*s == ' ') ++s; @@ -9050,7 +9462,6 @@ do_msbd: lastregno = regno; continue; } - notreg: switch (*args++) { case 'r': @@ -9103,45 +9514,27 @@ do_msbd: case 'R': /* floating point source register */ case 'V': case 'W': + rtype = RTYPE_FPU; + if (is_mdmx + || (mips_opts.ase_mdmx + && (ip->insn_mo->pinfo & FP_D) + && (ip->insn_mo->pinfo & (INSN_COPROC_MOVE_DELAY + | INSN_COPROC_MEMORY_DELAY + | INSN_LOAD_COPROC_DELAY + | INSN_LOAD_MEMORY_DELAY + | INSN_STORE_MEMORY)))) + rtype |= RTYPE_VEC; s_reset = s; - if (mips_opts.arch == CPU_OCTEON && octeon_error_on_unsupported) - { - insn_error = "opcode not implemented in Octeon"; - return; - } - /* Accept $fN for FP and MDMX register numbers, and in - addition accept $vN for MDMX register numbers. */ - if ((s[0] == '$' && s[1] == 'f' && ISDIGIT (s[2])) - || (is_mdmx != 0 && s[0] == '$' && s[1] == 'v' - && ISDIGIT (s[2]))) + if (mips_opts.arch == CPU_OCTEON && octeon_error_on_unsupported) + { + insn_error = "opcode not implemented in Octeon"; + return; + } + if (reg_lookup (&s, rtype, ®no)) { - s += 2; - regno = 0; - do - { - regno *= 10; - regno += *s - '0'; - ++s; - } - while (ISDIGIT (*s)); - - if (regno > 31) - as_bad (_("Invalid float register number (%d)"), regno); - if ((regno & 1) != 0 && HAVE_32BIT_FPRS - && ! (strcmp (str, "mtc1") == 0 - || strcmp (str, "mfc1") == 0 - || strcmp (str, "lwc1") == 0 - || strcmp (str, "swc1") == 0 - || strcmp (str, "l.s") == 0 - || strcmp (str, "s.s") == 0 - || strcmp (str, "mftc1") == 0 - || strcmp (str, "mfthc1") == 0 - || strcmp (str, "cftc1") == 0 - || strcmp (str, "mttc1") == 0 - || strcmp (str, "mtthc1") == 0 - || strcmp (str, "cttc1") == 0)) + && ! mips_oddfpreg_ok (ip->insn_mo, argnum)) as_warn (_("Float register should be even, was %d"), regno); @@ -9403,15 +9796,14 @@ do_msbd: break; } new_seg = subseg_new (newname, (subsegT) 0); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + if (IS_ELF) bfd_set_section_flags (stdoutput, new_seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA)); frag_align (*args == 'l' ? 2 : 3, 0, 0); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour - && strcmp (TARGET_OS, "elf") != 0) + if (IS_ELF && strcmp (TARGET_OS, "elf") != 0) record_alignment (new_seg, 4); else record_alignment (new_seg, *args == 'l' ? 2 : 3); @@ -9529,19 +9921,11 @@ do_msbd: case 'N': /* 3 bit branch condition code */ case 'M': /* 3 bit compare condition code */ - if (strncmp (s, "$fcc", 4) != 0) + rtype = RTYPE_CCC; + if (ip->insn_mo->pinfo & (FP_D| FP_S)) + rtype |= RTYPE_FCC; + if (!reg_lookup (&s, rtype, ®no)) break; - s += 4; - regno = 0; - do - { - regno *= 10; - regno += *s - '0'; - ++s; - } - while (ISDIGIT (*s)); - if (regno > 7) - as_bad (_("Invalid condition code register $fcc%d"), regno); if ((strcmp(str + strlen(str) - 3, ".ps") == 0 || strcmp(str + strlen(str) - 5, "any2f") == 0 || strcmp(str + strlen(str) - 5, "any2t") == 0) @@ -9708,8 +10092,38 @@ mips16_ip (char *str, struct mips_cl_insn *ip) argsstart = s; for (;;) { + bfd_boolean ok; + assert (strcmp (insn->name, str) == 0); + if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_opts.arch)) + ok = TRUE; + else + ok = FALSE; + + if (! ok) + { + if (insn + 1 < &mips16_opcodes[bfd_mips16_num_opcodes] + && strcmp (insn->name, insn[1].name) == 0) + { + ++insn; + continue; + } + else + { + if (!insn_error) + { + static char buf[100]; + sprintf (buf, + _("opcode not supported on this processor: %s (%s)"), + mips_cpu_info_from_arch (mips_opts.arch)->name, + mips_cpu_info_from_isa (mips_opts.isa)->name); + insn_error = buf; + } + return; + } + } + create_insn (ip, insn); imm_expr.X_op = O_absent; imm_reloc[0] = BFD_RELOC_UNUSED; @@ -9822,70 +10236,19 @@ mips16_ip (char *str, struct mips_cl_insn *ip) case 'R': case 'X': case 'Y': - if (s[0] != '$') - break; - s_reset = s; - if (ISDIGIT (s[1])) + s_reset = s; + if (!reg_lookup (&s, RTYPE_NUM | RTYPE_GP, ®no)) { - ++s; - regno = 0; - do + if (c == 'v' || c == 'w') { - regno *= 10; - regno += *s - '0'; - ++s; + if (c == 'v') + MIPS16_INSERT_OPERAND (RX, *ip, lastregno); + else + MIPS16_INSERT_OPERAND (RY, *ip, lastregno); + ++args; + continue; } - while (ISDIGIT (*s)); - if (regno > 31) - { - as_bad (_("invalid register number (%d)"), regno); - regno = 2; - } - } - else - { - if (s[1] == 'r' && s[2] == 'a') - { - s += 3; - regno = RA; - } - else if (s[1] == 'f' && s[2] == 'p') - { - s += 3; - regno = FP; - } - else if (s[1] == 's' && s[2] == 'p') - { - s += 3; - regno = SP; - } - else if (s[1] == 'g' && s[2] == 'p') - { - s += 3; - regno = GP; - } - else if (s[1] == 'a' && s[2] == 't') - { - s += 3; - regno = AT; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '0') - { - s += 4; - regno = KT0; - } - else if (s[1] == 'k' && s[2] == 't' && s[3] == '1') - { - s += 4; - regno = KT1; - } - else if (s[1] == 'z' && s[2] == 'e' && s[3] == 'r' && s[4] == 'o') - { - s += 5; - regno = ZERO; - } - else - break; + break; } if (*s == ' ') @@ -10091,30 +10454,19 @@ mips16_ip (char *str, struct mips_cl_insn *ip) mask = 7 << 3; while (*s != '\0') { - int freg, reg1, reg2; + unsigned int freg, reg1, reg2; while (*s == ' ' || *s == ',') ++s; - if (*s != '$') + if (reg_lookup (&s, RTYPE_GP | RTYPE_NUM, ®1)) + freg = 0; + else if (reg_lookup (&s, RTYPE_FPU, ®1)) + freg = 1; + else { as_bad (_("can't parse register list")); break; } - ++s; - if (*s != 'f') - freg = 0; - else - { - freg = 1; - ++s; - } - reg1 = 0; - while (ISDIGIT (*s)) - { - reg1 *= 10; - reg1 += *s - '0'; - ++s; - } if (*s == ' ') ++s; if (*s != '-') @@ -10122,25 +10474,11 @@ mips16_ip (char *str, struct mips_cl_insn *ip) else { ++s; - if (*s != '$') - break; - ++s; - if (freg) + if (!reg_lookup (&s, freg ? RTYPE_FPU + : (RTYPE_GP | RTYPE_NUM), ®2)) { - if (*s == 'f') - ++s; - else - { - as_bad (_("invalid register list")); - break; - } - } - reg2 = 0; - while (ISDIGIT (*s)) - { - reg2 *= 10; - reg2 += *s - '0'; - ++s; + as_bad (_("invalid register list")); + break; } } if (freg && reg1 == 0 && reg2 == 0 && c == 'L') @@ -10205,46 +10543,33 @@ mips16_ip (char *str, struct mips_cl_insn *ip) continue; } - if (*s != '$') + if (! reg_lookup (&s, RTYPE_GP | RTYPE_NUM, ®1)) { as_bad (_("can't parse register list")); break; } - ++s; - reg1 = 0; - while (ISDIGIT (*s)) - { - reg1 *= 10; - reg1 += *s - '0'; - ++s; - } - SKIP_SPACE_TABS (s); + while (*s == ' ') + ++s; + if (*s != '-') reg2 = reg1; else { ++s; - if (*s != '$') + if (! reg_lookup (&s, RTYPE_GP | RTYPE_NUM, ®2) + || reg2 < reg1) { as_bad (_("can't parse register list")); break; } - ++s; - reg2 = 0; - while (ISDIGIT (*s)) - { - reg2 *= 10; - reg2 += *s - '0'; - ++s; - } } while (reg1 <= reg2) { if (reg1 >= 4 && reg1 <= 7) { - if (c == 'm' && !seen_framesz) + if (!seen_framesz) /* args $a0-$a3 */ args |= 1 << (reg1 - 4); else @@ -10456,7 +10781,7 @@ mips16_immed (char *file, unsigned int line, int type, offsetT val, unsigned long *insn, bfd_boolean *use_extend, unsigned short *extend) { - register const struct mips16_immed_operand *op; + const struct mips16_immed_operand *op; int mintiny, maxtiny; bfd_boolean needext; @@ -10866,9 +11191,17 @@ struct option md_longopts[] = {"mmt", no_argument, NULL, OPTION_MT}, #define OPTION_NO_MT (OPTION_ASE_BASE + 9) {"mno-mt", no_argument, NULL, OPTION_NO_MT}, +#define OPTION_SMARTMIPS (OPTION_ASE_BASE + 10) + {"msmartmips", no_argument, NULL, OPTION_SMARTMIPS}, +#define OPTION_NO_SMARTMIPS (OPTION_ASE_BASE + 11) + {"mno-smartmips", no_argument, NULL, OPTION_NO_SMARTMIPS}, +#define OPTION_DSPR2 (OPTION_ASE_BASE + 12) + {"mdspr2", no_argument, NULL, OPTION_DSPR2}, +#define OPTION_NO_DSPR2 (OPTION_ASE_BASE + 13) + {"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2}, /* Old-style architecture options. Don't add more of these. */ -#define OPTION_COMPAT_ARCH_BASE (OPTION_ASE_BASE + 10) +#define OPTION_COMPAT_ARCH_BASE (OPTION_ASE_BASE + 14) #define OPTION_M4650 (OPTION_COMPAT_ARCH_BASE + 0) {"m4650", no_argument, NULL, OPTION_M4650}, #define OPTION_NO_M4650 (OPTION_COMPAT_ARCH_BASE + 1) @@ -11046,7 +11379,7 @@ md_parse_option (int c, char *arg) break; case 'O': - if (arg && arg[1] == '0') + if (arg && arg[0] == '0') mips_optimize = 1; else mips_optimize = 2; @@ -11057,11 +11390,6 @@ md_parse_option (int c, char *arg) mips_debug = 2; else mips_debug = atoi (arg); - /* When the MIPS assembler sees -g or -g2, it does not do - optimizations which limit full symbolic debugging. We take - that to be equivalent to -O0. */ - if (mips_debug == 2) - mips_optimize = 1; break; case OPTION_MIPS1: @@ -11150,9 +11478,21 @@ md_parse_option (int c, char *arg) case OPTION_DSP: mips_opts.ase_dsp = 1; + mips_opts.ase_dspr2 = 0; break; case OPTION_NO_DSP: + mips_opts.ase_dsp = 0; + mips_opts.ase_dspr2 = 0; + break; + + case OPTION_DSPR2: + mips_opts.ase_dspr2 = 1; + mips_opts.ase_dsp = 1; + break; + + case OPTION_NO_DSPR2: + mips_opts.ase_dspr2 = 0; mips_opts.ase_dsp = 0; break; @@ -11182,6 +11522,14 @@ md_parse_option (int c, char *arg) mips_opts.ase_mips3d = 0; break; + case OPTION_SMARTMIPS: + mips_opts.ase_smartmips = 1; + break; + + case OPTION_NO_SMARTMIPS: + mips_opts.ase_smartmips = 0; + break; + case OPTION_FIX_VR4120: mips_fix_vr4120 = 1; break; @@ -11227,7 +11575,7 @@ md_parse_option (int c, char *arg) select SVR4_PIC, and -non_shared to select no PIC. This is intended to be compatible with Irix 5. */ case OPTION_CALL_SHARED: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-call_shared is supported only for ELF format")); return 0; @@ -11237,7 +11585,7 @@ md_parse_option (int c, char *arg) break; case OPTION_NON_SHARED: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-non_shared is supported only for ELF format")); return 0; @@ -11263,7 +11611,7 @@ md_parse_option (int c, char *arg) /* The -32, -n32 and -64 options are shortcuts for -mabi=32, -mabi=n32 and -mabi=64. */ case OPTION_32: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-32 is supported for ELF format only")); return 0; @@ -11272,7 +11620,7 @@ md_parse_option (int c, char *arg) break; case OPTION_N32: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-n32 is supported for ELF format only")); return 0; @@ -11281,13 +11629,13 @@ md_parse_option (int c, char *arg) break; case OPTION_64: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-64 is supported for ELF format only")); return 0; } mips_abi = N64_ABI; - if (! support_64bit_objects()) + if (!support_64bit_objects()) as_fatal (_("No compiled in support for 64 bit object file format")); break; #endif /* OBJ_ELF */ @@ -11310,7 +11658,7 @@ md_parse_option (int c, char *arg) #ifdef OBJ_ELF case OPTION_MABI: - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { as_bad (_("-mabi is supported for ELF format only")); return 0; @@ -11482,14 +11830,43 @@ mips_after_parse_args (void) || !ISA_HAS_64BIT_REGS (mips_opts.isa)); } - /* ??? GAS treats single-float processors as though they had 64-bit - float registers (although it complains when double-precision - instructions are used). As things stand, saying they have 32-bit - registers would lead to spurious "register must be even" messages. - So here we assume float registers are always the same size as - integer ones, unless the user says otherwise. */ - if (file_mips_fp32 < 0) - file_mips_fp32 = file_mips_gp32; + switch (file_mips_fp32) + { + default: + case -1: + /* No user specified float register size. + ??? GAS treats single-float processors as though they had 64-bit + float registers (although it complains when double-precision + instructions are used). As things stand, saying they have 32-bit + registers would lead to spurious "register must be even" messages. + So here we assume float registers are never smaller than the + integer ones. */ + if (file_mips_gp32 == 0) + /* 64-bit integer registers implies 64-bit float registers. */ + file_mips_fp32 = 0; + else if ((mips_opts.ase_mips3d > 0 || mips_opts.ase_mdmx > 0) + && ISA_HAS_64BIT_FPRS (mips_opts.isa)) + /* -mips3d and -mdmx imply 64-bit float registers, if possible. */ + file_mips_fp32 = 0; + else + /* 32-bit float registers. */ + file_mips_fp32 = 1; + break; + + /* The user specified the size of the float registers. Check if it + agrees with the ABI and ISA. */ + case 0: + if (!ISA_HAS_64BIT_FPRS (mips_opts.isa)) + as_bad (_("-mfp64 used with a 32-bit fpu")); + else if (ABI_NEEDS_32BIT_REGS (mips_abi) + && !ISA_HAS_MXHC1 (mips_opts.isa)) + as_warn (_("-mfp64 used with a 32-bit ABI")); + break; + case 1: + if (ABI_NEEDS_64BIT_REGS (mips_abi)) + as_warn (_("-mfp32 used with a 64-bit ABI")); + break; + } /* End of GCC-shared inference code. */ @@ -11508,19 +11885,51 @@ mips_after_parse_args (void) if (mips_opts.mips16 == -1) mips_opts.mips16 = (CPU_HAS_MIPS16 (file_mips_arch)) ? 1 : 0; if (mips_opts.ase_mips3d == -1) - mips_opts.ase_mips3d = (CPU_HAS_MIPS3D (file_mips_arch)) ? 1 : 0; + mips_opts.ase_mips3d = ((arch_info->flags & MIPS_CPU_ASE_MIPS3D) + && file_mips_fp32 == 0) ? 1 : 0; + if (mips_opts.ase_mips3d && file_mips_fp32 == 1) + as_bad (_("-mfp32 used with -mips3d")); + if (mips_opts.ase_mdmx == -1) - mips_opts.ase_mdmx = (CPU_HAS_MDMX (file_mips_arch)) ? 1 : 0; + mips_opts.ase_mdmx = ((arch_info->flags & MIPS_CPU_ASE_MDMX) + && file_mips_fp32 == 0) ? 1 : 0; + if (mips_opts.ase_mdmx && file_mips_fp32 == 1) + as_bad (_("-mfp32 used with -mdmx")); + + if (mips_opts.ase_smartmips == -1) + mips_opts.ase_smartmips = (arch_info->flags & MIPS_CPU_ASE_SMARTMIPS) ? 1 : 0; + if (mips_opts.ase_smartmips && !ISA_SUPPORTS_SMARTMIPS) + as_warn ("%s ISA does not support SmartMIPS", + mips_cpu_info_from_isa (mips_opts.isa)->name); + if (mips_opts.ase_dsp == -1) - mips_opts.ase_dsp = (CPU_HAS_DSP (file_mips_arch)) ? 1 : 0; + mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0; + if (mips_opts.ase_dsp && !ISA_SUPPORTS_DSP_ASE) + as_warn ("%s ISA does not support DSP ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + + if (mips_opts.ase_dspr2 == -1) + { + mips_opts.ase_dspr2 = (arch_info->flags & MIPS_CPU_ASE_DSPR2) ? 1 : 0; + mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0; + } + if (mips_opts.ase_dspr2 && !ISA_SUPPORTS_DSPR2_ASE) + as_warn ("%s ISA does not support DSP R2 ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + if (mips_opts.ase_mt == -1) - mips_opts.ase_mt = (CPU_HAS_MT (file_mips_arch)) ? 1 : 0; + mips_opts.ase_mt = (arch_info->flags & MIPS_CPU_ASE_MT) ? 1 : 0; + if (mips_opts.ase_mt && !ISA_SUPPORTS_MT_ASE) + as_warn ("%s ISA does not support MT ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); file_mips_isa = mips_opts.isa; file_ase_mips16 = mips_opts.mips16; file_ase_mips3d = mips_opts.ase_mips3d; file_ase_mdmx = mips_opts.ase_mdmx; + file_ase_smartmips = mips_opts.ase_smartmips; file_ase_dsp = mips_opts.ase_dsp; + file_ase_dspr2 = mips_opts.ase_dspr2; file_ase_mt = mips_opts.ase_mt; mips_opts.gp32 = file_mips_gp32; mips_opts.fp32 = file_mips_fp32; @@ -11555,6 +11964,10 @@ md_pcrel_from (fixS *fixP) /* Return the address of the delay slot. */ return addr + 4; default: + /* We have no relocation type for PC relative MIPS16 instructions. */ + if (fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != now_seg) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("PC relative MIPS16 instruction references a different section")); return addr; } } @@ -11737,11 +12150,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) || fixP->fx_r_type == BFD_RELOC_CTOR || fixP->fx_r_type == BFD_RELOC_MIPS_SUB || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY); + || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY + || fixP->fx_r_type == BFD_RELOC_MIPS_TLS_DTPREL64); buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where); - assert (! fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2); + assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2); /* Don't treat parts of a composite relocation as done. There are two reasons for this: @@ -11753,13 +12167,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) constants. The easiest way of dealing with the pathological exceptions is to generate a relocation against STN_UNDEF and leave everything up to the linker. */ - if (fixP->fx_addsy == NULL && ! fixP->fx_pcrel && fixP->fx_tcbit == 0) + if (fixP->fx_addsy == NULL && !fixP->fx_pcrel && fixP->fx_tcbit == 0) fixP->fx_done = 1; switch (fixP->fx_r_type) { case BFD_RELOC_MIPS_TLS_GD: case BFD_RELOC_MIPS_TLS_LDM: + case BFD_RELOC_MIPS_TLS_DTPREL32: + case BFD_RELOC_MIPS_TLS_DTPREL64: case BFD_RELOC_MIPS_TLS_DTPREL_HI16: case BFD_RELOC_MIPS_TLS_DTPREL_LO16: case BFD_RELOC_MIPS_TLS_GOTTPREL: @@ -11798,14 +12214,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_MIPS16_GPREL: case BFD_RELOC_MIPS16_HI16: case BFD_RELOC_MIPS16_HI16_S: - /* Nothing needed to do. The value comes from the reloc entry */ - break; - case BFD_RELOC_MIPS16_JMP: - /* We currently always generate a reloc against a symbol, which - means that we don't want an addend even if the symbol is - defined. */ - *valP = 0; + /* Nothing needed to do. The value comes from the reloc entry. */ break; case BFD_RELOC_64: @@ -11833,18 +12243,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_RVA: case BFD_RELOC_32: - /* If we are deleting this reloc entry, we must fill in the - value now. This can happen if we have a .word which is not - resolved when it appears but is later defined. */ - if (fixP->fx_done) - md_number_to_chars ((char *) buf, *valP, 4); - break; - case BFD_RELOC_16: /* If we are deleting this reloc entry, we must fill in the - value now. */ + value now. This can happen if we have a .word which is not + resolved when it appears but is later defined. */ if (fixP->fx_done) - md_number_to_chars ((char *) buf, *valP, 2); + md_number_to_chars ((char *) buf, *valP, fixP->fx_size); break; case BFD_RELOC_LO16: @@ -11869,15 +12273,13 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) as_bad_where (fixP->fx_file, fixP->fx_line, _("Branch to misaligned address (%lx)"), (long) *valP); - /* - * We need to save the bits in the instruction since fixup_segment() - * might be deleting the relocation entry (i.e., a branch within - * the current segment). - */ + /* We need to save the bits in the instruction since fixup_segment() + might be deleting the relocation entry (i.e., a branch within + the current segment). */ if (! fixP->fx_done) break; - /* update old instruction data */ + /* Update old instruction data. */ if (target_big_endian) insn = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; else @@ -11977,21 +12379,17 @@ mips_align (int to, int fill, symbolS *label) static void s_align (int x ATTRIBUTE_UNUSED) { - register int temp; - register long temp_fill; + int temp; + long temp_fill; long max_alignment = 15; - /* - - o Note that the assembler pulls down any immediately preceding label + /* o Note that the assembler pulls down any immediately preceding label to the aligned address. - o It's not documented but auto alignment is reinstated by + o It's not documented but auto alignment is reinstated by a .align pseudo instruction. - o Note also that after auto alignment is turned off the mips assembler + o Note also that after auto alignment is turned off the mips assembler issues an error on attempt to assemble an improperly aligned data item. - We don't. - - */ + We don't. */ temp = get_absolute_expression (); if (temp > max_alignment) @@ -12010,9 +12408,11 @@ s_align (int x ATTRIBUTE_UNUSED) temp_fill = 0; if (temp) { + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l = si->label_list; + /* Auto alignment should be switched on by next section change. */ auto_align = 1; - mips_align (temp, (int) temp_fill, - insn_labels != NULL ? insn_labels->label : NULL); + mips_align (temp, (int) temp_fill, l != NULL ? l->label : NULL); } else { @@ -12034,7 +12434,8 @@ s_change_sec (int sec) as it would not be appropriate to use it in the section changing functions in read.c, since obj-elf.c intercepts those. FIXME: This should be cleaner, somehow. */ - obj_elf_section_change_hook (); + if (IS_ELF) + obj_elf_section_change_hook (); #endif mips_emit_delays (); @@ -12054,7 +12455,7 @@ s_change_sec (int sec) case 'r': seg = subseg_new (RDATA_SECTION_NAME, (subsegT) get_absolute_expression ()); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + if (IS_ELF) { bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC @@ -12067,7 +12468,7 @@ s_change_sec (int sec) case 's': seg = subseg_new (".sdata", (subsegT) get_absolute_expression ()); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + if (IS_ELF) { bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA); @@ -12093,7 +12494,7 @@ s_change_section (int ignore ATTRIBUTE_UNUSED) int section_entry_size; int section_alignment; - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) return; section_name = input_line_pointer; @@ -12138,7 +12539,7 @@ s_change_section (int ignore ATTRIBUTE_UNUSED) There's nothing really harmful in this, since bfd will correct SHT_PROGBITS to SHT_MIPS_DWARF before writing out the file. But it - means that, for backwards compatibiltiy, the special_section entries + means that, for backwards compatibility, the special_section entries for dwarf sections must use SHT_PROGBITS rather than SHT_MIPS_DWARF. Even so, we shouldn't force users of the MIPS .section syntax to @@ -12165,9 +12566,11 @@ mips_enable_auto_align (void) static void s_cons (int log_size) { + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l = si->label_list; symbolS *label; - label = insn_labels != NULL ? insn_labels->label : NULL; + label = l != NULL ? l->label : NULL; mips_emit_delays (); if (log_size > 0 && auto_align) mips_align (log_size, 0, label); @@ -12178,9 +12581,11 @@ s_cons (int log_size) static void s_float_cons (int type) { + segment_info_type *si = seg_info (now_seg); + struct insn_label_list *l = si->label_list; symbolS *label; - label = insn_labels != NULL ? insn_labels->label : NULL; + label = l != NULL ? l->label : NULL; mips_emit_delays (); @@ -12367,12 +12772,43 @@ s_mipsset (int x ATTRIBUTE_UNUSED) { mips_opts.nobopt = 1; } + else if (strcmp (name, "gp=default") == 0) + mips_opts.gp32 = file_mips_gp32; + else if (strcmp (name, "gp=32") == 0) + mips_opts.gp32 = 1; + else if (strcmp (name, "gp=64") == 0) + { + if (!ISA_HAS_64BIT_REGS (mips_opts.isa)) + as_warn ("%s isa does not support 64-bit registers", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.gp32 = 0; + } + else if (strcmp (name, "fp=default") == 0) + mips_opts.fp32 = file_mips_fp32; + else if (strcmp (name, "fp=32") == 0) + mips_opts.fp32 = 1; + else if (strcmp (name, "fp=64") == 0) + { + if (!ISA_HAS_64BIT_FPRS (mips_opts.isa)) + as_warn ("%s isa does not support 64-bit floating point registers", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.fp32 = 0; + } else if (strcmp (name, "mips16") == 0 || strcmp (name, "MIPS-16") == 0) mips_opts.mips16 = 1; else if (strcmp (name, "nomips16") == 0 || strcmp (name, "noMIPS-16") == 0) mips_opts.mips16 = 0; + else if (strcmp (name, "smartmips") == 0) + { + if (!ISA_SUPPORTS_SMARTMIPS) + as_warn ("%s ISA does not support SmartMIPS ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_smartmips = 1; + } + else if (strcmp (name, "nosmartmips") == 0) + mips_opts.ase_smartmips = 0; else if (strcmp (name, "mips3d") == 0) mips_opts.ase_mips3d = 1; else if (strcmp (name, "nomips3d") == 0) @@ -12382,11 +12818,38 @@ s_mipsset (int x ATTRIBUTE_UNUSED) else if (strcmp (name, "nomdmx") == 0) mips_opts.ase_mdmx = 0; else if (strcmp (name, "dsp") == 0) - mips_opts.ase_dsp = 1; + { + if (!ISA_SUPPORTS_DSP_ASE) + as_warn ("%s ISA does not support DSP ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_dsp = 1; + mips_opts.ase_dspr2 = 0; + } else if (strcmp (name, "nodsp") == 0) - mips_opts.ase_dsp = 0; + { + mips_opts.ase_dsp = 0; + mips_opts.ase_dspr2 = 0; + } + else if (strcmp (name, "dspr2") == 0) + { + if (!ISA_SUPPORTS_DSPR2_ASE) + as_warn ("%s ISA does not support DSP R2 ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_dspr2 = 1; + mips_opts.ase_dsp = 1; + } + else if (strcmp (name, "nodspr2") == 0) + { + mips_opts.ase_dspr2 = 0; + mips_opts.ase_dsp = 0; + } else if (strcmp (name, "mt") == 0) - mips_opts.ase_mt = 1; + { + if (!ISA_SUPPORTS_MT_ASE) + as_warn ("%s ISA does not support MT ASE", + mips_cpu_info_from_isa (mips_opts.isa)->name); + mips_opts.ase_mt = 1; + } else if (strcmp (name, "nomt") == 0) mips_opts.ase_mt = 0; else if (strncmp (name, "mips", 4) == 0 || strncmp (name, "arch=", 5) == 0) @@ -12497,6 +12960,14 @@ s_mipsset (int x ATTRIBUTE_UNUSED) mips_opts.sym32 = TRUE; else if (strcmp (name, "nosym32") == 0) mips_opts.sym32 = FALSE; + else if (strchr (name, ',')) + { + /* Generic ".set" directive; use the generic handler. */ + *input_line_pointer = ch; + input_line_pointer = name; + s_set (0); + return; + } else { as_warn (_("Tried to set unrecognized symbol: %s\n"), name); @@ -12604,8 +13075,7 @@ s_cpload (int ignore ATTRIBUTE_UNUSED) The -mno-shared option replaces the last three instructions with lui $gp,%hi(_gp) - addiu $gp,$gp,%lo(_gp) - */ + addiu $gp,$gp,%lo(_gp) */ static void s_cpsetup (int ignore ATTRIBUTE_UNUSED) @@ -12707,7 +13177,7 @@ static void s_cplocal (int ignore ATTRIBUTE_UNUSED) { /* If we are not generating SVR4 PIC code, or if this is not NewABI code, - .cplocal is ignored. */ + .cplocal is ignored. */ if (mips_pic != SVR4_PIC || ! HAVE_NEWABI) { s_ignore (0); @@ -12756,8 +13226,8 @@ s_cprestore (int ignore ATTRIBUTE_UNUSED) ld $gp, offset($sp) If a register $reg2 was given there, it results in: - daddu $gp, $reg2, $0 - */ + daddu $gp, $reg2, $0 */ + static void s_cpreturn (int ignore ATTRIBUTE_UNUSED) { @@ -12789,6 +13259,52 @@ s_cpreturn (int ignore ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +/* Handle the .dtprelword and .dtpreldword pseudo-ops. They generate + a 32-bit or 64-bit DTP-relative relocation (BYTES says which) for + use in DWARF debug information. */ + +static void +s_dtprel_internal (size_t bytes) +{ + expressionS ex; + char *p; + + expression (&ex); + + if (ex.X_op != O_symbol) + { + as_bad (_("Unsupported use of %s"), (bytes == 8 + ? ".dtpreldword" + : ".dtprelword")); + ignore_rest_of_line (); + } + + p = frag_more (bytes); + md_number_to_chars (p, 0, bytes); + fix_new_exp (frag_now, p - frag_now->fr_literal, bytes, &ex, FALSE, + (bytes == 8 + ? BFD_RELOC_MIPS_TLS_DTPREL64 + : BFD_RELOC_MIPS_TLS_DTPREL32)); + + demand_empty_rest_of_line (); +} + +/* Handle .dtprelword. */ + +static void +s_dtprelword (int ignore ATTRIBUTE_UNUSED) +{ + s_dtprel_internal (4); +} + +/* Handle .dtpreldword. */ + +static void +s_dtpreldword (int ignore ATTRIBUTE_UNUSED) +{ + s_dtprel_internal (8); +} + /* Handle the .gpvalue pseudo-op. This is used when generating NewABI PIC code. It sets the offset to use in gp_rel relocations. */ @@ -12814,6 +13330,8 @@ s_gpvalue (int ignore ATTRIBUTE_UNUSED) static void s_gpword (int ignore ATTRIBUTE_UNUSED) { + segment_info_type *si; + struct insn_label_list *l; symbolS *label; expressionS ex; char *p; @@ -12825,7 +13343,9 @@ s_gpword (int ignore ATTRIBUTE_UNUSED) return; } - label = insn_labels != NULL ? insn_labels->label : NULL; + si = seg_info (now_seg); + l = si->label_list; + label = l != NULL ? l->label : NULL; mips_emit_delays (); if (auto_align) mips_align (2, 0, label); @@ -12850,6 +13370,8 @@ s_gpword (int ignore ATTRIBUTE_UNUSED) static void s_gpdword (int ignore ATTRIBUTE_UNUSED) { + segment_info_type *si; + struct insn_label_list *l; symbolS *label; expressionS ex; char *p; @@ -12861,7 +13383,9 @@ s_gpdword (int ignore ATTRIBUTE_UNUSED) return; } - label = insn_labels != NULL ? insn_labels->label : NULL; + si = seg_info (now_seg); + l = si->label_list; + label = l != NULL ? l->label : NULL; mips_emit_delays (); if (auto_align) mips_align (3, 0, label); @@ -12943,8 +13467,7 @@ s_mips_stab (int type) s_stab (type); } -/* Handle the .weakext pseudo-op as defined in Kane and Heinrich. - */ +/* Handle the .weakext pseudo-op as defined in Kane and Heinrich. */ static void s_mips_weakext (int ignore ATTRIBUTE_UNUSED) @@ -12998,73 +13521,11 @@ s_mips_weakext (int ignore ATTRIBUTE_UNUSED) int tc_get_register (int frame) { - int reg; + unsigned int reg; SKIP_WHITESPACE (); - if (*input_line_pointer++ != '$') - { - as_warn (_("expected `$'")); - reg = ZERO; - } - else if (ISDIGIT (*input_line_pointer)) - { - reg = get_absolute_expression (); - if (reg < 0 || reg >= 32) - { - as_warn (_("Bad register number")); - reg = ZERO; - } - } - else - { - if (strncmp (input_line_pointer, "ra", 2) == 0) - { - reg = RA; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "fp", 2) == 0) - { - reg = FP; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "sp", 2) == 0) - { - reg = SP; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "gp", 2) == 0) - { - reg = GP; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "at", 2) == 0) - { - reg = AT; - input_line_pointer += 2; - } - else if (strncmp (input_line_pointer, "kt0", 3) == 0) - { - reg = KT0; - input_line_pointer += 3; - } - else if (strncmp (input_line_pointer, "kt1", 3) == 0) - { - reg = KT1; - input_line_pointer += 3; - } - else if (strncmp (input_line_pointer, "zero", 4) == 0) - { - reg = ZERO; - input_line_pointer += 4; - } - else - { - as_warn (_("Unrecognized register name")); - reg = ZERO; - while (ISALNUM(*input_line_pointer)) - input_line_pointer++; - } - } + if (! reg_lookup (&input_line_pointer, RWARN | RTYPE_NUM | RTYPE_GP, ®)) + reg = 0; if (frame) { mips_frame_reg = reg != 0 ? reg : SP; @@ -13079,16 +13540,17 @@ md_section_align (asection *seg, valueT addr) { int align = bfd_get_section_alignment (stdoutput, seg); -#ifdef OBJ_ELF - /* We don't need to align ELF sections to the full alignment. - However, Irix 5 may prefer that we align them at least to a 16 - byte boundary. We don't bother to align the sections if we are - targeted for an embedded system. */ - if (strcmp (TARGET_OS, "elf") == 0) - return addr; - if (align > 4) - align = 4; -#endif + if (IS_ELF) + { + /* We don't need to align ELF sections to the full alignment. + However, Irix 5 may prefer that we align them at least to a 16 + byte boundary. We don't bother to align the sections if we + are targeted for an embedded system. */ + if (strcmp (TARGET_OS, "elf") == 0) + return addr; + if (align > 4) + align = 4; + } return ((addr + (1 << align) - 1) & (-1 << align)); } @@ -13154,6 +13616,8 @@ nopic_need_relax (symbolS *sym, int before_relaxing) change = (strcmp (segname, ".sdata") != 0 && strcmp (segname, ".sbss") != 0 && strncmp (segname, ".sdata.", 7) != 0 + && strncmp (segname, ".sbss.", 6) != 0 + && strncmp (segname, ".gnu.linkonce.sb.", 17) != 0 && strncmp (segname, ".gnu.linkonce.s.", 16) != 0); } return change; @@ -13170,48 +13634,32 @@ static bfd_boolean pic_need_relax (symbolS *sym, asection *segtype) { asection *symsec; - bfd_boolean linkonce; /* Handle the case of a symbol equated to another symbol. */ while (symbol_equated_reloc_p (sym)) { symbolS *n; - /* It's possible to get a loop here in a badly written - program. */ + /* It's possible to get a loop here in a badly written program. */ n = symbol_get_value_expression (sym)->X_add_symbol; if (n == sym) break; sym = n; } + if (symbol_section_p (sym)) + return TRUE; + symsec = S_GET_SEGMENT (sym); - /* duplicate the test for LINK_ONCE sections as in adjust_reloc_syms */ - linkonce = FALSE; - if (symsec != segtype && ! S_IS_LOCAL (sym)) - { - if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) - != 0) - linkonce = TRUE; - - /* The GNU toolchain uses an extension for ELF: a section - beginning with the magic string .gnu.linkonce is a linkonce - section. */ - if (strncmp (segment_name (symsec), ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0) - linkonce = TRUE; - } - /* This must duplicate the test in adjust_reloc_syms. */ return (symsec != &bfd_und_section && symsec != &bfd_abs_section - && ! bfd_is_com_section (symsec) - && !linkonce + && !bfd_is_com_section (symsec) + && !s_is_linkonce (sym, segtype) #ifdef OBJ_ELF /* A global or weak symbol is treated as external. */ - && (OUTPUT_FLAVOR != bfd_target_elf_flavour - || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym))) + && (!IS_ELF || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym))) #endif ); } @@ -13224,7 +13672,7 @@ static int mips16_extended_frag (fragS *fragp, asection *sec, long stretch) { int type; - register const struct mips16_immed_operand *op; + const struct mips16_immed_operand *op; offsetT val; int mintiny, maxtiny; segT symsec; @@ -13527,11 +13975,6 @@ md_estimate_size_before_relax (fragS *fragp, asection *segtype) int mips_fix_adjustable (fixS *fixp) { - /* Don't adjust MIPS16 jump relocations, so we don't have to worry - about the format of the offset in the .o file. */ - if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP) - return 0; - if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; @@ -13561,11 +14004,50 @@ mips_fix_adjustable (fixS *fixp) return 0; #ifdef OBJ_ELF - /* Don't adjust relocations against mips16 symbols, so that the linker - can find them if it needs to set up a stub. */ - if (OUTPUT_FLAVOR == bfd_target_elf_flavour - && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 - && fixp->fx_subsy == NULL) + /* R_MIPS16_26 relocations against non-MIPS16 functions might resolve + to a floating-point stub. The same is true for non-R_MIPS16_26 + relocations against MIPS16 functions; in this case, the stub becomes + the function's canonical address. + + Floating-point stubs are stored in unique .mips16.call.* or + .mips16.fn.* sections. If a stub T for function F is in section S, + the first relocation in section S must be against F; this is how the + linker determines the target function. All relocations that might + resolve to T must also be against F. We therefore have the following + restrictions, which are given in an intentionally-redundant way: + + 1. We cannot reduce R_MIPS16_26 relocations against non-MIPS16 + symbols. + + 2. We cannot reduce a stub's relocations against non-MIPS16 symbols + if that stub might be used. + + 3. We cannot reduce non-R_MIPS16_26 relocations against MIPS16 + symbols. + + 4. We cannot reduce a stub's relocations against MIPS16 symbols if + that stub might be used. + + There is a further restriction: + + 5. We cannot reduce R_MIPS16_26 relocations against MIPS16 symbols + on targets with in-place addends; the relocation field cannot + encode the low bit. + + For simplicity, we deal with (3)-(5) by not reducing _any_ relocation + against a MIPS16 symbol. + + We deal with (1)-(2) by saying that, if there's a R_MIPS16_26 + relocation against some symbol R, no relocation against R may be + reduced. (Note that this deals with (2) as well as (1) because + relocations against global symbols will never be reduced on ELF + targets.) This approach is a little simpler than trying to detect + stub sections, and gives the "all or nothing" per-symbol consistency + that we have for MIPS16 symbols. */ + if (IS_ELF + && fixp->fx_subsy == NULL + && (S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 + || *symbol_get_tc (fixp->fx_addsy))) return 0; #endif @@ -13595,7 +14077,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) /* At this point, fx_addnumber is "symbol offset - pcrel address". Relocations want only the symbol offset. */ reloc->addend = fixp->fx_addnumber + reloc->address; - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) { /* A gruesome hack which is a result of the gruesome gas reloc handling. What's worse, for COFF (as opposed to @@ -13694,7 +14176,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) exp.X_add_number = fragp->fr_offset; fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 1, BFD_RELOC_16_PCREL_S2); + 4, &exp, TRUE, BFD_RELOC_16_PCREL_S2); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13726,14 +14208,14 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) case 0: /* bltz 0x04000000 bgez 0x04010000 - bltzal 0x04100000 bgezal 0x04110000 */ + bltzal 0x04100000 bgezal 0x04110000 */ assert ((insn & 0xfc0e0000) == 0x04000000); insn ^= 0x00010000; break; case 1: /* beq 0x10000000 bne 0x14000000 - blez 0x18000000 bgtz 0x1c000000 */ + blez 0x18000000 bgtz 0x1c000000 */ insn ^= 0x04000000; break; @@ -13747,8 +14229,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) /* Clear the and-link bit. */ assert ((insn & 0xfc1c0000) == 0x04100000); - /* bltzal 0x04100000 bgezal 0x04110000 - bltzall 0x04120000 bgezall 0x04130000 */ + /* bltzal 0x04100000 bgezal 0x04110000 + bltzall 0x04120000 bgezall 0x04130000 */ insn &= ~0x00100000; } @@ -13773,7 +14255,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) md_number_to_chars ((char *) buf, insn, 4); buf += 4; - /* Nop */ + /* nop */ md_number_to_chars ((char *) buf, 0, 4); buf += 4; @@ -13811,7 +14293,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) exp.X_add_number = fragp->fr_offset; fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 0, BFD_RELOC_MIPS_JMP); + 4, &exp, FALSE, BFD_RELOC_MIPS_JMP); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13833,7 +14315,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) } fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 0, BFD_RELOC_MIPS_GOT16); + 4, &exp, FALSE, BFD_RELOC_MIPS_GOT16); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13851,7 +14333,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) insn = HAVE_64BIT_ADDRESSES ? 0x64210000 : 0x24210000; fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, - 4, &exp, 0, BFD_RELOC_LO16); + 4, &exp, FALSE, BFD_RELOC_LO16); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; @@ -13880,7 +14362,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) if (RELAX_MIPS16_P (fragp->fr_subtype)) { int type; - register const struct mips16_immed_operand *op; + const struct mips16_immed_operand *op; bfd_boolean small, ext; offsetT val; bfd_byte *buf; @@ -14034,7 +14516,7 @@ mips_frob_file_after_relocs (void) asymbol **syms; unsigned int count, i; - if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + if (!IS_ELF) return; syms = bfd_get_outsymbols (stdoutput); @@ -14062,6 +14544,7 @@ mips_frob_file_after_relocs (void) void mips_define_label (symbolS *sym) { + segment_info_type *si = seg_info (now_seg); struct insn_label_list *l; if (free_insn_labels == NULL) @@ -14073,8 +14556,8 @@ mips_define_label (symbolS *sym) } l->label = sym; - l->next = insn_labels; - insn_labels = l; + l->next = si->label_list; + si->label_list = l; #ifdef OBJ_ELF dwarf2_emit_label (sym); @@ -14136,6 +14619,7 @@ mips_elf_final_processing (void) /* Set MIPS ELF flags for ASEs. */ /* We may need to define a new flag for DSP ASE, and set this flag when file_ase_dsp is true. */ + /* Same for DSP R2. */ /* We may need to define a new flag for MT ASE, and set this flag when file_ase_mt is true. */ if (file_ase_mips16) @@ -14166,6 +14650,12 @@ mips_elf_final_processing (void) if (mips_32bitmode) elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE; + +#if 0 /* XXX FIXME */ + /* 32 bit code with 64 bit FP registers. */ + if (!file_mips_fp32 && ABI_NEEDS_32BIT_REGS (mips_abi)) + elf_elfheader (stdoutput)->e_flags |= ???; +#endif } #endif /* OBJ_ELF || OBJ_MAYBE_ELF */ @@ -14226,7 +14716,7 @@ md_obj_begin (void) static void md_obj_end (void) { - /* check for premature end, nesting errors, etc */ + /* Check for premature end, nesting errors, etc. */ if (cur_proc_ptr) as_warn (_("missing .end at end of assembly")); } @@ -14383,8 +14873,7 @@ s_mips_end (int x ATTRIBUTE_UNUSED) } /* Generate a .pdr section. */ - if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING - && mips_flag_pdr) + if (IS_ELF && !ECOFF_DEBUGGING && mips_flag_pdr) { segT saved_seg = now_seg; subsegT saved_subseg = now_subseg; @@ -14478,7 +14967,7 @@ static void s_mips_frame (int ignore ATTRIBUTE_UNUSED) { #ifdef OBJ_ELF - if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING) + if (IS_ELF && !ECOFF_DEBUGGING) { long val; @@ -14521,7 +15010,7 @@ static void s_mips_mask (int reg_type) { #ifdef OBJ_ELF - if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING) + if (IS_ELF && !ECOFF_DEBUGGING) { long mask, off; @@ -14568,72 +15057,102 @@ s_mips_mask (int reg_type) static const struct mips_cpu_info mips_cpu_info_table[] = { /* Entries for generic ISAs */ - { "mips1", 1, ISA_MIPS1, CPU_R3000 }, - { "mips2", 1, ISA_MIPS2, CPU_R6000 }, - { "mips3", 1, ISA_MIPS3, CPU_R4000 }, - { "mips4", 1, ISA_MIPS4, CPU_R8000 }, - { "mips5", 1, ISA_MIPS5, CPU_MIPS5 }, - { "mips32", 1, ISA_MIPS32, CPU_MIPS32 }, - { "mips32r2", 1, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "mips64", 1, ISA_MIPS64, CPU_MIPS64 }, - { "mips64r2", 1, ISA_MIPS64R2, CPU_MIPS64R2 }, + { "mips1", MIPS_CPU_IS_ISA, ISA_MIPS1, CPU_R3000 }, + { "mips2", MIPS_CPU_IS_ISA, ISA_MIPS2, CPU_R6000 }, + { "mips3", MIPS_CPU_IS_ISA, ISA_MIPS3, CPU_R4000 }, + { "mips4", MIPS_CPU_IS_ISA, ISA_MIPS4, CPU_R8000 }, + { "mips5", MIPS_CPU_IS_ISA, ISA_MIPS5, CPU_MIPS5 }, + { "mips32", MIPS_CPU_IS_ISA, ISA_MIPS32, CPU_MIPS32 }, + { "mips32r2", MIPS_CPU_IS_ISA, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "mips64", MIPS_CPU_IS_ISA, ISA_MIPS64, CPU_MIPS64 }, + { "mips64r2", MIPS_CPU_IS_ISA, ISA_MIPS64R2, CPU_MIPS64R2 }, /* MIPS I */ - { "r3000", 0, ISA_MIPS1, CPU_R3000 }, - { "r2000", 0, ISA_MIPS1, CPU_R3000 }, - { "r3900", 0, ISA_MIPS1, CPU_R3900 }, + { "r3000", 0, ISA_MIPS1, CPU_R3000 }, + { "r2000", 0, ISA_MIPS1, CPU_R3000 }, + { "r3900", 0, ISA_MIPS1, CPU_R3900 }, /* MIPS II */ - { "r6000", 0, ISA_MIPS2, CPU_R6000 }, + { "r6000", 0, ISA_MIPS2, CPU_R6000 }, /* MIPS III */ - { "r4000", 0, ISA_MIPS3, CPU_R4000 }, - { "r4010", 0, ISA_MIPS2, CPU_R4010 }, - { "vr4100", 0, ISA_MIPS3, CPU_VR4100 }, - { "vr4111", 0, ISA_MIPS3, CPU_R4111 }, - { "vr4120", 0, ISA_MIPS3, CPU_VR4120 }, - { "vr4130", 0, ISA_MIPS3, CPU_VR4120 }, - { "vr4181", 0, ISA_MIPS3, CPU_R4111 }, - { "vr4300", 0, ISA_MIPS3, CPU_R4300 }, - { "r4400", 0, ISA_MIPS3, CPU_R4400 }, - { "r4600", 0, ISA_MIPS3, CPU_R4600 }, - { "orion", 0, ISA_MIPS3, CPU_R4600 }, - { "r4650", 0, ISA_MIPS3, CPU_R4650 }, + { "r4000", 0, ISA_MIPS3, CPU_R4000 }, + { "r4010", 0, ISA_MIPS2, CPU_R4010 }, + { "vr4100", 0, ISA_MIPS3, CPU_VR4100 }, + { "vr4111", 0, ISA_MIPS3, CPU_R4111 }, + { "vr4120", 0, ISA_MIPS3, CPU_VR4120 }, + { "vr4130", 0, ISA_MIPS3, CPU_VR4120 }, + { "vr4181", 0, ISA_MIPS3, CPU_R4111 }, + { "vr4300", 0, ISA_MIPS3, CPU_R4300 }, + { "r4400", 0, ISA_MIPS3, CPU_R4400 }, + { "r4600", 0, ISA_MIPS3, CPU_R4600 }, + { "orion", 0, ISA_MIPS3, CPU_R4600 }, + { "r4650", 0, ISA_MIPS3, CPU_R4650 }, /* MIPS IV */ - { "r8000", 0, ISA_MIPS4, CPU_R8000 }, - { "r10000", 0, ISA_MIPS4, CPU_R10000 }, - { "r12000", 0, ISA_MIPS4, CPU_R12000 }, - { "vr5000", 0, ISA_MIPS4, CPU_R5000 }, - { "vr5400", 0, ISA_MIPS4, CPU_VR5400 }, - { "vr5500", 0, ISA_MIPS4, CPU_VR5500 }, - { "rm5200", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5230", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5231", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5261", 0, ISA_MIPS4, CPU_R5000 }, - { "rm5721", 0, ISA_MIPS4, CPU_R5000 }, - { "rm7000", 0, ISA_MIPS4, CPU_RM7000 }, - { "rm9000", 0, ISA_MIPS4, CPU_RM9000 }, + { "r8000", 0, ISA_MIPS4, CPU_R8000 }, + { "r10000", 0, ISA_MIPS4, CPU_R10000 }, + { "r12000", 0, ISA_MIPS4, CPU_R12000 }, + { "vr5000", 0, ISA_MIPS4, CPU_R5000 }, + { "vr5400", 0, ISA_MIPS4, CPU_VR5400 }, + { "vr5500", 0, ISA_MIPS4, CPU_VR5500 }, + { "rm5200", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5230", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5231", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5261", 0, ISA_MIPS4, CPU_R5000 }, + { "rm5721", 0, ISA_MIPS4, CPU_R5000 }, + { "rm7000", 0, ISA_MIPS4, CPU_RM7000 }, + { "rm9000", 0, ISA_MIPS4, CPU_RM9000 }, /* MIPS 32 */ - { "4kc", 0, ISA_MIPS32, CPU_MIPS32 }, - { "4km", 0, ISA_MIPS32, CPU_MIPS32 }, - { "4kp", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4kc", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4km", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4kp", 0, ISA_MIPS32, CPU_MIPS32 }, + { "4ksc", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32, CPU_MIPS32 }, - /* MIPS32 Release 2 */ - { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, - { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* MIPS 32 Release 2 */ + { "4kec", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "4kem", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "4kep", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "4ksd", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "m4kp", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* 24KE is a 24K with DSP ASE, other ASEs are optional. */ + { "24kec", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kef", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 }, + { "24kex", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 }, + /* 34K is a 24K with DSP and MT ASE, other ASEs are optional. */ + { "34kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "34kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "34kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT, + ISA_MIPS32R2, CPU_MIPS32R2 }, + /* 74K with DSP and DSPR2 ASE, other ASEs are optional. */ + { "74kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "74kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2, + ISA_MIPS32R2, CPU_MIPS32R2 }, + { "74kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2, + ISA_MIPS32R2, CPU_MIPS32R2 }, /* MIPS 64 */ - { "5kc", 0, ISA_MIPS64, CPU_MIPS64 }, - { "5kf", 0, ISA_MIPS64, CPU_MIPS64 }, - { "20kc", 0, ISA_MIPS64, CPU_MIPS64 }, + { "5kc", 0, ISA_MIPS64, CPU_MIPS64 }, + { "5kf", 0, ISA_MIPS64, CPU_MIPS64 }, + { "20kc", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 }, + { "25kf", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 }, + + /* MIPS 64 Release 2 */ /* Broadcom SB-1 CPU core */ - { "sb1", 0, ISA_MIPS64, CPU_SB1 }, + { "sb1", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX, + ISA_MIPS64, CPU_SB1 }, + /* Broadcom SB-1A CPU core */ + { "sb1a", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX, + ISA_MIPS64, CPU_SB1 }, /* Cavium Networks Octeon CPU core */ { "octeon", 0, ISA_MIPS64R2, CPU_OCTEON }, @@ -14751,7 +15270,7 @@ mips_cpu_info_from_isa (int isa) int i; for (i = 0; mips_cpu_info_table[i].name != NULL; i++) - if (mips_cpu_info_table[i].is_isa + if ((mips_cpu_info_table[i].flags & MIPS_CPU_IS_ISA) && isa == mips_cpu_info_table[i].isa) return (&mips_cpu_info_table[i]); @@ -14845,9 +15364,15 @@ MIPS options:\n\ -mips16 generate mips16 instructions\n\ -no-mips16 do not generate mips16 instructions\n")); fprintf (stream, _("\ +-msmartmips generate smartmips instructions\n\ +-mno-smartmips do not generate smartmips instructions\n")); + fprintf (stream, _("\ -mdsp generate DSP instructions\n\ -mno-dsp do not generate DSP instructions\n")); fprintf (stream, _("\ +-mdspr2 generate DSP R2 instructions\n\ +-mno-dspr2 do not generate DSP R2 instructions\n")); + fprintf (stream, _("\ -mmt generate MT instructions\n\ -mno-mt do not generate MT instructions\n")); fprintf (stream, _("\ @@ -14855,7 +15380,6 @@ MIPS options:\n\ -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\ -mgp32 use 32-bit GPRs, regardless of the chosen ISA\n\ -mfp32 use 32-bit FPRs, regardless of the chosen ISA\n\ --mno-shared optimize output for executables\n\ -msym32 assume all symbols have 32-bit values\n\ -O0 remove unneeded NOPs, do not swap branches\n\ -O remove unneeded NOPs and swap branches\n\ @@ -14865,11 +15389,12 @@ MIPS options:\n\ #ifdef OBJ_ELF fprintf (stream, _("\ -KPIC, -call_shared generate SVR4 position independent code\n\ +-mvxworks-pic generate VxWorks position independent code\n\ -non_shared do not generate position independent code\n\ -xgot assume a 32 bit GOT\n\ -mpdr, -mno-pdr enable/disable creation of .pdr sections\n\ -mshared, -mno-shared disable/enable .cpload optimization for\n\ - non-shared code\n\ + position dependent (non shared) code\n\ -mabi=ABI create ABI conformant object file for:\n")); first = 1; @@ -14926,3 +15451,14 @@ mips_cfi_frame_initial_instructions (void) cfi_add_CFA_def_cfa_register (SP); } +int +tc_mips_regname_to_dw2regnum (char *regname) +{ + unsigned int regnum = -1; + unsigned int reg; + + if (reg_lookup (®name, RTYPE_GP | RTYPE_NUM, ®)) + regnum = reg; + + return regnum; +} diff --git a/contrib/binutils/gas/config/tc-mips.h b/contrib/binutils/gas/config/tc-mips.h index 5665d3decdd..117417cfed5 100644 --- a/contrib/binutils/gas/config/tc-mips.h +++ b/contrib/binutils/gas/config/tc-mips.h @@ -1,6 +1,6 @@ /* tc-mips.h -- header file for tc-mips.c. - Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, + 2005, 2006 Free Software Foundation, Inc. Contributed by the OSF and Ralph Campbell. Written by Keith Knowles and Ralph Campbell, working independently. Modified for ECOFF support by Ian Lance Taylor of Cygnus Support. @@ -58,6 +58,12 @@ extern void mips_handle_align (struct frag *); #define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2) +struct insn_label_list; +#define TC_SEGMENT_INFO_TYPE struct insn_label_list * + +/* This field is nonzero if the symbol is the target of a MIPS16 jump. */ +#define TC_SYMFIELD_TYPE int + /* Tell assembler that we have an itbl_mips.h header file to include. */ #define HAVE_ITBL_CPU @@ -149,6 +155,7 @@ extern void mips_emit_delays (void); extern void mips_enable_auto_align (void); #define md_elf_section_change_hook() mips_enable_auto_align() +enum dwarf2_format; extern enum dwarf2_format mips_dwarf2_format (void); #define DWARF2_FORMAT() mips_dwarf2_format () @@ -160,7 +167,10 @@ extern int mips_dwarf2_addr_size (void); #define tc_cfi_frame_initial_instructions mips_cfi_frame_initial_instructions extern void mips_cfi_frame_initial_instructions (void); +#define tc_regname_to_dw2regnum tc_mips_regname_to_dw2regnum +extern int tc_mips_regname_to_dw2regnum (char *regname); + #define DWARF2_DEFAULT_RETURN_COLUMN 31 -#define DWARF2_CIE_DATA_ALIGNMENT -4 +#define DWARF2_CIE_DATA_ALIGNMENT (-4) #endif /* TC_MIPS */ diff --git a/contrib/binutils/gas/config/tc-ppc.c b/contrib/binutils/gas/config/tc-ppc.c index d5bdb9e643e..a86a3bea92c 100644 --- a/contrib/binutils/gas/config/tc-ppc.c +++ b/contrib/binutils/gas/config/tc-ppc.c @@ -1,6 +1,6 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -20,7 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -85,67 +84,57 @@ static int set_target_endian = 0; static bfd_boolean reg_names_p = TARGET_REG_NAMES_P; -static bfd_boolean register_name PARAMS ((expressionS *)); -static void ppc_set_cpu PARAMS ((void)); -static unsigned long ppc_insert_operand - PARAMS ((unsigned long insn, const struct powerpc_operand *operand, - offsetT val, char *file, unsigned int line)); -static void ppc_macro PARAMS ((char *str, const struct powerpc_macro *macro)); -static void ppc_byte PARAMS ((int)); +static void ppc_macro (char *, const struct powerpc_macro *); +static void ppc_byte (int); #if defined (OBJ_XCOFF) || defined (OBJ_ELF) -static int ppc_is_toc_sym PARAMS ((symbolS *sym)); -static void ppc_tc PARAMS ((int)); -static void ppc_machine PARAMS ((int)); +static void ppc_tc (int); +static void ppc_machine (int); #endif #ifdef OBJ_XCOFF -static void ppc_comm PARAMS ((int)); -static void ppc_bb PARAMS ((int)); -static void ppc_bc PARAMS ((int)); -static void ppc_bf PARAMS ((int)); -static void ppc_biei PARAMS ((int)); -static void ppc_bs PARAMS ((int)); -static void ppc_eb PARAMS ((int)); -static void ppc_ec PARAMS ((int)); -static void ppc_ef PARAMS ((int)); -static void ppc_es PARAMS ((int)); -static void ppc_csect PARAMS ((int)); -static void ppc_change_csect PARAMS ((symbolS *, offsetT)); -static void ppc_function PARAMS ((int)); -static void ppc_extern PARAMS ((int)); -static void ppc_lglobl PARAMS ((int)); -static void ppc_section PARAMS ((int)); -static void ppc_named_section PARAMS ((int)); -static void ppc_stabx PARAMS ((int)); -static void ppc_rename PARAMS ((int)); -static void ppc_toc PARAMS ((int)); -static void ppc_xcoff_cons PARAMS ((int)); -static void ppc_vbyte PARAMS ((int)); +static void ppc_comm (int); +static void ppc_bb (int); +static void ppc_bc (int); +static void ppc_bf (int); +static void ppc_biei (int); +static void ppc_bs (int); +static void ppc_eb (int); +static void ppc_ec (int); +static void ppc_ef (int); +static void ppc_es (int); +static void ppc_csect (int); +static void ppc_change_csect (symbolS *, offsetT); +static void ppc_function (int); +static void ppc_extern (int); +static void ppc_lglobl (int); +static void ppc_section (int); +static void ppc_named_section (int); +static void ppc_stabx (int); +static void ppc_rename (int); +static void ppc_toc (int); +static void ppc_xcoff_cons (int); +static void ppc_vbyte (int); #endif #ifdef OBJ_ELF -static bfd_reloc_code_real_type ppc_elf_suffix PARAMS ((char **, expressionS *)); -static void ppc_elf_cons PARAMS ((int)); -static void ppc_elf_rdata PARAMS ((int)); -static void ppc_elf_lcomm PARAMS ((int)); -static void ppc_elf_validate_fix PARAMS ((fixS *, segT)); -static void ppc_apuinfo_section_add PARAMS ((unsigned int apu, unsigned int version)); +static void ppc_elf_cons (int); +static void ppc_elf_rdata (int); +static void ppc_elf_lcomm (int); #endif #ifdef TE_PE -static void ppc_set_current_section PARAMS ((segT)); -static void ppc_previous PARAMS ((int)); -static void ppc_pdata PARAMS ((int)); -static void ppc_ydata PARAMS ((int)); -static void ppc_reldata PARAMS ((int)); -static void ppc_rdata PARAMS ((int)); -static void ppc_ualong PARAMS ((int)); -static void ppc_znop PARAMS ((int)); -static void ppc_pe_comm PARAMS ((int)); -static void ppc_pe_section PARAMS ((int)); -static void ppc_pe_function PARAMS ((int)); -static void ppc_pe_tocd PARAMS ((int)); +static void ppc_previous (int); +static void ppc_pdata (int); +static void ppc_ydata (int); +static void ppc_reldata (int); +static void ppc_rdata (int); +static void ppc_ualong (int); +static void ppc_znop (int); +static void ppc_pe_comm (int); +static void ppc_pe_section (int); +static void ppc_pe_function (int); +static void ppc_pe_tocd (int); #endif /* Generic assembler global variables which must be defined by all @@ -183,11 +172,9 @@ const char EXP_CHARS[] = "eE"; as in 0d1.0. */ const char FLT_CHARS[] = "dD"; -/* '+' and '-' can be used as postfix predicate predictors for conditional - branches. So they need to be accepted as symbol characters. - Also, anything that can start an operand needs to be mentioned here, +/* Anything that can start an operand needs to be mentioned here, to stop the input scrubber eating whitespace. */ -const char ppc_symbol_chars[] = "+-%["; +const char ppc_symbol_chars[] = "%["; /* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ int ppc_cie_data_alignment; @@ -567,14 +554,8 @@ static const struct pd_reg pre_defined_registers[] = /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ -static int reg_name_search - PARAMS ((const struct pd_reg *, int, const char * name)); - static int -reg_name_search (regs, regcount, name) - const struct pd_reg *regs; - int regcount; - const char *name; +reg_name_search (const struct pd_reg *regs, int regcount, const char *name) { int middle, low, high; int cmp; @@ -611,8 +592,7 @@ reg_name_search (regs, regcount, name) */ static bfd_boolean -register_name (expressionP) - expressionS *expressionP; +register_name (expressionS *expressionP) { int reg_number; char *name; @@ -679,9 +659,7 @@ static const struct pd_reg cr_names[] = expression. */ int -ppc_parse_name (name, expr) - const char *name; - expressionS *expr; +ppc_parse_name (const char *name, expressionS *expr) { int val; @@ -917,6 +895,18 @@ parse_cpu (const char *arg) | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5); } + else if (strcmp (arg, "power6") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4 + | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6); + } + else if (strcmp (arg, "cell") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4 + | PPC_OPCODE_CELL); + } /* -mcom means assemble for the common intersection between Power and PowerPC. At present, we just allow the union, rather than the intersection. */ @@ -932,9 +922,7 @@ parse_cpu (const char *arg) } int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -1088,8 +1076,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fprintf (stream, _("\ PowerPC options:\n\ @@ -1112,6 +1099,8 @@ PowerPC options:\n\ -mbooke, mbooke32 generate code for 32-bit PowerPC BookE\n\ -mpower4 generate code for Power4 architecture\n\ -mpower5 generate code for Power5 architecture\n\ +-mpower6 generate code for Power6 architecture\n\ +-mcell generate code for Cell Broadband Engine architecture\n\ -mcom generate code Power/PowerPC common instructions\n\ -many generate code for any architecture (PWR/PWRX/PPC)\n")); fprintf (stream, _("\ @@ -1140,7 +1129,7 @@ PowerPC options:\n\ /* Set ppc_cpu if it is not already set. */ static void -ppc_set_cpu () +ppc_set_cpu (void) { const char *default_os = TARGET_OS; const char *default_cpu = TARGET_CPU; @@ -1168,7 +1157,7 @@ ppc_set_cpu () are called well before md_begin, when the output file is opened. */ enum bfd_architecture -ppc_arch () +ppc_arch (void) { const char *default_cpu = TARGET_CPU; ppc_set_cpu (); @@ -1190,7 +1179,7 @@ ppc_arch () } unsigned long -ppc_mach () +ppc_mach (void) { if (ppc_obj64) return bfd_mach_ppc64; @@ -1201,7 +1190,7 @@ ppc_mach () } extern char* -ppc_target_format () +ppc_target_format (void) { #ifdef OBJ_COFF #ifdef TE_PE @@ -1233,11 +1222,11 @@ ppc_target_format () static void ppc_setup_opcodes (void) { - register const struct powerpc_opcode *op; + const struct powerpc_opcode *op; const struct powerpc_opcode *op_end; const struct powerpc_macro *macro; const struct powerpc_macro *macro_end; - bfd_boolean dup_insn = FALSE; + bfd_boolean bad_insn = FALSE; if (ppc_hash != NULL) hash_die (ppc_hash); @@ -1247,10 +1236,77 @@ ppc_setup_opcodes (void) /* Insert the opcodes into a hash table. */ ppc_hash = hash_new (); + if (ENABLE_CHECKING) + { + unsigned int i; + + /* Check operand masks. Code here and in the disassembler assumes + all the 1's in the mask are contiguous. */ + for (i = 0; i < num_powerpc_operands; ++i) + { + unsigned long mask = powerpc_operands[i].bitm; + unsigned long right_bit; + unsigned int j; + + right_bit = mask & -mask; + mask += right_bit; + right_bit = mask & -mask; + if (mask != right_bit) + { + as_bad (_("powerpc_operands[%d].bitm invalid"), i); + bad_insn = TRUE; + } + for (j = i + 1; j < num_powerpc_operands; ++j) + if (memcmp (&powerpc_operands[i], &powerpc_operands[j], + sizeof (powerpc_operands[0])) == 0) + { + as_bad (_("powerpc_operands[%d] duplicates powerpc_operands[%d]"), + j, i); + bad_insn = TRUE; + } + } + } + op_end = powerpc_opcodes + powerpc_num_opcodes; for (op = powerpc_opcodes; op < op_end; op++) { - know ((op->opcode & op->mask) == op->opcode); + if (ENABLE_CHECKING) + { + const unsigned char *o; + unsigned long omask = op->mask; + + /* The mask had better not trim off opcode bits. */ + if ((op->opcode & omask) != op->opcode) + { + as_bad (_("mask trims opcode bits for %s"), + op->name); + bad_insn = TRUE; + } + + /* The operands must not overlap the opcode or each other. */ + for (o = op->operands; *o; ++o) + if (*o >= num_powerpc_operands) + { + as_bad (_("operand index error for %s"), + op->name); + bad_insn = TRUE; + } + else + { + const struct powerpc_operand *operand = &powerpc_operands[*o]; + if (operand->shift >= 0) + { + unsigned long mask = operand->bitm << operand->shift; + if (omask & mask) + { + as_bad (_("operand %d overlap in %s"), + (int) (o - op->operands), op->name); + bad_insn = TRUE; + } + omask |= mask; + } + } + } if ((op->flags & ppc_cpu & ~(PPC_OPCODE_32 | PPC_OPCODE_64)) != 0 && ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0 @@ -1270,11 +1326,14 @@ ppc_setup_opcodes (void) == (ppc_cpu & PPC_OPCODE_POWER4))) && ((op->flags & PPC_OPCODE_POWER5) == 0 || ((op->flags & PPC_OPCODE_POWER5) - == (ppc_cpu & PPC_OPCODE_POWER5)))) + == (ppc_cpu & PPC_OPCODE_POWER5))) + && ((op->flags & PPC_OPCODE_POWER6) == 0 + || ((op->flags & PPC_OPCODE_POWER6) + == (ppc_cpu & PPC_OPCODE_POWER6)))) { const char *retval; - retval = hash_insert (ppc_hash, op->name, (PTR) op); + retval = hash_insert (ppc_hash, op->name, (void *) op); if (retval != NULL) { /* Ignore Power duplicates for -m601. */ @@ -1282,16 +1341,16 @@ ppc_setup_opcodes (void) && (op->flags & PPC_OPCODE_POWER) != 0) continue; - as_bad (_("Internal assembler error for instruction %s"), + as_bad (_("duplicate instruction %s"), op->name); - dup_insn = TRUE; + bad_insn = TRUE; } } } if ((ppc_cpu & PPC_OPCODE_ANY) != 0) for (op = powerpc_opcodes; op < op_end; op++) - hash_insert (ppc_hash, op->name, (PTR) op); + hash_insert (ppc_hash, op->name, (void *) op); /* Insert the macros into a hash table. */ ppc_macro_hash = hash_new (); @@ -1303,16 +1362,16 @@ ppc_setup_opcodes (void) { const char *retval; - retval = hash_insert (ppc_macro_hash, macro->name, (PTR) macro); + retval = hash_insert (ppc_macro_hash, macro->name, (void *) macro); if (retval != (const char *) NULL) { - as_bad (_("Internal assembler error for macro %s"), macro->name); - dup_insn = TRUE; + as_bad (_("duplicate macro %s"), macro->name); + bad_insn = TRUE; } } } - if (dup_insn) + if (bad_insn) abort (); } @@ -1321,7 +1380,7 @@ ppc_setup_opcodes (void) opened. */ void -md_begin () +md_begin (void) { ppc_set_cpu (); @@ -1364,7 +1423,7 @@ md_begin () } void -ppc_cleanup () +ppc_cleanup (void) { #ifdef OBJ_ELF if (ppc_apuinfo_list == NULL) @@ -1426,54 +1485,60 @@ ppc_cleanup () /* Insert an operand value into an instruction. */ static unsigned long -ppc_insert_operand (insn, operand, val, file, line) - unsigned long insn; - const struct powerpc_operand *operand; - offsetT val; - char *file; - unsigned int line; +ppc_insert_operand (unsigned long insn, + const struct powerpc_operand *operand, + offsetT val, + char *file, + unsigned int line) { - if (operand->bits != 32) + long min, max, right; + + max = operand->bitm; + right = max & -max; + min = 0; + + if ((operand->flags & PPC_OPERAND_SIGNED) != 0) { - long min, max; - offsetT test; + if ((operand->flags & PPC_OPERAND_SIGNOPT) == 0) + max = (max >> 1) & -right; + min = ~max & -right; + } - if ((operand->flags & PPC_OPERAND_SIGNED) != 0) - { - if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0) - max = (1 << operand->bits) - 1; - else - max = (1 << (operand->bits - 1)) - 1; - min = - (1 << (operand->bits - 1)); + if ((operand->flags & PPC_OPERAND_PLUS1) != 0) + max++; - if (!ppc_obj64) - { - /* Some people write 32 bit hex constants with the sign - extension done by hand. This shouldn't really be - valid, but, to permit this code to assemble on a 64 - bit host, we sign extend the 32 bit value. */ - if (val > 0 - && (val & (offsetT) 0x80000000) != 0 - && (val & (offsetT) 0xffffffff) == val) - { - val -= 0x80000000; - val -= 0x80000000; - } - } - } - else - { - max = (1 << operand->bits) - 1; - min = 0; - } + if ((operand->flags & PPC_OPERAND_NEGATIVE) != 0) + { + long tmp = min; + min = -max; + max = -tmp; + } - if ((operand->flags & PPC_OPERAND_NEGATIVE) != 0) - test = - val; - else - test = val; + if (min <= max) + { + /* Some people write constants with the sign extension done by + hand but only up to 32 bits. This shouldn't really be valid, + but, to permit this code to assemble on a 64-bit host, we + sign extend the 32-bit value to 64 bits if so doing makes the + value valid. */ + if (val > max + && (offsetT) (val - 0x80000000 - 0x80000000) >= min + && (offsetT) (val - 0x80000000 - 0x80000000) <= max + && ((val - 0x80000000 - 0x80000000) & (right - 1)) == 0) + val = val - 0x80000000 - 0x80000000; - if (test < (offsetT) min || test > (offsetT) max) - as_bad_value_out_of_range (_("operand"), test, (offsetT) min, (offsetT) max, file, line); + /* Similarly, people write expressions like ~(1<<15), and expect + this to be OK for a 32-bit unsigned value. */ + else if (val < min + && (offsetT) (val + 0x80000000 + 0x80000000) >= min + && (offsetT) (val + 0x80000000 + 0x80000000) <= max + && ((val + 0x80000000 + 0x80000000) & (right - 1)) == 0) + val = val + 0x80000000 + 0x80000000; + + else if (val < min + || val > max + || (val & (right - 1)) != 0) + as_bad_value_out_of_range (_("operand"), val, min, max, file, line); } if (operand->insert) @@ -1486,8 +1551,7 @@ ppc_insert_operand (insn, operand, val, file, line) as_bad_where (file, line, errmsg); } else - insn |= (((long) val & ((1 << operand->bits) - 1)) - << operand->shift); + insn |= ((long) val & operand->bitm) << operand->shift; return insn; } @@ -1496,9 +1560,7 @@ ppc_insert_operand (insn, operand, val, file, line) #ifdef OBJ_ELF /* Parse @got, etc. and return the desired relocation. */ static bfd_reloc_code_real_type -ppc_elf_suffix (str_p, exp_p) - char **str_p; - expressionS *exp_p; +ppc_elf_suffix (char **str_p, expressionS *exp_p) { struct map_bfd { char *string; @@ -1676,8 +1738,7 @@ ppc_elf_suffix (str_p, exp_p) /* Like normal .long/.short/.word, except support @got, etc. Clobbers input_line_pointer, checks end-of-line. */ static void -ppc_elf_cons (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long, 8=.llong. */ +ppc_elf_cons (int nbytes /* 1=.byte, 2=.word, 4=.long, 8=.llong */) { expressionS exp; bfd_reloc_code_real_type reloc; @@ -1732,8 +1793,7 @@ ppc_elf_cons (nbytes) /* Solaris pseduo op to change to the .rodata section. */ static void -ppc_elf_rdata (xxx) - int xxx; +ppc_elf_rdata (int xxx) { char *save_line = input_line_pointer; static char section[] = ".rodata\n"; @@ -1747,14 +1807,13 @@ ppc_elf_rdata (xxx) /* Pseudo op to make file scope bss items. */ static void -ppc_elf_lcomm (xxx) - int xxx ATTRIBUTE_UNUSED; +ppc_elf_lcomm (int xxx ATTRIBUTE_UNUSED) { - register char *name; - register char c; - register char *p; + char *name; + char c; + char *p; offsetT size; - register symbolS *symbolP; + symbolS *symbolP; offsetT align; segT old_sec; int old_subsec; @@ -1857,9 +1916,7 @@ ppc_elf_lcomm (xxx) fixups for word relocations in writable segments, so we can adjust them at runtime. */ static void -ppc_elf_validate_fix (fixp, seg) - fixS *fixp; - segT seg; +ppc_elf_validate_fix (fixS *fixp, segT seg) { if (fixp->fx_done || fixp->fx_pcrel) return; @@ -1904,7 +1961,7 @@ ppc_elf_validate_fix (fixp, seg) function descriptor sym if the corresponding code sym is used. */ void -ppc_frob_file_before_adjust () +ppc_frob_file_before_adjust (void) { symbolS *symp; asection *toc; @@ -1987,8 +2044,7 @@ enum toc_size_qualifier }; static int -parse_toc_entry (toc_kind) - enum toc_size_qualifier *toc_kind; +parse_toc_entry (enum toc_size_qualifier *toc_kind) { char *start; char *toc_spec; @@ -2052,8 +2108,7 @@ parse_toc_entry (toc_kind) #ifdef OBJ_ELF #define APUID(a,v) ((((a) & 0xffff) << 16) | ((v) & 0xffff)) static void -ppc_apuinfo_section_add (apu, version) - unsigned int apu, version; +ppc_apuinfo_section_add (unsigned int apu, unsigned int version) { unsigned int i; @@ -2099,8 +2154,7 @@ struct ppc_fixup /* This routine is called for each instruction to be assembled. */ void -md_assemble (str) - char *str; +md_assemble (char *str) { char *s; const struct powerpc_opcode *opcode; @@ -2724,16 +2778,14 @@ md_assemble (str) around operands here. */ static void -ppc_macro (str, macro) - char *str; - const struct powerpc_macro *macro; +ppc_macro (char *str, const struct powerpc_macro *macro) { char *operands[10]; unsigned int count; char *s; unsigned int len; const char *format; - int arg; + unsigned int arg; char *send; char *complete; @@ -2771,7 +2823,7 @@ ppc_macro (str, macro) else { arg = strtol (format + 1, &send, 10); - know (send != format && arg >= 0 && arg < count); + know (send != format && arg < count); len += strlen (operands[arg]); format = send; } @@ -2802,9 +2854,7 @@ ppc_macro (str, macro) /* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED. */ int -ppc_section_letter (letter, ptr_msg) - int letter; - char **ptr_msg; +ppc_section_letter (int letter, char **ptr_msg) { if (letter == 'e') return SHF_EXCLUDE; @@ -2814,9 +2864,7 @@ ppc_section_letter (letter, ptr_msg) } int -ppc_section_word (str, len) - char *str; - size_t len; +ppc_section_word (char *str, size_t len) { if (len == 7 && strncmp (str, "exclude", 7) == 0) return SHF_EXCLUDE; @@ -2825,9 +2873,7 @@ ppc_section_word (str, len) } int -ppc_section_type (str, len) - char *str; - size_t len; +ppc_section_type (char *str, size_t len) { if (len == 7 && strncmp (str, "ordered", 7) == 0) return SHT_ORDERED; @@ -2836,10 +2882,7 @@ ppc_section_type (str, len) } int -ppc_section_flags (flags, attr, type) - int flags; - int attr; - int type; +ppc_section_flags (int flags, int attr, int type) { if (type == SHT_ORDERED) flags |= SEC_ALLOC | SEC_LOAD | SEC_SORT_ENTRIES; @@ -2858,8 +2901,7 @@ ppc_section_flags (flags, attr, type) pseudo-op, but it can also take a single ASCII string. */ static void -ppc_byte (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_byte (int ignore ATTRIBUTE_UNUSED) { if (*input_line_pointer != '\"') { @@ -2903,8 +2945,7 @@ static bfd_boolean ppc_stab_symbol; aligns .comm and .lcomm to 4 bytes. */ static void -ppc_comm (lcomm) - int lcomm; +ppc_comm (int lcomm) { asection *current_seg = now_seg; subsegT current_subseg = now_subseg; @@ -3058,8 +3099,7 @@ ppc_comm (lcomm) optional second argument is the alignment (the default is 2). */ static void -ppc_csect (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_csect (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3094,9 +3134,7 @@ ppc_csect (ignore) /* Change to a different csect. */ static void -ppc_change_csect (sym, align) - symbolS *sym; - offsetT align; +ppc_change_csect (symbolS *sym, offsetT align) { if (S_IS_DEFINED (sym)) subseg_set (S_GET_SEGMENT (sym), symbol_get_tc (sym)->subseg); @@ -3196,8 +3234,7 @@ ppc_change_csect (sym, align) convenience of people who aren't used to XCOFF. */ static void -ppc_section (type) - int type; +ppc_section (int type) { const char *name; symbolS *sym; @@ -3221,8 +3258,7 @@ ppc_section (type) we do permit the user to name the text or data section. */ static void -ppc_named_section (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_named_section (int ignore ATTRIBUTE_UNUSED) { char *user_name; const char *real_name; @@ -3256,8 +3292,7 @@ ppc_named_section (ignore) /* The .extern pseudo-op. We create an undefined symbol. */ static void -ppc_extern (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_extern (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3275,8 +3310,7 @@ ppc_extern (ignore) /* The .lglobl pseudo-op. Keep the symbol in the symbol table. */ static void -ppc_lglobl (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_lglobl (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3298,8 +3332,7 @@ ppc_lglobl (ignore) although I don't know why it bothers. */ static void -ppc_rename (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_rename (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3334,8 +3367,7 @@ ppc_rename (ignore) always zero, and I am assuming it is the type. */ static void -ppc_stabx (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_stabx (int ignore ATTRIBUTE_UNUSED) { char *name; int len; @@ -3461,8 +3493,7 @@ ppc_stabx (ignore) gets an aux entry like that used for a csect. */ static void -ppc_function (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_function (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3555,8 +3586,7 @@ ppc_function (ignore) static symbolS *saved_bi_sym = 0; static void -ppc_bf (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bf (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3591,8 +3621,7 @@ ppc_bf (ignore) most recent ".bf" symbol. */ static void -ppc_ef (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ef (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3616,8 +3645,7 @@ ppc_ef (ignore) is encountered. */ static void -ppc_biei (ei) - int ei; +ppc_biei (int ei) { static symbolS *last_biei; @@ -3671,8 +3699,7 @@ ppc_biei (ei) .bs symbol is the index of this csect symbol. */ static void -ppc_bs (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bs (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -3707,8 +3734,7 @@ ppc_bs (ignore) /* The .es pseudo-op. Generate a C_ESTART symbol named .es. */ static void -ppc_es (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_es (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3732,8 +3758,7 @@ ppc_es (ignore) line number. */ static void -ppc_bb (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bb (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3759,8 +3784,7 @@ ppc_bb (ignore) line number. */ static void -ppc_eb (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_eb (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3784,8 +3808,7 @@ ppc_eb (ignore) specified name. */ static void -ppc_bc (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_bc (int ignore ATTRIBUTE_UNUSED) { char *name; int len; @@ -3807,8 +3830,7 @@ ppc_bc (ignore) /* The .ec pseudo-op. This just creates a C_ECOMM symbol. */ static void -ppc_ec (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ec (int ignore ATTRIBUTE_UNUSED) { symbolS *sym; @@ -3827,8 +3849,7 @@ ppc_ec (ignore) /* The .toc pseudo-op. Switch to the .toc subsegment. */ static void -ppc_toc (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_toc (int ignore ATTRIBUTE_UNUSED) { if (ppc_toc_csect != (symbolS *) NULL) subseg_set (data_section, symbol_get_tc (ppc_toc_csect)->subseg); @@ -3874,8 +3895,7 @@ ppc_toc (ignore) .short pseudo-op, and we want to be compatible. */ static void -ppc_xcoff_cons (log_size) - int log_size; +ppc_xcoff_cons (int log_size) { frag_align (log_size, 0, 0); record_alignment (now_seg, log_size); @@ -3883,8 +3903,7 @@ ppc_xcoff_cons (log_size) } static void -ppc_vbyte (dummy) - int dummy ATTRIBUTE_UNUSED; +ppc_vbyte (int dummy ATTRIBUTE_UNUSED) { expressionS exp; int byte_count; @@ -3927,8 +3946,7 @@ ppc_vbyte (dummy) the first argument is simply ignored. */ static void -ppc_tc (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_tc (int ignore ATTRIBUTE_UNUSED) { #ifdef OBJ_XCOFF @@ -4014,8 +4032,7 @@ ppc_tc (ignore) /* Pseudo-op .machine. */ static void -ppc_machine (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_machine (int ignore ATTRIBUTE_UNUSED) { char *cpu_string; #define MAX_HISTORY 100 @@ -4078,8 +4095,7 @@ ppc_machine (ignore) /* See whether a symbol is in the TOC section. */ static int -ppc_is_toc_sym (sym) - symbolS *sym; +ppc_is_toc_sym (symbolS *sym) { #ifdef OBJ_XCOFF return symbol_get_tc (sym)->class == XMC_TC; @@ -4100,8 +4116,7 @@ ppc_is_toc_sym (sym) /* Set the current section. */ static void -ppc_set_current_section (new) - segT new; +ppc_set_current_section (segT new) { ppc_previous_section = ppc_current_section; ppc_current_section = new; @@ -4113,8 +4128,7 @@ ppc_set_current_section (new) warnings: "No previous section" */ static void -ppc_previous (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_previous (int ignore ATTRIBUTE_UNUSED) { symbolS *tmp; @@ -4145,8 +4159,7 @@ ppc_previous (ignore) handling, debugging, etc. */ static void -ppc_pdata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pdata (int ignore ATTRIBUTE_UNUSED) { if (pdata_section == 0) { @@ -4180,8 +4193,7 @@ ppc_pdata (ignore) debugging, etc. */ static void -ppc_ydata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ydata (int ignore ATTRIBUTE_UNUSED) { if (ydata_section == 0) { @@ -4217,8 +4229,7 @@ ppc_ydata (ignore) function descriptors, etc. */ static void -ppc_reldata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_reldata (int ignore ATTRIBUTE_UNUSED) { if (reldata_section == 0) { @@ -4248,8 +4259,7 @@ ppc_reldata (ignore) 3 - double word aligned (that would be 4 byte boundary) */ static void -ppc_rdata (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_rdata (int ignore ATTRIBUTE_UNUSED) { if (rdata_section == 0) { @@ -4275,8 +4285,7 @@ ppc_rdata (ignore) warnings: None */ static void -ppc_ualong (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_ualong (int ignore ATTRIBUTE_UNUSED) { /* Try for long. */ cons (4); @@ -4290,8 +4299,7 @@ ppc_ualong (ignore) warnings: Missing symbol name */ static void -ppc_znop (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_znop (int ignore ATTRIBUTE_UNUSED) { unsigned long insn; const struct powerpc_opcode *opcode; @@ -4343,14 +4351,13 @@ ppc_znop (ignore) warnings: */ static void -ppc_pe_comm (lcomm) - int lcomm; +ppc_pe_comm (int lcomm) { - register char *name; - register char c; - register char *p; + char *name; + char c; + char *p; offsetT temp; - register symbolS *symbolP; + symbolS *symbolP; offsetT align; name = input_line_pointer; @@ -4473,8 +4480,7 @@ ppc_pe_comm (lcomm) */ void -ppc_pe_section (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pe_section (int ignore ATTRIBUTE_UNUSED) { /* Strip out the section name. */ char *section_name; @@ -4562,7 +4568,7 @@ ppc_pe_section (ignore) case 'R': /* Remove section at link time */ flags |= SEC_NEVER_LOAD; break; - +#if IFLICT_BRAIN_DAMAGE /* Section Protection */ case 'r': /* section is readable */ flags |= IMAGE_SCN_MEM_READ; @@ -4606,7 +4612,7 @@ ppc_pe_section (ignore) flags |= IMAGE_SCN_ALIGN_64BYTES; align = 6; break; - +#endif default: as_bad (_("unknown section attribute '%c'"), *input_line_pointer); @@ -4632,12 +4638,10 @@ ppc_pe_section (ignore) } bfd_set_section_alignment (stdoutput, sec, align); - } static void -ppc_pe_function (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pe_function (int ignore ATTRIBUTE_UNUSED) { char *name; char endc; @@ -4659,8 +4663,7 @@ ppc_pe_function (ignore) } static void -ppc_pe_tocd (ignore) - int ignore ATTRIBUTE_UNUSED; +ppc_pe_tocd (int ignore ATTRIBUTE_UNUSED) { if (tocdata_section == 0) { @@ -4685,8 +4688,7 @@ ppc_pe_tocd (ignore) /* Don't adjust TOC relocs to use the section symbol. */ int -ppc_pe_fix_adjustable (fix) - fixS *fix; +ppc_pe_fix_adjustable (fixS *fix) { return fix->fx_r_type != BFD_RELOC_PPC_TOC16; } @@ -4701,8 +4703,7 @@ ppc_pe_fix_adjustable (fix) any, to use square brackets, and to be in upper case. */ char * -ppc_canonicalize_symbol_name (name) - char *name; +ppc_canonicalize_symbol_name (char *name) { char *s; @@ -4739,8 +4740,7 @@ ppc_canonicalize_symbol_name (name) called whenever a new symbol is created. */ void -ppc_symbol_new_hook (sym) - symbolS *sym; +ppc_symbol_new_hook (symbolS *sym) { struct ppc_tc_sy *tc; const char *s; @@ -4828,8 +4828,7 @@ ppc_symbol_new_hook (sym) follows the csect symbol. */ void -ppc_frob_label (sym) - symbolS *sym; +ppc_frob_label (symbolS *sym) { if (ppc_current_csect != (symbolS *) NULL) { @@ -4859,8 +4858,7 @@ static bfd_boolean ppc_saw_abs; symbol table. */ int -ppc_frob_symbol (sym) - symbolS *sym; +ppc_frob_symbol (symbolS *sym) { static symbolS *ppc_last_function; static symbolS *set_end; @@ -5123,7 +5121,7 @@ ppc_frob_symbol (sym) absolute symbols. */ void -ppc_adjust_symtab () +ppc_adjust_symtab (void) { symbolS *sym; @@ -5169,8 +5167,7 @@ ppc_adjust_symtab () turn. */ void -ppc_frob_section (sec) - asection *sec; +ppc_frob_section (asection *sec) { static bfd_vma vma = 0; @@ -5187,10 +5184,7 @@ ppc_frob_section (sec) returned, or NULL on OK. */ char * -md_atof (type, litp, sizep) - int type; - char *litp; - int *sizep; +md_atof (int type, char *litp, int *sizep) { int prec; LITTLENUM_TYPE words[4]; @@ -5242,10 +5236,7 @@ md_atof (type, litp, sizep) endianness. */ void -md_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; +md_number_to_chars (char *buf, valueT val, int n) { if (target_big_endian) number_to_chars_bigendian (buf, val, n); @@ -5256,21 +5247,22 @@ md_number_to_chars (buf, val, n) /* Align a section (I don't know why this is machine dependent). */ valueT -md_section_align (seg, addr) - asection *seg; - valueT addr; +md_section_align (asection *seg ATTRIBUTE_UNUSED, valueT addr) { +#ifdef OBJ_ELF + return addr; +#else int align = bfd_get_section_alignment (stdoutput, seg); return ((addr + (1 << align) - 1) & (-1 << align)); +#endif } /* We don't have any form of relaxing. */ int -md_estimate_size_before_relax (fragp, seg) - fragS *fragp ATTRIBUTE_UNUSED; - asection *seg ATTRIBUTE_UNUSED; +md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_UNUSED, + asection *seg ATTRIBUTE_UNUSED) { abort (); return 0; @@ -5279,10 +5271,9 @@ md_estimate_size_before_relax (fragp, seg) /* Convert a machine dependent frag. We never generate these. */ void -md_convert_frag (abfd, sec, fragp) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - fragS *fragp ATTRIBUTE_UNUSED; +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + fragS *fragp ATTRIBUTE_UNUSED) { abort (); } @@ -5290,8 +5281,7 @@ md_convert_frag (abfd, sec, fragp) /* We have no need to default values of symbols. */ symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) { return 0; } @@ -5302,9 +5292,7 @@ md_undefined_symbol (name) given a PC relative reloc. */ long -md_pcrel_from_section (fixp, sec) - fixS *fixp; - segT sec ATTRIBUTE_UNUSED; +md_pcrel_from_section (fixS *fixp, segT sec ATTRIBUTE_UNUSED) { return fixp->fx_frag->fr_address + fixp->fx_where; } @@ -5317,8 +5305,7 @@ md_pcrel_from_section (fixp, sec) corresponding .tc symbol. */ int -ppc_fix_adjustable (fix) - fixS *fix; +ppc_fix_adjustable (fixS *fix) { valueT val = resolve_symbol_value (fix->fx_addsy); segT symseg = S_GET_SEGMENT (fix->fx_addsy); @@ -5443,8 +5430,7 @@ ppc_fix_adjustable (fix) between two csects in the same section. */ int -ppc_force_relocation (fix) - fixS *fix; +ppc_force_relocation (fixS *fix) { /* At this point fix->fx_addsy should already have been converted to a csect symbol. If the csect does not include the fragment, then @@ -5469,8 +5455,7 @@ ppc_force_relocation (fix) will be emitted for a fixup. */ int -ppc_force_relocation (fix) - fixS *fix; +ppc_force_relocation (fixS *fix) { /* Branch prediction relocations must force a relocation, as must the vtable description relocs. */ @@ -5495,8 +5480,7 @@ ppc_force_relocation (fix) } int -ppc_fix_adjustable (fix) - fixS *fix; +ppc_fix_adjustable (fixS *fix) { return (fix->fx_r_type != BFD_RELOC_16_GOTOFF && fix->fx_r_type != BFD_RELOC_LO16_GOTOFF @@ -5510,6 +5494,47 @@ ppc_fix_adjustable (fix) } #endif +/* Implement HANDLE_ALIGN. This writes the NOP pattern into an + rs_align_code frag. */ + +void +ppc_handle_align (struct frag *fragP) +{ + valueT count = (fragP->fr_next->fr_address + - (fragP->fr_address + fragP->fr_fix)); + + if (count != 0 && (count & 3) == 0) + { + char *dest = fragP->fr_literal + fragP->fr_fix; + + fragP->fr_var = 4; + md_number_to_chars (dest, 0x60000000, 4); + + if ((ppc_cpu & PPC_OPCODE_POWER6) != 0) + { + /* For power6, we want the last nop to be a group terminating + one, "ori 1,1,0". Do this by inserting an rs_fill frag + immediately after this one, with its address set to the last + nop location. This will automatically reduce the number of + nops in the current frag by one. */ + if (count > 4) + { + struct frag *group_nop = xmalloc (SIZEOF_STRUCT_FRAG + 4); + + memcpy (group_nop, fragP, SIZEOF_STRUCT_FRAG); + group_nop->fr_address = group_nop->fr_next->fr_address - 4; + group_nop->fr_fix = 0; + group_nop->fr_offset = 1; + group_nop->fr_type = rs_fill; + fragP->fr_next = group_nop; + dest = group_nop->fr_literal; + } + + md_number_to_chars (dest, 0x60210000, 4); + } + } +} + /* Apply a fixup to the object code. This is called for all the fixups we generated by the call to fix_new_exp, above. In the call above we used a reloc code which was the largest legal reloc code @@ -5520,10 +5545,7 @@ ppc_fix_adjustable (fix) fixup. */ void -md_apply_fix (fixP, valP, seg) - fixS *fixP; - valueT * valP; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { valueT value = * valP; @@ -5580,7 +5602,7 @@ md_apply_fix (fixP, valP, seg) csect. Other usages, such as `.long sym', generate relocs. This is the documented behaviour of non-TOC symbols. */ if ((operand->flags & PPC_OPERAND_PARENS) != 0 - && operand->bits == 16 + && (operand->bitm & 0xfff0) == 0xfff0 && operand->shift == 0 && (operand->insert == NULL || ppc_obj64) && fixP->fx_addsy != NULL @@ -5618,11 +5640,11 @@ md_apply_fix (fixP, valP, seg) We are only prepared to turn a few of the operands into relocs. */ if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 - && operand->bits == 26 + && operand->bitm == 0x3fffffc && operand->shift == 0) fixP->fx_r_type = BFD_RELOC_PPC_B26; else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0 - && operand->bits == 16 + && operand->bitm == 0xfffc && operand->shift == 0) { fixP->fx_r_type = BFD_RELOC_PPC_B16; @@ -5633,11 +5655,11 @@ md_apply_fix (fixP, valP, seg) #endif } else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0 - && operand->bits == 26 + && operand->bitm == 0x3fffffc && operand->shift == 0) fixP->fx_r_type = BFD_RELOC_PPC_BA26; else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0 - && operand->bits == 16 + && operand->bitm == 0xfffc && operand->shift == 0) { fixP->fx_r_type = BFD_RELOC_PPC_BA16; @@ -5649,7 +5671,7 @@ md_apply_fix (fixP, valP, seg) } #if defined (OBJ_XCOFF) || defined (OBJ_ELF) else if ((operand->flags & PPC_OPERAND_PARENS) != 0 - && operand->bits == 16 + && (operand->bitm & 0xfff0) == 0xfff0 && operand->shift == 0) { if (ppc_is_toc_sym (fixP->fx_addsy)) @@ -6047,9 +6069,7 @@ md_apply_fix (fixP, valP, seg) /* Generate a reloc for a fixup. */ arelent * -tc_gen_reloc (seg, fixp) - asection *seg ATTRIBUTE_UNUSED; - fixS *fixp; +tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) { arelent *reloc; @@ -6072,13 +6092,13 @@ tc_gen_reloc (seg, fixp) } void -ppc_cfi_frame_initial_instructions () +ppc_cfi_frame_initial_instructions (void) { cfi_add_CFA_def_cfa (1, 0); } int -tc_ppc_regname_to_dw2regnum (const char *regname) +tc_ppc_regname_to_dw2regnum (char *regname) { unsigned int regnum = -1; unsigned int i; diff --git a/contrib/binutils/gas/config/tc-ppc.h b/contrib/binutils/gas/config/tc-ppc.h index f7c2da619cb..1e856497959 100644 --- a/contrib/binutils/gas/config/tc-ppc.h +++ b/contrib/binutils/gas/config/tc-ppc.h @@ -1,6 +1,6 @@ /* tc-ppc.h -- Header file for tc-ppc.c. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -42,15 +42,15 @@ struct fix; /* The target BFD architecture. */ #define TARGET_ARCH (ppc_arch ()) #define TARGET_MACH (ppc_mach ()) -extern enum bfd_architecture ppc_arch PARAMS ((void)); -extern unsigned long ppc_mach PARAMS ((void)); +extern enum bfd_architecture ppc_arch (void); +extern unsigned long ppc_mach (void); /* Whether or not the target is big endian */ extern int target_big_endian; /* The target BFD format. */ #define TARGET_FORMAT (ppc_target_format ()) -extern char *ppc_target_format PARAMS ((void)); +extern char *ppc_target_format (void); /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -78,31 +78,12 @@ extern char *ppc_target_format PARAMS ((void)); #define MAX_MEM_FOR_RS_ALIGN_CODE 4 #define HANDLE_ALIGN(FRAGP) \ - if ((FRAGP)->fr_type == rs_align_code) \ - { \ - valueT count = ((FRAGP)->fr_next->fr_address \ - - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \ - if (count != 0 && (count & 3) == 0) \ - { \ - char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \ - \ - (FRAGP)->fr_var = 4; \ - if (target_big_endian) \ - { \ - *dest++ = 0x60; \ - *dest++ = 0; \ - *dest++ = 0; \ - *dest++ = 0; \ - } \ - else \ - { \ - *dest++ = 0; \ - *dest++ = 0; \ - *dest++ = 0; \ - *dest++ = 0x60; \ - } \ - } \ - } + if ((FRAGP)->fr_type == rs_align_code) \ + ppc_handle_align (FRAGP); + +extern void ppc_handle_align (struct frag *); + +#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 #define md_frag_check(FRAGP) \ if ((FRAGP)->has_code \ @@ -117,7 +98,7 @@ extern char *ppc_target_format PARAMS ((void)); /* Don't adjust TOC relocs. */ #define tc_fix_adjustable(FIX) ppc_pe_fix_adjustable (FIX) -extern int ppc_pe_fix_adjustable PARAMS ((struct fix *)); +extern int ppc_pe_fix_adjustable (struct fix *); #endif @@ -165,31 +146,31 @@ struct ppc_tc_sy /* Canonicalize the symbol name. */ #define tc_canonicalize_symbol_name(name) ppc_canonicalize_symbol_name (name) -extern char *ppc_canonicalize_symbol_name PARAMS ((char *)); +extern char *ppc_canonicalize_symbol_name (char *); /* Get the symbol class from the name. */ #define tc_symbol_new_hook(sym) ppc_symbol_new_hook (sym) -extern void ppc_symbol_new_hook PARAMS ((symbolS *)); +extern void ppc_symbol_new_hook (symbolS *); /* Set the symbol class of a label based on the csect. */ #define tc_frob_label(sym) ppc_frob_label (sym) -extern void ppc_frob_label PARAMS ((symbolS *)); +extern void ppc_frob_label (symbolS *); /* TOC relocs requires special handling. */ #define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) -extern int ppc_fix_adjustable PARAMS ((struct fix *)); +extern int ppc_fix_adjustable (struct fix *); /* We need to set the section VMA. */ #define tc_frob_section(sec) ppc_frob_section (sec) -extern void ppc_frob_section PARAMS ((asection *)); +extern void ppc_frob_section (asection *); /* Finish up the symbol. */ #define tc_frob_symbol(sym, punt) punt = ppc_frob_symbol (sym) -extern int ppc_frob_symbol PARAMS ((symbolS *)); +extern int ppc_frob_symbol (symbolS *); /* Finish up the entire symtab. */ #define tc_adjust_symtab() ppc_adjust_symtab () -extern void ppc_adjust_symtab PARAMS ((void)); +extern void ppc_adjust_symtab (void); /* We also need to copy, in particular, the class of the symbol, over what obj-coff would otherwise have copied. */ @@ -211,10 +192,10 @@ extern const char ppc_symbol_chars[]; #ifdef OBJ_ELF /* Support for SHF_EXCLUDE and SHT_ORDERED */ -extern int ppc_section_letter PARAMS ((int, char **)); -extern int ppc_section_type PARAMS ((char *, size_t)); -extern int ppc_section_word PARAMS ((char *, size_t)); -extern int ppc_section_flags PARAMS ((int, int, int)); +extern int ppc_section_letter (int, char **); +extern int ppc_section_type (char *, size_t); +extern int ppc_section_word (char *, size_t); +extern int ppc_section_flags (int, int, int); #define md_elf_section_letter(LETTER, PTR_MSG) ppc_section_letter (LETTER, PTR_MSG) #define md_elf_section_type(STR, LEN) ppc_section_type (STR, LEN) @@ -226,40 +207,40 @@ extern const char *ppc_comment_chars; /* Keep relocations relative to the GOT, or non-PC relative. */ #define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) -extern int ppc_fix_adjustable PARAMS ((struct fix *)); +extern int ppc_fix_adjustable (struct fix *); /* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_frob_file_before_adjust ppc_frob_file_before_adjust -extern void ppc_frob_file_before_adjust PARAMS ((void)); +extern void ppc_frob_file_before_adjust (void); #endif /* OBJ_ELF */ #if defined (OBJ_ELF) || defined (OBJ_XCOFF) #define TC_FORCE_RELOCATION(FIX) ppc_force_relocation (FIX) -extern int ppc_force_relocation PARAMS ((struct fix *)); +extern int ppc_force_relocation (struct fix *); #endif /* call md_pcrel_from_section, not md_pcrel_from */ #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); +extern long md_pcrel_from_section (struct fix *, segT); #define md_parse_name(name, exp, mode, c) ppc_parse_name (name, exp) -extern int ppc_parse_name PARAMS ((const char *, struct expressionS *)); +extern int ppc_parse_name (const char *, struct expressionS *); #define md_operand(x) #define md_cleanup() ppc_cleanup () - extern void ppc_cleanup PARAMS ((void)); +extern void ppc_cleanup (void); #define TARGET_USE_CFIPOP 1 #define tc_cfi_frame_initial_instructions ppc_cfi_frame_initial_instructions -extern void ppc_cfi_frame_initial_instructions PARAMS ((void)); +extern void ppc_cfi_frame_initial_instructions (void); #define tc_regname_to_dw2regnum tc_ppc_regname_to_dw2regnum -extern int tc_ppc_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int tc_ppc_regname_to_dw2regnum (char *); extern int ppc_cie_data_alignment; diff --git a/contrib/binutils/gas/config/tc-s390.c b/contrib/binutils/gas/config/tc-s390.c index 56b5b2594f8..6ca31f7b43b 100644 --- a/contrib/binutils/gas/config/tc-s390.c +++ b/contrib/binutils/gas/config/tc-s390.c @@ -1,5 +1,5 @@ /* tc-s390.c -- Assemble for the S390 - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -20,7 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -412,6 +411,8 @@ md_parse_option (c, arg) current_cpu = S390_OPCODE_Z990; else if (strcmp (arg + 5, "z9-109") == 0) current_cpu = S390_OPCODE_Z9_109; + else if (strcmp (arg + 5, "z9-ec") == 0) + current_cpu = S390_OPCODE_Z9_EC; else { as_bad (_("invalid switch -m%s"), arg); @@ -2322,7 +2323,7 @@ s390_cfi_frame_initial_instructions () } int -tc_s390_regname_to_dw2regnum (const char *regname) +tc_s390_regname_to_dw2regnum (char *regname) { int regnum = -1; diff --git a/contrib/binutils/gas/config/tc-s390.h b/contrib/binutils/gas/config/tc-s390.h index dbecfef3a55..b387c3b867d 100644 --- a/contrib/binutils/gas/config/tc-s390.h +++ b/contrib/binutils/gas/config/tc-s390.h @@ -88,7 +88,7 @@ extern void s390_md_end PARAMS ((void)); extern void s390_cfi_frame_initial_instructions PARAMS ((void)); #define tc_regname_to_dw2regnum tc_s390_regname_to_dw2regnum -extern int tc_s390_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int tc_s390_regname_to_dw2regnum PARAMS ((char *regname)); extern int s390_cie_data_alignment; diff --git a/contrib/binutils/gas/config/tc-score.c b/contrib/binutils/gas/config/tc-score.c new file mode 100644 index 00000000000..fe45b00bad6 --- /dev/null +++ b/contrib/binutils/gas/config/tc-score.c @@ -0,0 +1,6661 @@ +/* tc-score.c -- Assembler for Score + Copyright 2006 Free Software Foundation, Inc. + Contributed by: + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "as.h" +#include "config.h" +#include "subsegs.h" +#include "safe-ctype.h" +#include "opcode/score-inst.h" +#include "opcode/score-datadep.h" +#include "struc-symbol.h" + +#ifdef OBJ_ELF +#include "elf/score.h" +#include "dwarf2dbg.h" +#endif + +#define GP 28 +#define PIC_CALL_REG 29 +#define MAX_LITERAL_POOL_SIZE 1024 +#define FAIL 0x80000000 +#define SUCCESS 0 +#define INSN_SIZE 4 +#define INSN16_SIZE 2 +#define RELAX_INST_NUM 3 + +/* For score5u : div/mul will pop warning message, mmu/alw/asw will pop error message. */ +#define BAD_ARGS _("bad arguments to instruction") +#define BAD_PC _("r15 not allowed here") +#define BAD_COND _("instruction is not conditional") +#define ERR_NO_ACCUM _("acc0 expected") +#define ERR_FOR_SCORE5U_MUL_DIV _("div / mul are reserved instructions") +#define ERR_FOR_SCORE5U_MMU _("This architecture doesn't support mmu") +#define ERR_FOR_SCORE5U_ATOMIC _("This architecture doesn't support atomic instruction") +#define LONG_LABEL_LEN _("the label length is longer than 1024"); +#define BAD_SKIP_COMMA BAD_ARGS +#define BAD_GARBAGE _("garbage following instruction"); + +#define skip_whitespace(str) while (*(str) == ' ') ++(str) + +/* The name of the readonly data section. */ +#define RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_aout_flavour \ + ? ".data" \ + : OUTPUT_FLAVOR == bfd_target_ecoff_flavour \ + ? ".rdata" \ + : OUTPUT_FLAVOR == bfd_target_coff_flavour \ + ? ".rdata" \ + : OUTPUT_FLAVOR == bfd_target_elf_flavour \ + ? ".rodata" \ + : (abort (), "")) + +#define RELAX_ENCODE(old, new, type, reloc1, reloc2, opt) \ + ((relax_substateT) \ + (((old) << 23) \ + | ((new) << 16) \ + | ((type) << 9) \ + | ((reloc1) << 5) \ + | ((reloc2) << 1) \ + | ((opt) ? 1 : 0))) + +#define RELAX_OLD(i) (((i) >> 23) & 0x7f) +#define RELAX_NEW(i) (((i) >> 16) & 0x7f) +#define RELAX_TYPE(i) (((i) >> 9) & 0x7f) +#define RELAX_RELOC1(i) ((valueT) ((i) >> 5) & 0xf) +#define RELAX_RELOC2(i) ((valueT) ((i) >> 1) & 0xf) +#define RELAX_OPT(i) ((i) & 1) +#define RELAX_OPT_CLEAR(i) ((i) & ~1) + +#define SET_INSN_ERROR(s) (inst.error = (s)) +#define INSN_IS_PCE_P(s) (strstr (str, "||") != NULL) + +#define GET_INSN_CLASS(type) (get_insn_class_from_type (type)) + +#define GET_INSN_SIZE(type) ((GET_INSN_CLASS (type) == INSN_CLASS_16) \ + ? INSN16_SIZE : INSN_SIZE) + +/* This array holds the chars that always start a comment. If the + pre-processor is disabled, these aren't very useful. */ +const char comment_chars[] = "#"; +const char line_comment_chars[] = "#"; +const char line_separator_chars[] = ";"; + +/* Chars that can be used to separate mant from exp in floating point numbers. */ +const char EXP_CHARS[] = "eE"; +const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; + +/* Used to contain constructed error messages. */ +static char err_msg[255]; + +fragS *score_fragp = 0; +static int fix_data_dependency = 0; +static int warn_fix_data_dependency = 1; +static int score7 = 1; +static int university_version = 0; + +static int in_my_get_expression = 0; + +#define USE_GLOBAL_POINTER_OPT 1 +#define SCORE_BI_ENDIAN + +/* Default, pop warning message when using r1. */ +static int nor1 = 1; + +/* Default will do instruction relax, -O0 will set g_opt = 0. */ +static unsigned int g_opt = 1; + +/* The size of the small data section. */ +static unsigned int g_switch_value = 8; + +#ifdef OBJ_ELF +/* Pre-defined "_GLOBAL_OFFSET_TABLE_" */ +symbolS *GOT_symbol; +#endif +static segT pdr_seg; + +enum score_pic_level score_pic = NO_PIC; + +#define INSN_NAME_LEN 16 +struct score_it +{ + char name[INSN_NAME_LEN]; + unsigned long instruction; + unsigned long relax_inst; + int size; + int relax_size; + enum score_insn_type type; + char str[MAX_LITERAL_POOL_SIZE]; + const char *error; + int bwarn; + char reg[INSN_NAME_LEN]; + struct + { + bfd_reloc_code_real_type type; + expressionS exp; + int pc_rel; + }reloc; +}; +struct score_it inst; + +typedef struct proc +{ + symbolS *isym; + unsigned long reg_mask; + unsigned long reg_offset; + unsigned long fpreg_mask; + unsigned long leaf; + unsigned long frame_offset; + unsigned long frame_reg; + unsigned long pc_reg; +} +procS; + +static procS cur_proc; +static procS *cur_proc_ptr; +static int numprocs; + +#define SCORE7_PIPELINE 7 +#define SCORE5_PIPELINE 5 +static int vector_size = SCORE7_PIPELINE; +struct score_it dependency_vector[SCORE7_PIPELINE]; + +/* Relax will need some padding for alignment. */ +#define RELAX_PAD_BYTE 3 + +/* Number of littlenums required to hold an extended precision number. For md_atof. */ +#define NUM_FLOAT_VALS 8 +#define MAX_LITTLENUMS 6 +LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS][MAX_LITTLENUMS]; + +/* Structure for a hash table entry for a register. */ +struct reg_entry +{ + const char *name; + int number; +}; + +static const struct reg_entry score_rn_table[] = +{ + {"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, + {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, + {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, + {"r12", 12}, {"r13", 13}, {"r14", 14}, {"r15", 15}, + {"r16", 16}, {"r17", 17}, {"r18", 18}, {"r19", 19}, + {"r20", 20}, {"r21", 21}, {"r22", 22}, {"r23", 23}, + {"r24", 24}, {"r25", 25}, {"r26", 26}, {"r27", 27}, + {"r28", 28}, {"r29", 29}, {"r30", 30}, {"r31", 31}, + {NULL, 0} +}; + +static const struct reg_entry score_srn_table[] = +{ + {"sr0", 0}, {"sr1", 1}, {"sr2", 2}, + {NULL, 0} +}; + +static const struct reg_entry score_crn_table[] = +{ + {"cr0", 0}, {"cr1", 1}, {"cr2", 2}, {"cr3", 3}, + {"cr4", 4}, {"cr5", 5}, {"cr6", 6}, {"cr7", 7}, + {"cr8", 8}, {"cr9", 9}, {"cr10", 10}, {"cr11", 11}, + {"cr12", 12}, {"cr13", 13}, {"cr14", 14}, {"cr15", 15}, + {"cr16", 16}, {"cr17", 17}, {"cr18", 18}, {"cr19", 19}, + {"cr20", 20}, {"cr21", 21}, {"cr22", 22}, {"cr23", 23}, + {"cr24", 24}, {"cr25", 25}, {"cr26", 26}, {"cr27", 27}, + {"cr28", 28}, {"cr29", 29}, {"cr30", 30}, {"cr31", 31}, + {NULL, 0} +}; + +struct reg_map +{ + const struct reg_entry *names; + int max_regno; + struct hash_control *htab; + const char *expected; +}; + +struct reg_map all_reg_maps[] = +{ + {score_rn_table, 31, NULL, N_("S+core register expected")}, + {score_srn_table, 2, NULL, N_("S+core special-register expected")}, + {score_crn_table, 31, NULL, N_("S+core co-processor register expected")}, +}; + +static struct hash_control *score_ops_hsh = NULL; + +static struct hash_control *dependency_insn_hsh = NULL; + +/* Enumeration matching entries in table above. */ +enum score_reg_type +{ + REG_TYPE_SCORE = 0, +#define REG_TYPE_FIRST REG_TYPE_SCORE + REG_TYPE_SCORE_SR = 1, + REG_TYPE_SCORE_CR = 2, + REG_TYPE_MAX = 3 +}; + +typedef struct literalS +{ + struct expressionS exp; + struct score_it *inst; +} +literalT; + +literalT literals[MAX_LITERAL_POOL_SIZE]; + +static void do_ldst_insn (char *); +static void do_crdcrscrsimm5 (char *); +static void do_ldst_unalign (char *); +static void do_ldst_atomic (char *); +static void do_ldst_cop (char *); +static void do_macro_li_rdi32 (char *); +static void do_macro_la_rdi32 (char *); +static void do_macro_rdi32hi (char *); +static void do_macro_rdi32lo (char *); +static void do_macro_mul_rdrsrs (char *); +static void do_macro_ldst_label (char *); +static void do_branch (char *); +static void do_jump (char *); +static void do_empty (char *); +static void do_rdrsrs (char *); +static void do_rdsi16 (char *); +static void do_rdrssi14 (char *); +static void do_sub_rdsi16 (char *); +static void do_sub_rdrssi14 (char *); +static void do_rdrsi5 (char *); +static void do_rdrsi14 (char *); +static void do_rdi16 (char *); +static void do_xrsi5 (char *); +static void do_rdrs (char *); +static void do_rdxrs (char *); +static void do_rsrs (char *); +static void do_rdcrs (char *); +static void do_rdsrs (char *); +static void do_rd (char *); +static void do_rs (char *); +static void do_i15 (char *); +static void do_xi5x (char *); +static void do_ceinst (char *); +static void do_cache (char *); +static void do16_rdrs (char *); +static void do16_rs (char *); +static void do16_xrs (char *); +static void do16_mv_rdrs (char *); +static void do16_hrdrs (char *); +static void do16_rdhrs (char *); +static void do16_rdi4 (char *); +static void do16_rdi5 (char *); +static void do16_xi5 (char *); +static void do16_ldst_insn (char *); +static void do16_ldst_imm_insn (char *); +static void do16_push_pop (char *); +static void do16_branch (char *); +static void do16_jump (char *); +static void do_rdi16_pic (char *); +static void do_addi_s_pic (char *); +static void do_addi_u_pic (char *); +static void do_lw_pic (char *); + +static const struct asm_opcode score_ldst_insns[] = +{ + {"lw", 0x20000000, 0x3e000000, 0x2008, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lw", 0x06000000, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lw", 0x0e000000, 0x3e000007, 0x200a, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"lh", 0x22000000, 0x3e000000, 0x2009, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lh", 0x06000001, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lh", 0x0e000001, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"lhu", 0x24000000, 0x3e000000, 0x8000, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lhu", 0x06000002, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lhu", 0x0e000002, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"lb", 0x26000000, 0x3e000000, 0x8000, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lb", 0x06000003, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lb", 0x0e000003, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"sw", 0x28000000, 0x3e000000, 0x200c, Rd_lvalueRs_SI15, do_ldst_insn}, + {"sw", 0x06000004, 0x3e000007, 0x200e, Rd_lvalueRs_preSI12, do_ldst_insn}, + {"sw", 0x0e000004, 0x3e000007, 0x8000, Rd_lvalueRs_postSI12, do_ldst_insn}, + {"sh", 0x2a000000, 0x3e000000, 0x200d, Rd_lvalueRs_SI15, do_ldst_insn}, + {"sh", 0x06000005, 0x3e000007, 0x8000, Rd_lvalueRs_preSI12, do_ldst_insn}, + {"sh", 0x0e000005, 0x3e000007, 0x8000, Rd_lvalueRs_postSI12, do_ldst_insn}, + {"lbu", 0x2c000000, 0x3e000000, 0x200b, Rd_rvalueRs_SI15, do_ldst_insn}, + {"lbu", 0x06000006, 0x3e000007, 0x8000, Rd_rvalueRs_preSI12, do_ldst_insn}, + {"lbu", 0x0e000006, 0x3e000007, 0x8000, Rd_rvalueRs_postSI12, do_ldst_insn}, + {"sb", 0x2e000000, 0x3e000000, 0x200f, Rd_lvalueRs_SI15, do_ldst_insn}, + {"sb", 0x06000007, 0x3e000007, 0x8000, Rd_lvalueRs_preSI12, do_ldst_insn}, + {"sb", 0x0e000007, 0x3e000007, 0x8000, Rd_lvalueRs_postSI12, do_ldst_insn}, +}; + +static const struct asm_opcode score_insns[] = +{ + {"abs", 0x3800000a, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"abs.s", 0x3800004b, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"add", 0x00000010, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"add.c", 0x00000011, 0x3e0003ff, 0x2000, Rd_Rs_Rs, do_rdrsrs}, + {"add.s", 0x38000048, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"addc", 0x00000012, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"addc.c", 0x00000013, 0x3e0003ff, 0x0009, Rd_Rs_Rs, do_rdrsrs}, + {"addi", 0x02000000, 0x3e0e0001, 0x8000, Rd_SI16, do_rdsi16}, + {"addi.c", 0x02000001, 0x3e0e0001, 0x8000, Rd_SI16, do_rdsi16}, + {"addis", 0x0a000000, 0x3e0e0001, 0x8000, Rd_SI16, do_rdi16}, + {"addis.c", 0x0a000001, 0x3e0e0001, 0x8000, Rd_SI16, do_rdi16}, + {"addri", 0x10000000, 0x3e000001, 0x8000, Rd_Rs_SI14, do_rdrssi14}, + {"addri.c", 0x10000001, 0x3e000001, 0x8000, Rd_Rs_SI14, do_rdrssi14}, + {"addc!", 0x0009, 0x700f, 0x00000013, Rd_Rs, do16_rdrs}, + {"add!", 0x2000, 0x700f, 0x00000011, Rd_Rs, do16_rdrs}, + {"addei!", 0x6000 , 0x7087, 0x02000001, Rd_I4, do16_rdi4}, + {"subi", 0x02000000, 0x3e0e0001, 0x8000, Rd_SI16, do_sub_rdsi16}, + {"subi.c", 0x02000001, 0x3e0e0001, 0x8000, Rd_SI16, do_sub_rdsi16}, + {"subri", 0x10000000, 0x3e000001, 0x8000, Rd_Rs_SI14, do_sub_rdrssi14}, + {"subri.c", 0x10000001, 0x3e000001, 0x8000, Rd_Rs_SI14, do_sub_rdrssi14}, + {"and", 0x00000020, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"and.c", 0x00000021, 0x3e0003ff, 0x2004, Rd_Rs_Rs, do_rdrsrs}, + {"andi", 0x02080000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andi.c", 0x02080001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andis", 0x0a080000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andis.c", 0x0a080001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"andri", 0x18000000, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"andri.c", 0x18000001, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"and!", 0x2004, 0x700f, 0x00000021, Rd_Rs, do16_rdrs}, + {"bcs", 0x08000000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bcc", 0x08000400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bcnz", 0x08003800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bcsl", 0x08000001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bccl", 0x08000401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bcnzl", 0x08003801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bcs!", 0x4000, 0x7f00, 0x08000000, PC_DISP8div2, do16_branch}, + {"bcc!", 0x4100, 0x7f00, 0x08000400, PC_DISP8div2, do16_branch}, + {"bcnz!", 0x4e00, 0x7f00, 0x08003800, PC_DISP8div2, do16_branch}, + {"beq", 0x08001000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"beql", 0x08001001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"beq!", 0x4400, 0x7f00, 0x08001000, PC_DISP8div2, do16_branch}, + {"bgtu", 0x08000800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bgt", 0x08001800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bge", 0x08002000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bgtul", 0x08000801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bgtl", 0x08001801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bgel", 0x08002001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bgtu!", 0x4200, 0x7f00, 0x08000800, PC_DISP8div2, do16_branch}, + {"bgt!", 0x4600, 0x7f00, 0x08001800, PC_DISP8div2, do16_branch}, + {"bge!", 0x4800, 0x7f00, 0x08002000, PC_DISP8div2, do16_branch}, + {"bitclr.c", 0x00000029, 0x3e0003ff, 0x6004, Rd_Rs_I5, do_rdrsi5}, + {"bitrev", 0x3800000c, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"bitset.c", 0x0000002b, 0x3e0003ff, 0x6005, Rd_Rs_I5, do_rdrsi5}, + {"bittst.c", 0x0000002d, 0x3e0003ff, 0x6006, x_Rs_I5, do_xrsi5}, + {"bittgl.c", 0x0000002f, 0x3e0003ff, 0x6007, Rd_Rs_I5, do_rdrsi5}, + {"bitclr!", 0x6004, 0x7007, 0x00000029, Rd_I5, do16_rdi5}, + {"bitset!", 0x6005, 0x7007, 0x0000002b, Rd_I5, do16_rdi5}, + {"bittst!", 0x6006, 0x7007, 0x0000002d, Rd_I5, do16_rdi5}, + {"bittgl!", 0x6007, 0x7007, 0x0000002f, Rd_I5, do16_rdi5}, + {"bleu", 0x08000c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"ble", 0x08001c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"blt", 0x08002400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bleul", 0x08000c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"blel", 0x08001c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bltl", 0x08002401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bl", 0x08003c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bleu!", 0x4300, 0x7f00, 0x08000c00, PC_DISP8div2, do16_branch}, + {"ble!", 0x4700, 0x7f00, 0x08001c00, PC_DISP8div2, do16_branch}, + {"blt!", 0x4900, 0x7f00, 0x08002400, PC_DISP8div2, do16_branch}, + {"bmi", 0x08002800, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bmil", 0x08002801, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bmi!", 0x00004a00, 0x00007f00, 0x08002800, PC_DISP8div2, do16_branch}, + {"bne", 0x08001400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bnel", 0x08001401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bne!", 0x4500, 0x7f00, 0x08001400, PC_DISP8div2, do16_branch}, + {"bpl", 0x08002c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bpll", 0x08002c01, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bpl!", 0x4b00, 0x7f00, 0x08002c00, PC_DISP8div2, do16_branch}, + {"brcs", 0x00000008, 0x3e007fff, 0x0004, x_Rs_x, do_rs}, + {"brcc", 0x00000408, 0x3e007fff, 0x0104, x_Rs_x, do_rs}, + {"brgtu", 0x00000808, 0x3e007fff, 0x0204, x_Rs_x, do_rs}, + {"brleu", 0x00000c08, 0x3e007fff, 0x0304, x_Rs_x, do_rs}, + {"breq", 0x00001008, 0x3e007fff, 0x0404, x_Rs_x, do_rs}, + {"brne", 0x00001408, 0x3e007fff, 0x0504, x_Rs_x, do_rs}, + {"brgt", 0x00001808, 0x3e007fff, 0x0604, x_Rs_x, do_rs}, + {"brle", 0x00001c08, 0x3e007fff, 0x0704, x_Rs_x, do_rs}, + {"brge", 0x00002008, 0x3e007fff, 0x0804, x_Rs_x, do_rs}, + {"brlt", 0x00002408, 0x3e007fff, 0x0904, x_Rs_x, do_rs}, + {"brmi", 0x00002808, 0x3e007fff, 0x0a04, x_Rs_x, do_rs}, + {"brpl", 0x00002c08, 0x3e007fff, 0x0b04, x_Rs_x, do_rs}, + {"brvs", 0x00003008, 0x3e007fff, 0x0c04, x_Rs_x, do_rs}, + {"brvc", 0x00003408, 0x3e007fff, 0x0d04, x_Rs_x, do_rs}, + {"brcnz", 0x00003808, 0x3e007fff, 0x0e04, x_Rs_x, do_rs}, + {"br", 0x00003c08, 0x3e007fff, 0x0f04, x_Rs_x, do_rs}, + {"brcsl", 0x00000009, 0x3e007fff, 0x000c, x_Rs_x, do_rs}, + {"brccl", 0x00000409, 0x3e007fff, 0x010c, x_Rs_x, do_rs}, + {"brgtul", 0x00000809, 0x3e007fff, 0x020c, x_Rs_x, do_rs}, + {"brleul", 0x00000c09, 0x3e007fff, 0x030c, x_Rs_x, do_rs}, + {"breql", 0x00001009, 0x3e007fff, 0x040c, x_Rs_x, do_rs}, + {"brnel", 0x00001409, 0x3e007fff, 0x050c, x_Rs_x, do_rs}, + {"brgtl", 0x00001809, 0x3e007fff, 0x060c, x_Rs_x, do_rs}, + {"brlel", 0x00001c09, 0x3e007fff, 0x070c, x_Rs_x, do_rs}, + {"brgel", 0x00002009, 0x3e007fff, 0x080c, x_Rs_x, do_rs}, + {"brltl", 0x00002409, 0x3e007fff, 0x090c, x_Rs_x, do_rs}, + {"brmil", 0x00002809, 0x3e007fff, 0x0a0c, x_Rs_x, do_rs}, + {"brpll", 0x00002c09, 0x3e007fff, 0x0b0c, x_Rs_x, do_rs}, + {"brvsl", 0x00003009, 0x3e007fff, 0x0c0c, x_Rs_x, do_rs}, + {"brvcl", 0x00003409, 0x3e007fff, 0x0d0c, x_Rs_x, do_rs}, + {"brcnzl", 0x00003809, 0x3e007fff, 0x0e0c, x_Rs_x, do_rs}, + {"brl", 0x00003c09, 0x3e007fff, 0x0f0c, x_Rs_x, do_rs}, + {"brcs!", 0x0004, 0x7f0f, 0x00000008, x_Rs, do16_xrs}, + {"brcc!", 0x0104, 0x7f0f, 0x00000408, x_Rs, do16_xrs}, + {"brgtu!", 0x0204, 0x7f0f, 0x00000808, x_Rs, do16_xrs}, + {"brleu!", 0x0304, 0x7f0f, 0x00000c08, x_Rs, do16_xrs}, + {"breq!", 0x0404, 0x7f0f, 0x00001008, x_Rs, do16_xrs}, + {"brne!", 0x0504, 0x7f0f, 0x00001408, x_Rs, do16_xrs}, + {"brgt!", 0x0604, 0x7f0f, 0x00001808, x_Rs, do16_xrs}, + {"brle!", 0x0704, 0x7f0f, 0x00001c08, x_Rs, do16_xrs}, + {"brge!", 0x0804, 0x7f0f, 0x00002008, x_Rs, do16_xrs}, + {"brlt!", 0x0904, 0x7f0f, 0x00002408, x_Rs, do16_xrs}, + {"brmi!", 0x0a04, 0x7f0f, 0x00002808, x_Rs, do16_xrs}, + {"brpl!", 0x0b04, 0x7f0f, 0x00002c08, x_Rs, do16_xrs}, + {"brvs!", 0x0c04, 0x7f0f, 0x00003008, x_Rs, do16_xrs}, + {"brvc!", 0x0d04, 0x7f0f, 0x00003408, x_Rs, do16_xrs}, + {"brcnz!", 0x0e04, 0x7f0f, 0x00003808, x_Rs, do16_xrs}, + {"br!", 0x0f04, 0x7f0f, 0x00003c08, x_Rs, do16_xrs}, + {"brcsl!", 0x000c, 0x7f0f, 0x00000009, x_Rs, do16_xrs}, + {"brccl!", 0x010c, 0x7f0f, 0x00000409, x_Rs, do16_xrs}, + {"brgtul!", 0x020c, 0x7f0f, 0x00000809, x_Rs, do16_xrs}, + {"brleul!", 0x030c, 0x7f0f, 0x00000c09, x_Rs, do16_xrs}, + {"breql!", 0x040c, 0x7f0f, 0x00001009, x_Rs, do16_xrs}, + {"brnel!", 0x050c, 0x7f0f, 0x00001409, x_Rs, do16_xrs}, + {"brgtl!", 0x060c, 0x7f0f, 0x00001809, x_Rs, do16_xrs}, + {"brlel!", 0x070c, 0x7f0f, 0x00001c09, x_Rs, do16_xrs}, + {"brgel!", 0x080c, 0x7f0f, 0x00002009, x_Rs, do16_xrs}, + {"brltl!", 0x090c, 0x7f0f, 0x00002409, x_Rs, do16_xrs}, + {"brmil!", 0x0a0c, 0x7f0f, 0x00002809, x_Rs, do16_xrs}, + {"brpll!", 0x0b0c, 0x7f0f, 0x00002c09, x_Rs, do16_xrs}, + {"brvsl!", 0x0c0c, 0x7f0f, 0x00003009, x_Rs, do16_xrs}, + {"brvcl!", 0x0d0c, 0x7f0f, 0x00003409, x_Rs, do16_xrs}, + {"brcnzl!", 0x0e0c, 0x7f0f, 0x00003809, x_Rs, do16_xrs}, + {"brl!", 0x0f0c, 0x7f0f, 0x00003c09, x_Rs, do16_xrs}, + {"bvs", 0x08003000, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bvc", 0x08003400, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"bvsl", 0x08003001, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bvcl", 0x08003401, 0x3e007c01, 0x8000, PC_DISP19div2, do_branch}, + {"bvs!", 0x4c00, 0x7f00, 0x08003000, PC_DISP8div2, do16_branch}, + {"bvc!", 0x4d00, 0x7f00, 0x08003400, PC_DISP8div2, do16_branch}, + {"b!", 0x4f00, 0x7f00, 0x08003c00, PC_DISP8div2, do16_branch}, + {"b", 0x08003c00, 0x3e007c01, 0x4000, PC_DISP19div2, do_branch}, + {"cache", 0x30000000, 0x3ff00000, 0x8000, OP5_rvalueRs_SI15, do_cache}, + {"ceinst", 0x38000000, 0x3e000000, 0x8000, I5_Rs_Rs_I5_OP5, do_ceinst}, + {"clz", 0x3800000d, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"cmpteq.c", 0x00000019, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"cmptmi.c", 0x00100019, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"cmp.c", 0x00300019, 0x3ff003ff, 0x2003, x_Rs_Rs, do_rsrs}, + {"cmpzteq.c", 0x0000001b, 0x3ff07fff, 0x8000, x_Rs_x, do_rs}, + {"cmpztmi.c", 0x0010001b, 0x3ff07fff, 0x8000, x_Rs_x, do_rs}, + {"cmpz.c", 0x0030001b, 0x3ff07fff, 0x8000, x_Rs_x, do_rs}, + {"cmpi.c", 0x02040001, 0x3e0e0001, 0x8000, Rd_SI16, do_rdsi16}, + {"cmp!", 0x2003, 0x700f, 0x00300019, Rd_Rs, do16_rdrs}, + {"cop1", 0x0c00000c, 0x3e00001f, 0x8000, Rd_Rs_Rs_imm, do_crdcrscrsimm5}, + {"cop2", 0x0c000014, 0x3e00001f, 0x8000, Rd_Rs_Rs_imm, do_crdcrscrsimm5}, + {"cop3", 0x0c00001c, 0x3e00001f, 0x8000, Rd_Rs_Rs_imm, do_crdcrscrsimm5}, + {"drte", 0x0c0000a4, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"extsb", 0x00000058, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extsb.c", 0x00000059, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extsh", 0x0000005a, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extsh.c", 0x0000005b, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzb", 0x0000005c, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzb.c", 0x0000005d, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzh", 0x0000005e, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"extzh.c", 0x0000005f, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"jl", 0x04000001, 0x3e000001, 0x8000, PC_DISP24div2, do_jump}, + {"jl!", 0x3001, 0x7001, 0x04000001, PC_DISP11div2, do16_jump}, + {"j!", 0x3000, 0x7001, 0x04000000, PC_DISP11div2, do16_jump}, + {"j", 0x04000000, 0x3e000001, 0x8000, PC_DISP24div2, do_jump}, + {"lbu!", 0x200b, 0x0000700f, 0x2c000000, Rd_rvalueRs, do16_ldst_insn}, + {"lbup!", 0x7003, 0x7007, 0x2c000000, Rd_rvalueBP_I5, do16_ldst_imm_insn}, + {"alw", 0x0000000c, 0x3e0003ff, 0x8000, Rd_rvalue32Rs, do_ldst_atomic}, + {"lcb", 0x00000060, 0x3e0003ff, 0x8000, x_rvalueRs_post4, do_ldst_unalign}, + {"lcw", 0x00000062, 0x3e0003ff, 0x8000, Rd_rvalueRs_post4, do_ldst_unalign}, + {"lce", 0x00000066, 0x3e0003ff, 0x8000, Rd_rvalueRs_post4, do_ldst_unalign}, + {"ldc1", 0x0c00000a, 0x3e00001f, 0x8000, Rd_rvalueRs_SI10, do_ldst_cop}, + {"ldc2", 0x0c000012, 0x3e00001f, 0x8000, Rd_rvalueRs_SI10, do_ldst_cop}, + {"ldc3", 0x0c00001a, 0x3e00001f, 0x8000, Rd_rvalueRs_SI10, do_ldst_cop}, + {"lh!", 0x2009, 0x700f, 0x22000000, Rd_rvalueRs, do16_ldst_insn}, + {"lhp!", 0x7001, 0x7007, 0x22000000, Rd_rvalueBP_I5, do16_ldst_imm_insn}, + {"ldi", 0x020c0000, 0x3e0e0000, 0x5000, Rd_SI16, do_rdsi16}, + {"ldis", 0x0a0c0000, 0x3e0e0000, 0x8000, Rd_I16, do_rdi16}, + {"ldiu!", 0x5000, 0x7000, 0x020c0000, Rd_I8, do16_ldst_imm_insn}, + {"lw!", 0x2008, 0x700f, 0x20000000, Rd_rvalueRs, do16_ldst_insn}, + {"lwp!", 0x7000, 0x7007, 0x20000000, Rd_rvalueBP_I5, do16_ldst_imm_insn}, + {"mfcel", 0x00000448, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mfcel!", 0x1001, 0x7f0f, 0x00000448, x_Rs, do16_rs}, + {"mad", 0x38000000, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mad.f!", 0x1004, 0x700f, 0x38000080, Rd_Rs, do16_rdrs}, + {"madh", 0x38000203, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madh.fs", 0x380002c3, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madh.fs!", 0x100b, 0x700f, 0x380002c3, Rd_Rs, do16_rdrs}, + {"madl", 0x38000002, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madl.fs", 0x380000c2, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madl.fs!", 0x100a, 0x700f, 0x380000c2, Rd_Rs, do16_rdrs}, + {"madu", 0x38000020, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"madu!", 0x1005, 0x700f, 0x38000020, Rd_Rs, do16_rdrs}, + {"mad.f", 0x38000080, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"max", 0x38000007, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"mazh", 0x38000303, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazh.f", 0x38000383, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazh.f!", 0x1009, 0x700f, 0x3800038c, Rd_Rs, do16_rdrs}, + {"mazl", 0x38000102, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazl.f", 0x38000182, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mazl.f!", 0x1008, 0x700f, 0x38000182, Rd_Rs, do16_rdrs}, + {"mfceh", 0x00000848, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mfceh!", 0x1101, 0x7f0f, 0x00000848, x_Rs, do16_rs}, + {"mfcehl", 0x00000c48, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mfsr", 0x00000050, 0x3e0003ff, 0x8000, Rd_x_I5, do_rdsrs}, + {"mfcr", 0x0c000001, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfc1", 0x0c000009, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfc2", 0x0c000011, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfc3", 0x0c000019, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfcc1", 0x0c00000f, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfcc2", 0x0c000017, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mfcc3", 0x0c00001f, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mhfl!", 0x0002, 0x700f, 0x00003c56, Rd_LowRs, do16_hrdrs}, + {"min", 0x38000006, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"mlfh!", 0x0001, 0x700f, 0x00003c56, Rd_HighRs, do16_rdhrs}, + {"msb", 0x38000001, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msb.f!", 0x1006, 0x700f, 0x38000081, Rd_Rs, do16_rdrs}, + {"msbh", 0x38000205, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbh.fs", 0x380002c5, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbh.fs!", 0x100f, 0x700f, 0x380002c5, Rd_Rs, do16_rdrs}, + {"msbl", 0x38000004, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbl.fs", 0x380000c4, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbl.fs!", 0x100e, 0x700f, 0x380000c4, Rd_Rs, do16_rdrs}, + {"msbu", 0x38000021, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"msbu!", 0x1007, 0x700f, 0x38000021, Rd_Rs, do16_rdrs}, + {"msb.f", 0x38000081, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszh", 0x38000305, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszh.f", 0x38000385, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszh.f!", 0x100d, 0x700f, 0x38000385, Rd_Rs, do16_rdrs}, + {"mszl", 0x38000104, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszl.f", 0x38000184, 0x3ff003ff, 0x8000, x_Rs_Rs, do_rsrs}, + {"mszl.f!", 0x100c, 0x700f, 0x38000184, Rd_Rs, do16_rdrs}, + {"mtcel!", 0x1000, 0x7f0f, 0x0000044a, x_Rs, do16_rs}, + {"mtcel", 0x0000044a, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mtceh", 0x0000084a, 0x3e007fff, 0x8000, Rd_x_x, do_rd}, + {"mtceh!", 0x1100, 0x7f0f, 0x0000084a, x_Rs, do16_rs}, + {"mtcehl", 0x00000c4a, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mtsr", 0x00000052, 0x3e0003ff, 0x8000, x_Rs_I5, do_rdsrs}, + {"mtcr", 0x0c000000, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtc1", 0x0c000008, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtc2", 0x0c000010, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtc3", 0x0c000018, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtcc1", 0x0c00000e, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtcc2", 0x0c000016, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mtcc3", 0x0c00001e, 0x3e00001f, 0x8000, Rd_Rs_x, do_rdcrs}, + {"mul.f!", 0x1002, 0x700f, 0x00000041, Rd_Rs, do16_rdrs}, + {"mulu!", 0x1003, 0x700f, 0x00000042, Rd_Rs, do16_rdrs}, + {"mvcs", 0x00000056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvcc", 0x00000456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvgtu", 0x00000856, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvleu", 0x00000c56, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mveq", 0x00001056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvne", 0x00001456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvgt", 0x00001856, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvle", 0x00001c56, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvge", 0x00002056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvlt", 0x00002456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvmi", 0x00002856, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvpl", 0x00002c56, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvvs", 0x00003056, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mvvc", 0x00003456, 0x3e007fff, 0x8000, Rd_Rs_x, do_rdrs}, + {"mv", 0x00003c56, 0x3e007fff, 0x0003, Rd_Rs_x, do_rdrs}, + {"mv!", 0x0003, 0x700f, 0x00003c56, Rd_Rs, do16_mv_rdrs}, + {"neg", 0x0000001e, 0x3e0003ff, 0x8000, Rd_x_Rs, do_rdxrs}, + {"neg.c", 0x0000001f, 0x3e0003ff, 0x2002, Rd_x_Rs, do_rdxrs}, + {"neg!", 0x2002, 0x700f, 0x0000001f, Rd_Rs, do16_rdrs}, + {"nop", 0x00000000, 0x3e0003ff, 0x0000, NO_OPD, do_empty}, + {"not", 0x00000024, 0x3e0003ff, 0x8000, Rd_Rs_x, do_rdrs}, + {"not.c", 0x00000025, 0x3e0003ff, 0x2006, Rd_Rs_x, do_rdrs}, + {"nop!", 0x0000, 0x700f, 0x00000000, NO16_OPD, do_empty}, + {"not!", 0x2006, 0x700f, 0x00000025, Rd_Rs, do16_rdrs}, + {"or", 0x00000022, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"or.c", 0x00000023, 0x3e0003ff, 0x2005, Rd_Rs_Rs, do_rdrsrs}, + {"ori", 0x020a0000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"ori.c", 0x020a0001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"oris", 0x0a0a0000, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"oris.c", 0x0a0a0001, 0x3e0e0001, 0x8000, Rd_I16, do_rdi16}, + {"orri", 0x1a000000, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"orri.c", 0x1a000001, 0x3e000001, 0x8000, Rd_Rs_I14, do_rdrsi14}, + {"or!", 0x2005, 0x700f, 0x00000023, Rd_Rs, do16_rdrs}, + {"pflush", 0x0000000a, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"pop!", 0x200a, 0x700f, 0x0e000000, Rd_rvalueRs, do16_push_pop}, + {"push!", 0x200e, 0x700f, 0x06000004, Rd_lvalueRs, do16_push_pop}, + {"ror", 0x00000038, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"ror.c", 0x00000039, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rorc.c", 0x0000003b, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rol", 0x0000003c, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rol.c", 0x0000003d, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rolc.c", 0x0000003f, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"rori", 0x00000078, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"rori.c", 0x00000079, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"roric.c", 0x0000007b, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"roli", 0x0000007c, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"roli.c", 0x0000007d, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"rolic.c", 0x0000007f, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"rte", 0x0c000084, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"sb!", 0x200f, 0x700f, 0x2e000000, Rd_lvalueRs, do16_ldst_insn}, + {"sbp!", 0x7007, 0x7007, 0x2e000000, Rd_lvalueBP_I5, do16_ldst_imm_insn}, + {"asw", 0x0000000e, 0x3e0003ff, 0x8000, Rd_lvalue32Rs, do_ldst_atomic}, + {"scb", 0x00000068, 0x3e0003ff, 0x8000, Rd_lvalueRs_post4, do_ldst_unalign}, + {"scw", 0x0000006a, 0x3e0003ff, 0x8000, Rd_lvalueRs_post4, do_ldst_unalign}, + {"sce", 0x0000006e, 0x3e0003ff, 0x8000, x_lvalueRs_post4, do_ldst_unalign}, + {"sdbbp", 0x00000006, 0x3e0003ff, 0x6002, x_I5_x, do_xi5x}, + {"sdbbp!", 0x6002, 0x7007, 0x00000006, Rd_I5, do16_xi5}, + {"sh!", 0x200d, 0x700f, 0x2a000000, Rd_lvalueRs, do16_ldst_insn}, + {"shp!", 0x7005, 0x7007, 0x2a000000, Rd_lvalueBP_I5, do16_ldst_imm_insn}, + {"sleep", 0x0c0000c4, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"sll", 0x00000030, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sll.c", 0x00000031, 0x3e0003ff, 0x0008, Rd_Rs_Rs, do_rdrsrs}, + {"sll.s", 0x3800004e, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"slli", 0x00000070, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"slli.c", 0x00000071, 0x3e0003ff, 0x6001, Rd_Rs_I5, do_rdrsi5}, + {"sll!", 0x0008, 0x700f, 0x00000031, Rd_Rs, do16_rdrs}, + {"slli!", 0x6001, 0x7007, 0x00000071, Rd_I5, do16_rdi5}, + {"srl", 0x00000034, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"srl.c", 0x00000035, 0x3e0003ff, 0x000a, Rd_Rs_Rs, do_rdrsrs}, + {"sra", 0x00000036, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sra.c", 0x00000037, 0x3e0003ff, 0x000b, Rd_Rs_Rs, do_rdrsrs}, + {"srli", 0x00000074, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"srli.c", 0x00000075, 0x3e0003ff, 0x6003, Rd_Rs_I5, do_rdrsi5}, + {"srai", 0x00000076, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"srai.c", 0x00000077, 0x3e0003ff, 0x8000, Rd_Rs_I5, do_rdrsi5}, + {"srl!", 0x000a, 0x700f, 0x00000035, Rd_Rs, do16_rdrs}, + {"sra!", 0x000b, 0x700f, 0x00000037, Rd_Rs, do16_rdrs}, + {"srli!", 0x6003, 0x7007, 0x00000075, Rd_Rs, do16_rdi5}, + {"stc1", 0x0c00000b, 0x3e00001f, 0x8000, Rd_lvalueRs_SI10, do_ldst_cop}, + {"stc2", 0x0c000013, 0x3e00001f, 0x8000, Rd_lvalueRs_SI10, do_ldst_cop}, + {"stc3", 0x0c00001b, 0x3e00001f, 0x8000, Rd_lvalueRs_SI10, do_ldst_cop}, + {"sub", 0x00000014, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sub.c", 0x00000015, 0x3e0003ff, 0x2001, Rd_Rs_Rs, do_rdrsrs}, + {"sub.s", 0x38000049, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"subc", 0x00000016, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"subc.c", 0x00000017, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"sub!", 0x2001, 0x700f, 0x00000015, Rd_Rs, do16_rdrs}, + {"subei!", 0x6080, 0x7087, 0x02000001, Rd_I4, do16_rdi4}, + {"sw!", 0x200c, 0x700f, 0x28000000, Rd_lvalueRs, do16_ldst_insn}, + {"swp!", 0x7004, 0x7007, 0x28000000, Rd_lvalueBP_I5, do16_ldst_imm_insn}, + {"syscall", 0x00000002, 0x3e0003ff, 0x8000, I15, do_i15}, + {"tcs", 0x00000054, 0x3e007fff, 0x0005, NO_OPD, do_empty}, + {"tcc", 0x00000454, 0x3e007fff, 0x0105, NO_OPD, do_empty}, + {"tcnz", 0x00003854, 0x3e007fff, 0x0e05, NO_OPD, do_empty}, + {"tcs!", 0x0005, 0x7f0f, 0x00000054, NO16_OPD, do_empty}, + {"tcc!", 0x0105, 0x7f0f, 0x00000454, NO16_OPD, do_empty}, + {"tcnz!", 0x0e05, 0x7f0f, 0x00003854, NO16_OPD, do_empty}, + {"teq", 0x00001054, 0x3e007fff, 0x0405, NO_OPD, do_empty}, + {"teq!", 0x0405, 0x7f0f, 0x00001054, NO16_OPD, do_empty}, + {"tgtu", 0x00000854, 0x3e007fff, 0x0205, NO_OPD, do_empty}, + {"tgt", 0x00001854, 0x3e007fff, 0x0605, NO_OPD, do_empty}, + {"tge", 0x00002054, 0x3e007fff, 0x0805, NO_OPD, do_empty}, + {"tgtu!", 0x0205, 0x7f0f, 0x00000854, NO16_OPD, do_empty}, + {"tgt!", 0x0605, 0x7f0f, 0x00001854, NO16_OPD, do_empty}, + {"tge!", 0x0805, 0x7f0f, 0x00002054, NO16_OPD, do_empty}, + {"tleu", 0x00000c54, 0x3e007fff, 0x0305, NO_OPD, do_empty}, + {"tle", 0x00001c54, 0x3e007fff, 0x0705, NO_OPD, do_empty}, + {"tlt", 0x00002454, 0x3e007fff, 0x0905, NO_OPD, do_empty}, + {"stlb", 0x0c000004, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"mftlb", 0x0c000024, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"mtptlb", 0x0c000044, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"mtrtlb", 0x0c000064, 0x3e0003ff, 0x8000, NO_OPD, do_empty}, + {"tleu!", 0x0305, 0x7f0f, 0x00000c54, NO16_OPD, do_empty}, + {"tle!", 0x0705, 0x7f0f, 0x00001c54, NO16_OPD, do_empty}, + {"tlt!", 0x0905, 0x7f0f, 0x00002454, NO16_OPD, do_empty}, + {"tmi", 0x00002854, 0x3e007fff, 0x0a05, NO_OPD, do_empty}, + {"tmi!", 0x0a05, 0x7f0f, 0x00002854, NO16_OPD, do_empty}, + {"tne", 0x00001454, 0x3e007fff, 0x0505, NO_OPD, do_empty}, + {"tne!", 0x0505, 0x7f0f, 0x00001454, NO16_OPD, do_empty}, + {"tpl", 0x00002c54, 0x3e007fff, 0x0b05, NO_OPD, do_empty}, + {"tpl!", 0x0b05, 0x7f0f, 0x00002c54, NO16_OPD, do_empty}, + {"trapcs", 0x00000004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapcc", 0x00000404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapgtu", 0x00000804, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapleu", 0x00000c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapeq", 0x00001004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapne", 0x00001404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapgt", 0x00001804, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"traple", 0x00001c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapge", 0x00002004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"traplt", 0x00002404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapmi", 0x00002804, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trappl", 0x00002c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapvs", 0x00003004, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trapvc", 0x00003404, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"trap", 0x00003c04, 0x3e007fff, 0x8000, x_I5_x, do_xi5x}, + {"tset", 0x00003c54, 0x3e007fff, 0x0f05, NO_OPD, do_empty}, + {"tset!", 0x0f05, 0x00007f0f, 0x00003c54, NO16_OPD, do_empty}, + {"tvs", 0x00003054, 0x3e007fff, 0x0c05, NO_OPD, do_empty}, + {"tvc", 0x00003454, 0x3e007fff, 0x0d05, NO_OPD, do_empty}, + {"tvs!", 0x0c05, 0x7f0f, 0x00003054, NO16_OPD, do_empty}, + {"tvc!", 0x0d05, 0x7f0f, 0x00003454, NO16_OPD, do_empty}, + {"xor", 0x00000026, 0x3e0003ff, 0x8000, Rd_Rs_Rs, do_rdrsrs}, + {"xor.c", 0x00000027, 0x3e0003ff, 0x2007, Rd_Rs_Rs, do_rdrsrs}, + {"xor!", 0x2007, 0x700f, 0x00000027, Rd_Rs, do16_rdrs}, + /* Macro instruction. */ + {"li", 0x020c0000, 0x3e0e0000, 0x8000, Insn_Type_SYN, do_macro_li_rdi32}, + /* la reg, imm32 -->(1) ldi reg, simm16 + (2) ldis reg, %HI(imm32) + ori reg, %LO(imm32) + + la reg, symbol -->(1) lis reg, %HI(imm32) + ori reg, %LO(imm32) */ + {"la", 0x020c0000, 0x3e0e0000, 0x8000, Insn_Type_SYN, do_macro_la_rdi32}, + {"div", 0x00000044, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"divu", 0x00000046, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"rem", 0x00000044, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"remu", 0x00000046, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mul", 0x00000040, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mulu", 0x00000042, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"maz", 0x00000040, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mazu", 0x00000042, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"mul.f", 0x00000041, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"maz.f", 0x00000041, 0x3e0003ff, 0x8000, Insn_Type_SYN, do_macro_mul_rdrsrs}, + {"lb", INSN_LB, 0x00000000, 0x8000, Insn_Type_SYN, do_macro_ldst_label}, + {"lbu", INSN_LBU, 0x00000000, 0x200b, Insn_Type_SYN, do_macro_ldst_label}, + {"lh", INSN_LH, 0x00000000, 0x2009, Insn_Type_SYN, do_macro_ldst_label}, + {"lhu", INSN_LHU, 0x00000000, 0x8000, Insn_Type_SYN, do_macro_ldst_label}, + {"lw", INSN_LW, 0x00000000, 0x2008, Insn_Type_SYN, do_macro_ldst_label}, + {"sb", INSN_SB, 0x00000000, 0x200f, Insn_Type_SYN, do_macro_ldst_label}, + {"sh", INSN_SH, 0x00000000, 0x200d, Insn_Type_SYN, do_macro_ldst_label}, + {"sw", INSN_SW, 0x00000000, 0x200c, Insn_Type_SYN, do_macro_ldst_label}, + /* Assembler use internal. */ + {"ld_i32hi", 0x0a0c0000, 0x3e0e0000, 0x8000, Insn_internal, do_macro_rdi32hi}, + {"ld_i32lo", 0x020a0000, 0x3e0e0001, 0x8000, Insn_internal, do_macro_rdi32lo}, + {"ldis_pic", 0x0a0c0000, 0x3e0e0000, 0x5000, Insn_internal, do_rdi16_pic}, + {"addi_s_pic",0x02000000, 0x3e0e0001, 0x8000, Insn_internal, do_addi_s_pic}, + {"addi_u_pic",0x02000000, 0x3e0e0001, 0x8000, Insn_internal, do_addi_u_pic}, + {"lw_pic", 0x20000000, 0x3e000000, 0x8000, Insn_internal, do_lw_pic}, +}; + +/* Next free entry in the pool. */ +int next_literal_pool_place = 0; + +/* Next literal pool number. */ +int lit_pool_num = 1; +symbolS *current_poolP = NULL; + + +static int +end_of_line (char *str) +{ + int retval = SUCCESS; + + skip_whitespace (str); + if (*str != '\0') + { + retval = (int) FAIL; + + if (!inst.error) + inst.error = BAD_GARBAGE; + } + + return retval; +} + +static int +score_reg_parse (char **ccp, struct hash_control *htab) +{ + char *start = *ccp; + char c; + char *p; + struct reg_entry *reg; + + p = start; + if (!ISALPHA (*p) || !is_name_beginner (*p)) + return (int) FAIL; + + c = *p++; + + while (ISALPHA (c) || ISDIGIT (c) || c == '_') + c = *p++; + + *--p = 0; + reg = (struct reg_entry *) hash_find (htab, start); + *p = c; + + if (reg) + { + *ccp = p; + return reg->number; + } + return (int) FAIL; +} + +/* If shift <= 0, only return reg. */ + +static int +reg_required_here (char **str, int shift, enum score_reg_type reg_type) +{ + static char buff[MAX_LITERAL_POOL_SIZE]; + int reg = (int) FAIL; + char *start = *str; + + if ((reg = score_reg_parse (str, all_reg_maps[reg_type].htab)) != (int) FAIL) + { + if (reg_type == REG_TYPE_SCORE) + { + if ((reg == 1) && (nor1 == 1) && (inst.bwarn == 0)) + { + as_warn (_("Using temp register(r1)")); + inst.bwarn = 1; + } + } + if (shift >= 0) + { + if (reg_type == REG_TYPE_SCORE_CR) + strcpy (inst.reg, score_crn_table[reg].name); + else if (reg_type == REG_TYPE_SCORE_SR) + strcpy (inst.reg, score_srn_table[reg].name); + else + strcpy (inst.reg, ""); + + inst.instruction |= reg << shift; + } + } + else + { + *str = start; + sprintf (buff, _("register expected, not '%.100s'"), start); + inst.error = buff; + } + + return reg; +} + +static int +skip_past_comma (char **str) +{ + char *p = *str; + char c; + int comma = 0; + + while ((c = *p) == ' ' || c == ',') + { + p++; + if (c == ',' && comma++) + { + inst.error = BAD_SKIP_COMMA; + return (int) FAIL; + } + } + + if ((c == '\0') || (comma == 0)) + { + inst.error = BAD_SKIP_COMMA; + return (int) FAIL; + } + + *str = p; + return comma ? SUCCESS : (int) FAIL; +} + +static void +do_rdrsrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + if ((((inst.instruction >> 15) & 0x10) == 0) + && (((inst.instruction >> 10) & 0x10) == 0) + && (((inst.instruction >> 20) & 0x10) == 0) + && (inst.relax_inst != 0x8000) + && (((inst.instruction >> 20) & 0xf) == ((inst.instruction >> 15) & 0xf))) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 4) + | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } +} + +static int +walk_no_bignums (symbolS * sp) +{ + if (symbol_get_value_expression (sp)->X_op == O_big) + return 1; + + if (symbol_get_value_expression (sp)->X_add_symbol) + return (walk_no_bignums (symbol_get_value_expression (sp)->X_add_symbol) + || (symbol_get_value_expression (sp)->X_op_symbol + && walk_no_bignums (symbol_get_value_expression (sp)->X_op_symbol))); + + return 0; +} + +static int +my_get_expression (expressionS * ep, char **str) +{ + char *save_in; + segT seg; + + save_in = input_line_pointer; + input_line_pointer = *str; + in_my_get_expression = 1; + seg = expression (ep); + in_my_get_expression = 0; + + if (ep->X_op == O_illegal) + { + *str = input_line_pointer; + input_line_pointer = save_in; + inst.error = _("illegal expression"); + return (int) FAIL; + } + /* Get rid of any bignums now, so that we don't generate an error for which + we can't establish a line number later on. Big numbers are never valid + in instructions, which is where this routine is always called. */ + if (ep->X_op == O_big + || (ep->X_add_symbol + && (walk_no_bignums (ep->X_add_symbol) + || (ep->X_op_symbol && walk_no_bignums (ep->X_op_symbol))))) + { + inst.error = _("invalid constant"); + *str = input_line_pointer; + input_line_pointer = save_in; + return (int) FAIL; + } + + if ((ep->X_add_symbol != NULL) + && (inst.type != PC_DISP19div2) + && (inst.type != PC_DISP8div2) + && (inst.type != PC_DISP24div2) + && (inst.type != PC_DISP11div2) + && (inst.type != Insn_Type_SYN) + && (inst.type != Rd_rvalueRs_SI15) + && (inst.type != Rd_lvalueRs_SI15) + && (inst.type != Insn_internal)) + { + inst.error = BAD_ARGS; + *str = input_line_pointer; + input_line_pointer = save_in; + return (int) FAIL; + } + + *str = input_line_pointer; + input_line_pointer = save_in; + return SUCCESS; +} + +/* Check if an immediate is valid. If so, convert it to the right format. */ + +static int +validate_immediate (int val, unsigned int data_type, int hex_p) +{ + switch (data_type) + { + case _VALUE_HI16: + { + int val_hi = ((val & 0xffff0000) >> 16); + + if (score_df_range[data_type].range[0] <= val_hi + && val_hi <= score_df_range[data_type].range[1]) + return val_hi; + } + break; + + case _VALUE_LO16: + { + int val_lo = (val & 0xffff); + + if (score_df_range[data_type].range[0] <= val_lo + && val_lo <= score_df_range[data_type].range[1]) + return val_lo; + } + break; + + case _VALUE: + return val; + break; + + case _SIMM14: + if (hex_p == 1) + { + if (!(val >= -0x2000 && val <= 0x3fff)) + { + return (int) FAIL; + } + } + else + { + if (!(val >= -8192 && val <= 8191)) + { + return (int) FAIL; + } + } + + return val; + break; + + case _SIMM16_NEG: + if (hex_p == 1) + { + if (!(val >= -0x7fff && val <= 0xffff && val != 0x8000)) + { + return (int) FAIL; + } + } + else + { + if (!(val >= -32767 && val <= 32768)) + { + return (int) FAIL; + } + } + + val = -val; + return val; + break; + + default: + if (data_type == _SIMM14_NEG || data_type == _IMM16_NEG) + val = -val; + + if (score_df_range[data_type].range[0] <= val + && val <= score_df_range[data_type].range[1]) + return val; + + break; + } + + return (int) FAIL; +} + +static int +data_op2 (char **str, int shift, enum score_data_type data_type) +{ + int value; + char data_exp[MAX_LITERAL_POOL_SIZE]; + char *dataptr; + int cnt = 0; + char *pp = NULL; + + skip_whitespace (*str); + inst.error = NULL; + dataptr = * str; + + /* Set hex_p to zero. */ + int hex_p = 0; + + while ((*dataptr != '\0') && (*dataptr != '|') && (cnt <= MAX_LITERAL_POOL_SIZE)) /* 0x7c = ='|' */ + { + data_exp[cnt] = *dataptr; + dataptr++; + cnt++; + } + + data_exp[cnt] = '\0'; + pp = (char *)&data_exp; + + if (*dataptr == '|') /* process PCE */ + { + if (my_get_expression (&inst.reloc.exp, &pp) == (int) FAIL) + return (int) FAIL; + end_of_line (pp); + if (inst.error != 0) + return (int) FAIL; /* to ouptut_inst to printf out the error */ + *str = dataptr; + } + else /* process 16 bit */ + { + if (my_get_expression (&inst.reloc.exp, str) == (int) FAIL) + { + return (int) FAIL; + } + + dataptr = (char *)data_exp; + for (; *dataptr != '\0'; dataptr++) + { + *dataptr = TOLOWER (*dataptr); + if (*dataptr == '!' || *dataptr == ' ') + break; + } + dataptr = (char *)data_exp; + + if ((dataptr != NULL) + && (((strstr (dataptr, "0x")) != NULL) + || ((strstr (dataptr, "0X")) != NULL))) + { + hex_p = 1; + if ((data_type != _SIMM16_LA) + && (data_type != _VALUE_HI16) + && (data_type != _VALUE_LO16) + && (data_type != _IMM16) + && (data_type != _IMM15) + && (data_type != _IMM14) + && (data_type != _IMM4) + && (data_type != _IMM5) + && (data_type != _IMM8) + && (data_type != _IMM5_RSHIFT_1) + && (data_type != _IMM5_RSHIFT_2) + && (data_type != _SIMM14) + && (data_type != _SIMM14_NEG) + && (data_type != _SIMM16_NEG) + && (data_type != _IMM10_RSHIFT_2) + && (data_type != _GP_IMM15)) + { + data_type += 24; + } + } + + if ((inst.reloc.exp.X_add_number == 0) + && (inst.type != Insn_Type_SYN) + && (inst.type != Rd_rvalueRs_SI15) + && (inst.type != Rd_lvalueRs_SI15) + && (inst.type != Insn_internal) + && (((*dataptr >= 'a') && (*dataptr <= 'z')) + || ((*dataptr == '0') && (*(dataptr + 1) == 'x') && (*(dataptr + 2) != '0')) + || ((*dataptr == '+') && (*(dataptr + 1) != '0')) + || ((*dataptr == '-') && (*(dataptr + 1) != '0')))) + { + inst.error = BAD_ARGS; + return (int) FAIL; + } + } + + if ((inst.reloc.exp.X_add_symbol) + && ((data_type == _SIMM16) + || (data_type == _SIMM16_NEG) + || (data_type == _IMM16_NEG) + || (data_type == _SIMM14) + || (data_type == _SIMM14_NEG) + || (data_type == _IMM5) + || (data_type == _IMM14) + || (data_type == _IMM20) + || (data_type == _IMM16) + || (data_type == _IMM15) + || (data_type == _IMM4))) + { + inst.error = BAD_ARGS; + return (int) FAIL; + } + + if (inst.reloc.exp.X_add_symbol) + { + switch (data_type) + { + case _SIMM16_LA: + return (int) FAIL; + case _VALUE_HI16: + inst.reloc.type = BFD_RELOC_HI16_S; + inst.reloc.pc_rel = 0; + break; + case _VALUE_LO16: + inst.reloc.type = BFD_RELOC_LO16; + inst.reloc.pc_rel = 0; + break; + case _GP_IMM15: + inst.reloc.type = BFD_RELOC_SCORE_GPREL15; + inst.reloc.pc_rel = 0; + break; + case _SIMM16_pic: + case _IMM16_LO16_pic: + inst.reloc.type = BFD_RELOC_SCORE_GOT_LO16; + inst.reloc.pc_rel = 0; + break; + default: + inst.reloc.type = BFD_RELOC_32; + inst.reloc.pc_rel = 0; + break; + } + } + else + { + if (data_type == _IMM16_pic) + { + inst.reloc.type = BFD_RELOC_SCORE_DUMMY_HI16; + inst.reloc.pc_rel = 0; + } + + if (data_type == _SIMM16_LA && inst.reloc.exp.X_unsigned == 1) + { + value = validate_immediate (inst.reloc.exp.X_add_number, _SIMM16_LA_POS, hex_p); + if (value == (int) FAIL) /* for advance to check if this is ldis */ + if ((inst.reloc.exp.X_add_number & 0xffff) == 0) + { + inst.instruction |= 0x8000000; + inst.instruction |= ((inst.reloc.exp.X_add_number >> 16) << 1) & 0x1fffe; + return SUCCESS; + } + } + else + { + value = validate_immediate (inst.reloc.exp.X_add_number, data_type, hex_p); + } + + if (value == (int) FAIL) + { + if ((data_type != _SIMM14_NEG) && (data_type != _SIMM16_NEG) && (data_type != _IMM16_NEG)) + { + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + score_df_range[data_type].range[0], score_df_range[data_type].range[1]); + } + else + { + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + -score_df_range[data_type].range[1], -score_df_range[data_type].range[0]); + } + + inst.error = err_msg; + return (int) FAIL; + } + + if ((score_df_range[data_type].range[0] != 0) || (data_type == _IMM5_RANGE_8_31)) + { + value &= (1 << score_df_range[data_type].bits) - 1; + } + + inst.instruction |= value << shift; + } + + if ((inst.instruction & 0xf0000000) == 0x30000000) + { + if ((((inst.instruction >> 20) & 0x1F) != 0) + && (((inst.instruction >> 20) & 0x1F) != 1) + && (((inst.instruction >> 20) & 0x1F) != 2) + && (((inst.instruction >> 20) & 0x1F) != 3) + && (((inst.instruction >> 20) & 0x1F) != 4) + && (((inst.instruction >> 20) & 0x1F) != 8) + && (((inst.instruction >> 20) & 0x1F) != 9) + && (((inst.instruction >> 20) & 0x1F) != 0xa) + && (((inst.instruction >> 20) & 0x1F) != 0xb) + && (((inst.instruction >> 20) & 0x1F) != 0xc) + && (((inst.instruction >> 20) & 0x1F) != 0xd) + && (((inst.instruction >> 20) & 0x1F) != 0xe) + && (((inst.instruction >> 20) & 0x1F) != 0x10) + && (((inst.instruction >> 20) & 0x1F) != 0x11) + && (((inst.instruction >> 20) & 0x1F) != 0x18) + && (((inst.instruction >> 20) & 0x1F) != 0x1A) + && (((inst.instruction >> 20) & 0x1F) != 0x1B) + && (((inst.instruction >> 20) & 0x1F) != 0x1d) + && (((inst.instruction >> 20) & 0x1F) != 0x1e) + && (((inst.instruction >> 20) & 0x1F) != 0x1f)) + { + inst.error = _("invalid constant: bit expression not defined"); + return (int) FAIL; + } + } + + return SUCCESS; +} + +/* Handle addi/addi.c/addis.c/cmpi.c/addis.c/ldi. */ + +static void +do_rdsi16 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 1, _SIMM16) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + /* ldi. */ + if ((inst.instruction & 0x20c0000) == 0x20c0000) + { + if ((((inst.instruction >> 20) & 0x10) == 0x10) || ((inst.instruction & 0x1fe00) != 0)) + { + inst.relax_inst = 0x8000; + } + else + { + inst.relax_inst |= (inst.instruction >> 1) & 0xff; + inst.relax_inst |= (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + } + else if (((inst.instruction >> 20) & 0x10) == 0x10) + { + inst.relax_inst = 0x8000; + } +} + +/* Handle subi/subi.c. */ + +static void +do_sub_rdsi16 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _SIMM16_NEG) != (int) FAIL) + end_of_line (str); +} + +/* Handle addri/addri.c. */ + +static void +do_rdrssi14 (char *str) /* -(2^13)~((2^13)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + data_op2 (&str, 1, _SIMM14); +} + +/* Handle subri.c/subri. */ +static void +do_sub_rdrssi14 (char *str) /* -(2^13)~((2^13)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _SIMM14_NEG) != (int) FAIL) + end_of_line (str); +} + +/* Handle bitclr.c/bitset.c/bittgl.c/slli.c/srai.c/srli.c/roli.c/rori.c/rolic.c. */ +static void +do_rdrsi5 (char *str) /* 0~((2^14)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 10, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((((inst.instruction >> 20) & 0x1f) == ((inst.instruction >> 15) & 0x1f)) + && (inst.relax_inst != 0x8000) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0x1f) << 3) | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +/* Handle andri/orri/andri.c/orri.c. */ + +static void +do_rdrsi14 (char *str) /* 0 ~ ((2^14)-1) */ +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _IMM14) != (int) FAIL) + end_of_line (str); +} + +/* Handle bittst.c. */ +static void +do_xrsi5 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 10, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0x1f) << 3) | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +/* Handle addis/andi/ori/andis/oris/ldis. */ +static void +do_rdi16 (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 1, _IMM16) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + /* + if (((inst.instruction & 0xa0dfffe) != 0xa0c0000) || ((((inst.instruction >> 20) & 0x1f) & 0x10) == 0x10)) + inst.relax_inst = 0x8000; + else + inst.relax_size = 2; + */ +} + +static void +do_macro_rdi32hi (char *str) +{ + skip_whitespace (str); + + /* Do not handle end_of_line(). */ + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + data_op2 (&str, 1, _VALUE_HI16); +} + +static void +do_macro_rdi32lo (char *str) +{ + skip_whitespace (str); + + /* Do not handle end_of_line(). */ + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + data_op2 (&str, 1, _VALUE_LO16); +} + +/* Handle ldis_pic. */ + +static void +do_rdi16_pic (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _IMM16_pic) != (int) FAIL) + end_of_line (str); +} + +/* Handle addi_s_pic to generate R_SCORE_GOT_LO16 . */ + +static void +do_addi_s_pic (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _SIMM16_pic) != (int) FAIL) + end_of_line (str); +} + +/* Handle addi_u_pic to generate R_SCORE_GOT_LO16 . */ + +static void +do_addi_u_pic (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && data_op2 (&str, 1, _IMM16_LO16_pic) != (int) FAIL) + end_of_line (str); +} + +/* Handle mfceh/mfcel/mtceh/mtchl. */ + +static void +do_rd (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL) + end_of_line (str); +} + +static void +do_rs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 8) | (((inst.instruction >> 15) & 0xf) << 4); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +static void +do_i15 (char *str) +{ + skip_whitespace (str); + + if (data_op2 (&str, 10, _IMM15) != (int) FAIL) + end_of_line (str); +} + +static void +do_xi5x (char *str) +{ + skip_whitespace (str); + + if (data_op2 (&str, 15, _IMM5) == (int) FAIL || end_of_line (str) == (int) FAIL) + return; + + if (inst.relax_inst != 0x8000) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0x1f) << 3); + inst.relax_size = 2; + } +} + +static void +do_rdrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if (inst.relax_inst != 0x8000) + { + if (((inst.instruction & 0x7f) == 0x56)) /* adjust mv -> mv! / mlfh! / mhfl! */ + { + /* mlfh */ + if ((((inst.instruction >> 15) & 0x10) != 0x0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst = 0x00000001 | (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* mhfl */ + else if ((((inst.instruction >> 15) & 0x10) == 0x0) && ((inst.instruction >> 20) & 0x10) != 0) + { + inst.relax_inst = 0x00000002 | (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else if ((((inst.instruction >> 15) & 0x10) == 0x0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else if ((((inst.instruction >> 15) & 0x10) == 0x0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } +} + +/* Handle mfcr/mtcr. */ +static void +do_rdcrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 15, REG_TYPE_SCORE_CR) != (int) FAIL) + end_of_line (str); +} + +/* Handle mfsr/mtsr. */ + +static void +do_rdsrs (char *str) +{ + skip_whitespace (str); + + /* mfsr */ + if ((inst.instruction & 0xff) == 0x50) + { + if (reg_required_here (&str, 20, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reg_required_here (&str, 10, REG_TYPE_SCORE_SR) != (int) FAIL) + end_of_line (str); + } + else + { + if (reg_required_here (&str, 15, REG_TYPE_SCORE) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL) + reg_required_here (&str, 10, REG_TYPE_SCORE_SR); + } +} + +/* Handle neg. */ + +static void +do_rdxrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 10) & 0x10) == 0) + && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 4) | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +/* Handle cmp.c/cmp. */ +static void +do_rsrs (char *str) +{ + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if ((inst.relax_inst != 0x8000) && (((inst.instruction >> 20) & 0x1f) == 3) + && (((inst.instruction >> 10) & 0x10) == 0) && (((inst.instruction >> 15) & 0x10) == 0)) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 4) | (((inst.instruction >> 15) & 0xf) << 8); + inst.relax_size = 2; + } + else + inst.relax_inst = 0x8000; +} + +static void +do_ceinst (char *str) +{ + char *strbak; + + strbak = str; + skip_whitespace (str); + + if (data_op2 (&str, 20, _IMM5) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 5, _IMM5) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 0, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + str = strbak; + if (data_op2 (&str, 0, _IMM25) == (int) FAIL) + return; + } +} + +static int +reglow_required_here (char **str, int shift) +{ + static char buff[MAX_LITERAL_POOL_SIZE]; + int reg; + char *start = *str; + + if ((reg = score_reg_parse (str, all_reg_maps[REG_TYPE_SCORE].htab)) != (int) FAIL) + { + if ((reg == 1) && (nor1 == 1) && (inst.bwarn == 0)) + { + as_warn (_("Using temp register(r1)")); + inst.bwarn = 1; + } + if (reg < 16) + { + if (shift >= 0) + inst.instruction |= reg << shift; + + return reg; + } + } + + /* Restore the start point, we may have got a reg of the wrong class. */ + *str = start; + sprintf (buff, _("low register(r0-r15)expected, not '%.100s'"), start); + inst.error = buff; + return (int) FAIL; +} + +/* Handle addc!/add!/and!/cmp!/neg!/not!/or!/sll!/srl!/sra!/xor!/sub!. */ +static void +do16_rdrs (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reglow_required_here (&str, 4) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + if ((inst.instruction & 0x700f) == 0x2003) /* cmp! */ + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 15) + | (((inst.instruction >> 4) & 0xf) << 10); + } + else if ((inst.instruction & 0x700f) == 0x2006) /* not! */ + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0xf) << 15); + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 8) & 0xf) << 15) | (((inst.instruction >> 4) & 0xf) << 10); + } + inst.relax_size = 4; + } +} + +static void +do16_rs (char *str) +{ + int rd = 0; + + skip_whitespace (str); + + if ((rd = reglow_required_here (&str, 4)) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + inst.relax_inst |= rd << 20; + inst.relax_size = 4; + } +} + +/* Handle br!/brl!. */ +static void +do16_xrs (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 4) == (int) FAIL || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 10) + | (((inst.instruction >> 4) & 0xf) << 15); + inst.relax_size = 4; + } +} + +static int +reghigh_required_here (char **str, int shift) +{ + static char buff[MAX_LITERAL_POOL_SIZE]; + int reg; + char *start = *str; + + if ((reg = score_reg_parse (str, all_reg_maps[REG_TYPE_SCORE].htab)) != (int) FAIL) + { + if (15 < reg && reg < 32) + { + if (shift >= 0) + inst.instruction |= (reg & 0xf) << shift; + + return reg; + } + } + + *str = start; + sprintf (buff, _("high register(r16-r31)expected, not '%.100s'"), start); + inst.error = buff; + return (int) FAIL; +} + +/* Handle mhfl!. */ +static void +do16_hrdrs (char *str) +{ + skip_whitespace (str); + + if (reghigh_required_here (&str, 8) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reglow_required_here (&str, 4) != (int) FAIL + && end_of_line (str) != (int) FAIL) + { + inst.relax_inst |= ((((inst.instruction >> 8) & 0xf) | 0x10) << 20) + | (((inst.instruction >> 4) & 0xf) << 15) | (0xf << 10); + inst.relax_size = 4; + } +} + +/* Handle mlfh!. */ +static void +do16_rdhrs (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) != (int) FAIL + && skip_past_comma (&str) != (int) FAIL + && reghigh_required_here (&str, 4) != (int) FAIL + && end_of_line (str) != (int) FAIL) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | ((((inst.instruction >> 4) & 0xf) | 0x10) << 15) | (0xf << 10); + inst.relax_size = 4; + } +} + +/* We need to be able to fix up arbitrary expressions in some statements. + This is so that we can handle symbols that are an arbitrary distance from + the pc. The most common cases are of the form ((+/-sym -/+ . - 8) & mask), + which returns part of an address in a form which will be valid for + a data instruction. We do this by pushing the expression into a symbol + in the expr_section, and creating a fix for that. */ +static fixS * +fix_new_score (fragS * frag, int where, short int size, expressionS * exp, int pc_rel, int reloc) +{ + fixS *new_fix; + + switch (exp->X_op) + { + case O_constant: + case O_symbol: + case O_add: + case O_subtract: + new_fix = fix_new_exp (frag, where, size, exp, pc_rel, reloc); + break; + default: + new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0, pc_rel, reloc); + break; + } + return new_fix; +} + +static void +init_dependency_vector (void) +{ + int i; + + for (i = 0; i < vector_size; i++) + memset (&dependency_vector[i], '\0', sizeof (dependency_vector[i])); + + return; +} + +static enum insn_type_for_dependency +dependency_type_from_insn (char *insn_name) +{ + char name[INSN_NAME_LEN]; + const struct insn_to_dependency *tmp; + + strcpy (name, insn_name); + tmp = (const struct insn_to_dependency *) hash_find (dependency_insn_hsh, name); + + if (tmp) + return tmp->type; + + return D_all_insn; +} + +static int +check_dependency (char *pre_insn, char *pre_reg, + char *cur_insn, char *cur_reg, int *warn_or_error) +{ + int bubbles = 0; + unsigned int i; + enum insn_type_for_dependency pre_insn_type; + enum insn_type_for_dependency cur_insn_type; + + pre_insn_type = dependency_type_from_insn (pre_insn); + cur_insn_type = dependency_type_from_insn (cur_insn); + + for (i = 0; i < sizeof (data_dependency_table) / sizeof (data_dependency_table[0]); i++) + { + if ((pre_insn_type == data_dependency_table[i].pre_insn_type) + && (D_all_insn == data_dependency_table[i].cur_insn_type + || cur_insn_type == data_dependency_table[i].cur_insn_type) + && (strcmp (data_dependency_table[i].pre_reg, "") == 0 + || strcmp (data_dependency_table[i].pre_reg, pre_reg) == 0) + && (strcmp (data_dependency_table[i].cur_reg, "") == 0 + || strcmp (data_dependency_table[i].cur_reg, cur_reg) == 0)) + { + bubbles = (score7) ? data_dependency_table[i].bubblenum_7 : data_dependency_table[i].bubblenum_5; + *warn_or_error = data_dependency_table[i].warn_or_error; + break; + } + } + + return bubbles; +} + +static void +build_one_frag (struct score_it one_inst) +{ + char *p; + int relaxable_p = g_opt; + int relax_size = 0; + + /* Start a new frag if frag_now is not empty. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + frag_wane (frag_now); + + frag_new (0); + } + frag_grow (20); + + p = frag_more (one_inst.size); + md_number_to_chars (p, one_inst.instruction, one_inst.size); + +#ifdef OBJ_ELF + dwarf2_emit_insn (one_inst.size); +#endif + + relaxable_p &= (one_inst.relax_size != 0); + relax_size = relaxable_p ? one_inst.relax_size : 0; + + p = frag_var (rs_machine_dependent, relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (one_inst.size, one_inst.relax_size, + one_inst.type, 0, 0, relaxable_p), + NULL, 0, NULL); + + if (relaxable_p) + md_number_to_chars (p, one_inst.relax_inst, relax_size); +} + +static void +handle_dependency (struct score_it *theinst) +{ + int i; + int warn_or_error = 0; /* warn - 0; error - 1 */ + int bubbles = 0; + int remainder_bubbles = 0; + char cur_insn[INSN_NAME_LEN]; + char pre_insn[INSN_NAME_LEN]; + struct score_it nop_inst; + struct score_it pflush_inst; + + nop_inst.instruction = 0x0000; + nop_inst.size = 2; + nop_inst.relax_inst = 0x80008000; + nop_inst.relax_size = 4; + nop_inst.type = NO16_OPD; + + pflush_inst.instruction = 0x8000800a; + pflush_inst.size = 4; + pflush_inst.relax_inst = 0x8000; + pflush_inst.relax_size = 0; + pflush_inst.type = NO_OPD; + + /* pflush will clear all data dependency. */ + if (strcmp (theinst->name, "pflush") == 0) + { + init_dependency_vector (); + return; + } + + /* Push current instruction to dependency_vector[0]. */ + for (i = vector_size - 1; i > 0; i--) + memcpy (&dependency_vector[i], &dependency_vector[i - 1], sizeof (dependency_vector[i])); + + memcpy (&dependency_vector[0], theinst, sizeof (dependency_vector[i])); + + /* There is no dependency between nop and any instruction. */ + if (strcmp (dependency_vector[0].name, "nop") == 0 + || strcmp (dependency_vector[0].name, "nop!") == 0) + return; + + /* "pce" is defined in insn_to_dependency_table. */ +#define PCE_NAME "pce" + + if (dependency_vector[0].type == Insn_Type_PCE) + strcpy (cur_insn, PCE_NAME); + else + strcpy (cur_insn, dependency_vector[0].name); + + for (i = 1; i < vector_size; i++) + { + /* The element of dependency_vector is NULL. */ + if (dependency_vector[i].name[0] == '\0') + continue; + + if (dependency_vector[i].type == Insn_Type_PCE) + strcpy (pre_insn, PCE_NAME); + else + strcpy (pre_insn, dependency_vector[i].name); + + bubbles = check_dependency (pre_insn, dependency_vector[i].reg, + cur_insn, dependency_vector[0].reg, &warn_or_error); + remainder_bubbles = bubbles - i + 1; + + if (remainder_bubbles > 0) + { + int j; + + if (fix_data_dependency == 1) + { + if (remainder_bubbles <= 2) + { + if (warn_fix_data_dependency) + as_warn (_("Fix data dependency: %s %s -- %s %s (insert %d nop!/%d)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + remainder_bubbles, bubbles); + + for (j = (vector_size - 1); (j - remainder_bubbles) > 0; j--) + memcpy (&dependency_vector[j], &dependency_vector[j - remainder_bubbles], + sizeof (dependency_vector[j])); + + for (j = 1; j <= remainder_bubbles; j++) + { + memset (&dependency_vector[j], '\0', sizeof (dependency_vector[j])); + /* Insert nop!. */ + build_one_frag (nop_inst); + } + } + else + { + if (warn_fix_data_dependency) + as_warn (_("Fix data dependency: %s %s -- %s %s (insert 1 pflush/%d)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + bubbles); + + for (j = 1; j < vector_size; j++) + memset (&dependency_vector[j], '\0', sizeof (dependency_vector[j])); + + /* Insert pflush. */ + build_one_frag (pflush_inst); + } + } + else + { + if (warn_or_error) + { + as_bad (_("data dependency: %s %s -- %s %s (%d/%d bubble)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + remainder_bubbles, bubbles); + } + else + { + as_warn (_("data dependency: %s %s -- %s %s (%d/%d bubble)"), + dependency_vector[i].name, dependency_vector[i].reg, + dependency_vector[0].name, dependency_vector[0].reg, + remainder_bubbles, bubbles); + } + } + } + } +} + +static enum insn_class +get_insn_class_from_type (enum score_insn_type type) +{ + enum insn_class retval = (int) FAIL; + + switch (type) + { + case Rd_I4: + case Rd_I5: + case Rd_rvalueBP_I5: + case Rd_lvalueBP_I5: + case Rd_I8: + case PC_DISP8div2: + case PC_DISP11div2: + case Rd_Rs: + case Rd_HighRs: + case Rd_lvalueRs: + case Rd_rvalueRs: + case x_Rs: + case Rd_LowRs: + case NO16_OPD: + retval = INSN_CLASS_16; + break; + case Rd_Rs_I5: + case x_Rs_I5: + case x_I5_x: + case Rd_Rs_I14: + case I15: + case Rd_I16: + case Rd_SI16: + case Rd_rvalueRs_SI10: + case Rd_lvalueRs_SI10: + case Rd_rvalueRs_preSI12: + case Rd_rvalueRs_postSI12: + case Rd_lvalueRs_preSI12: + case Rd_lvalueRs_postSI12: + case Rd_Rs_SI14: + case Rd_rvalueRs_SI15: + case Rd_lvalueRs_SI15: + case PC_DISP19div2: + case PC_DISP24div2: + case Rd_Rs_Rs: + case x_Rs_x: + case x_Rs_Rs: + case Rd_Rs_x: + case Rd_x_Rs: + case Rd_x_x: + case OP5_rvalueRs_SI15: + case I5_Rs_Rs_I5_OP5: + case x_rvalueRs_post4: + case Rd_rvalueRs_post4: + case Rd_x_I5: + case Rd_lvalueRs_post4: + case x_lvalueRs_post4: + case Rd_Rs_Rs_imm: + case NO_OPD: + case Rd_lvalue32Rs: + case Rd_rvalue32Rs: + case Insn_GP: + case Insn_PIC: + case Insn_internal: + retval = INSN_CLASS_32; + break; + case Insn_Type_PCE: + retval = INSN_CLASS_PCE; + break; + case Insn_Type_SYN: + retval = INSN_CLASS_SYN; + break; + default: + abort (); + break; + } + return retval; +} + +static unsigned long +adjust_paritybit (unsigned long m_code, enum insn_class class) +{ + unsigned long result = 0; + unsigned long m_code_high = 0; + unsigned long m_code_low = 0; + unsigned long pb_high = 0; + unsigned long pb_low = 0; + + if (class == INSN_CLASS_32) + { + pb_high = 0x80000000; + pb_low = 0x00008000; + } + else if (class == INSN_CLASS_16) + { + pb_high = 0; + pb_low = 0; + } + else if (class == INSN_CLASS_PCE) + { + pb_high = 0; + pb_low = 0x00008000; + } + else if (class == INSN_CLASS_SYN) + { + /* FIXME. at this time, INSN_CLASS_SYN must be 32 bit, but, instruction type should + be changed if macro instruction has been expanded. */ + pb_high = 0x80000000; + pb_low = 0x00008000; + } + else + { + abort (); + } + + m_code_high = m_code & 0x3fff8000; + m_code_low = m_code & 0x00007fff; + result = pb_high | (m_code_high << 1) | pb_low | m_code_low; + return result; + +} + +static void +gen_insn_frag (struct score_it *part_1, struct score_it *part_2) +{ + char *p; + bfd_boolean pce_p = FALSE; + int relaxable_p = g_opt; + int relax_size = 0; + struct score_it *inst1 = part_1; + struct score_it *inst2 = part_2; + struct score_it backup_inst1; + + pce_p = (inst2) ? TRUE : FALSE; + memcpy (&backup_inst1, inst1, sizeof (struct score_it)); + + /* Adjust instruction opcode and to be relaxed instruction opcode. */ + if (pce_p) + { + backup_inst1.instruction = ((backup_inst1.instruction & 0x7FFF) << 15) + | (inst2->instruction & 0x7FFF); + backup_inst1.instruction = adjust_paritybit (backup_inst1.instruction, INSN_CLASS_PCE); + backup_inst1.relax_inst = 0x8000; + backup_inst1.size = INSN_SIZE; + backup_inst1.relax_size = 0; + backup_inst1.type = Insn_Type_PCE; + } + else + { + backup_inst1.instruction = adjust_paritybit (backup_inst1.instruction, + GET_INSN_CLASS (backup_inst1.type)); + } + + if (backup_inst1.relax_size != 0) + { + enum insn_class tmp; + + tmp = (backup_inst1.size == INSN_SIZE) ? INSN_CLASS_16 : INSN_CLASS_32; + backup_inst1.relax_inst = adjust_paritybit (backup_inst1.relax_inst, tmp); + } + + /* Check data dependency. */ + handle_dependency (&backup_inst1); + + /* Start a new frag if frag_now is not empty and is not instruction frag, maybe it contains + data produced by .ascii etc. Doing this is to make one instruction per frag. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + frag_wane (frag_now); + + frag_new (0); + } + + /* Here, we must call frag_grow in order to keep the instruction frag type is + rs_machine_dependent. + For, frag_var may change frag_now->fr_type to rs_fill by calling frag_grow which + acturally will call frag_wane. + Calling frag_grow first will create a new frag_now which free size is 20 that is enough + for frag_var. */ + frag_grow (20); + + p = frag_more (backup_inst1.size); + md_number_to_chars (p, backup_inst1.instruction, backup_inst1.size); + +#ifdef OBJ_ELF + dwarf2_emit_insn (backup_inst1.size); +#endif + + /* Generate fixup structure. */ + if (pce_p) + { + if (inst1->reloc.type != BFD_RELOC_NONE) + fix_new_score (frag_now, p - frag_now->fr_literal, + inst1->size, &inst1->reloc.exp, + inst1->reloc.pc_rel, inst1->reloc.type); + + if (inst2->reloc.type != BFD_RELOC_NONE) + fix_new_score (frag_now, p - frag_now->fr_literal + 2, + inst2->size, &inst2->reloc.exp, inst2->reloc.pc_rel, inst2->reloc.type); + } + else + { + if (backup_inst1.reloc.type != BFD_RELOC_NONE) + fix_new_score (frag_now, p - frag_now->fr_literal, + backup_inst1.size, &backup_inst1.reloc.exp, + backup_inst1.reloc.pc_rel, backup_inst1.reloc.type); + } + + /* relax_size may be 2, 4, 12 or 0, 0 indicates no relaxation. */ + relaxable_p &= (backup_inst1.relax_size != 0); + relax_size = relaxable_p ? backup_inst1.relax_size : 0; + + p = frag_var (rs_machine_dependent, relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (backup_inst1.size, backup_inst1.relax_size, + backup_inst1.type, 0, 0, relaxable_p), + backup_inst1.reloc.exp.X_add_symbol, 0, NULL); + + if (relaxable_p) + md_number_to_chars (p, backup_inst1.relax_inst, relax_size); + + memcpy (inst1, &backup_inst1, sizeof (struct score_it)); +} + +static void +parse_16_32_inst (char *insnstr, bfd_boolean gen_frag_p) +{ + char c; + char *p; + char *operator = insnstr; + const struct asm_opcode *opcode; + + /* Parse operator and operands. */ + skip_whitespace (operator); + + for (p = operator; *p != '\0'; p++) + if ((*p == ' ') || (*p == '!')) + break; + + if (*p == '!') + p++; + + c = *p; + *p = '\0'; + + opcode = (const struct asm_opcode *) hash_find (score_ops_hsh, operator); + *p = c; + + memset (&inst, '\0', sizeof (inst)); + sprintf (inst.str, "%s", insnstr); + if (opcode) + { + inst.instruction = opcode->value; + inst.relax_inst = opcode->relax_value; + inst.type = opcode->type; + inst.size = GET_INSN_SIZE (inst.type); + inst.relax_size = 0; + inst.bwarn = 0; + sprintf (inst.name, "%s", opcode->template); + strcpy (inst.reg, ""); + inst.error = NULL; + inst.reloc.type = BFD_RELOC_NONE; + + (*opcode->parms) (p); + + /* It indicates current instruction is a macro instruction if inst.bwarn equals -1. */ + if ((inst.bwarn != -1) && (!inst.error) && (gen_frag_p)) + gen_insn_frag (&inst, NULL); + } + else + inst.error = _("unrecognized opcode"); +} + +static int +append_insn (char *str, bfd_boolean gen_frag_p) +{ + int retval = SUCCESS; + + parse_16_32_inst (str, gen_frag_p); + + if (inst.error) + { + retval = (int) FAIL; + as_bad (_("%s -- `%s'"), inst.error, inst.str); + inst.error = NULL; + } + + return retval; +} + +/* Handle mv! reg_high, reg_low; + mv! reg_low, reg_high; + mv! reg_low, reg_low; */ +static void +do16_mv_rdrs (char *str) +{ + int reg_rd; + int reg_rs; + char *backupstr = NULL; + + backupstr = str; + skip_whitespace (str); + + if ((reg_rd = reg_required_here (&str, 8, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || (reg_rs = reg_required_here (&str, 4, REG_TYPE_SCORE)) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + /* Case 1 : mv! or mlfh!. */ + if (reg_rd < 16) + { + if (reg_rs < 16) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0xf) << 15) | (0xf << 10); + inst.relax_size = 4; + } + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + + sprintf (append_str, "mlfh! %s", backupstr); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + /* Case 2 : mhfl!. */ + else + { + if (reg_rs > 16) + { + SET_INSN_ERROR (BAD_ARGS); + return; + } + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + + sprintf (append_str, "mhfl! %s", backupstr); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + } +} + +static void +do16_rdi4 (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 3, _IMM4) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else + { + if (((inst.instruction >> 3) & 0x10) == 0) /* for judge is addei or subei : bit 5 =0 : addei */ + { + if (((inst.instruction >> 3) & 0xf) != 0xf) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | ((1 << ((inst.instruction >> 3) & 0xf)) << 1); + inst.relax_size = 4; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + if (((inst.instruction >> 3) & 0xf) != 0xf) + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((-(1 << ((inst.instruction >> 3) & 0xf))) & 0xffff) << 1); + inst.relax_size = 4; + } + else + { + inst.relax_inst = 0x8000; + } + } + } +} + +static void +do16_rdi5 (char *str) +{ + skip_whitespace (str); + + if (reglow_required_here (&str, 8) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || data_op2 (&str, 3, _IMM5) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 8) & 0xf) << 15) | (((inst.instruction >> 3) & 0x1f) << 10); + inst.relax_size = 4; + } +} + +/* Handle sdbbp. */ +static void +do16_xi5 (char *str) +{ + skip_whitespace (str); + + if (data_op2 (&str, 3, _IMM5) == (int) FAIL || end_of_line (str) == (int) FAIL) + return; + else + { + inst.relax_inst |= (((inst.instruction >> 3) & 0x1f) << 15); + inst.relax_size = 4; + } +} + +/* Check that an immediate is word alignment or half word alignment. + If so, convert it to the right format. */ +static int +validate_immediate_align (int val, unsigned int data_type) +{ + if (data_type == _IMM5_RSHIFT_1) + { + if (val % 2) + { + inst.error = _("address offset must be half word alignment"); + return (int) FAIL; + } + } + else if ((data_type == _IMM5_RSHIFT_2) || (data_type == _IMM10_RSHIFT_2)) + { + if (val % 4) + { + inst.error = _("address offset must be word alignment"); + return (int) FAIL; + } + } + + return SUCCESS; +} + +static int +exp_ldst_offset (char **str, int shift, unsigned int data_type) +{ + char *dataptr; + + dataptr = * str; + + if ((*dataptr == '0') && (*(dataptr + 1) == 'x') + && (data_type != _SIMM16_LA) + && (data_type != _VALUE_HI16) + && (data_type != _VALUE_LO16) + && (data_type != _IMM16) + && (data_type != _IMM15) + && (data_type != _IMM14) + && (data_type != _IMM4) + && (data_type != _IMM5) + && (data_type != _IMM8) + && (data_type != _IMM5_RSHIFT_1) + && (data_type != _IMM5_RSHIFT_2) + && (data_type != _SIMM14_NEG) + && (data_type != _IMM10_RSHIFT_2)) + { + data_type += 24; + } + + if (my_get_expression (&inst.reloc.exp, str) == (int) FAIL) + return (int) FAIL; + + if (inst.reloc.exp.X_op == O_constant) + { + /* Need to check the immediate align. */ + int value = validate_immediate_align (inst.reloc.exp.X_add_number, data_type); + + if (value == (int) FAIL) + return (int) FAIL; + + value = validate_immediate (inst.reloc.exp.X_add_number, data_type, 0); + if (value == (int) FAIL) + { + if (data_type < 30) + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + score_df_range[data_type].range[0], score_df_range[data_type].range[1]); + else + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type - 24].bits, + score_df_range[data_type - 24].range[0], score_df_range[data_type - 24].range[1]); + inst.error = err_msg; + return (int) FAIL; + } + + if (data_type == _IMM5_RSHIFT_1) + { + value >>= 1; + } + else if ((data_type == _IMM5_RSHIFT_2) || (data_type == _IMM10_RSHIFT_2)) + { + value >>= 2; + } + + if (score_df_range[data_type].range[0] != 0) + { + value &= (1 << score_df_range[data_type].bits) - 1; + } + + inst.instruction |= value << shift; + } + else + { + inst.reloc.pc_rel = 0; + } + + return SUCCESS; +} + +static void +do_ldst_insn (char *str) +{ + int pre_inc = 0; + int conflict_reg; + int value; + char * temp; + char *strbak; + char *dataptr; + int reg; + int ldst_idx = 0; + + strbak = str; + skip_whitespace (str); + + if (((conflict_reg = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + /* ld/sw rD, [rA, simm15] ld/sw rD, [rA]+, simm12 ld/sw rD, [rA, simm12]+. */ + if (*str == '[') + { + str++; + skip_whitespace (str); + + if ((reg = reg_required_here (&str, 15, REG_TYPE_SCORE)) == (int) FAIL) + return; + + /* Conflicts can occur on stores as well as loads. */ + conflict_reg = (conflict_reg == reg); + skip_whitespace (str); + temp = str + 1; /* The latter will process decimal/hex expression. */ + + /* ld/sw rD, [rA]+, simm12 ld/sw rD, [rA]+. */ + if (*str == ']') + { + str++; + if (*str == '+') + { + str++; + /* ld/sw rD, [rA]+, simm12. */ + if (skip_past_comma (&str) == SUCCESS) + { + if ((exp_ldst_offset (&str, 3, _SIMM12) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + return; + + if (conflict_reg) + { + unsigned int ldst_func = inst.instruction & OPC_PSEUDOLDST_MASK; + + if ((ldst_func == INSN_LH) + || (ldst_func == INSN_LHU) + || (ldst_func == INSN_LW) + || (ldst_func == INSN_LB) + || (ldst_func == INSN_LBU)) + { + inst.error = _("register same as write-back base"); + return; + } + } + + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + LDST_POST].value; + + /* lw rD, [rA]+, 4 convert to pop rD, [rA]. */ + if ((inst.instruction & 0x3e000007) == 0x0e000000) + { + /* rs = r0-r7, offset = 4 */ + if ((((inst.instruction >> 15) & 0x18) == 0) + && (((inst.instruction >> 3) & 0xfff) == 4)) + { + /* Relax to pophi. */ + if ((((inst.instruction >> 20) & 0x10) == 0x10)) + { + inst.relax_inst = 0x0000200a | (((inst.instruction >> 20) & 0xf) + << 8) | 1 << 7 | + (((inst.instruction >> 15) & 0x7) << 4); + } + /* Relax to pop. */ + else + { + inst.relax_inst = 0x0000200a | (((inst.instruction >> 20) & 0xf) + << 8) | 0 << 7 | + (((inst.instruction >> 15) & 0x7) << 4); + } + inst.relax_size = 2; + } + } + return; + } + /* ld/sw rD, [rA]+ convert to ld/sw rD, [rA, 0]+. */ + else + { + SET_INSN_ERROR (NULL); + if (end_of_line (str) == (int) FAIL) + { + return; + } + + pre_inc = 1; + value = validate_immediate (inst.reloc.exp.X_add_number, _SIMM12, 0); + value &= (1 << score_df_range[_SIMM12].bits) - 1; + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + pre_inc].value; + inst.instruction |= value << 3; + inst.relax_inst = 0x8000; + return; + } + } + /* ld/sw rD, [rA] convert to ld/sw rD, [rA, simm15]. */ + else + { + if (end_of_line (str) == (int) FAIL) + return; + + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + LDST_NOUPDATE].value; + + /* lbu rd, [rs] -> lbu! rd, [rs] */ + if (ldst_idx == INSN_LBU) + { + inst.relax_inst = INSN16_LBU; + } + else if (ldst_idx == INSN_LH) + { + inst.relax_inst = INSN16_LH; + } + else if (ldst_idx == INSN_LW) + { + inst.relax_inst = INSN16_LW; + } + else if (ldst_idx == INSN_SB) + { + inst.relax_inst = INSN16_SB; + } + else if (ldst_idx == INSN_SH) + { + inst.relax_inst = INSN16_SH; + } + else if (ldst_idx == INSN_SW) + { + inst.relax_inst = INSN16_SW; + } + else + { + inst.relax_inst = 0x8000; + } + + /* lw/lh/lbu/sw/sh/sb, offset = 0, relax to 16 bit instruction. */ + if ((ldst_idx == INSN_LBU) + || (ldst_idx == INSN_LH) + || (ldst_idx == INSN_LW) + || (ldst_idx == INSN_SB) || (ldst_idx == INSN_SH) || (ldst_idx == INSN_SW)) + { + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + inst.relax_inst |= (2 << 12) | (((inst.instruction >> 20) & 0xf) << 8) | + (((inst.instruction >> 15) & 0xf) << 4); + inst.relax_size = 2; + } + } + + return; + } + } + /* ld/sw rD, [rA, simm15] ld/sw rD, [rA, simm12]+. */ + else + { + if (skip_past_comma (&str) == (int) FAIL) + { + inst.error = _("pre-indexed expression expected"); + return; + } + + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL) + return; + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + + skip_whitespace (str); + /* ld/sw rD, [rA, simm12]+. */ + if (*str == '+') + { + str++; + pre_inc = 1; + if (conflict_reg) + { + unsigned int ldst_func = inst.instruction & OPC_PSEUDOLDST_MASK; + + if ((ldst_func == INSN_LH) + || (ldst_func == INSN_LHU) + || (ldst_func == INSN_LW) + || (ldst_func == INSN_LB) + || (ldst_func == INSN_LBU)) + { + inst.error = _("register same as write-back base"); + return; + } + } + } + + if (end_of_line (str) == (int) FAIL) + return; + + if (inst.reloc.exp.X_op == O_constant) + { + int value; + unsigned int data_type; + + if (pre_inc == 1) + data_type = _SIMM12; + else + data_type = _SIMM15; + dataptr = temp; + + if ((*dataptr == '0') && (*(dataptr + 1) == 'x') + && (data_type != _SIMM16_LA) + && (data_type != _VALUE_HI16) + && (data_type != _VALUE_LO16) + && (data_type != _IMM16) + && (data_type != _IMM15) + && (data_type != _IMM14) + && (data_type != _IMM4) + && (data_type != _IMM5) + && (data_type != _IMM8) + && (data_type != _IMM5_RSHIFT_1) + && (data_type != _IMM5_RSHIFT_2) + && (data_type != _SIMM14_NEG) + && (data_type != _IMM10_RSHIFT_2)) + { + data_type += 24; + } + + value = validate_immediate (inst.reloc.exp.X_add_number, data_type, 0); + if (value == (int) FAIL) + { + if (data_type < 30) + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type].bits, + score_df_range[data_type].range[0], score_df_range[data_type].range[1]); + else + sprintf (err_msg, + _("invalid constant: %d bit expression not in range %d..%d"), + score_df_range[data_type - 24].bits, + score_df_range[data_type - 24].range[0], + score_df_range[data_type - 24].range[1]); + inst.error = err_msg; + return; + } + + value &= (1 << score_df_range[data_type].bits) - 1; + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + pre_inc].value; + if (pre_inc == 1) + inst.instruction |= value << 3; + else + inst.instruction |= value; + + /* lw rD, [rA, simm15] */ + if ((inst.instruction & 0x3e000000) == 0x20000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) + && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, lw -> lw!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, lw -> lwp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x3) == 0) + && ((inst.instruction & 0x7fff) < 128)) + { + inst.relax_inst = 0x7000 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 2) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sw rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x28000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, sw -> sw!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, sw -> swp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x3) == 0) + && ((inst.instruction & 0x7fff) < 128)) + { + inst.relax_inst = 0x7004 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 2) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sw rD, [rA, simm15]+ sw pre. */ + else if ((inst.instruction & 0x3e000007) == 0x06000004) + { + /* rA is in [r0 - r7], and simm15 = -4. */ + if ((((inst.instruction >> 15) & 0x18) == 0) + && (((inst.instruction >> 3) & 0xfff) == 0xffc)) + { + /* sw -> pushhi!. */ + if ((((inst.instruction >> 20) & 0x10) == 0x10)) + { + inst.relax_inst = 0x0000200e | (((inst.instruction >> 20) & 0xf) << 8) + | 1 << 7 | (((inst.instruction >> 15) & 0x7) << 4); + inst.relax_size = 2; + } + /* sw -> push!. */ + else + { + inst.relax_inst = 0x0000200e | (((inst.instruction >> 20) & 0xf) << 8) + | 0 << 7 | (((inst.instruction >> 15) & 0x7) << 4); + inst.relax_size = 2; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* lh rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x22000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, lh -> lh!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, lh -> lhp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x1) == 0) + && ((inst.instruction & 0x7fff) < 64)) + { + inst.relax_inst = 0x7001 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 1) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sh rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x2a000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, sh -> sh!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, sh -> shp!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x1) == 0) + && ((inst.instruction & 0x7fff) < 64)) + { + inst.relax_inst = 0x7005 | (((inst.instruction >> 20) & 0xf) << 8) + | (((inst.instruction & 0x7fff) >> 1) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* lbu rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x2c000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, lbu -> lbu!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, lbu -> lbup!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x7fff) < 32)) + { + inst.relax_inst = 0x7003 | (((inst.instruction >> 20) & 0xf) << 8) + | ((inst.instruction & 0x7fff) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + /* sb rD, [rA, simm15] */ + else if ((inst.instruction & 0x3e000000) == 0x2e000000) + { + /* Both rD and rA are in [r0 - r15]. */ + if ((((inst.instruction >> 15) & 0x10) == 0) && (((inst.instruction >> 20) & 0x10) == 0)) + { + /* simm15 = 0, sb -> sb!. */ + if ((inst.instruction & 0x7fff) == 0) + { + inst.relax_inst |= (((inst.instruction >> 15) & 0xf) << 4) + | (((inst.instruction >> 20) & 0xf) << 8); + inst.relax_size = 2; + } + /* rA = r2, sb -> sb!. */ + else if ((((inst.instruction >> 15) & 0xf) == 2) + && ((inst.instruction & 0x7fff) < 32)) + { + inst.relax_inst = 0x7007 | (((inst.instruction >> 20) & 0xf) << 8) + | ((inst.instruction & 0x7fff) << 3); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + } + else + { + inst.relax_inst = 0x8000; + } + + return; + } + else + { + /* FIXME: may set error, for there is no ld/sw rD, [rA, label] */ + inst.reloc.pc_rel = 0; + } + } + } + else + { + inst.error = BAD_ARGS; + } +} + +/* Handle cache. */ + +static void +do_cache (char *str) +{ + skip_whitespace (str); + + if ((data_op2 (&str, 20, _IMM5) == (int) FAIL) || (skip_past_comma (&str) == (int) FAIL)) + { + return; + } + else + { + int cache_op; + + cache_op = (inst.instruction >> 20) & 0x1F; + sprintf (inst.name, "cache %d", cache_op); + } + + if (*str == '[') + { + str++; + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL) + return; + + skip_whitespace (str); + + /* cache op, [rA] */ + if (skip_past_comma (&str) == (int) FAIL) + { + SET_INSN_ERROR (NULL); + if (*str != ']') + { + inst.error = _("missing ]"); + return; + } + str++; + } + /* cache op, [rA, simm15] */ + else + { + if (exp_ldst_offset (&str, 0, _SIMM15) == (int) FAIL) + { + return; + } + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + } + + if (end_of_line (str) == (int) FAIL) + return; + } + else + { + inst.error = BAD_ARGS; + } +} + +static void +do_crdcrscrsimm5 (char *str) +{ + char *strbak; + + strbak = str; + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE_CR) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 15, REG_TYPE_SCORE_CR) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL + || reg_required_here (&str, 10, REG_TYPE_SCORE_CR) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL) + { + str = strbak; + /* cop1 cop_code20. */ + if (data_op2 (&str, 5, _IMM20) == (int) FAIL) + return; + } + else + { + if (data_op2 (&str, 5, _IMM5) == (int) FAIL) + return; + } + + end_of_line (str); +} + +/* Handle ldc/stc. */ +static void +do_ldst_cop (char *str) +{ + skip_whitespace (str); + + if ((reg_required_here (&str, 15, REG_TYPE_SCORE_CR) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + if (*str == '[') + { + str++; + skip_whitespace (str); + + if (reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL) + return; + + skip_whitespace (str); + + if (*str++ != ']') + { + if (exp_ldst_offset (&str, 5, _IMM10_RSHIFT_2) == (int) FAIL) + return; + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + } + + end_of_line (str); + } + else + inst.error = BAD_ARGS; +} + +static void +do16_ldst_insn (char *str) +{ + skip_whitespace (str); + + if ((reglow_required_here (&str, 8) == (int) FAIL) || (skip_past_comma (&str) == (int) FAIL)) + return; + + if (*str == '[') + { + int reg; + + str++; + skip_whitespace (str); + + if ((reg = reglow_required_here (&str, 4)) == (int) FAIL) + return; + + skip_whitespace (str); + if (*str++ == ']') + { + if (end_of_line (str) == (int) FAIL) + return; + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0xf) << 15); + inst.relax_size = 4; + } + } + else + { + inst.error = _("missing ]"); + } + } + else + { + inst.error = BAD_ARGS; + } +} + +/* Handle lbup!/lhp!/ldiu!/lwp!/sbp!/shp!/swp!. */ +static void +do16_ldst_imm_insn (char *str) +{ + char data_exp[MAX_LITERAL_POOL_SIZE]; + int reg_rd; + char *dataptr = NULL, *pp = NULL; + int cnt = 0; + int assign_data = (int) FAIL; + unsigned int ldst_func; + + skip_whitespace (str); + + if (((reg_rd = reglow_required_here (&str, 8)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + skip_whitespace (str); + dataptr = str; + + while ((*dataptr != '\0') && (*dataptr != '|') && (cnt <= MAX_LITERAL_POOL_SIZE)) + { + data_exp[cnt] = *dataptr; + dataptr++; + cnt++; + } + + data_exp[cnt] = '\0'; + pp = &data_exp[0]; + + str = dataptr; + + ldst_func = inst.instruction & LDST16_RI_MASK; + if (ldst_func == N16_LIU) + assign_data = exp_ldst_offset (&pp, 0, _IMM8); + else if (ldst_func == N16_LHP || ldst_func == N16_SHP) + assign_data = exp_ldst_offset (&pp, 3, _IMM5_RSHIFT_1); + else if (ldst_func == N16_LWP || ldst_func == N16_SWP) + assign_data = exp_ldst_offset (&pp, 3, _IMM5_RSHIFT_2); + else + assign_data = exp_ldst_offset (&pp, 3, _IMM5); + + if ((assign_data == (int) FAIL) || (end_of_line (pp) == (int) FAIL)) + return; + else + { + if ((inst.instruction & 0x7000) == N16_LIU) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 + | ((inst.instruction & 0xff) << 1); + } + else if (((inst.instruction & 0x7007) == N16_LHP) + || ((inst.instruction & 0x7007) == N16_SHP)) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 | 2 << 15 + | (((inst.instruction >> 3) & 0x1f) << 1); + } + else if (((inst.instruction & 0x7007) == N16_LWP) + || ((inst.instruction & 0x7007) == N16_SWP)) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 | 2 << 15 + | (((inst.instruction >> 3) & 0x1f) << 2); + } + else if (((inst.instruction & 0x7007) == N16_LBUP) + || ((inst.instruction & 0x7007) == N16_SBP)) + { + inst.relax_inst |= ((inst.instruction >> 8) & 0xf) << 20 | 2 << 15 + | (((inst.instruction >> 3) & 0x1f)); + } + + inst.relax_size = 4; + } +} + +static void +do16_push_pop (char *str) +{ + int reg_rd; + int H_bit_mask = 0; + + skip_whitespace (str); + if (((reg_rd = reg_required_here (&str, 8, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + return; + + if (reg_rd >= 16) + H_bit_mask = 1; + + /* reg_required_here will change bit 12 of opcode, so we must restore bit 12. */ + inst.instruction &= ~(1 << 12); + + inst.instruction |= H_bit_mask << 7; + + if (*str == '[') + { + int reg; + + str++; + skip_whitespace (str); + if ((reg = reg_required_here (&str, 4, REG_TYPE_SCORE)) == (int) FAIL) + return; + else if (reg > 7) + { + if (!inst.error) + inst.error = _("base register nums are over 3 bit"); + + return; + } + + skip_whitespace (str); + if ((*str++ != ']') || (end_of_line (str) == (int) FAIL)) + { + if (!inst.error) + inst.error = _("missing ]"); + + return; + } + + /* pop! */ + if ((inst.instruction & 0xf) == 0xa) + { + if (H_bit_mask) + { + inst.relax_inst |= ((((inst.instruction >> 8) & 0xf) | 0x10) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (4 << 3); + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (4 << 3); + } + } + /* push! */ + else + { + if (H_bit_mask) + { + inst.relax_inst |= ((((inst.instruction >> 8) & 0xf) | 0x10) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (((-4) & 0xfff) << 3); + } + else + { + inst.relax_inst |= (((inst.instruction >> 8) & 0xf) << 20) + | (((inst.instruction >> 4) & 0x7) << 15) | (((-4) & 0xfff) << 3); + } + } + inst.relax_size = 4; + } + else + { + inst.error = BAD_ARGS; + } +} + +/* Handle lcb/lcw/lce/scb/scw/sce. */ +static void +do_ldst_unalign (char *str) +{ + int conflict_reg; + + if (university_version == 1) + { + inst.error = ERR_FOR_SCORE5U_ATOMIC; + return; + } + + skip_whitespace (str); + + /* lcb/scb [rA]+. */ + if (*str == '[') + { + str++; + skip_whitespace (str); + + if (reg_required_here (&str, 15, REG_TYPE_SCORE) == (int) FAIL) + return; + + if (*str++ == ']') + { + if (*str++ != '+') + { + inst.error = _("missing +"); + return; + } + } + else + { + inst.error = _("missing ]"); + return; + } + + if (end_of_line (str) == (int) FAIL) + return; + } + /* lcw/lce/scb/sce rD, [rA]+. */ + else + { + if (((conflict_reg = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + { + return; + } + + skip_whitespace (str); + if (*str++ == '[') + { + int reg; + + skip_whitespace (str); + if ((reg = reg_required_here (&str, 15, REG_TYPE_SCORE)) == (int) FAIL) + { + return; + } + + /* Conflicts can occur on stores as well as loads. */ + conflict_reg = (conflict_reg == reg); + skip_whitespace (str); + if (*str++ == ']') + { + unsigned int ldst_func = inst.instruction & LDST_UNALIGN_MASK; + + if (*str++ == '+') + { + if (conflict_reg) + { + as_warn (_("%s register same as write-back base"), + ((ldst_func & UA_LCE) || (ldst_func & UA_LCW) + ? _("destination") : _("source"))); + } + } + else + { + inst.error = _("missing +"); + return; + } + + if (end_of_line (str) == (int) FAIL) + return; + } + else + { + inst.error = _("missing ]"); + return; + } + } + else + { + inst.error = BAD_ARGS; + return; + } + } +} + +/* Handle alw/asw. */ +static void +do_ldst_atomic (char *str) +{ + if (university_version == 1) + { + inst.error = ERR_FOR_SCORE5U_ATOMIC; + return; + } + + skip_whitespace (str); + + if ((reg_required_here (&str, 20, REG_TYPE_SCORE) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL)) + { + return; + } + else + { + + skip_whitespace (str); + if (*str++ == '[') + { + int reg; + + skip_whitespace (str); + if ((reg = reg_required_here (&str, 15, REG_TYPE_SCORE)) == (int) FAIL) + { + return; + } + + skip_whitespace (str); + if (*str++ != ']') + { + inst.error = _("missing ]"); + return; + } + + end_of_line (str); + } + else + inst.error = BAD_ARGS; + } +} + +static void +build_relax_frag (struct score_it fix_insts[RELAX_INST_NUM], int fix_num ATTRIBUTE_UNUSED, + struct score_it var_insts[RELAX_INST_NUM], int var_num, + symbolS *add_symbol) +{ + int i; + char *p; + fixS *fixp = NULL; + fixS *cur_fixp = NULL; + long where; + struct score_it inst_main; + + memcpy (&inst_main, &fix_insts[0], sizeof (struct score_it)); + + /* Adjust instruction opcode and to be relaxed instruction opcode. */ + inst_main.instruction = adjust_paritybit (inst_main.instruction, GET_INSN_CLASS (inst_main.type)); + inst_main.type = Insn_PIC; + + for (i = 0; i < var_num; i++) + { + inst_main.relax_size += var_insts[i].size; + var_insts[i].instruction = adjust_paritybit (var_insts[i].instruction, + GET_INSN_CLASS (var_insts[i].type)); + } + + /* Check data dependency. */ + handle_dependency (&inst_main); + + /* Start a new frag if frag_now is not empty. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + { + frag_wane (frag_now); + } + frag_new (0); + } + frag_grow (20); + + /* Write fr_fix part. */ + p = frag_more (inst_main.size); + md_number_to_chars (p, inst_main.instruction, inst_main.size); + + if (inst_main.reloc.type != BFD_RELOC_NONE) + fixp = fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size, + &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type); + + frag_now->tc_frag_data.fixp = fixp; + cur_fixp = frag_now->tc_frag_data.fixp; + +#ifdef OBJ_ELF + dwarf2_emit_insn (inst_main.size); +#endif + + where = p - frag_now->fr_literal + inst_main.size; + for (i = 0; i < var_num; i++) + { + if (i > 0) + where += var_insts[i - 1].size; + + if (var_insts[i].reloc.type != BFD_RELOC_NONE) + { + fixp = fix_new_score (frag_now, where, var_insts[i].size, + &var_insts[i].reloc.exp, var_insts[i].reloc.pc_rel, + var_insts[i].reloc.type); + if (fixp) + { + if (cur_fixp) + { + cur_fixp->fx_next = fixp; + cur_fixp = cur_fixp->fx_next; + } + else + { + frag_now->tc_frag_data.fixp = fixp; + cur_fixp = frag_now->tc_frag_data.fixp; + } + } + } + } + + p = frag_var (rs_machine_dependent, inst_main.relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (inst_main.size, inst_main.relax_size, inst_main.type, + 0, inst_main.size, 0), add_symbol, 0, NULL); + + /* Write fr_var part. + no calling gen_insn_frag, no fixS will be generated. */ + for (i = 0; i < var_num; i++) + { + md_number_to_chars (p, var_insts[i].instruction, var_insts[i].size); + p += var_insts[i].size; + } + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; +} + +/* Build a relax frag for la instruction when generating PIC, + external symbol first and local symbol second. */ + +static void +build_la_pic (int reg_rd, expressionS exp) +{ + symbolS *add_symbol = exp.X_add_symbol; + offsetT add_number = exp.X_add_number; + struct score_it fix_insts[RELAX_INST_NUM]; + struct score_it var_insts[RELAX_INST_NUM]; + int fix_num = 0; + int var_num = 0; + char tmp[MAX_LITERAL_POOL_SIZE]; + int r1_bak; + + r1_bak = nor1; + nor1 = 0; + + if (add_number == 0) + { + fix_num = 1; + var_num = 2; + + /* For an external symbol, only one insn is generated; + For a local symbol, two insns are generated. */ + /* Fix part + For an external symbol: lw rD, ($gp) + (BFD_RELOC_SCORE_GOT15 or BFD_RELOC_SCORE_CALL15) */ + sprintf (tmp, "lw_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + if (reg_rd == PIC_CALL_REG) + inst.reloc.type = BFD_RELOC_SCORE_CALL15; + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol : + lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) + addi rD, (BFD_RELOC_GOT_LO16) */ + inst.reloc.type = BFD_RELOC_SCORE_GOT15; + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + sprintf (tmp, "addi_s_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[1], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + } + else if (add_number >= -0x8000 && add_number <= 0x7fff) + { + /* Insn 1: lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) */ + sprintf (tmp, "lw_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Insn 2 */ + fix_num = 1; + var_num = 1; + /* Fix part + For an external symbol: addi rD, */ + sprintf (tmp, "addi r%d, %d", reg_rd, (int)add_number); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol: addi rD, + (BFD_RELOC_GOT_LO16) */ + sprintf (tmp, "addi_s_pic r%d, %s + %d", reg_rd, add_symbol->bsym->name, (int)add_number); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + } + else + { + int hi = (add_number >> 16) & 0x0000FFFF; + int lo = add_number & 0x0000FFFF; + + /* Insn 1: lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) */ + sprintf (tmp, "lw_pic r%d, %s", reg_rd, add_symbol->bsym->name); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Insn 2 */ + fix_num = 1; + var_num = 1; + /* Fix part + For an external symbol: ldis r1, HI% */ + sprintf (tmp, "ldis r1, %d", hi); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol: ldis r1, HI% + but, if lo is outof 16 bit, make hi plus 1 */ + if ((lo < -0x8000) || (lo > 0x7fff)) + { + hi += 1; + } + sprintf (tmp, "ldis_pic r1, %d", hi); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + + /* Insn 3 */ + fix_num = 1; + var_num = 1; + /* Fix part + For an external symbol: ori r1, LO% */ + sprintf (tmp, "ori r1, %d", lo); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol: addi r1, +LO% (BFD_RELOC_GOT_LO16) */ + sprintf (tmp, "addi_u_pic r1, %s + %d", add_symbol->bsym->name, lo); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + + /* Insn 4: add rD, rD, r1 */ + sprintf (tmp, "add r%d, r%d, r1", reg_rd, reg_rd); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + + nor1 = r1_bak; +} + +/* Handle la. */ +static void +do_macro_la_rdi32 (char *str) +{ + int reg_rd; + + skip_whitespace (str); + if ((reg_rd = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL) + { + return; + } + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + char *keep_data = str; + + /* la rd, simm16. */ + if (data_op2 (&str, 1, _SIMM16_LA) != (int) FAIL) + { + end_of_line (str); + return; + } + /* la rd, imm32 or la rd, label. */ + else + { + SET_INSN_ERROR (NULL); + str = keep_data; + if ((data_op2 (&str, 1, _VALUE_HI16) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + { + return; + } + else + { + if ((score_pic == NO_PIC) || (!inst.reloc.exp.X_add_symbol)) + { + sprintf (append_str, "ld_i32hi r%d, %s", reg_rd, keep_data); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + sprintf (append_str, "ld_i32lo r%d, %s", reg_rd, keep_data); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + } + else + { + assert (inst.reloc.exp.X_add_symbol); + build_la_pic (reg_rd, inst.reloc.exp); + } + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + } +} + +/* Handle li. */ +static void +do_macro_li_rdi32 (char *str){ + + int reg_rd; + + skip_whitespace (str); + if ((reg_rd = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&str) == (int) FAIL) + { + return; + } + else + { + char *keep_data = str; + + /* li rd, simm16. */ + if (data_op2 (&str, 1, _SIMM16_LA) != (int) FAIL) + { + end_of_line (str); + return; + } + /* li rd, imm32. */ + else + { + char append_str[MAX_LITERAL_POOL_SIZE]; + + str = keep_data; + + if ((data_op2 (&str, 1, _VALUE_HI16) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + { + return; + } + else if (inst.reloc.exp.X_add_symbol) + { + inst.error = _("li rd label isn't correct instruction form"); + return; + } + else + { + sprintf (append_str, "ld_i32hi r%d, %s", reg_rd, keep_data); + + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + else + { + sprintf (append_str, "ld_i32lo r%d, %s", reg_rd, keep_data); + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } + } + } +} + +/* Handle mul/mulu/div/divu/rem/remu. */ +static void +do_macro_mul_rdrsrs (char *str) +{ + int reg_rd; + int reg_rs1; + int reg_rs2; + char *backupstr; + char append_str[MAX_LITERAL_POOL_SIZE]; + + if (university_version == 1) + as_warn ("%s", ERR_FOR_SCORE5U_MUL_DIV); + + strcpy (append_str, str); + backupstr = append_str; + skip_whitespace (backupstr); + if (((reg_rd = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&backupstr) == (int) FAIL) + || ((reg_rs1 = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL)) + { + inst.error = BAD_ARGS; + return; + } + + if (skip_past_comma (&backupstr) == (int) FAIL) + { + /* rem/remu rA, rB is error format. */ + if (strcmp (inst.name, "rem") == 0 || strcmp (inst.name, "remu") == 0) + { + SET_INSN_ERROR (BAD_ARGS); + } + else + { + SET_INSN_ERROR (NULL); + do_rsrs (str); + } + return; + } + else + { + SET_INSN_ERROR (NULL); + if (((reg_rs2 = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL) + || (end_of_line (backupstr) == (int) FAIL)) + { + return; + } + else + { + char append_str1[MAX_LITERAL_POOL_SIZE]; + + if (strcmp (inst.name, "rem") == 0) + { + sprintf (append_str, "mul r%d, r%d", reg_rs1, reg_rs2); + sprintf (append_str1, "mfceh r%d", reg_rd); + } + else if (strcmp (inst.name, "remu") == 0) + { + sprintf (append_str, "mulu r%d, r%d", reg_rs1, reg_rs2); + sprintf (append_str1, "mfceh r%d", reg_rd); + } + else + { + sprintf (append_str, "%s r%d, r%d", inst.name, reg_rs1, reg_rs2); + sprintf (append_str1, "mfcel r%d", reg_rd); + } + + /* Output mul/mulu or div/divu or rem/remu. */ + if (append_insn (append_str, TRUE) == (int) FAIL) + return; + + /* Output mfcel or mfceh. */ + if (append_insn (append_str1, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + } +} + +static void +exp_macro_ldst_abs (char *str) +{ + int reg_rd; + char *backupstr, *tmp; + char append_str[MAX_LITERAL_POOL_SIZE]; + char verifystr[MAX_LITERAL_POOL_SIZE]; + struct score_it inst_backup; + int r1_bak = 0; + + r1_bak = nor1; + nor1 = 0; + memcpy (&inst_backup, &inst, sizeof (struct score_it)); + + strcpy (verifystr, str); + backupstr = verifystr; + skip_whitespace (backupstr); + if ((reg_rd = reg_required_here (&backupstr, -1, REG_TYPE_SCORE)) == (int) FAIL) + return; + + tmp = backupstr; + if (skip_past_comma (&backupstr) == (int) FAIL) + return; + + backupstr = tmp; + sprintf (append_str, "li r1 %s", backupstr); + append_insn (append_str, TRUE); + + memcpy (&inst, &inst_backup, sizeof (struct score_it)); + sprintf (append_str, " r%d, [r1,0]", reg_rd); + do_ldst_insn (append_str); + + nor1 = r1_bak; +} + +static int +nopic_need_relax (symbolS * sym, int before_relaxing) +{ + if (sym == NULL) + return 0; + else if (USE_GLOBAL_POINTER_OPT && g_switch_value > 0) + { + const char *symname; + const char *segname; + + /* Find out whether this symbol can be referenced off the $gp + register. It can be if it is smaller than the -G size or if + it is in the .sdata or .sbss section. Certain symbols can + not be referenced off the $gp, although it appears as though + they can. */ + symname = S_GET_NAME (sym); + if (symname != (const char *)NULL + && (strcmp (symname, "eprol") == 0 + || strcmp (symname, "etext") == 0 + || strcmp (symname, "_gp") == 0 + || strcmp (symname, "edata") == 0 + || strcmp (symname, "_fbss") == 0 + || strcmp (symname, "_fdata") == 0 + || strcmp (symname, "_ftext") == 0 + || strcmp (symname, "end") == 0 + || strcmp (symname, GP_DISP_LABEL) == 0)) + { + return 1; + } + else if ((!S_IS_DEFINED (sym) || S_IS_COMMON (sym)) && (0 + /* We must defer this decision until after the whole file has been read, + since there might be a .extern after the first use of this symbol. */ + || (before_relaxing + && S_GET_VALUE (sym) == 0) + || (S_GET_VALUE (sym) != 0 + && S_GET_VALUE (sym) <= g_switch_value))) + { + return 0; + } + + segname = segment_name (S_GET_SEGMENT (sym)); + return (strcmp (segname, ".sdata") != 0 + && strcmp (segname, ".sbss") != 0 + && strncmp (segname, ".sdata.", 7) != 0 + && strncmp (segname, ".gnu.linkonce.s.", 16) != 0); + } + /* We are not optimizing for the $gp register. */ + else + return 1; +} + +/* Build a relax frag for lw/st instruction when generating PIC, + external symbol first and local symbol second. */ + +static void +build_lwst_pic (int reg_rd, expressionS exp, const char *insn_name) +{ + symbolS *add_symbol = exp.X_add_symbol; + int add_number = exp.X_add_number; + struct score_it fix_insts[RELAX_INST_NUM]; + struct score_it var_insts[RELAX_INST_NUM]; + int fix_num = 0; + int var_num = 0; + char tmp[MAX_LITERAL_POOL_SIZE]; + int r1_bak; + + r1_bak = nor1; + nor1 = 0; + + if ((add_number == 0) || (add_number >= -0x8000 && add_number <= 0x7fff)) + { + fix_num = 1; + var_num = 2; + + /* For an external symbol, two insns are generated; + For a local symbol, three insns are generated. */ + /* Fix part + For an external symbol: lw rD, ($gp) + (BFD_RELOC_SCORE_GOT15) */ + sprintf (tmp, "lw_pic r1, %s", add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&fix_insts[0], &inst, sizeof (struct score_it)); + + /* Var part + For a local symbol : + lw rD, ($gp) (BFD_RELOC_SCORE_GOT15) + addi rD, (BFD_RELOC_GOT_LO16) */ + inst.reloc.type = BFD_RELOC_SCORE_GOT15; + memcpy (&var_insts[0], &inst, sizeof (struct score_it)); + sprintf (tmp, "addi_s_pic r1, %s", add_symbol->bsym->name); + if (append_insn (tmp, FALSE) == (int) FAIL) + return; + + memcpy (&var_insts[1], &inst, sizeof (struct score_it)); + build_relax_frag (fix_insts, fix_num, var_insts, var_num, add_symbol); + + /* Insn 2 or Insn 3: lw/st rD, [r1, constant] */ + sprintf (tmp, "%s r%d, [r1, %d]", insn_name, reg_rd, add_number); + if (append_insn (tmp, TRUE) == (int) FAIL) + return; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; + } + else + { + inst.error = _("PIC code offset overflow (max 16 signed bits)"); + return; + } + + nor1 = r1_bak; +} + +static void +do_macro_ldst_label (char *str) +{ + int i; + int ldst_gp_p = 0; + int reg_rd; + int r1_bak; + char *backup_str; + char *label_str; + char *absolute_value; + char append_str[3][MAX_LITERAL_POOL_SIZE]; + char verifystr[MAX_LITERAL_POOL_SIZE]; + struct score_it inst_backup; + struct score_it inst_expand[3]; + struct score_it inst_main; + + memcpy (&inst_backup, &inst, sizeof (struct score_it)); + strcpy (verifystr, str); + backup_str = verifystr; + + skip_whitespace (backup_str); + if ((reg_rd = reg_required_here (&backup_str, -1, REG_TYPE_SCORE)) == (int) FAIL) + return; + + if (skip_past_comma (&backup_str) == (int) FAIL) + return; + + label_str = backup_str; + + /* Ld/st rD, [rA, imm] ld/st rD, [rA]+, imm ld/st rD, [rA, imm]+. */ + if (*backup_str == '[') + { + inst.type = Rd_rvalueRs_preSI12; + do_ldst_insn (str); + return; + } + + /* Ld/st rD, imm. */ + absolute_value = backup_str; + inst.type = Rd_rvalueRs_SI15; + if ((my_get_expression (&inst.reloc.exp, &backup_str) == (int) FAIL) + || (validate_immediate (inst.reloc.exp.X_add_number, _VALUE, 0) == (int) FAIL) + || (end_of_line (backup_str) == (int) FAIL)) + { + return; + } + else + { + if (inst.reloc.exp.X_add_symbol == 0) + { + memcpy (&inst, &inst_backup, sizeof (struct score_it)); + exp_macro_ldst_abs (str); + return; + } + } + + /* Ld/st rD, label. */ + inst.type = Rd_rvalueRs_SI15; + backup_str = absolute_value; + if ((data_op2 (&backup_str, 1, _GP_IMM15) == (int) FAIL) + || (end_of_line (backup_str) == (int) FAIL)) + { + return; + } + else + { + if (inst.reloc.exp.X_add_symbol == 0) + { + if (!inst.error) + inst.error = BAD_ARGS; + + return; + } + + if (score_pic == PIC) + { + int ldst_idx = 0; + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + build_lwst_pic (reg_rd, inst.reloc.exp, score_ldst_insns[ldst_idx * 3 + 0].template); + return; + } + else + { + if ((inst.reloc.exp.X_add_number <= 0x3fff) + && (inst.reloc.exp.X_add_number >= -0x4000) + && (!nopic_need_relax (inst.reloc.exp.X_add_symbol, 1))) + { + int ldst_idx = 0; + + /* Assign the real opcode. */ + ldst_idx = inst.instruction & OPC_PSEUDOLDST_MASK; + inst.instruction &= ~OPC_PSEUDOLDST_MASK; + inst.instruction |= score_ldst_insns[ldst_idx * 3 + 0].value; + inst.instruction |= reg_rd << 20; + inst.instruction |= GP << 15; + inst.relax_inst = 0x8000; + inst.relax_size = 0; + ldst_gp_p = 1; + } + } + } + + /* Backup inst. */ + memcpy (&inst_main, &inst, sizeof (struct score_it)); + r1_bak = nor1; + nor1 = 0; + + /* Determine which instructions should be output. */ + sprintf (append_str[0], "ld_i32hi r1, %s", label_str); + sprintf (append_str[1], "ld_i32lo r1, %s", label_str); + sprintf (append_str[2], "%s r%d, [r1, 0]", inst_backup.name, reg_rd); + + /* Generate three instructions. + la r1, label + ld/st rd, [r1, 0] */ + for (i = 0; i < 3; i++) + { + if (append_insn (append_str[i], FALSE) == (int) FAIL) + return; + + memcpy (&inst_expand[i], &inst, sizeof (struct score_it)); + } + + if (ldst_gp_p) + { + char *p; + + /* Adjust instruction opcode and to be relaxed instruction opcode. */ + inst_main.instruction = adjust_paritybit (inst_main.instruction, GET_INSN_CLASS (inst_main.type)); + inst_main.relax_size = inst_expand[0].size + inst_expand[1].size + inst_expand[2].size; + inst_main.type = Insn_GP; + + for (i = 0; i < 3; i++) + inst_expand[i].instruction = adjust_paritybit (inst_expand[i].instruction + , GET_INSN_CLASS (inst_expand[i].type)); + + /* Check data dependency. */ + handle_dependency (&inst_main); + + /* Start a new frag if frag_now is not empty. */ + if (frag_now_fix () != 0) + { + if (!frag_now->tc_frag_data.is_insn) + frag_wane (frag_now); + + frag_new (0); + } + frag_grow (20); + + /* Write fr_fix part. */ + p = frag_more (inst_main.size); + md_number_to_chars (p, inst_main.instruction, inst_main.size); + + if (inst_main.reloc.type != BFD_RELOC_NONE) + { + fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size, + &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type); + } + +#ifdef OBJ_ELF + dwarf2_emit_insn (inst_main.size); +#endif + + /* GP instruction can not do optimization, only can do relax between + 1 instruction and 3 instructions. */ + p = frag_var (rs_machine_dependent, inst_main.relax_size + RELAX_PAD_BYTE, 0, + RELAX_ENCODE (inst_main.size, inst_main.relax_size, inst_main.type, 0, 4, 0), + inst_main.reloc.exp.X_add_symbol, 0, NULL); + + /* Write fr_var part. + no calling gen_insn_frag, no fixS will be generated. */ + md_number_to_chars (p, inst_expand[0].instruction, inst_expand[0].size); + p += inst_expand[0].size; + md_number_to_chars (p, inst_expand[1].instruction, inst_expand[1].size); + p += inst_expand[1].size; + md_number_to_chars (p, inst_expand[2].instruction, inst_expand[2].size); + } + else + { + gen_insn_frag (&inst_expand[0], NULL); + gen_insn_frag (&inst_expand[1], NULL); + gen_insn_frag (&inst_expand[2], NULL); + } + nor1 = r1_bak; + + /* Set bwarn as -1, so macro instruction itself will not be generated frag. */ + inst.bwarn = -1; +} + +static void +do_lw_pic (char *str) +{ + int reg_rd; + + skip_whitespace (str); + if (((reg_rd = reg_required_here (&str, 20, REG_TYPE_SCORE)) == (int) FAIL) + || (skip_past_comma (&str) == (int) FAIL) + || (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL) + || (end_of_line (str) == (int) FAIL)) + { + return; + } + else + { + if (inst.reloc.exp.X_add_symbol == 0) + { + if (!inst.error) + inst.error = BAD_ARGS; + + return; + } + + inst.instruction |= GP << 15; + inst.reloc.type = BFD_RELOC_SCORE_GOT15; + } +} + +static void +do_empty (char *str) +{ + str = str; + if (university_version == 1) + { + if (((inst.instruction & 0x3e0003ff) == 0x0c000004) + || ((inst.instruction & 0x3e0003ff) == 0x0c000024) + || ((inst.instruction & 0x3e0003ff) == 0x0c000044) + || ((inst.instruction & 0x3e0003ff) == 0x0c000064)) + { + inst.error = ERR_FOR_SCORE5U_MMU; + return; + } + } + if (end_of_line (str) == (int) FAIL) + return; + + if (inst.relax_inst != 0x8000) + { + if (inst.type == NO_OPD) + { + inst.relax_size = 2; + } + else + { + inst.relax_size = 4; + } + } +} + +static void +do_jump (char *str) +{ + char *save_in; + + skip_whitespace (str); + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL) + return; + + if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label "); + return; + } + + if (((inst.reloc.exp.X_add_number & 0xff000000) != 0) + && ((inst.reloc.exp.X_add_number & 0xff000000) != 0xff000000)) + { + inst.error = _("invalid constant: 25 bit expression not in range -2^24..2^24"); + return; + } + + save_in = input_line_pointer; + input_line_pointer = str; + inst.reloc.type = BFD_RELOC_SCORE_JMP; + inst.reloc.pc_rel = 1; + input_line_pointer = save_in; +} + +static void +do16_jump (char *str) +{ + skip_whitespace (str); + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label "); + return; + } + else if (((inst.reloc.exp.X_add_number & 0xfffff800) != 0) + && ((inst.reloc.exp.X_add_number & 0xfffff800) != 0xfffff800)) + { + inst.error = _("invalid constant: 12 bit expression not in range -2^11..2^11"); + return; + } + + inst.reloc.type = BFD_RELOC_SCORE16_JMP; + inst.reloc.pc_rel = 1; +} + +static void +do_branch (char *str) +{ + unsigned long abs_value = 0; + + if (my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL) + { + return; + } + else if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label "); + return; + } + else if (((inst.reloc.exp.X_add_number & 0xff000000) != 0) + && ((inst.reloc.exp.X_add_number & 0xff000000) != 0xff000000)) + { + inst.error = _("invalid constant: 20 bit expression not in range -2^19..2^19"); + return; + } + + inst.reloc.type = BFD_RELOC_SCORE_BRANCH; + inst.reloc.pc_rel = 1; + + /* Branch 32 offset field : 20 bit, 16 bit branch offset field : 8 bit. */ + inst.instruction |= (inst.reloc.exp.X_add_number & 0x3fe) | ((inst.reloc.exp.X_add_number & 0xffc00) << 5); + + /* Compute 16 bit branch instruction. */ + if ((inst.relax_inst != 0x8000) && (abs_value & 0xfffffe00) == 0) + { + inst.relax_inst |= (((inst.instruction >> 10) & 0xf) << 8); + inst.relax_inst |= ((inst.reloc.exp.X_add_number >> 1) & 0xff); + inst.relax_size = 2; + } + else + { + inst.relax_inst = 0x8000; + } +} + +static void +do16_branch (char *str) +{ + if ((my_get_expression (&inst.reloc.exp, &str) == (int) FAIL + || end_of_line (str) == (int) FAIL)) + { + ; + } + else if (inst.reloc.exp.X_add_symbol == 0) + { + inst.error = _("lacking label"); + } + else if (((inst.reloc.exp.X_add_number & 0xffffff00) != 0) + && ((inst.reloc.exp.X_add_number & 0xffffff00) != 0xffffff00)) + { + inst.error = _("invalid constant: 9 bit expression not in range -2^8..2^8"); + } + else + { + inst.reloc.type = BFD_RELOC_SCORE16_BRANCH; + inst.reloc.pc_rel = 1; + inst.instruction |= ((inst.reloc.exp.X_add_number >> 1) & 0xff); + } +} + +/* Iterate over the base tables to create the instruction patterns. */ +static void +build_score_ops_hsh (void) +{ + unsigned int i; + static struct obstack insn_obstack; + + obstack_begin (&insn_obstack, 4000); + for (i = 0; i < sizeof (score_insns) / sizeof (struct asm_opcode); i++) + { + const struct asm_opcode *insn = score_insns + i; + unsigned len = strlen (insn->template); + struct asm_opcode *new; + char *template; + new = obstack_alloc (&insn_obstack, sizeof (struct asm_opcode)); + template = obstack_alloc (&insn_obstack, len + 1); + + strcpy (template, insn->template); + new->template = template; + new->parms = insn->parms; + new->value = insn->value; + new->relax_value = insn->relax_value; + new->type = insn->type; + new->bitmask = insn->bitmask; + hash_insert (score_ops_hsh, new->template, (void *) new); + } +} + +static void +build_dependency_insn_hsh (void) +{ + unsigned int i; + static struct obstack dependency_obstack; + + obstack_begin (&dependency_obstack, 4000); + for (i = 0; i < sizeof (insn_to_dependency_table) / sizeof (insn_to_dependency_table[0]); i++) + { + const struct insn_to_dependency *tmp = insn_to_dependency_table + i; + unsigned len = strlen (tmp->insn_name); + struct insn_to_dependency *new; + + new = obstack_alloc (&dependency_obstack, sizeof (struct insn_to_dependency)); + new->insn_name = obstack_alloc (&dependency_obstack, len + 1); + + strcpy (new->insn_name, tmp->insn_name); + new->type = tmp->type; + hash_insert (dependency_insn_hsh, new->insn_name, (void *) new); + } +} + +/* Turn an integer of n bytes (in val) into a stream of bytes appropriate + for use in the a.out file, and stores them in the array pointed to by buf. + This knows about the endian-ness of the target machine and does + THE RIGHT THING, whatever it is. Possible values for n are 1 (byte) + 2 (short) and 4 (long) Floating numbers are put out as a series of + LITTLENUMS (shorts, here at least). */ + +void +md_number_to_chars (char *buf, valueT val, int n) +{ + if (target_big_endian) + number_to_chars_bigendian (buf, val, n); + else + number_to_chars_littleendian (buf, val, n); +} + +static valueT +md_chars_to_number (char *buf, int n) +{ + valueT result = 0; + unsigned char *where = (unsigned char *)buf; + + if (target_big_endian) + { + while (n--) + { + result <<= 8; + result |= (*where++ & 255); + } + } + else + { + while (n--) + { + result <<= 8; + result |= (where[n] & 255); + } + } + + return result; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. + + Note that fp constants aren't represent in the normal way on the ARM. + In big endian mode, things are as expected. However, in little endian + mode fp constants are big-endian word-wise, and little-endian byte-wise + within the words. For example, (double) 1.1 in big endian mode is + the byte sequence 3f f1 99 99 99 99 99 9a, and in little endian mode is + the byte sequence 99 99 f1 3f 9a 99 99 99. */ + +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + char *t; + int i; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + case 'x': + case 'X': + case 'p': + case 'P': + prec = 6; + break; + default: + *sizeP = 0; + return _("bad call to MD_ATOF()"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + *sizeP = prec * 2; + + if (target_big_endian) + { + for (i = 0; i < prec; i++) + { + md_number_to_chars (litP, (valueT) words[i], 2); + litP += 2; + } + } + else + { + for (i = 0; i < prec; i += 2) + { + md_number_to_chars (litP, (valueT) words[i + 1], 2); + md_number_to_chars (litP + 2, (valueT) words[i], 2); + litP += 4; + } + } + + return 0; +} + +/* Return true if the given symbol should be considered local for PIC. */ + +static bfd_boolean +pic_need_relax (symbolS *sym, asection *segtype) +{ + asection *symsec; + bfd_boolean linkonce; + + /* Handle the case of a symbol equated to another symbol. */ + while (symbol_equated_reloc_p (sym)) + { + symbolS *n; + + /* It's possible to get a loop here in a badly written + program. */ + n = symbol_get_value_expression (sym)->X_add_symbol; + if (n == sym) + break; + sym = n; + } + + symsec = S_GET_SEGMENT (sym); + + /* duplicate the test for LINK_ONCE sections as in adjust_reloc_syms */ + linkonce = FALSE; + if (symsec != segtype && ! S_IS_LOCAL (sym)) + { + if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0) + linkonce = TRUE; + + /* The GNU toolchain uses an extension for ELF: a section + beginning with the magic string .gnu.linkonce is a linkonce + section. */ + if (strncmp (segment_name (symsec), ".gnu.linkonce", + sizeof ".gnu.linkonce" - 1) == 0) + linkonce = TRUE; + } + + /* This must duplicate the test in adjust_reloc_syms. */ + return (symsec != &bfd_und_section + && symsec != &bfd_abs_section + && ! bfd_is_com_section (symsec) + && !linkonce +#ifdef OBJ_ELF + /* A global or weak symbol is treated as external. */ + && (OUTPUT_FLAVOR != bfd_target_elf_flavour + || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym))) +#endif + ); +} + +static int +judge_size_before_relax (fragS * fragp, asection *sec) +{ + int change = 0; + + if (score_pic == NO_PIC) + change = nopic_need_relax (fragp->fr_symbol, 0); + else + change = pic_need_relax (fragp->fr_symbol, sec); + + if (change == 1) + { + /* Only at the first time determining whether GP instruction relax should be done, + return the difference between insntruction size and instruction relax size. */ + if (fragp->fr_opcode == NULL) + { + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype); + fragp->fr_opcode = fragp->fr_literal + RELAX_RELOC1 (fragp->fr_subtype); + return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype); + } + } + + return 0; +} + +/* In this function, we determine whether GP instruction should do relaxation, + for the label being against was known now. + Doing this here but not in md_relax_frag() can induce iteration times + in stage of doing relax. */ +int +md_estimate_size_before_relax (fragS * fragp, asection * sec ATTRIBUTE_UNUSED) +{ + if ((RELAX_TYPE (fragp->fr_subtype) == Insn_GP) + || (RELAX_TYPE (fragp->fr_subtype) == Insn_PIC)) + return judge_size_before_relax (fragp, sec); + + return 0; +} + +static int +b32_relax_to_b16 (fragS * fragp) +{ + int grows = 0; + int relaxable_p = 0; + int old; + int new; + int frag_addr = fragp->fr_address + fragp->insn_addr; + + addressT symbol_address = 0; + symbolS *s; + offsetT offset; + unsigned long value; + unsigned long abs_value; + + /* FIXME : here may be able to modify better . + I don't know how to get the fragp's section , + so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section + is different from the symbol's. */ + + old = RELAX_OLD (fragp->fr_subtype); + new = RELAX_NEW (fragp->fr_subtype); + relaxable_p = RELAX_OPT (fragp->fr_subtype); + + s = fragp->fr_symbol; + /* b/bl immediate */ + if (s == NULL) + frag_addr = 0; + else + { + if (s->bsym != 0) + symbol_address = (addressT) s->sy_frag->fr_address; + } + + value = md_chars_to_number (fragp->fr_literal, INSN_SIZE); + + /* b 32's offset : 20 bit, b 16's tolerate field : 0xff. */ + offset = ((value & 0x3ff0000) >> 6) | (value & 0x3fe); + if ((offset & 0x80000) == 0x80000) + offset |= 0xfff00000; + + abs_value = offset + symbol_address - frag_addr; + if ((abs_value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - abs_value + 1; + + /* Relax branch 32 to branch 16. */ + if (relaxable_p && (s->bsym != NULL) && ((abs_value & 0xffffff00) == 0) + && (S_IS_DEFINED (s) && !S_IS_COMMON (s) && !S_IS_EXTERNAL (s))) + { + /* do nothing. */ + } + else + { + /* Branch 32 can not be relaxed to b 16, so clear OPT bit. */ + fragp->fr_opcode = NULL; + fragp->fr_subtype = RELAX_OPT_CLEAR (fragp->fr_subtype); + } + + return grows; +} + +/* Main purpose is to determine whether one frag should do relax. + frag->fr_opcode indicates this point. */ + +int +score_relax_frag (asection * sec ATTRIBUTE_UNUSED, fragS * fragp, long stretch ATTRIBUTE_UNUSED) +{ + int grows = 0; + int insn_size; + int insn_relax_size; + int do_relax_p = 0; /* Indicate doing relaxation for this frag. */ + int relaxable_p = 0; + bfd_boolean word_align_p = FALSE; + fragS *next_fragp; + + /* If the instruction address is odd, make it half word align first. */ + if ((fragp->fr_address) % 2 != 0) + { + if ((fragp->fr_address + fragp->insn_addr) % 2 != 0) + { + fragp->insn_addr = 1; + grows += 1; + } + } + + word_align_p = ((fragp->fr_address + fragp->insn_addr) % 4 == 0) ? TRUE : FALSE; + + /* Get instruction size and relax size after the last relaxation. */ + if (fragp->fr_opcode) + { + insn_size = RELAX_NEW (fragp->fr_subtype); + insn_relax_size = RELAX_OLD (fragp->fr_subtype); + } + else + { + insn_size = RELAX_OLD (fragp->fr_subtype); + insn_relax_size = RELAX_NEW (fragp->fr_subtype); + } + + /* Handle specially for GP instruction. for, judge_size_before_relax() has already determine + whether the GP instruction should do relax. */ + if ((RELAX_TYPE (fragp->fr_subtype) == Insn_GP) + || (RELAX_TYPE (fragp->fr_subtype) == Insn_PIC)) + { + if (!word_align_p) + { + if (fragp->insn_addr < 2) + { + fragp->insn_addr += 2; + grows += 2; + } + else + { + fragp->insn_addr -= 2; + grows -= 2; + } + } + + if (fragp->fr_opcode) + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype) + fragp->insn_addr; + else + fragp->fr_fix = RELAX_OLD (fragp->fr_subtype) + fragp->insn_addr; + } + else + { + if (RELAX_TYPE (fragp->fr_subtype) == PC_DISP19div2) + b32_relax_to_b16 (fragp); + + relaxable_p = RELAX_OPT (fragp->fr_subtype); + next_fragp = fragp->fr_next; + while ((next_fragp) && (next_fragp->fr_type != rs_machine_dependent)) + { + next_fragp = next_fragp->fr_next; + } + + if (next_fragp) + { + int n_insn_size; + int n_relaxable_p = 0; + + if (next_fragp->fr_opcode) + { + n_insn_size = RELAX_NEW (next_fragp->fr_subtype); + } + else + { + n_insn_size = RELAX_OLD (next_fragp->fr_subtype); + } + + if (RELAX_TYPE (next_fragp->fr_subtype) == PC_DISP19div2) + b32_relax_to_b16 (next_fragp); + n_relaxable_p = RELAX_OPT (next_fragp->fr_subtype); + + if (word_align_p) + { + if (insn_size == 4) + { + /* 32 -> 16. */ + if (relaxable_p && ((n_insn_size == 2) || n_relaxable_p)) + { + grows -= 2; + do_relax_p = 1; + } + } + else if (insn_size == 2) + { + /* 16 -> 32. */ + if (relaxable_p && (((n_insn_size == 4) && !n_relaxable_p) || (n_insn_size > 4))) + { + grows += 2; + do_relax_p = 1; + } + } + else + { + abort (); + } + } + else + { + if (insn_size == 4) + { + /* 32 -> 16. */ + if (relaxable_p) + { + grows -= 2; + do_relax_p = 1; + } + /* Make the 32 bit insturction word align. */ + else + { + fragp->insn_addr += 2; + grows += 2; + } + } + else if (insn_size == 2) + { + /* Do nothing. */ + } + else + { + abort (); + } + } + } + else + { + /* Here, try best to do relax regardless fragp->fr_next->fr_type. */ + if (word_align_p == FALSE) + { + if (insn_size % 4 == 0) + { + /* 32 -> 16. */ + if (relaxable_p) + { + grows -= 2; + do_relax_p = 1; + } + else + { + fragp->insn_addr += 2; + grows += 2; + } + } + } + else + { + /* Do nothing. */ + } + } + + /* fragp->fr_opcode indicates whether this frag should be relaxed. */ + if (do_relax_p) + { + if (fragp->fr_opcode) + { + fragp->fr_opcode = NULL; + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_OLD (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + else + { + fragp->fr_opcode = fragp->fr_literal + RELAX_RELOC1 (fragp->fr_subtype); + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + } + else + { + if (fragp->fr_opcode) + { + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_NEW (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + else + { + /* Guarantee estimate stage is correct. */ + fragp->fr_fix = RELAX_OLD (fragp->fr_subtype); + fragp->fr_fix += fragp->insn_addr; + } + } + } + + return grows; +} + +void +md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp) +{ + int old; + int new; + char backup[20]; + fixS *fixp; + + old = RELAX_OLD (fragp->fr_subtype); + new = RELAX_NEW (fragp->fr_subtype); + + /* fragp->fr_opcode indicates whether this frag should be relaxed. */ + if (fragp->fr_opcode == NULL) + { + memcpy (backup, fragp->fr_literal, old); + fragp->fr_fix = old; + } + else + { + memcpy (backup, fragp->fr_literal + old, new); + fragp->fr_fix = new; + } + + fixp = fragp->tc_frag_data.fixp; + while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old) + { + if (fragp->fr_opcode) + fixp->fx_done = 1; + fixp = fixp->fx_next; + } + while (fixp && fixp->fx_frag == fragp) + { + if (fragp->fr_opcode) + fixp->fx_where -= old + fragp->insn_addr; + else + fixp->fx_done = 1; + fixp = fixp->fx_next; + } + + if (fragp->insn_addr) + { + md_number_to_chars (fragp->fr_literal, 0x0, fragp->insn_addr); + } + memcpy (fragp->fr_literal + fragp->insn_addr, backup, fragp->fr_fix); + fragp->fr_fix += fragp->insn_addr; +} + +/* Implementation of md_frag_check. + Called after md_convert_frag(). */ + +void +score_frag_check (fragS * fragp ATTRIBUTE_UNUSED) +{ + know (fragp->insn_addr <= RELAX_PAD_BYTE); +} + +bfd_boolean +score_fix_adjustable (fixS * fixP) +{ + if (fixP->fx_addsy == NULL) + { + return 1; + } + else if (OUTPUT_FLAVOR == bfd_target_elf_flavour + && (S_IS_EXTERNAL (fixP->fx_addsy) || S_IS_WEAK (fixP->fx_addsy))) + { + return 0; + } + else if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + { + return 0; + } + + return 1; +} + +/* Implementation of TC_VALIDATE_FIX. + Called before md_apply_fix() and after md_convert_frag(). */ +void +score_validate_fix (fixS *fixP) +{ + fixP->fx_where += fixP->fx_frag->insn_addr; +} + +long +md_pcrel_from (fixS * fixP) +{ + long retval = 0; + + if (fixP->fx_addsy + && (S_GET_SEGMENT (fixP->fx_addsy) == undefined_section) + && (fixP->fx_subsy == NULL)) + { + retval = 0; + } + else + { + retval = fixP->fx_where + fixP->fx_frag->fr_address; + } + + return retval; +} + +int +score_force_relocation (struct fix *fixp) +{ + int retval = 0; + + if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY + || fixp->fx_r_type == BFD_RELOC_SCORE_JMP + || fixp->fx_r_type == BFD_RELOC_SCORE_BRANCH + || fixp->fx_r_type == BFD_RELOC_SCORE16_JMP + || fixp->fx_r_type == BFD_RELOC_SCORE16_BRANCH) + { + retval = 1; + } + + return retval; +} + +/* Round up a section size to the appropriate boundary. */ +valueT +md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, segment); + + return ((size + (1 << align) - 1) & (-1 << align)); +} + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg) +{ + offsetT value = *valP; + offsetT abs_value = 0; + offsetT newval; + offsetT content; + unsigned short HI, LO; + + char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; + + assert (fixP->fx_r_type < BFD_RELOC_UNUSED); + if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) + { + if (fixP->fx_r_type != BFD_RELOC_SCORE_DUMMY_HI16) + fixP->fx_done = 1; + } + + /* If this symbol is in a different section then we need to leave it for + the linker to deal with. Unfortunately, md_pcrel_from can't tell, + so we have to undo it's effects here. */ + if (fixP->fx_pcrel) + { + if (fixP->fx_addsy != NULL + && S_IS_DEFINED (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) != seg) + value += md_pcrel_from (fixP); + } + + /* Remember value for emit_reloc. */ + fixP->fx_addnumber = value; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_HI16_S: + if (fixP->fx_done) + { /* For la rd, imm32. */ + newval = md_chars_to_number (buf, INSN_SIZE); + HI = (value) >> 16; /* mul to 2, then take the hi 16 bit. */ + newval |= (HI & 0x3fff) << 1; + newval |= ((HI >> 14) & 0x3) << 16; + md_number_to_chars (buf, newval, INSN_SIZE); + } + break; + case BFD_RELOC_LO16: + if (fixP->fx_done) /* For la rd, imm32. */ + { + newval = md_chars_to_number (buf, INSN_SIZE); + LO = (value) & 0xffff; + newval |= (LO & 0x3fff) << 1; /* 16 bit: imm -> 14 bit in lo, 2 bit in hi. */ + newval |= ((LO >> 14) & 0x3) << 16; + md_number_to_chars (buf, newval, INSN_SIZE); + } + break; + case BFD_RELOC_SCORE_JMP: + { + content = md_chars_to_number (buf, INSN_SIZE); + value = fixP->fx_offset; + content = (content & ~0x3ff7ffe) | ((value << 1) & 0x3ff0000) | (value & 0x7fff); + md_number_to_chars (buf, content, INSN_SIZE); + } + break; + case BFD_RELOC_SCORE_BRANCH: + if ((S_GET_SEGMENT (fixP->fx_addsy) != seg) || (fixP->fx_addsy != NULL && S_IS_EXTERNAL (fixP->fx_addsy))) + value = fixP->fx_offset; + else + fixP->fx_done = 1; + + content = md_chars_to_number (buf, INSN_SIZE); + if ((fixP->fx_frag->fr_opcode != 0) && ((content & 0x80008000) != 0x80008000)) + { + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xffffff00) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^8 ~ 2^8]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN16_SIZE); + content &= 0xff00; + content = (content & 0xff00) | ((value >> 1) & 0xff); + md_number_to_chars (buf, content, INSN16_SIZE); + fixP->fx_r_type = BFD_RELOC_SCORE16_BRANCH; + fixP->fx_size = 2; + } + else + { + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xfff80000) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^19 ~ 2^19]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN_SIZE); + content &= 0xfc00fc01; + content = (content & 0xfc00fc01) | (value & 0x3fe) | ((value << 6) & 0x3ff0000); + md_number_to_chars (buf, content, INSN_SIZE); + } + break; + case BFD_RELOC_SCORE16_JMP: + content = md_chars_to_number (buf, INSN16_SIZE); + content &= 0xf001; + value = fixP->fx_offset & 0xfff; + content = (content & 0xfc01) | (value & 0xffe); + md_number_to_chars (buf, content, INSN16_SIZE); + break; + case BFD_RELOC_SCORE16_BRANCH: + content = md_chars_to_number (buf, INSN_SIZE); + if ((fixP->fx_frag->fr_opcode != 0) && ((content & 0x80008000) == 0x80008000)) + { + if ((S_GET_SEGMENT (fixP->fx_addsy) != seg) || + (fixP->fx_addsy != NULL && S_IS_EXTERNAL (fixP->fx_addsy))) + value = fixP->fx_offset; + else + fixP->fx_done = 1; + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xfff80000) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^19 ~ 2^19]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN_SIZE); + content = (content & 0xfc00fc01) | (value & 0x3fe) | ((value << 6) & 0x3ff0000); + md_number_to_chars (buf, content, INSN_SIZE); + fixP->fx_r_type = BFD_RELOC_SCORE_BRANCH; + fixP->fx_size = 4; + break; + } + else + { + /* In differnt section. */ + if ((S_GET_SEGMENT (fixP->fx_addsy) != seg) || + (fixP->fx_addsy != NULL && S_IS_EXTERNAL (fixP->fx_addsy))) + value = fixP->fx_offset; + else + fixP->fx_done = 1; + + if ((value & 0x80000000) == 0x80000000) + abs_value = 0xffffffff - value + 1; + if ((abs_value & 0xffffff00) != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _(" branch relocation truncate (0x%x) [-2^8 ~ 2^8]"), (unsigned int)value); + return; + } + content = md_chars_to_number (buf, INSN16_SIZE); + content = (content & 0xff00) | ((value >> 1) & 0xff); + md_number_to_chars (buf, content, INSN16_SIZE); + break; + } + case BFD_RELOC_8: + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 1); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 1); + } +#endif + break; + + case BFD_RELOC_16: + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 2); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 2); + } +#endif + break; + case BFD_RELOC_RVA: + case BFD_RELOC_32: + if (fixP->fx_done || fixP->fx_pcrel) + md_number_to_chars (buf, value, 4); +#ifdef OBJ_ELF + else + { + value = fixP->fx_offset; + md_number_to_chars (buf, value, 4); + } +#endif + break; + case BFD_RELOC_VTABLE_INHERIT: + fixP->fx_done = 0; + if (fixP->fx_addsy && !S_IS_DEFINED (fixP->fx_addsy) && !S_IS_WEAK (fixP->fx_addsy)) + S_SET_WEAK (fixP->fx_addsy); + break; + case BFD_RELOC_VTABLE_ENTRY: + fixP->fx_done = 0; + break; + case BFD_RELOC_SCORE_GPREL15: + content = md_chars_to_number (buf, INSN_SIZE); + if ((fixP->fx_frag->fr_opcode != 0) && ((content & 0xfc1c8000) != 0x94188000)) + fixP->fx_r_type = BFD_RELOC_NONE; + fixP->fx_done = 0; + break; + case BFD_RELOC_SCORE_GOT15: + case BFD_RELOC_SCORE_DUMMY_HI16: + case BFD_RELOC_SCORE_GOT_LO16: + case BFD_RELOC_SCORE_CALL15: + case BFD_RELOC_GPREL32: + break; + case BFD_RELOC_NONE: + default: + as_bad_where (fixP->fx_file, fixP->fx_line, _("bad relocation fixup type (%d)"), fixP->fx_r_type); + } +} + +/* Translate internal representation of relocation info to BFD target format. */ +arelent ** +tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp) +{ + static arelent *retval[MAX_RELOC_EXPANSION + 1]; /* MAX_RELOC_EXPANSION equals 2. */ + arelent *reloc; + bfd_reloc_code_real_type code; + char *type; + fragS *f; + symbolS *s; + expressionS e; + + reloc = retval[0] = xmalloc (sizeof (arelent)); + retval[1] = NULL; + + reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->addend = fixp->fx_offset; + + /* If this is a variant frag, we may need to adjust the existing + reloc and generate a new one. */ + if (fixp->fx_frag->fr_opcode != NULL && (fixp->fx_r_type == BFD_RELOC_SCORE_GPREL15)) + { + /* Update instruction imm bit. */ + offsetT newval; + unsigned short off; + char *buf; + + buf = fixp->fx_frag->fr_literal + fixp->fx_frag->insn_addr; + newval = md_chars_to_number (buf, INSN_SIZE); + off = fixp->fx_offset >> 16; + newval |= (off & 0x3fff) << 1; + newval |= ((off >> 14) & 0x3) << 16; + md_number_to_chars (buf, newval, INSN_SIZE); + + buf += INSN_SIZE; + newval = md_chars_to_number (buf, INSN_SIZE); + off = fixp->fx_offset & 0xffff; + newval |= ((off & 0x3fff) << 1); + newval |= (((off >> 14) & 0x3) << 16); + md_number_to_chars (buf, newval, INSN_SIZE); + + retval[1] = xmalloc (sizeof (arelent)); + retval[2] = NULL; + retval[1]->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); + *retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + retval[1]->address = (reloc->address + RELAX_RELOC2 (fixp->fx_frag->fr_subtype)); + + f = fixp->fx_frag; + s = f->fr_symbol; + e = s->sy_value; + + retval[1]->addend = 0; + retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16); + assert (retval[1]->howto != NULL); + + fixp->fx_r_type = BFD_RELOC_HI16_S; + } + + code = fixp->fx_r_type; + switch (fixp->fx_r_type) + { + case BFD_RELOC_32: + if (fixp->fx_pcrel) + { + code = BFD_RELOC_32_PCREL; + break; + } + case BFD_RELOC_HI16_S: + case BFD_RELOC_LO16: + case BFD_RELOC_SCORE_JMP: + case BFD_RELOC_SCORE_BRANCH: + case BFD_RELOC_SCORE16_JMP: + case BFD_RELOC_SCORE16_BRANCH: + case BFD_RELOC_VTABLE_ENTRY: + case BFD_RELOC_VTABLE_INHERIT: + case BFD_RELOC_SCORE_GPREL15: + case BFD_RELOC_SCORE_GOT15: + case BFD_RELOC_SCORE_DUMMY_HI16: + case BFD_RELOC_SCORE_GOT_LO16: + case BFD_RELOC_SCORE_CALL15: + case BFD_RELOC_GPREL32: + case BFD_RELOC_NONE: + code = fixp->fx_r_type; + break; + default: + type = _(""); + as_bad_where (fixp->fx_file, fixp->fx_line, + _("cannot represent %s relocation in this object file format"), type); + return NULL; + } + + reloc->howto = bfd_reloc_type_lookup (stdoutput, code); + if (reloc->howto == NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("cannot represent %s relocation in this object file format1"), + bfd_get_reloc_code_name (code)); + return NULL; + } + /* HACK: Since arm ELF uses Rel instead of Rela, encode the + vtable entry to be used in the relocation's section offset. */ + if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + reloc->address = fixp->fx_offset; + + return retval; +} + +void +score_elf_final_processing (void) +{ + if (fix_data_dependency == 1) + { + elf_elfheader (stdoutput)->e_flags |= EF_SCORE_FIXDEP; + } + if (score_pic == PIC) + { + elf_elfheader (stdoutput)->e_flags |= EF_SCORE_PIC; + } +} + +static void +parse_pce_inst (char *insnstr) +{ + char c; + char *p; + char first[MAX_LITERAL_POOL_SIZE]; + char second[MAX_LITERAL_POOL_SIZE]; + struct score_it pec_part_1; + + /* Get first part string of PCE. */ + p = strstr (insnstr, "||"); + c = *p; + *p = '\0'; + sprintf (first, "%s", insnstr); + + /* Get second part string of PCE. */ + *p = c; + p += 2; + sprintf (second, "%s", p); + + parse_16_32_inst (first, FALSE); + if (inst.error) + return; + + memcpy (&pec_part_1, &inst, sizeof (inst)); + + parse_16_32_inst (second, FALSE); + if (inst.error) + return; + + if ( ((pec_part_1.size == INSN_SIZE) && (inst.size == INSN_SIZE)) + || ((pec_part_1.size == INSN_SIZE) && (inst.size == INSN16_SIZE)) + || ((pec_part_1.size == INSN16_SIZE) && (inst.size == INSN_SIZE))) + { + inst.error = _("pce instruction error (16 bit || 16 bit)'"); + sprintf (inst.str, insnstr); + return; + } + + if (!inst.error) + gen_insn_frag (&pec_part_1, &inst); +} + +void +md_assemble (char *str) +{ + know (str); + know (strlen (str) < MAX_LITERAL_POOL_SIZE); + + memset (&inst, '\0', sizeof (inst)); + if (INSN_IS_PCE_P (str)) + parse_pce_inst (str); + else + parse_16_32_inst (str, TRUE); + + if (inst.error) + as_bad (_("%s -- `%s'"), inst.error, inst.str); +} + +/* We handle all bad expressions here, so that we can report the faulty + instruction in the error message. */ +void +md_operand (expressionS * expr) +{ + if (in_my_get_expression) + { + expr->X_op = O_illegal; + if (inst.error == NULL) + { + inst.error = _("bad expression"); + } + } +} + +const char *md_shortopts = "nO::g::G:"; + +#ifdef SCORE_BI_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#define OPTION_EL (OPTION_MD_BASE + 1) +#else +#if TARGET_BYTES_BIG_ENDIAN +#define OPTION_EB (OPTION_MD_BASE + 0) +#else +#define OPTION_EL (OPTION_MD_BASE + 1) +#endif +#endif +#define OPTION_FIXDD (OPTION_MD_BASE + 2) +#define OPTION_NWARN (OPTION_MD_BASE + 3) +#define OPTION_SCORE5 (OPTION_MD_BASE + 4) +#define OPTION_SCORE5U (OPTION_MD_BASE + 5) +#define OPTION_SCORE7 (OPTION_MD_BASE + 6) +#define OPTION_R1 (OPTION_MD_BASE + 7) +#define OPTION_O0 (OPTION_MD_BASE + 8) +#define OPTION_SCORE_VERSION (OPTION_MD_BASE + 9) +#define OPTION_PIC (OPTION_MD_BASE + 10) + +struct option md_longopts[] = +{ +#ifdef OPTION_EB + {"EB" , no_argument, NULL, OPTION_EB}, +#endif +#ifdef OPTION_EL + {"EL" , no_argument, NULL, OPTION_EL}, +#endif + {"FIXDD" , no_argument, NULL, OPTION_FIXDD}, + {"NWARN" , no_argument, NULL, OPTION_NWARN}, + {"SCORE5" , no_argument, NULL, OPTION_SCORE5}, + {"SCORE5U", no_argument, NULL, OPTION_SCORE5U}, + {"SCORE7" , no_argument, NULL, OPTION_SCORE7}, + {"USE_R1" , no_argument, NULL, OPTION_R1}, + {"O0" , no_argument, NULL, OPTION_O0}, + {"V" , no_argument, NULL, OPTION_SCORE_VERSION}, + {"KPIC" , no_argument, NULL, OPTION_PIC}, + {NULL , no_argument, NULL, 0} +}; + +size_t md_longopts_size = sizeof (md_longopts); + +int +md_parse_option (int c, char *arg) +{ + switch (c) + { +#ifdef OPTION_EB + case OPTION_EB: + target_big_endian = 1; + break; +#endif +#ifdef OPTION_EL + case OPTION_EL: + target_big_endian = 0; + break; +#endif + case OPTION_FIXDD: + fix_data_dependency = 1; + break; + case OPTION_NWARN: + warn_fix_data_dependency = 0; + break; + case OPTION_SCORE5: + score7 = 0; + university_version = 0; + vector_size = SCORE5_PIPELINE; + break; + case OPTION_SCORE5U: + score7 = 0; + university_version = 1; + vector_size = SCORE5_PIPELINE; + break; + case OPTION_SCORE7: + score7 = 1; + university_version = 0; + vector_size = SCORE7_PIPELINE; + break; + case OPTION_R1: + nor1 = 0; + break; + case 'G': + g_switch_value = atoi (arg); + break; + case OPTION_O0: + g_opt = 0; + break; + case OPTION_SCORE_VERSION: + printf (_("Sunplus-v2-0-0-20060510\n")); + break; + case OPTION_PIC: + score_pic = PIC; + g_switch_value = 0; /* Must set -G num as 0 to generate PIC code. */ + break; + default: + /* as_bad (_("unrecognized option `-%c%s'"), c, arg ? arg : ""); */ + return 0; + } + return 1; +} + +void +md_show_usage (FILE * fp) +{ + fprintf (fp, _(" Score-specific assembler options:\n")); +#ifdef OPTION_EB + fprintf (fp, _("\ + -EB\t\tassemble code for a big-endian cpu\n")); +#endif + +#ifdef OPTION_EL + fprintf (fp, _("\ + -EL\t\tassemble code for a little-endian cpu\n")); +#endif + + fprintf (fp, _("\ + -FIXDD\t\tassemble code for fix data dependency\n")); + fprintf (fp, _("\ + -NWARN\t\tassemble code for no warning message for fix data dependency\n")); + fprintf (fp, _("\ + -SCORE5\t\tassemble code for target is SCORE5\n")); + fprintf (fp, _("\ + -SCORE5U\tassemble code for target is SCORE5U\n")); + fprintf (fp, _("\ + -SCORE7\t\tassemble code for target is SCORE7, this is default setting\n")); + fprintf (fp, _("\ + -USE_R1\t\tassemble code for no warning message when using temp register r1\n")); + fprintf (fp, _("\ + -KPIC\t\tassemble code for PIC\n")); + fprintf (fp, _("\ + -O0\t\tassembler will not perform any optimizations\n")); + fprintf (fp, _("\ + -G gpnum\tassemble code for setting gpsize and default is 8 byte\n")); + fprintf (fp, _("\ + -V \t\tSunplus release version \n")); +} + + +/* Pesudo handling functions. */ + +/* If we change section we must dump the literal pool first. */ +static void +s_score_bss (int ignore ATTRIBUTE_UNUSED) +{ + subseg_set (bss_section, (subsegT) get_absolute_expression ()); + demand_empty_rest_of_line (); +} + +static void +s_score_text (int ignore) +{ + obj_elf_text (ignore); + record_alignment (now_seg, 2); +} + +static void +score_s_section (int ignore) +{ + obj_elf_section (ignore); + if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + record_alignment (now_seg, 2); + +} + +static void +s_change_sec (int sec) +{ + segT seg; + +#ifdef OBJ_ELF + /* The ELF backend needs to know that we are changing sections, so + that .previous works correctly. We could do something like check + for an obj_section_change_hook macro, but that might be confusing + as it would not be appropriate to use it in the section changing + functions in read.c, since obj-elf.c intercepts those. FIXME: + This should be cleaner, somehow. */ + obj_elf_section_change_hook (); +#endif + switch (sec) + { + case 'r': + seg = subseg_new (RDATA_SECTION_NAME, (subsegT) get_absolute_expression ()); + bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA)); + if (strcmp (TARGET_OS, "elf") != 0) + record_alignment (seg, 4); + demand_empty_rest_of_line (); + break; + case 's': + seg = subseg_new (".sdata", (subsegT) get_absolute_expression ()); + bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA); + if (strcmp (TARGET_OS, "elf") != 0) + record_alignment (seg, 4); + demand_empty_rest_of_line (); + break; + } +} + +static void +s_score_mask (int reg_type ATTRIBUTE_UNUSED) +{ + long mask, off; + + if (cur_proc_ptr == (procS *) NULL) + { + as_warn (_(".mask outside of .ent")); + demand_empty_rest_of_line (); + return; + } + if (get_absolute_expression_and_terminator (&mask) != ',') + { + as_warn (_("Bad .mask directive")); + --input_line_pointer; + demand_empty_rest_of_line (); + return; + } + off = get_absolute_expression (); + cur_proc_ptr->reg_mask = mask; + cur_proc_ptr->reg_offset = off; + demand_empty_rest_of_line (); +} + +static symbolS * +get_symbol (void) +{ + int c; + char *name; + symbolS *p; + + name = input_line_pointer; + c = get_symbol_end (); + p = (symbolS *) symbol_find_or_make (name); + *input_line_pointer = c; + return p; +} + +static long +get_number (void) +{ + int negative = 0; + long val = 0; + + if (*input_line_pointer == '-') + { + ++input_line_pointer; + negative = 1; + } + if (!ISDIGIT (*input_line_pointer)) + as_bad (_("expected simple number")); + if (input_line_pointer[0] == '0') + { + if (input_line_pointer[1] == 'x') + { + input_line_pointer += 2; + while (ISXDIGIT (*input_line_pointer)) + { + val <<= 4; + val |= hex_value (*input_line_pointer++); + } + return negative ? -val : val; + } + else + { + ++input_line_pointer; + while (ISDIGIT (*input_line_pointer)) + { + val <<= 3; + val |= *input_line_pointer++ - '0'; + } + return negative ? -val : val; + } + } + if (!ISDIGIT (*input_line_pointer)) + { + printf (_(" *input_line_pointer == '%c' 0x%02x\n"), *input_line_pointer, *input_line_pointer); + as_warn (_("invalid number")); + return -1; + } + while (ISDIGIT (*input_line_pointer)) + { + val *= 10; + val += *input_line_pointer++ - '0'; + } + return negative ? -val : val; +} + +/* The .aent and .ent directives. */ + +static void +s_score_ent (int aent) +{ + symbolS *symbolP; + int maybe_text; + + symbolP = get_symbol (); + if (*input_line_pointer == ',') + ++input_line_pointer; + SKIP_WHITESPACE (); + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') + get_number (); + +#ifdef BFD_ASSEMBLER + if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + maybe_text = 1; + else + maybe_text = 0; +#else + if (now_seg != data_section && now_seg != bss_section) + maybe_text = 1; + else + maybe_text = 0; +#endif + if (!maybe_text) + as_warn (_(".ent or .aent not in text section.")); + if (!aent && cur_proc_ptr) + as_warn (_("missing .end")); + if (!aent) + { + cur_proc_ptr = &cur_proc; + cur_proc_ptr->reg_mask = 0xdeadbeaf; + cur_proc_ptr->reg_offset = 0xdeadbeaf; + cur_proc_ptr->fpreg_mask = 0xdeafbeaf; + cur_proc_ptr->leaf = 0xdeafbeaf; + cur_proc_ptr->frame_offset = 0xdeafbeaf; + cur_proc_ptr->frame_reg = 0xdeafbeaf; + cur_proc_ptr->pc_reg = 0xdeafbeaf; + cur_proc_ptr->isym = symbolP; + symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + ++numprocs; + if (debug_type == DEBUG_STABS) + stabs_generate_asm_func (S_GET_NAME (symbolP), S_GET_NAME (symbolP)); + } + demand_empty_rest_of_line (); +} + +static void +s_score_frame (int ignore ATTRIBUTE_UNUSED) +{ + char *backupstr; + char str[30]; + long val; + int i = 0; + + backupstr = input_line_pointer; + +#ifdef OBJ_ELF + if (cur_proc_ptr == (procS *) NULL) + { + as_warn (_(".frame outside of .ent")); + demand_empty_rest_of_line (); + return; + } + cur_proc_ptr->frame_reg = reg_required_here ((&backupstr), 0, REG_TYPE_SCORE); + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + while (*backupstr != ',') + { + str[i] = *backupstr; + i++; + backupstr++; + } + str[i] = '\0'; + val = atoi (str); + + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + cur_proc_ptr->frame_offset = val; + cur_proc_ptr->pc_reg = reg_required_here ((&backupstr), 0, REG_TYPE_SCORE); + + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + i = 0; + while (*backupstr != '\n') + { + str[i] = *backupstr; + i++; + backupstr++; + } + str[i] = '\0'; + val = atoi (str); + cur_proc_ptr->leaf = val; + SKIP_WHITESPACE (); + skip_past_comma (&backupstr); + +#endif /* OBJ_ELF */ + while (input_line_pointer != backupstr) + input_line_pointer++; +} + +/* The .end directive. */ +static void +s_score_end (int x ATTRIBUTE_UNUSED) +{ + symbolS *p; + int maybe_text; + + /* Generate a .pdr section. */ + segT saved_seg = now_seg; + subsegT saved_subseg = now_subseg; + valueT dot; + expressionS exp; + char *fragp; + + if (!is_end_of_line[(unsigned char)*input_line_pointer]) + { + p = get_symbol (); + demand_empty_rest_of_line (); + } + else + p = NULL; + +#ifdef BFD_ASSEMBLER + if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) + maybe_text = 1; + else + maybe_text = 0; +#else + if (now_seg != data_section && now_seg != bss_section) + maybe_text = 1; + else + maybe_text = 0; +#endif + + if (!maybe_text) + as_warn (_(".end not in text section")); + if (!cur_proc_ptr) + { + as_warn (_(".end directive without a preceding .ent directive.")); + demand_empty_rest_of_line (); + return; + } + if (p != NULL) + { + assert (S_GET_NAME (p)); + if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->isym))) + as_warn (_(".end symbol does not match .ent symbol.")); + if (debug_type == DEBUG_STABS) + stabs_generate_asm_endfunc (S_GET_NAME (p), S_GET_NAME (p)); + } + else + as_warn (_(".end directive missing or unknown symbol")); + + if ((cur_proc_ptr->reg_mask == 0xdeadbeaf) || + (cur_proc_ptr->reg_offset == 0xdeadbeaf) || + (cur_proc_ptr->leaf == 0xdeafbeaf) || + (cur_proc_ptr->frame_offset == 0xdeafbeaf) || + (cur_proc_ptr->frame_reg == 0xdeafbeaf) || (cur_proc_ptr->pc_reg == 0xdeafbeaf)); + + else + { + dot = frag_now_fix (); + assert (pdr_seg); + subseg_set (pdr_seg, 0); + /* Write the symbol. */ + exp.X_op = O_symbol; + exp.X_add_symbol = p; + exp.X_add_number = 0; + emit_expr (&exp, 4); + fragp = frag_more (7 * 4); + md_number_to_chars (fragp, (valueT) cur_proc_ptr->reg_mask, 4); + md_number_to_chars (fragp + 4, (valueT) cur_proc_ptr->reg_offset, 4); + md_number_to_chars (fragp + 8, (valueT) cur_proc_ptr->fpreg_mask, 4); + md_number_to_chars (fragp + 12, (valueT) cur_proc_ptr->leaf, 4); + md_number_to_chars (fragp + 16, (valueT) cur_proc_ptr->frame_offset, 4); + md_number_to_chars (fragp + 20, (valueT) cur_proc_ptr->frame_reg, 4); + md_number_to_chars (fragp + 24, (valueT) cur_proc_ptr->pc_reg, 4); + subseg_set (saved_seg, saved_subseg); + + } + cur_proc_ptr = NULL; +} + +/* Handle the .set pseudo-op. */ +static void +s_score_set (int x ATTRIBUTE_UNUSED) +{ + int i = 0; + char name[MAX_LITERAL_POOL_SIZE]; + char * orig_ilp = input_line_pointer; + + while (!is_end_of_line[(unsigned char)*input_line_pointer]) + { + name[i] = (char) * input_line_pointer; + i++; + ++input_line_pointer; + } + + name[i] = '\0'; + + if (strcmp (name, "nwarn") == 0) + { + warn_fix_data_dependency = 0; + } + else if (strcmp (name, "fixdd") == 0) + { + fix_data_dependency = 1; + } + else if (strcmp (name, "nofixdd") == 0) + { + fix_data_dependency = 0; + } + else if (strcmp (name, "r1") == 0) + { + nor1 = 0; + } + else if (strcmp (name, "nor1") == 0) + { + nor1 = 1; + } + else if (strcmp (name, "optimize") == 0) + { + g_opt = 1; + } + else if (strcmp (name, "volatile") == 0) + { + g_opt = 0; + } + else if (strcmp (name, "pic") == 0) + { + score_pic = PIC; + } + else + { + input_line_pointer = orig_ilp; + s_set (0); + } +} + +/* Handle the .cpload pseudo-op. This is used when generating PIC code. It sets the + $gp register for the function based on the function address, which is in the register + named in the argument. This uses a relocation against GP_DISP_LABEL, which is handled + specially by the linker. The result is: + ldis gp, %hi(GP_DISP_LABEL) + ori gp, %low(GP_DISP_LABEL) + add gp, gp, .cpload argument + The .cpload argument is normally r29. */ + +static void +s_score_cpload (int ignore ATTRIBUTE_UNUSED) +{ + int reg; + char insn_str[MAX_LITERAL_POOL_SIZE]; + + /* If we are not generating PIC code, .cpload is ignored. */ + if (score_pic == NO_PIC) + { + s_ignore (0); + return; + } + + if ((reg = reg_required_here (&input_line_pointer, -1, REG_TYPE_SCORE)) == (int) FAIL) + return; + + demand_empty_rest_of_line (); + + sprintf (insn_str, "ld_i32hi r%d, %s", GP, GP_DISP_LABEL); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "ld_i32lo r%d, %s", GP, GP_DISP_LABEL); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "add r%d, r%d, r%d", GP, GP, reg); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; +} + +/* Handle the .cprestore pseudo-op. This stores $gp into a given + offset from $sp. The offset is remembered, and after making a PIC + call $gp is restored from that location. */ + +static void +s_score_cprestore (int ignore ATTRIBUTE_UNUSED) +{ + int reg; + int cprestore_offset; + char insn_str[MAX_LITERAL_POOL_SIZE]; + + /* If we are not generating PIC code, .cprestore is ignored. */ + if (score_pic == NO_PIC) + { + s_ignore (0); + return; + } + + if ((reg = reg_required_here (&input_line_pointer, -1, REG_TYPE_SCORE)) == (int) FAIL + || skip_past_comma (&input_line_pointer) == (int) FAIL) + { + return; + } + + cprestore_offset = get_absolute_expression (); + + if (cprestore_offset <= 0x3fff) + { + sprintf (insn_str, "sw r%d, [r%d, %d]", GP, reg, cprestore_offset); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + } + else + { + int r1_bak; + + r1_bak = nor1; + nor1 = 0; + + sprintf (insn_str, "li r1, %d", cprestore_offset); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "add r1, r1, r%d", reg); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + sprintf (insn_str, "sw r%d, [r1]", GP); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; + + nor1 = r1_bak; + } + + demand_empty_rest_of_line (); +} + +/* Handle the .gpword pseudo-op. This is used when generating PIC + code. It generates a 32 bit GP relative reloc. */ +static void +s_score_gpword (int ignore ATTRIBUTE_UNUSED) +{ + expressionS ex; + char *p; + + /* When not generating PIC code, this is treated as .word. */ + if (score_pic == NO_PIC) + { + cons (4); + return; + } + expression (&ex); + if (ex.X_op != O_symbol || ex.X_add_number != 0) + { + as_bad (_("Unsupported use of .gpword")); + ignore_rest_of_line (); + } + p = frag_more (4); + md_number_to_chars (p, (valueT) 0, 4); + fix_new_exp (frag_now, p - frag_now->fr_literal, 4, &ex, FALSE, BFD_RELOC_GPREL32); + demand_empty_rest_of_line (); +} + +/* Handle the .cpadd pseudo-op. This is used when dealing with switch + tables in PIC code. */ + +static void +s_score_cpadd (int ignore ATTRIBUTE_UNUSED) +{ + int reg; + char insn_str[MAX_LITERAL_POOL_SIZE]; + + /* If we are not generating PIC code, .cpload is ignored. */ + if (score_pic == NO_PIC) + { + s_ignore (0); + return; + } + + if ((reg = reg_required_here (&input_line_pointer, -1, REG_TYPE_SCORE)) == (int) FAIL) + { + return; + } + demand_empty_rest_of_line (); + + /* Add $gp to the register named as an argument. */ + sprintf (insn_str, "add r%d, r%d, r%d", reg, reg, GP); + if (append_insn (insn_str, TRUE) == (int) FAIL) + return; +} + +#ifndef TC_IMPLICIT_LCOMM_ALIGNMENT +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) \ + do \ + { \ + if ((SIZE) >= 8) \ + (P2VAR) = 3; \ + else if ((SIZE) >= 4) \ + (P2VAR) = 2; \ + else if ((SIZE) >= 2) \ + (P2VAR) = 1; \ + else \ + (P2VAR) = 0; \ + } \ + while (0) +#endif + +static void +s_score_lcomm (int bytes_p) +{ + char *name; + char c; + char *p; + int temp; + symbolS *symbolP; + segT current_seg = now_seg; + subsegT current_subseg = now_subseg; + const int max_alignment = 15; + int align = 0; + segT bss_seg = bss_section; + int needs_align = 0; + + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + *p = c; + + if (name == p) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + + SKIP_WHITESPACE (); + + /* Accept an optional comma after the name. The comma used to be + required, but Irix 5 cc does not generate it. */ + if (*input_line_pointer == ',') + { + ++input_line_pointer; + SKIP_WHITESPACE (); + } + + if (is_end_of_line[(unsigned char)*input_line_pointer]) + { + as_bad (_("missing size expression")); + return; + } + + if ((temp = get_absolute_expression ()) < 0) + { + as_warn (_("BSS length (%d) < 0 ignored"), temp); + ignore_rest_of_line (); + return; + } + +#if defined (TC_SCORE) + if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour || OUTPUT_FLAVOR == bfd_target_elf_flavour) + { + /* For Score and Alpha ECOFF or ELF, small objects are put in .sbss. */ + if ((unsigned)temp <= bfd_get_gp_size (stdoutput)) + { + bss_seg = subseg_new (".sbss", 1); + seg_info (bss_seg)->bss = 1; +#ifdef BFD_ASSEMBLER + if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC)) + as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ())); +#endif + } + } +#endif + + SKIP_WHITESPACE (); + if (*input_line_pointer == ',') + { + ++input_line_pointer; + SKIP_WHITESPACE (); + + if (is_end_of_line[(unsigned char)*input_line_pointer]) + { + as_bad (_("missing alignment")); + return; + } + else + { + align = get_absolute_expression (); + needs_align = 1; + } + } + + if (!needs_align) + { + TC_IMPLICIT_LCOMM_ALIGNMENT (temp, align); + + /* Still zero unless TC_IMPLICIT_LCOMM_ALIGNMENT set it. */ + if (align) + record_alignment (bss_seg, align); + } + + if (needs_align) + { + if (bytes_p) + { + /* Convert to a power of 2. */ + if (align != 0) + { + unsigned int i; + + for (i = 0; align != 0; align >>= 1, ++i) + ; + align = i - 1; + } + } + + if (align > max_alignment) + { + align = max_alignment; + as_warn (_("alignment too large; %d assumed"), align); + } + else if (align < 0) + { + align = 0; + as_warn (_("alignment negative; 0 assumed")); + } + + record_alignment (bss_seg, align); + } + else + { + /* Assume some objects may require alignment on some systems. */ +#if defined (TC_ALPHA) && ! defined (VMS) + if (temp > 1) + { + align = ffs (temp) - 1; + if (temp % (1 << align)) + abort (); + } +#endif + } + + *p = 0; + symbolP = symbol_find_or_make (name); + *p = c; + + if ( +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT) \ + || defined (OBJ_BOUT) || defined (OBJ_MAYBE_BOUT)) +#ifdef BFD_ASSEMBLER + (OUTPUT_FLAVOR != bfd_target_aout_flavour + || (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0)) && +#else + (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0) && +#endif +#endif + (S_GET_SEGMENT (symbolP) == bss_seg || (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0))) + { + char *pfrag; + + subseg_set (bss_seg, 1); + + if (align) + frag_align (align, 0, 0); + + /* Detach from old frag. */ + if (S_GET_SEGMENT (symbolP) == bss_seg) + symbol_get_frag (symbolP)->fr_symbol = NULL; + + symbol_set_frag (symbolP, frag_now); + pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, (offsetT) temp, NULL); + *pfrag = 0; + + + S_SET_SEGMENT (symbolP, bss_seg); + +#ifdef OBJ_COFF + /* The symbol may already have been created with a preceding + ".globl" directive -- be careful not to step on storage class + in that case. Otherwise, set it to static. */ + if (S_GET_STORAGE_CLASS (symbolP) != C_EXT) + { + S_SET_STORAGE_CLASS (symbolP, C_STAT); + } +#endif /* OBJ_COFF */ + +#ifdef S_SET_SIZE + S_SET_SIZE (symbolP, temp); +#endif + } + else + as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); + + subseg_set (current_seg, current_subseg); + + demand_empty_rest_of_line (); +} + +static void +insert_reg (const struct reg_entry *r, struct hash_control *htab) +{ + int i = 0; + int len = strlen (r->name) + 2; + char *buf = xmalloc (len); + char *buf2 = xmalloc (len); + + strcpy (buf + i, r->name); + for (i = 0; buf[i]; i++) + { + buf2[i] = TOUPPER (buf[i]); + } + buf2[i] = '\0'; + + hash_insert (htab, buf, (void *) r); + hash_insert (htab, buf2, (void *) r); +} + +static void +build_reg_hsh (struct reg_map *map) +{ + const struct reg_entry *r; + + if ((map->htab = hash_new ()) == NULL) + { + as_fatal (_("virtual memory exhausted")); + } + for (r = map->names; r->name != NULL; r++) + { + insert_reg (r, map->htab); + } +} + +void +md_begin (void) +{ + unsigned int i; + segT seg; + subsegT subseg; + + if ((score_ops_hsh = hash_new ()) == NULL) + as_fatal (_("virtual memory exhausted")); + + build_score_ops_hsh (); + + if ((dependency_insn_hsh = hash_new ()) == NULL) + as_fatal (_("virtual memory exhausted")); + + build_dependency_insn_hsh (); + + for (i = (int)REG_TYPE_FIRST; i < (int)REG_TYPE_MAX; i++) + build_reg_hsh (all_reg_maps + i); + + /* Initialize dependency vector. */ + init_dependency_vector (); + + bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0); + seg = now_seg; + subseg = now_subseg; + pdr_seg = subseg_new (".pdr", (subsegT) 0); + (void)bfd_set_section_flags (stdoutput, pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING); + (void)bfd_set_section_alignment (stdoutput, pdr_seg, 2); + subseg_set (seg, subseg); + + if (USE_GLOBAL_POINTER_OPT) + bfd_set_gp_size (stdoutput, g_switch_value); +} + + +const pseudo_typeS md_pseudo_table[] = +{ + {"bss", s_score_bss, 0}, + {"text", s_score_text, 0}, + {"word", cons, 4}, + {"long", cons, 4}, + {"extend", float_cons, 'x'}, + {"ldouble", float_cons, 'x'}, + {"packed", float_cons, 'p'}, + {"end", s_score_end, 0}, + {"ent", s_score_ent, 0}, + {"frame", s_score_frame, 0}, + {"rdata", s_change_sec, 'r'}, + {"sdata", s_change_sec, 's'}, + {"set", s_score_set, 0}, + {"mask", s_score_mask, 'R'}, + {"dword", cons, 8}, + {"lcomm", s_score_lcomm, 1}, + {"section", score_s_section, 0}, + {"cpload", s_score_cpload, 0}, + {"cprestore", s_score_cprestore, 0}, + {"gpword", s_score_gpword, 0}, + {"cpadd", s_score_cpadd, 0}, + {0, 0, 0} +}; + diff --git a/contrib/binutils/gas/config/tc-score.h b/contrib/binutils/gas/config/tc-score.h new file mode 100644 index 00000000000..2cd40395688 --- /dev/null +++ b/contrib/binutils/gas/config/tc-score.h @@ -0,0 +1,83 @@ +/* tc-score.h -- Score specific file for assembler + Copyright 2006 Free Software Foundation, Inc. + Contributed by: + Mei Ligang (ligang@sunnorth.com.cn) + Pei-Lin Tsai (pltsai@sunplus.com) + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef TC_SCORE +#define TC_SCORE + +#define TARGET_ARCH bfd_arch_score +#define WORKING_DOT_WORD +#define DIFF_EXPR_OK +#define RELOC_EXPANSION_POSSIBLE +#define MAX_RELOC_EXPANSION 2 +#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4) + +#define md_undefined_symbol(name) NULL + +#define TARGET_FORMAT (target_big_endian ? "elf32-bigscore" : "elf32-littlescore") + +#define md_relax_frag(segment, fragp, stretch) score_relax_frag (segment, fragp, stretch) +extern int score_relax_frag (asection *, struct frag *, long); + +#define md_frag_check(fragp) score_frag_check (fragp) +extern void score_frag_check (fragS *); + +#define TC_VALIDATE_FIX(FIXP, SEGTYPE, SKIP) score_validate_fix (FIXP) +extern void score_validate_fix (struct fix *); + +#define TC_FORCE_RELOCATION(FIXP) score_force_relocation (FIXP) +extern int score_force_relocation (struct fix *); + +#define tc_fix_adjustable(fixp) score_fix_adjustable (fixp) +extern bfd_boolean score_fix_adjustable (struct fix *); + +#define elf_tc_final_processing score_elf_final_processing +extern void score_elf_final_processing (void); + +struct score_tc_frag_data +{ + unsigned int is_insn; + struct fix *fixp; +}; + +#define TC_FRAG_TYPE struct score_tc_frag_data + +#define TC_FRAG_INIT(FRAGP) \ + do \ + { \ + (FRAGP)->tc_frag_data.is_insn = (((FRAGP)->fr_type == rs_machine_dependent) ? 1 : 0); \ + } \ + while (0) + +#ifdef OBJ_ELF +#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" +#else +#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_" +#endif + +enum score_pic_level +{ + NO_PIC, + PIC +}; + +#endif /*TC_SCORE */ diff --git a/contrib/binutils/gas/config/tc-sparc.c b/contrib/binutils/gas/config/tc-sparc.c index 10a1411b526..d4a409fbc34 100644 --- a/contrib/binutils/gas/config/tc-sparc.c +++ b/contrib/binutils/gas/config/tc-sparc.c @@ -1,6 +1,6 @@ /* tc-sparc.c -- Assemble for the SPARC Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,8 +19,6 @@ to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -339,7 +337,7 @@ sparc_target_format () #endif #ifdef OBJ_ELF - return sparc_arch_size == 64 ? "elf64-sparc" : "elf32-sparc"; + return sparc_arch_size == 64 ? ELF64_TARGET_FORMAT : ELF_TARGET_FORMAT; #endif abort (); @@ -547,12 +545,12 @@ md_parse_option (c, arg) { if (sparc_arch_size == 32) { - if (strcmp (*l, "elf32-sparc") == 0) + if (CONST_STRNEQ (*l, "elf32-sparc")) break; } else { - if (strcmp (*l, "elf64-sparc") == 0) + if (CONST_STRNEQ (*l, "elf64-sparc")) break; } } @@ -1862,7 +1860,8 @@ sparc_ip (str, pinsn) case '\0': /* End of args. */ if (s[0] == ',' && s[1] == '%') { - static const struct tls_ops { + static const struct tls_ops + { /* The name as it appears in assembler. */ char *name; /* strlen (name), precomputed for speed */ @@ -1871,7 +1870,9 @@ sparc_ip (str, pinsn) int reloc; /* 1 if call. */ int call; - } tls_ops[] = { + } + tls_ops[] = + { { "tgd_add", 7, BFD_RELOC_SPARC_TLS_GD_ADD, 0 }, { "tgd_call", 8, BFD_RELOC_SPARC_TLS_GD_CALL, 1 }, { "tldm_add", 8, BFD_RELOC_SPARC_TLS_LDM_ADD, 0 }, @@ -1879,7 +1880,8 @@ sparc_ip (str, pinsn) { "tldo_add", 8, BFD_RELOC_SPARC_TLS_LDO_ADD, 0 }, { "tie_ldx", 7, BFD_RELOC_SPARC_TLS_IE_LDX, 0 }, { "tie_ld", 6, BFD_RELOC_SPARC_TLS_IE_LD, 0 }, - { "tie_add", 7, BFD_RELOC_SPARC_TLS_IE_ADD, 0 } + { "tie_add", 7, BFD_RELOC_SPARC_TLS_IE_ADD, 0 }, + { NULL, 0, 0, 0 } }; const struct tls_ops *o; char *s1; @@ -3311,9 +3313,9 @@ md_apply_fix (fixP, valP, segment) break; case BFD_RELOC_SPARC_WDISP16: - /* FIXME: simplify. */ - if (((val > 0) && (val & ~0x3fffc)) - || ((val < 0) && (~(val - 1) & ~0x3fffc))) + if ((val & 3) + || val >= 0x1fffc + || val <= -(offsetT) 0x20008) as_bad_where (fixP->fx_file, fixP->fx_line, _("relocation overflow")); /* FIXME: The +1 deserves a comment. */ @@ -3322,9 +3324,9 @@ md_apply_fix (fixP, valP, segment) break; case BFD_RELOC_SPARC_WDISP19: - /* FIXME: simplify. */ - if (((val > 0) && (val & ~0x1ffffc)) - || ((val < 0) && (~(val - 1) & ~0x1ffffc))) + if ((val & 3) + || val >= 0xffffc + || val <= -(offsetT) 0x100008) as_bad_where (fixP->fx_file, fixP->fx_line, _("relocation overflow")); /* FIXME: The +1 deserves a comment. */ @@ -3439,7 +3441,7 @@ md_apply_fix (fixP, valP, segment) arelent ** tc_gen_reloc (section, fixp) - asection *section ATTRIBUTE_UNUSED; + asection *section; fixS *fixp; { static arelent *relocs[3]; @@ -3582,6 +3584,16 @@ tc_gen_reloc (section, fixp) } #endif /* defined (OBJ_ELF) || defined (OBJ_AOUT) */ + /* Nothing is aligned in DWARF debugging sections. */ + if (bfd_get_section_flags (stdoutput, section) & SEC_DEBUGGING) + switch (code) + { + case BFD_RELOC_16: code = BFD_RELOC_SPARC_UA16; break; + case BFD_RELOC_32: code = BFD_RELOC_SPARC_UA32; break; + case BFD_RELOC_64: code = BFD_RELOC_SPARC_UA64; break; + default: break; + } + if (code == BFD_RELOC_SPARC_OLO10) reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO10); else @@ -4602,7 +4614,7 @@ sparc_cfi_frame_initial_instructions () } int -sparc_regname_to_dw2regnum (const char *regname) +sparc_regname_to_dw2regnum (char *regname) { char *p, *q; diff --git a/contrib/binutils/gas/config/tc-sparc.h b/contrib/binutils/gas/config/tc-sparc.h index 14da16ad627..90c0e95d0f5 100644 --- a/contrib/binutils/gas/config/tc-sparc.h +++ b/contrib/binutils/gas/config/tc-sparc.h @@ -1,6 +1,7 @@ /* tc-sparc.h - Macros and type defines for the sparc. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -31,6 +32,19 @@ struct frag; #define TARGET_ARCH bfd_arch_sparc +#ifdef TE_FreeBSD +#define ELF_TARGET_FORMAT "elf32-sparc-freebsd" +#define ELF64_TARGET_FORMAT "elf64-sparc-freebsd" +#endif + +#ifndef ELF_TARGET_FORMAT +#define ELF_TARGET_FORMAT "elf32-sparc" +#endif + +#ifndef ELF64_TARGET_FORMAT +#define ELF64_TARGET_FORMAT "elf64-sparc" +#endif + extern const char *sparc_target_format PARAMS ((void)); #define TARGET_FORMAT sparc_target_format () @@ -78,7 +92,6 @@ extern void sparc_handle_align PARAMS ((struct frag *)); #define TC_FORCE_RELOCATION_LOCAL(FIX) \ (!(FIX)->fx_pcrel \ - || (FIX)->fx_plt \ || (sparc_pic_code \ && S_IS_EXTERNAL ((FIX)->fx_addsy)) \ || TC_FORCE_RELOCATION (FIX)) @@ -171,7 +184,7 @@ extern void cons_fix_new_sparc extern void sparc_cfi_frame_initial_instructions PARAMS ((void)); #define tc_regname_to_dw2regnum sparc_regname_to_dw2regnum -extern int sparc_regname_to_dw2regnum PARAMS ((const char *regname)); +extern int sparc_regname_to_dw2regnum PARAMS ((char *regname)); #define tc_cfi_emit_pcrel_expr sparc_cfi_emit_pcrel_expr extern void sparc_cfi_emit_pcrel_expr PARAMS ((expressionS *, unsigned int)); diff --git a/contrib/binutils/gas/config/tc-spu.c b/contrib/binutils/gas/config/tc-spu.c new file mode 100644 index 00000000000..ef801df9a76 --- /dev/null +++ b/contrib/binutils/gas/config/tc-spu.c @@ -0,0 +1,1083 @@ +/* spu.c -- Assembler for the IBM Synergistic Processing Unit (SPU) + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "as.h" +#include "safe-ctype.h" +#include "subsegs.h" +#include "dwarf2dbg.h" + +const struct spu_opcode spu_opcodes[] = { +#define APUOP(TAG,MACFORMAT,OPCODE,MNEMONIC,ASMFORMAT,DEP,PIPE) \ + { MACFORMAT, (OPCODE) << (32-11), MNEMONIC, ASMFORMAT }, +#define APUOPFB(TAG,MACFORMAT,OPCODE,FB,MNEMONIC,ASMFORMAT,DEP,PIPE) \ + { MACFORMAT, ((OPCODE) << (32-11)) | ((FB) << (32-18)), MNEMONIC, ASMFORMAT }, +#include "opcode/spu-insns.h" +#undef APUOP +#undef APUOPFB +}; + +static const int spu_num_opcodes = + sizeof (spu_opcodes) / sizeof (spu_opcodes[0]); + +#define MAX_RELOCS 2 + +struct spu_insn +{ + unsigned int opcode; + expressionS exp[MAX_RELOCS]; + int reloc_arg[MAX_RELOCS]; + int flag[MAX_RELOCS]; + enum spu_insns tag; +}; + +static const char *get_imm (const char *param, struct spu_insn *insn, int arg); +static const char *get_reg (const char *param, struct spu_insn *insn, int arg, + int accept_expr); +static int calcop (struct spu_opcode *format, const char *param, + struct spu_insn *insn); +static void spu_cons (int); + +extern char *myname; +static struct hash_control *op_hash = NULL; + +/* These bits should be turned off in the first address of every segment */ +int md_seg_align = 7; + +/* These chars start a comment anywhere in a source file (except inside + another comment */ +const char comment_chars[] = "#"; + +/* These chars only start a comment at the beginning of a line. */ +const char line_comment_chars[] = "#"; + +/* gods own line continuation char */ +const char line_separator_chars[] = ";"; + +/* Chars that can be used to separate mant from exp in floating point nums */ +const char EXP_CHARS[] = "eE"; + +/* Chars that mean this number is a floating point constant */ +/* as in 0f123.456 */ +/* or 0H1.234E-12 (see exp chars above) */ +const char FLT_CHARS[] = "dDfF"; + +const pseudo_typeS md_pseudo_table[] = +{ + {"align", s_align_ptwo, 4}, + {"bss", s_lcomm_bytes, 1}, + {"def", s_set, 0}, + {"dfloat", float_cons, 'd'}, + {"ffloat", float_cons, 'f'}, + {"global", s_globl, 0}, + {"half", cons, 2}, + {"int", spu_cons, 4}, + {"long", spu_cons, 4}, + {"quad", spu_cons, 8}, + {"string", stringer, 1}, + {"word", spu_cons, 4}, + /* Force set to be treated as an instruction. */ + {"set", NULL, 0}, + {".set", s_set, 0}, + /* Likewise for eqv. */ + {"eqv", NULL, 0}, + {".eqv", s_set, -1}, + {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 }, + {"loc", dwarf2_directive_loc, 0}, + {0,0,0} +}; + +void +md_begin (void) +{ + const char *retval = NULL; + int i; + + /* initialize hash table */ + + op_hash = hash_new (); + + /* loop until you see the end of the list */ + + for (i = 0; i < spu_num_opcodes; i++) + { + /* hash each mnemonic and record its position */ + + retval = hash_insert (op_hash, spu_opcodes[i].mnemonic, (PTR)&spu_opcodes[i]); + + if (retval != NULL && strcmp (retval, "exists") != 0) + as_fatal (_("Can't hash instruction '%s':%s"), + spu_opcodes[i].mnemonic, retval); + } +} + +const char *md_shortopts = ""; +struct option md_longopts[] = { +#define OPTION_APUASM (OPTION_MD_BASE) + {"apuasm", no_argument, NULL, OPTION_APUASM}, +#define OPTION_DD2 (OPTION_MD_BASE+1) + {"mdd2.0", no_argument, NULL, OPTION_DD2}, +#define OPTION_DD1 (OPTION_MD_BASE+2) + {"mdd1.0", no_argument, NULL, OPTION_DD1}, +#define OPTION_DD3 (OPTION_MD_BASE+3) + {"mdd3.0", no_argument, NULL, OPTION_DD3}, + { NULL, no_argument, NULL, 0 } +}; +size_t md_longopts_size = sizeof (md_longopts); + +/* When set (by -apuasm) our assembler emulates the behaviour of apuasm. + * e.g. don't add bias to float conversion and don't right shift + * immediate values. */ +static int emulate_apuasm; + +/* Use the dd2.0 instructions set. The only differences are some new + * register names and the orx insn */ +static int use_dd2 = 1; + +int +md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +{ + switch (c) + { + case OPTION_APUASM: + emulate_apuasm = 1; + break; + case OPTION_DD3: + use_dd2 = 1; + break; + case OPTION_DD2: + use_dd2 = 1; + break; + case OPTION_DD1: + use_dd2 = 0; + break; + default: + return 0; + } + return 1; +} + +void +md_show_usage (FILE *stream) +{ + fputs (_("\ +SPU options:\n\ + --apuasm emulate behaviour of apuasm\n"), + stream); +} + + +struct arg_encode { + int size; + int pos; + int rshift; + int lo, hi; + int wlo, whi; + bfd_reloc_code_real_type reloc; +}; + +static struct arg_encode arg_encode[A_MAX] = { + { 7, 0, 0, 0, 127, 0, -1, 0 }, /* A_T */ + { 7, 7, 0, 0, 127, 0, -1, 0 }, /* A_A */ + { 7, 14, 0, 0, 127, 0, -1, 0 }, /* A_B */ + { 7, 21, 0, 0, 127, 0, -1, 0 }, /* A_C */ + { 7, 7, 0, 0, 127, 0, -1, 0 }, /* A_S */ + { 7, 7, 0, 0, 127, 0, -1, 0 }, /* A_H */ + { 0, 0, 0, 0, -1, 0, -1, 0 }, /* A_P */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_S3 */ + { 7, 14, 0, -32, 31, -31, 0, BFD_RELOC_SPU_IMM7 }, /* A_S6 */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_S7N */ + { 7, 14, 0, -64, 63, -63, 0, BFD_RELOC_SPU_IMM7 }, /* A_S7 */ + { 8, 14, 0, 0, 127, 0, -1, BFD_RELOC_SPU_IMM8 }, /* A_U7A */ + { 8, 14, 0, 0, 127, 0, -1, BFD_RELOC_SPU_IMM8 }, /* A_U7B */ + { 10, 14, 0, -512, 511, -128, 255, BFD_RELOC_SPU_IMM10 }, /* A_S10B */ + { 10, 14, 0, -512, 511, 0, -1, BFD_RELOC_SPU_IMM10 }, /* A_S10 */ + { 2, 23, 9, -1024, 1023, 0, -1, BFD_RELOC_SPU_PCREL9a }, /* A_S11 */ + { 2, 14, 9, -1024, 1023, 0, -1, BFD_RELOC_SPU_PCREL9b }, /* A_S11I */ + { 10, 14, 4, -8192, 8191, 0, -1, BFD_RELOC_SPU_IMM10W }, /* A_S14 */ + { 16, 7, 0, -32768, 32767, 0, -1, BFD_RELOC_SPU_IMM16 }, /* A_S16 */ + { 16, 7, 2, -131072, 262143, 0, -1, BFD_RELOC_SPU_IMM16W }, /* A_S18 */ + { 16, 7, 2, -262144, 262143, 0, -1, BFD_RELOC_SPU_PCREL16 }, /* A_R18 */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_U3 */ + { 7, 14, 0, 0, 127, 0, 31, BFD_RELOC_SPU_IMM7 }, /* A_U5 */ + { 7, 14, 0, 0, 127, 0, 63, BFD_RELOC_SPU_IMM7 }, /* A_U6 */ + { 7, 14, 0, 0, -1, 0, -1, BFD_RELOC_SPU_IMM7 }, /* A_U7 */ + { 14, 0, 0, 0, 16383, 0, -1, 0 }, /* A_U14 */ + { 16, 7, 0, -32768, 65535, 0, -1, BFD_RELOC_SPU_IMM16 }, /* A_X16 */ + { 18, 7, 0, 0, 262143, 0, -1, BFD_RELOC_SPU_IMM18 }, /* A_U18 */ +}; + +/* Some flags for handling errors. This is very hackish and added after + * the fact. */ +static int syntax_error_arg; +static const char *syntax_error_param; +static int syntax_reg; + +static char * +insn_fmt_string (struct spu_opcode *format) +{ + static char buf[64]; + int len = 0; + int i; + + len += sprintf (&buf[len], "%s\t", format->mnemonic); + for (i = 1; i <= format->arg[0]; i++) + { + int arg = format->arg[i]; + char *exp; + if (i > 1 && arg != A_P && format->arg[i-1] != A_P) + buf[len++] = ','; + if (arg == A_P) + exp = "("; + else if (arg < A_P) + exp = i == syntax_error_arg ? "REG" : "reg"; + else + exp = i == syntax_error_arg ? "IMM" : "imm"; + len += sprintf (&buf[len], "%s", exp); + if (i > 1 && format->arg[i-1] == A_P) + buf[len++] = ')'; + } + buf[len] = 0; + return buf; +} + +void +md_assemble (char *op) +{ + char *param, *thisfrag; + char c; + struct spu_opcode *format; + struct spu_insn insn; + int i; + + assert (op); + + /* skip over instruction to find parameters */ + + for (param = op; *param != 0 && !ISSPACE (*param); param++) + ; + c = *param; + *param = 0; + + if (c != 0 && c != '\n') + param++; + + /* try to find the instruction in the hash table */ + + if ((format = (struct spu_opcode *) hash_find (op_hash, op)) == NULL) + { + as_bad (_("Invalid mnemonic '%s'"), op); + return; + } + + if (!use_dd2 && strcmp (format->mnemonic, "orx") == 0) + { + as_bad (_("'%s' is only available in DD2.0 or higher."), op); + return; + } + + while (1) + { + /* try parsing this instruction into insn */ + for (i = 0; i < MAX_RELOCS; i++) + { + insn.exp[i].X_add_symbol = 0; + insn.exp[i].X_op_symbol = 0; + insn.exp[i].X_add_number = 0; + insn.exp[i].X_op = O_illegal; + insn.reloc_arg[i] = -1; + insn.flag[i] = 0; + } + insn.opcode = format->opcode; + insn.tag = (enum spu_insns) (format - spu_opcodes); + + syntax_error_arg = 0; + syntax_error_param = 0; + syntax_reg = 0; + if (calcop (format, param, &insn)) + break; + + /* if it doesn't parse try the next instruction */ + if (!strcmp (format[0].mnemonic, format[1].mnemonic)) + format++; + else + { + int parg = format[0].arg[syntax_error_arg-1]; + + as_fatal (_("Error in argument %d. Expecting: \"%s\""), + syntax_error_arg - (parg == A_P), + insn_fmt_string (format)); + return; + } + } + + if ((syntax_reg & 4) + && ! (insn.tag == M_RDCH + || insn.tag == M_RCHCNT + || insn.tag == M_WRCH)) + as_warn (_("Mixing register syntax, with and without '$'.")); + if (syntax_error_param) + { + const char *d = syntax_error_param; + while (*d != '$') + d--; + as_warn (_("Treating '%-*s' as a symbol."), (int)(syntax_error_param - d), d); + } + + /* grow the current frag and plop in the opcode */ + + thisfrag = frag_more (4); + md_number_to_chars (thisfrag, insn.opcode, 4); + + /* if this instruction requires labels mark it for later */ + + for (i = 0; i < MAX_RELOCS; i++) + if (insn.reloc_arg[i] >= 0) + { + fixS *fixP; + bfd_reloc_code_real_type reloc = arg_encode[insn.reloc_arg[i]].reloc; + int pcrel = 0; + + if (reloc == BFD_RELOC_SPU_PCREL9a + || reloc == BFD_RELOC_SPU_PCREL9b + || reloc == BFD_RELOC_SPU_PCREL16) + pcrel = 1; + if (insn.flag[i] == 1) + reloc = BFD_RELOC_SPU_HI16; + else if (insn.flag[i] == 2) + reloc = BFD_RELOC_SPU_LO16; + fixP = fix_new_exp (frag_now, + thisfrag - frag_now->fr_literal, + 4, + &insn.exp[i], + pcrel, + reloc); + fixP->tc_fix_data.arg_format = insn.reloc_arg[i]; + fixP->tc_fix_data.insn_tag = insn.tag; + } + dwarf2_emit_insn (4); +} + +static int +calcop (struct spu_opcode *format, const char *param, struct spu_insn *insn) +{ + int i; + int paren = 0; + int arg; + + for (i = 1; i <= format->arg[0]; i++) + { + arg = format->arg[i]; + syntax_error_arg = i; + + while (ISSPACE (*param)) + param++; + if (*param == 0 || *param == ',') + return 0; + if (arg < A_P) + param = get_reg (param, insn, arg, 1); + else if (arg > A_P) + param = get_imm (param, insn, arg); + else if (arg == A_P) + { + paren++; + if ('(' != *param++) + return 0; + } + + if (!param) + return 0; + + while (ISSPACE (*param)) + param++; + + if (arg != A_P && paren) + { + paren--; + if (')' != *param++) + return 0; + } + else if (i < format->arg[0] + && format->arg[i] != A_P + && format->arg[i+1] != A_P) + { + if (',' != *param++) + { + syntax_error_arg++; + return 0; + } + } + } + while (ISSPACE (*param)) + param++; + return !paren && (*param == 0 || *param == '\n'); +} + +struct reg_name { + unsigned int regno; + unsigned int length; + char name[32]; +}; + +#define REG_NAME(NO,NM) { NO, sizeof (NM) - 1, NM } + +static struct reg_name reg_name[] = { + REG_NAME (0, "lr"), /* link register */ + REG_NAME (1, "sp"), /* stack pointer */ + REG_NAME (0, "rp"), /* link register */ + REG_NAME (127, "fp"), /* frame pointer */ +}; + +static struct reg_name sp_reg_name[] = { +}; + +static struct reg_name ch_reg_name[] = { + REG_NAME ( 0, "SPU_RdEventStat"), + REG_NAME ( 1, "SPU_WrEventMask"), + REG_NAME ( 2, "SPU_WrEventAck"), + REG_NAME ( 3, "SPU_RdSigNotify1"), + REG_NAME ( 4, "SPU_RdSigNotify2"), + REG_NAME ( 7, "SPU_WrDec"), + REG_NAME ( 8, "SPU_RdDec"), + REG_NAME ( 11, "SPU_RdEventMask"), /* DD2.0 only */ + REG_NAME ( 13, "SPU_RdMachStat"), + REG_NAME ( 14, "SPU_WrSRR0"), + REG_NAME ( 15, "SPU_RdSRR0"), + REG_NAME ( 28, "SPU_WrOutMbox"), + REG_NAME ( 29, "SPU_RdInMbox"), + REG_NAME ( 30, "SPU_WrOutIntrMbox"), + REG_NAME ( 9, "MFC_WrMSSyncReq"), + REG_NAME ( 12, "MFC_RdTagMask"), /* DD2.0 only */ + REG_NAME ( 16, "MFC_LSA"), + REG_NAME ( 17, "MFC_EAH"), + REG_NAME ( 18, "MFC_EAL"), + REG_NAME ( 19, "MFC_Size"), + REG_NAME ( 20, "MFC_TagID"), + REG_NAME ( 21, "MFC_Cmd"), + REG_NAME ( 22, "MFC_WrTagMask"), + REG_NAME ( 23, "MFC_WrTagUpdate"), + REG_NAME ( 24, "MFC_RdTagStat"), + REG_NAME ( 25, "MFC_RdListStallStat"), + REG_NAME ( 26, "MFC_WrListStallAck"), + REG_NAME ( 27, "MFC_RdAtomicStat"), +}; +#undef REG_NAME + +static const char * +get_reg (const char *param, struct spu_insn *insn, int arg, int accept_expr) +{ + unsigned regno; + int saw_prefix = 0; + + if (*param == '$') + { + saw_prefix = 1; + param++; + } + + if (arg == A_H) /* Channel */ + { + if ((param[0] == 'c' || param[0] == 'C') + && (param[1] == 'h' || param[1] == 'H') + && ISDIGIT (param[2])) + param += 2; + } + else if (arg == A_S) /* Special purpose register */ + { + if ((param[0] == 's' || param[0] == 'S') + && (param[1] == 'p' || param[1] == 'P') + && ISDIGIT (param[2])) + param += 2; + } + + if (ISDIGIT (*param)) + { + regno = 0; + while (ISDIGIT (*param)) + regno = regno * 10 + *param++ - '0'; + } + else + { + struct reg_name *rn; + unsigned int i, n, l = 0; + + if (arg == A_H) /* Channel */ + { + rn = ch_reg_name; + n = sizeof (ch_reg_name) / sizeof (*ch_reg_name); + } + else if (arg == A_S) /* Special purpose register */ + { + rn = sp_reg_name; + n = sizeof (sp_reg_name) / sizeof (*sp_reg_name); + } + else + { + rn = reg_name; + n = sizeof (reg_name) / sizeof (*reg_name); + } + regno = 128; + for (i = 0; i < n; i++) + if (rn[i].length > l + && 0 == strncasecmp (param, rn[i].name, rn[i].length)) + { + l = rn[i].length; + regno = rn[i].regno; + } + param += l; + } + + if (!use_dd2 + && arg == A_H) + { + if (regno == 11) + as_bad (_("'SPU_RdEventMask' (channel 11) is only available in DD2.0 or higher.")); + else if (regno == 12) + as_bad (_("'MFC_RdTagMask' (channel 12) is only available in DD2.0 or higher.")); + } + + if (regno < 128) + { + insn->opcode |= regno << arg_encode[arg].pos; + if ((!saw_prefix && syntax_reg == 1) + || (saw_prefix && syntax_reg == 2)) + syntax_reg |= 4; + syntax_reg |= saw_prefix ? 1 : 2; + return param; + } + + if (accept_expr) + { + char *save_ptr; + expressionS ex; + save_ptr = input_line_pointer; + input_line_pointer = (char *)param; + expression (&ex); + param = input_line_pointer; + input_line_pointer = save_ptr; + if (ex.X_op == O_register || ex.X_op == O_constant) + { + insn->opcode |= ex.X_add_number << arg_encode[arg].pos; + return param; + } + } + return 0; +} + +static const char * +get_imm (const char *param, struct spu_insn *insn, int arg) +{ + int val; + char *save_ptr; + int low = 0, high = 0; + int reloc_i = insn->reloc_arg[0] >= 0 ? 1 : 0; + + if (strncasecmp (param, "%lo(", 4) == 0) + { + param += 3; + low = 1; + as_warn (_("Using old style, %%lo(expr), please change to PPC style, expr@l.")); + } + else if (strncasecmp (param, "%hi(", 4) == 0) + { + param += 3; + high = 1; + as_warn (_("Using old style, %%hi(expr), please change to PPC style, expr@h.")); + } + else if (strncasecmp (param, "%pic(", 5) == 0) + { + /* Currently we expect %pic(expr) == expr, so do nothing here. + i.e. for code loaded at address 0 $toc will be 0. */ + param += 4; + } + + if (*param == '$') + { + /* Symbols can start with $, but if this symbol matches a register + name, it's probably a mistake. The only way to avoid this + warning is to rename the symbol. */ + struct spu_insn tmp_insn; + const char *np = get_reg (param, &tmp_insn, arg, 0); + + if (np) + syntax_error_param = np; + } + + save_ptr = input_line_pointer; + input_line_pointer = (char *) param; + expression (&insn->exp[reloc_i]); + param = input_line_pointer; + input_line_pointer = save_ptr; + + /* Similar to ppc_elf_suffix in tc-ppc.c. We have so few cases to + handle we do it inlined here. */ + if (param[0] == '@' && !ISALNUM (param[2]) && param[2] != '@') + { + if (param[1] == 'h' || param[1] == 'H') + { + high = 1; + param += 2; + } + else if (param[1] == 'l' || param[1] == 'L') + { + low = 1; + param += 2; + } + } + + if (insn->exp[reloc_i].X_op == O_constant) + { + val = insn->exp[reloc_i].X_add_number; + + if (emulate_apuasm) + { + /* Convert the value to a format we expect. */ + val <<= arg_encode[arg].rshift; + if (arg == A_U7A) + val = 173 - val; + else if (arg == A_U7B) + val = 155 - val; + } + + if (high) + val = val >> 16; + else if (low) + val = val & 0xffff; + + /* Warn about out of range expressions. */ + { + int hi = arg_encode[arg].hi; + int lo = arg_encode[arg].lo; + int whi = arg_encode[arg].whi; + int wlo = arg_encode[arg].wlo; + + if (hi > lo && (val < lo || val > hi)) + as_fatal (_("Constant expression %d out of range, [%d, %d]."), + val, lo, hi); + else if (whi > wlo && (val < wlo || val > whi)) + as_warn (_("Constant expression %d out of range, [%d, %d]."), + val, wlo, whi); + } + + if (arg == A_U7A) + val = 173 - val; + else if (arg == A_U7B) + val = 155 - val; + + /* Branch hints have a split encoding. Do the bottom part. */ + if (arg == A_S11 || arg == A_S11I) + insn->opcode |= ((val >> 2) & 0x7f); + + insn->opcode |= (((val >> arg_encode[arg].rshift) + & ((1 << arg_encode[arg].size) - 1)) + << arg_encode[arg].pos); + insn->reloc_arg[reloc_i] = -1; + insn->flag[reloc_i] = 0; + } + else + { + insn->reloc_arg[reloc_i] = arg; + if (high) + insn->flag[reloc_i] = 1; + else if (low) + insn->flag[reloc_i] = 2; + } + + return param; +} + +#define MAX_LITTLENUMS 6 + +/* Turn a string in input_line_pointer into a floating point constant of type + type, and store the appropriate bytes in *litP. The number of LITTLENUMS + emitted is stored in *sizeP . An error message is returned, or NULL on OK. + */ +char * +md_atof (int type, char *litP, int *sizeP) +{ + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + LITTLENUM_TYPE *wordP; + char *t; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + case 'x': + case 'X': + prec = 6; + break; + + case 'p': + case 'P': + prec = 6; + break; + + default: + *sizeP = 0; + return _("Bad call to MD_ATOF()"); + } + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * sizeof (LITTLENUM_TYPE); + for (wordP = words; prec--;) + { + md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + return 0; +} + +#ifndef WORKING_DOT_WORD +int md_short_jump_size = 4; + +void +md_create_short_jump (char *ptr, + addressT from_addr ATTRIBUTE_UNUSED, + addressT to_addr ATTRIBUTE_UNUSED, + fragS *frag, + symbolS *to_symbol) +{ + ptr[0] = (char) 0xc0; + ptr[1] = 0x00; + ptr[2] = 0x00; + ptr[3] = 0x00; + fix_new (frag, + ptr - frag->fr_literal, + 4, + to_symbol, + (offsetT) 0, + 0, + BFD_RELOC_SPU_PCREL16); +} + +int md_long_jump_size = 4; + +void +md_create_long_jump (char *ptr, + addressT from_addr ATTRIBUTE_UNUSED, + addressT to_addr ATTRIBUTE_UNUSED, + fragS *frag, + symbolS *to_symbol) +{ + ptr[0] = (char) 0xc0; + ptr[1] = 0x00; + ptr[2] = 0x00; + ptr[3] = 0x00; + fix_new (frag, + ptr - frag->fr_literal, + 4, + to_symbol, + (offsetT) 0, + 0, + BFD_RELOC_SPU_PCREL16); +} +#endif + +/* Support @ppu on symbols referenced in .int/.long/.word/.quad. */ +static void +spu_cons (int nbytes) +{ + expressionS exp; + + if (is_it_end_of_statement ()) + { + demand_empty_rest_of_line (); + return; + } + + do + { + deferred_expression (&exp); + if ((exp.X_op == O_symbol + || exp.X_op == O_constant) + && strncasecmp (input_line_pointer, "@ppu", 4) == 0) + { + char *p = frag_more (nbytes); + enum bfd_reloc_code_real reloc; + + /* Check for identifier@suffix+constant. */ + input_line_pointer += 4; + if (*input_line_pointer == '-' || *input_line_pointer == '+') + { + expressionS new_exp; + + expression (&new_exp); + if (new_exp.X_op == O_constant) + exp.X_add_number += new_exp.X_add_number; + } + + reloc = nbytes == 4 ? BFD_RELOC_SPU_PPU32 : BFD_RELOC_SPU_PPU64; + fix_new_exp (frag_now, p - frag_now->fr_literal, nbytes, + &exp, 0, reloc); + } + else + emit_expr (&exp, nbytes); + } + while (*input_line_pointer++ == ','); + + /* Put terminator back into stream. */ + input_line_pointer--; + demand_empty_rest_of_line (); +} + +int +md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, + segT segment_type ATTRIBUTE_UNUSED) +{ + as_fatal (_("Relaxation should never occur")); + return -1; +} + +/* If while processing a fixup, a reloc really needs to be created, + then it is done here. */ + +arelent * +tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) +{ + arelent *reloc; + reloc = (arelent *) xmalloc (sizeof (arelent)); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + if (fixp->fx_addsy) + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + else if (fixp->fx_subsy) + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); + else + abort (); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + if (reloc->howto == (reloc_howto_type *) NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("reloc %d not supported by object file format"), + (int) fixp->fx_r_type); + return NULL; + } + reloc->addend = fixp->fx_addnumber; + return reloc; +} + +/* Round up a section's size to the appropriate boundary. */ + +valueT +md_section_align (segT seg, valueT size) +{ + int align = bfd_get_section_alignment (stdoutput, seg); + valueT mask = ((valueT) 1 << align) - 1; + + return (size + mask) & ~mask; +} + +/* Where a PC relative offset is calculated from. On the spu they + are calculated from the beginning of the branch instruction. */ + +long +md_pcrel_from (fixS *fixp) +{ + return fixp->fx_frag->fr_address + fixp->fx_where; +} + +/* Fill in rs_align_code fragments. */ + +void +spu_handle_align (fragS *fragp) +{ + static const unsigned char nop_pattern[8] = { + 0x40, 0x20, 0x00, 0x00, /* even nop */ + 0x00, 0x20, 0x00, 0x00, /* odd nop */ + }; + + int bytes; + char *p; + + if (fragp->fr_type != rs_align_code) + return; + + bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; + p = fragp->fr_literal + fragp->fr_fix; + + if (bytes & 3) + { + int fix = bytes & 3; + memset (p, 0, fix); + p += fix; + bytes -= fix; + fragp->fr_fix += fix; + } + if (bytes & 4) + { + memcpy (p, &nop_pattern[4], 4); + p += 4; + bytes -= 4; + fragp->fr_fix += 4; + } + + memcpy (p, nop_pattern, 8); + fragp->fr_var = 8; +} + +void +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) +{ + unsigned int res; + valueT val = *valP; + char *place = fixP->fx_where + fixP->fx_frag->fr_literal; + + if (fixP->fx_subsy != (symbolS *) NULL) + { + /* We can't actually support subtracting a symbol. */ + as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + } + + if (fixP->fx_addsy != NULL) + { + if (fixP->fx_pcrel) + { + /* Hack around bfd_install_relocation brain damage. */ + val += fixP->fx_frag->fr_address + fixP->fx_where; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_32: + fixP->fx_r_type = BFD_RELOC_32_PCREL; + break; + + case BFD_RELOC_SPU_PCREL16: + case BFD_RELOC_SPU_PCREL9a: + case BFD_RELOC_SPU_PCREL9b: + case BFD_RELOC_32_PCREL: + break; + + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("expression too complex")); + break; + } + } + } + + fixP->fx_addnumber = val; + + if (fixP->fx_r_type == BFD_RELOC_SPU_PPU32 + || fixP->fx_r_type == BFD_RELOC_SPU_PPU64) + return; + + if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) + { + fixP->fx_done = 1; + res = 0; + if (fixP->tc_fix_data.arg_format > A_P) + { + int hi = arg_encode[fixP->tc_fix_data.arg_format].hi; + int lo = arg_encode[fixP->tc_fix_data.arg_format].lo; + if (hi > lo && ((offsetT) val < lo || (offsetT) val > hi)) + as_bad_where (fixP->fx_file, fixP->fx_line, + "Relocation doesn't fit. (relocation value = 0x%lx)", + (long) val); + } + + switch (fixP->fx_r_type) + { + case BFD_RELOC_8: + md_number_to_chars (place, val, 1); + return; + + case BFD_RELOC_16: + md_number_to_chars (place, val, 2); + return; + + case BFD_RELOC_32: + md_number_to_chars (place, val, 4); + return; + + case BFD_RELOC_64: + md_number_to_chars (place, val, 8); + return; + + case BFD_RELOC_SPU_IMM7: + res = (val & 0x7f) << 14; + break; + + case BFD_RELOC_SPU_IMM8: + res = (val & 0xff) << 14; + break; + + case BFD_RELOC_SPU_IMM10: + res = (val & 0x3ff) << 14; + break; + + case BFD_RELOC_SPU_IMM10W: + res = (val & 0x3ff0) << 10; + break; + + case BFD_RELOC_SPU_IMM16: + res = (val & 0xffff) << 7; + break; + + case BFD_RELOC_SPU_IMM16W: + res = (val & 0x3fffc) << 5; + break; + + case BFD_RELOC_SPU_IMM18: + res = (val & 0x3ffff) << 7; + break; + + case BFD_RELOC_SPU_PCREL9a: + res = ((val & 0x1fc) >> 2) | ((val & 0x600) << 14); + break; + + case BFD_RELOC_SPU_PCREL9b: + res = ((val & 0x1fc) >> 2) | ((val & 0x600) << 5); + break; + + case BFD_RELOC_SPU_PCREL16: + res = (val & 0x3fffc) << 5; + break; + + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("reloc %d not supported by object file format"), + (int) fixP->fx_r_type); + } + + if (res != 0) + { + place[0] |= (res >> 24) & 0xff; + place[1] |= (res >> 16) & 0xff; + place[2] |= (res >> 8) & 0xff; + place[3] |= (res) & 0xff; + } + } +} diff --git a/contrib/binutils/gas/config/tc-spu.h b/contrib/binutils/gas/config/tc-spu.h new file mode 100644 index 00000000000..4c6c2d4566e --- /dev/null +++ b/contrib/binutils/gas/config/tc-spu.h @@ -0,0 +1,107 @@ +/* spu.h -- Assembler for spu + + Copyright 2006, 2007 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS 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. + + GAS 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 GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#ifndef TC_SPU +#define TC_SPU 1 + +#include "opcode/spu.h" + +#define TARGET_FORMAT "elf32-spu" +#define TARGET_ARCH bfd_arch_spu +#define TARGET_NAME "elf32-spu" + +#define TARGET_BYTES_BIG_ENDIAN 1 + +struct tc_fix_info { + unsigned short arg_format; + unsigned short insn_tag; +}; + +/* fixS will have a member named tc_fix_data of this type. */ +#define TC_FIX_TYPE struct tc_fix_info +#define TC_INIT_FIX_DATA(FIXP) \ + do \ + { \ + (FIXP)->tc_fix_data.arg_format = 0; \ + (FIXP)->tc_fix_data.insn_tag = 0; \ + } \ + while (0) + +/* Don't reduce function symbols to section symbols, and don't adjust + references to PPU symbols. */ +#define tc_fix_adjustable(FIXP) \ + (!(S_IS_FUNCTION ((FIXP)->fx_addsy) \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU32 \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU64)) + +/* Keep relocs on calls. Branches to function symbols are tail or + sibling calls. */ +#define TC_FORCE_RELOCATION(FIXP) \ + ((FIXP)->tc_fix_data.insn_tag == M_BRSL \ + || (FIXP)->tc_fix_data.insn_tag == M_BRASL \ + || (((FIXP)->tc_fix_data.insn_tag == M_BR \ + || (FIXP)->tc_fix_data.insn_tag == M_BRA) \ + && (FIXP)->fx_addsy != NULL \ + && S_IS_FUNCTION ((FIXP)->fx_addsy)) \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU32 \ + || (FIXP)->fx_r_type == BFD_RELOC_SPU_PPU64 \ + || generic_force_reloc (FIXP)) + +/* Values passed to md_apply_fix don't include symbol values. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + +/* The spu uses pseudo-ops with no leading period. */ +#define NO_PSEUDO_DOT 1 + +/* Don't warn on word overflow; it happens on %hi relocs. */ +#undef WARN_SIGNED_OVERFLOW_WORD + +#define DIFF_EXPR_OK + +#define WORKING_DOT_WORD + +#define md_number_to_chars number_to_chars_bigendian + +#define md_convert_frag(b,s,f) {as_fatal (_("spu convert_frag\n"));} + +/* We don't need to do anything special for undefined symbols. */ +#define md_undefined_symbol(s) 0 + +extern symbolS *section_symbol (asection *); +#define md_operand(e) \ + do { \ + if (strncasecmp (input_line_pointer, "@ppu", 4) == 0) \ + { \ + e->X_op = O_symbol; \ + if (abs_section_sym == NULL) \ + abs_section_sym = section_symbol (absolute_section); \ + e->X_add_symbol = abs_section_sym; \ + e->X_add_number = 0; \ + } \ + } while (0) + +/* Fill in rs_align_code fragments. */ +extern void spu_handle_align PARAMS ((fragS *)); +#define HANDLE_ALIGN(frag) spu_handle_align (frag) + +#define MAX_MEM_FOR_RS_ALIGN_CODE (7 + 8) + +#endif /* TC_SPU */ diff --git a/contrib/binutils/gas/config/te-pep.h b/contrib/binutils/gas/config/te-pep.h new file mode 100644 index 00000000000..164b22d9840 --- /dev/null +++ b/contrib/binutils/gas/config/te-pep.h @@ -0,0 +1,10 @@ +#define TE_PEP +#define COFF_WITH_pex64 + +#define TE_PE +#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels. */ + +/* The PE format supports long section names. */ +#define COFF_LONG_SECTION_NAMES + +#include "obj-format.h" diff --git a/contrib/binutils/gas/configure b/contrib/binutils/gas/configure index dca6497031c..d2cc2e704e0 100755 --- a/contrib/binutils/gas/configure +++ b/contrib/binutils/gas/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 #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 GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS 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 LIBM 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 GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof OPCODES_LIB 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 ALLOCA LIBM datarootdir docdir htmldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -852,14 +1001,18 @@ 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 besides the primary + --enable-targets alternative target configurations besides the primary --enable-commonbfdlib build shared BFD/opcodes/libiberty library - --enable-werror treat compile warnings as errors - --enable-build-warnings Enable build-time compiler warnings + --enable-checking enable run-time checks + --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 @@ -867,9 +1020,9 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=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-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: CC C compiler command @@ -3072,73 +3225,264 @@ fi + + +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. - 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 + 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. - 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 + 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. - 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 + 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 + 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" @@ -3149,8 +3493,8 @@ 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 + 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 @@ -3160,12 +3504,12 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 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%/%"` + # 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" ;; @@ -3189,22 +3533,26 @@ 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-:}" + 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 GNU ld's only accept -v. + # but apparently some variants of GNU ld 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 + case `"$lt_cv_path_LD" -v 2>&1 &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 &5; then + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &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 + + + + + + + +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 @@ -3259,35 +3606,173 @@ else # 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 + 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 - fi + done + IFS="$lt_save_ifs" done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm + : ${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_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_DUMPBIN="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +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 -NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + 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_ac_ct_DUMPBIN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +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_DUMPBIN="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +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 "$ac_ct_DUMPBIN" && break +done +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + 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 + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:3761: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:3764: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:3767: 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 @@ -3300,179 +3785,6 @@ else 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 @@ -3491,6 +3803,13 @@ else 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. @@ -3515,174 +3834,400 @@ else 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 + 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 fi -if test -n "$lt_cv_sys_max_cmd_len" ; then +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 +max_cmd_len=$lt_cv_sys_max_cmd_len -# 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 + + + + + +: ${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 - 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 <&2 + lt_unset=false +fi -*** 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" + + + +# 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 -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 "$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 - 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 <&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" - ;; + 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 -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 + + + + + + + + + +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:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + 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 - MAGIC_CMD=: - fi -fi - + 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 +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 +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + 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 + # 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_RANLIB+set}" = set; then +if test "${ac_cv_prog_AR+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. + 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 @@ -3691,7 +4236,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_RANLIB="${ac_tool_prefix}ranlib" + ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3700,27 +4245,27 @@ 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 +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_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 +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_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_AR+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. + 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 @@ -3729,30 +4274,43 @@ 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_ac_ct_RANLIB="ranlib" + 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_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" 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 +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 - RANLIB=$ac_ct_RANLIB + AR=$ac_ct_AR else - RANLIB="$ac_cv_prog_RANLIB" + 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 @@ -3833,14 +4391,401 @@ else STRIP="$ac_cv_prog_STRIP" fi +test -z "$STRIP" && STRIP=: + + + + + + +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 + +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 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. @@ -3848,60 +4793,11 @@ 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" +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 -*-*-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 @@ -3910,19 +4806,56 @@ ia64-*-hpux*) 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" - ;; + 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 4822 "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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) +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 @@ -3930,39 +4863,45 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) 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 - ;; + 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* @@ -3977,9 +4916,7 @@ 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_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' @@ -4045,108 +4982,571 @@ echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 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" +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 ;; - *) - # `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 + 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' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 + + +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 + 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 +#include +#include +#include + +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 + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (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 + : +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_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +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 + 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 + 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 + 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 +fi +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 + +fi + +done + + + +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 +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 + 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 + 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 + 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 +fi +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 + +fi + +done + # 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" +LIBTOOL_DEPS="$ltmain" # 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 @@ -4154,6 +5554,3982 @@ exec 5>>./config.log + + + + + + + + + + + + + + + + + +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 + 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 + + + + + + + + + + + + + + + + + +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 + 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 + +*** 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 + +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_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 + +*** 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 + +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 + 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:5922: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:5926: \$? = $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:6244: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6248: \$? = $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:6349: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6353: \$? = $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:6404: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:6408: \$? = $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 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 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. */ + +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_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 + +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 + + 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. */ + +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_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 + +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 + + 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 + ;; + + 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 + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + 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 + 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 + + 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 + (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 + 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 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + 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 + ;; + + 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 + ;; + + 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 + ;; + + *nto* | *qnx*) + ;; + + 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 + ;; + + 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=: + ;; + + 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' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + 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.so + # instead of lib.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. */ + +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 + 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 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + 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 + + # 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' + ;; + +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 + ;; + +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 + ;; + +*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 + shlibpath_overrides_runpath=yes + fi + ;; + +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 + ;; + +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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + 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 +else + 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. */ + +/* 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 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_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + 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_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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 + 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. */ + +/* 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 () +{ +shl_load (); + ; + 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_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=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_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:$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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + 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_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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. */ + +/* 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 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_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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. */ + +/* 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 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_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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: $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 + 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 +else + 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. */ + +/* 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 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_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + 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 + 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 9201 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#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 +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 + 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 9301 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#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 -fr conftest* + + +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" + ;; + 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" @@ -4165,7 +9541,8 @@ echo "$as_me: error: enable-targets option must specify target names or 'all'" > no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +fi; +# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. if test "${enable_commonbfdlib+set}" = set; then enableval="$enable_commonbfdlib" case "${enableval}" in @@ -4176,6 +9553,25 @@ echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} { (exit 1); exit 1; }; } ;; esac fi; +ac_checking=yes +if grep '^RELEASE=y' ${srcdir}/../bfd/Makefile.am >/dev/null 2>/dev/null ; then + ac_checking= +fi +# Check whether --enable-checking or --disable-checking was given. +if test "${enable_checking+set}" = set; then + enableval="$enable_checking" + case "${enableval}" in + no|none) ac_checking= ;; + *) ac_checking=yes ;; +esac +fi; if test x$ac_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CHECKING 1 +_ACEOF + +fi + using_cgen=no @@ -4733,7 +10129,7 @@ _ACEOF # Do we need the opcodes library? case ${cpu_type} in - vax | i386 | tic30) + vax | tic30) ;; *) @@ -4779,6 +10175,10 @@ _ACEOF esac ;; + mep) + using_cgen=yes + ;; + mips) echo ${extra_objects} | grep -s "itbl-parse.o" if test $? -ne 0 ; then @@ -4896,6 +10296,19 @@ if test ${all_targets} = "yes"; then ;; esac ;; + x86_64) + case ${obj_format} in + aout) + emulations="$emulations i386coff i386elf" + ;; + coff) + emulations="$emulations i386aout i386elf" + ;; + elf) + emulations="$emulations i386aout i386coff" + ;; + esac + ;; esac fi @@ -4903,8 +10316,7 @@ fi # IEEE FP. On those that don't support FP at all, usually IEEE # is emulated. case ${target_cpu} in - vax | tahoe ) atof=${target_cpu} ;; - pdp11) atof=vax ;; + vax | pdp11 ) atof=vax ;; *) atof=ieee ;; esac @@ -4958,6 +10370,11 @@ _ACEOF m88k) cat >>confdefs.h <<\_ACEOF #define M88KCOFF 1 +_ACEOF + ;; + x86_64) +cat >>confdefs.h <<\_ACEOF +#define I386COFF 1 _ACEOF ;; esac @@ -5069,11 +10486,6 @@ cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_GENERIC 1 _ACEOF ;; - ieee) -cat >>confdefs.h <<\_ACEOF -#define OBJ_MAYBE_IEEE 1 -_ACEOF - ;; som) cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_SOM 1 @@ -5134,14 +10546,6 @@ yes) ;; esac -BFDLIB=../bfd/libbfd.la -BFDVER_H=../bfd/bfdver.h -ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' - - - - - @@ -6220,2479 +11624,138 @@ if test "$LEX" = :; then fi ALL_LINGUAS="fr tr es rw" -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 - -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 -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_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 - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_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 - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_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 - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_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 - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -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 - 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 -#include -#include -#include - -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 - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (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 - : -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_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_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. */ - -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 - 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 - -_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_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -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 -_ACEOF - ;; -esac - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -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 - 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 - 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 - 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 -fi -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 - -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 - 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; -} -_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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -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 - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -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 - 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 ((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 - 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_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 -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 - -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - ; - 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_working_alloca_h=yes -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 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -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 - 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 -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - ; - 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_alloca_works=yes -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 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -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. - -ALLOCA=alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -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 - -_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* - -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 - 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -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 (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -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 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -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_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 - 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 - 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 $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 -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 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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -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 -/* 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 -#include - -#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 -# 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 */ - -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); -} -_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_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 - 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 $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 -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 $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 -int -main () -{ -return LC_MESSAGES - ; - 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_val_LC_MESSAGES=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -am_cv_val_LC_MESSAGES=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -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 +# 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 - # Check whether --enable-nls or --disable-nls was given. +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + 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 + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + +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 "$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 -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 $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 -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 -_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 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 -_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 + 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_cpp_err=yes + ac_executable_p="test -f" 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 +rm -f conf$$.file - 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: 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 - ;; - 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 -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 $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 - -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 - 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 -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -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 - - 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 - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $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 bindtextdomain (); -int -main () -{ -bindtextdomain (); - ; - 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_intl_bindtextdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_bindtextdomain=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 $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. */ - -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_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gettext_libintl=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_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - # Extract the first word of "msgfmt", so it can be a program name with args. +# 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 @@ -8700,308 +11763,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. - ;; - *) - 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 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test "$MSGFMT" != "no"; then - -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 $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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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; -} -_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 - eval "$as_ac_var=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 -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 - - # 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. - ;; + ac_cv_path_MSGFMT="$MSGFMT" # 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 -n "$GMSGFMT"; then - echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 -else - 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 - 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 - - 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 - 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 - - - - - 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 + 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 - 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. -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 - 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="msgfmt" - ;; + 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 @@ -9009,7 +11795,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 @@ -9049,7 +11835,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 @@ -9057,27 +11873,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 @@ -9085,284 +11905,105 @@ else echo "${ECHO_T}no" >&6 fi - - 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 + rm -f messages.po - - - - - - - - - - - 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 " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . 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 -_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 -_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 + +# 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + 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 +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&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 -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 "$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 - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi + ac_config_commands="$ac_config_commands default-1" - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - 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 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. @@ -9389,6 +12030,16 @@ fi +if false; then + GENINSRC_NEVER_TRUE= + GENINSRC_NEVER_FALSE='#' +else + GENINSRC_NEVER_TRUE='#' + GENINSRC_NEVER_FALSE= +fi + + + @@ -10211,8 +12862,7 @@ yes) LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm - # on darwin the libm is a symbolic link to libSystem.dylib + # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) echo "$as_me:$LINENO: checking for _mwvalidcheckl in -lmw" >&5 @@ -10283,9 +12933,9 @@ if test $ac_cv_lib_mw__mwvalidcheckl = yes; then LIBM="-lmw" fi - echo "$as_me:$LINENO: checking for main in -lm" >&5 -echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 -if test "${ac_cv_lib_m_main+set}" = set; then + echo "$as_me:$LINENO: checking for cos in -lm" >&5 +echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_cos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10297,11 +12947,17 @@ 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 cos (); int main () { -main (); +cos (); ; return 0; } @@ -10328,28 +12984,28 @@ 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_m_main=yes + ac_cv_lib_m_cos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_m_main=no +ac_cv_lib_m_cos=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_m_main" >&5 -echo "${ECHO_T}$ac_cv_lib_m_main" >&6 -if test $ac_cv_lib_m_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5 +echo "${ECHO_T}$ac_cv_lib_m_cos" >&6 +if test $ac_cv_lib_m_cos = yes; then LIBM="$LIBM -lm" fi ;; *) - echo "$as_me:$LINENO: checking for main in -lm" >&5 -echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 -if test "${ac_cv_lib_m_main+set}" = set; then + echo "$as_me:$LINENO: checking for cos in -lm" >&5 +echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_cos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -10361,11 +13017,17 @@ 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 cos (); int main () { -main (); +cos (); ; return 0; } @@ -10392,20 +13054,20 @@ 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_m_main=yes + ac_cv_lib_m_cos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_m_main=no +ac_cv_lib_m_cos=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_m_main" >&5 -echo "${ECHO_T}$ac_cv_lib_m_main" >&6 -if test $ac_cv_lib_m_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5 +echo "${ECHO_T}$ac_cv_lib_m_cos" >&6 +if test $ac_cv_lib_m_cos = yes; then LIBM="-lm" fi @@ -10413,6 +13075,7 @@ fi esac + ;; esac @@ -11124,6 +13787,16 @@ fi +case "${host}" in +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) + +cat >>confdefs.h <<\_ACEOF +#define USE_BINARY_FOPEN 1 +_ACEOF + ;; +esac + + @@ -11246,6 +13919,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 @@ -11680,6 +14360,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%}" + target_cpu_type=${target_cpu_type} cgen_cpu_prefix=${cgen_cpu_prefix} obj_format=${obj_format} @@ -11700,6 +14628,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" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -11837,10 +14767,22 @@ 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,@GDBINIT@,$GDBINIT,;t t @@ -11851,40 +14793,32 @@ s,@obj_format@,$obj_format,;t t s,@te_file@,$te_file,;t t s,@install_tooldir@,$install_tooldir,;t t s,@atof@,$atof,;t t -s,@BFDLIB@,$BFDLIB,;t t s,@OPCODES_LIB@,$OPCODES_LIB,;t t -s,@BFDVER_H@,$BFDVER_H,;t t -s,@ALL_OBJ_DEPS@,$ALL_OBJ_DEPS,;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,@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,@GMSGFMT@,$GMSGFMT,;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,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;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,@ALLOCA@,$ALLOCA,;t t s,@LIBM@,$LIBM,;t t s,@datarootdir@,$datarootdir,;t t s,@docdir@,$docdir,;t t @@ -12573,6 +15507,656 @@ echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} done done ;; + 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 , 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 ;; default ) rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h @@ -12580,9 +16164,7 @@ done echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h if test "x$cgen_cpu_prefix" != x ; then echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h - fi - - sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; + fi ;; esac done _ACEOF diff --git a/contrib/binutils/gas/configure.in b/contrib/binutils/gas/configure.in index fe69a51c925..02e8e53af4f 100644 --- a/contrib/binutils/gas/configure.in +++ b/contrib/binutils/gas/configure.in @@ -23,13 +23,14 @@ AM_INIT_AUTOMAKE(gas, ${BFD_VERSION}) AM_PROG_LIBTOOL AC_ARG_ENABLE(targets, -[ --enable-targets alternative target configurations besides the primary], +[ --enable-targets alternative target configurations besides the primary], [case "${enableval}" in yes | "") AC_ERROR(enable-targets option must specify target names or 'all') ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac])dnl + AC_ARG_ENABLE(commonbfdlib, [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], [case "${enableval}" in @@ -38,6 +39,20 @@ AC_ARG_ENABLE(commonbfdlib, *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; esac])dnl +ac_checking=yes +if grep '^RELEASE=y' ${srcdir}/../bfd/Makefile.am >/dev/null 2>/dev/null ; then + ac_checking= +fi +AC_ARG_ENABLE(checking, +[ --enable-checking enable run-time checks], +[case "${enableval}" in + no|none) ac_checking= ;; + *) ac_checking=yes ;; +esac])dnl +if test x$ac_checking != x ; then + AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.]) +fi + using_cgen=no AM_BINUTILS_WARNINGS @@ -258,7 +273,7 @@ changequote([,])dnl # Do we need the opcodes library? case ${cpu_type} in - vax | i386 | tic30) + vax | tic30) ;; *) @@ -304,18 +319,22 @@ changequote([,])dnl esac ;; + mep) + using_cgen=yes + ;; + mips) - echo ${extra_objects} | grep -s "itbl-parse.o" + echo ${extra_objects} | grep -s "itbl-parse.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-parse.o" fi - echo ${extra_objects} | grep -s "itbl-lex.o" + echo ${extra_objects} | grep -s "itbl-lex.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-lex.o" fi - echo ${extra_objects} | grep -s "itbl-ops.o" + echo ${extra_objects} | grep -s "itbl-ops.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-ops.o" fi @@ -417,6 +436,19 @@ if test ${all_targets} = "yes"; then ;; esac ;; + x86_64) + case ${obj_format} in + aout) + emulations="$emulations i386coff i386elf" + ;; + coff) + emulations="$emulations i386aout i386elf" + ;; + elf) + emulations="$emulations i386aout i386coff" + ;; + esac + ;; esac fi @@ -424,8 +456,7 @@ fi # IEEE FP. On those that don't support FP at all, usually IEEE # is emulated. case ${target_cpu} in - vax | tahoe ) atof=${target_cpu} ;; - pdp11) atof=vax ;; + vax | pdp11 ) atof=vax ;; *) atof=ieee ;; esac @@ -462,6 +493,7 @@ case ${obj_format} in i386) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;; m68k) AC_DEFINE(M68KCOFF, 1, [Using m68k COFF?]) ;; m88k) AC_DEFINE(M88KCOFF, 1, [Using m88k COFF?]) ;; + x86_64) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;; esac ;; esac @@ -511,7 +543,6 @@ if test `set . $formats ; shift ; echo $#` -gt 1 ; then ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF, 1, [ECOFF support?]) ;; elf) AC_DEFINE(OBJ_MAYBE_ELF, 1, [ELF support?]) ;; generic) AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;; - ieee) AC_DEFINE(OBJ_MAYBE_IEEE, 1, [IEEE support?]) ;; som) AC_DEFINE(OBJ_MAYBE_SOM, 1, [SOM support?]) ;; esac extra_objects="$extra_objects obj-$fmt.o" @@ -556,16 +587,8 @@ yes) ;; esac -BFDLIB=../bfd/libbfd.la -BFDVER_H=../bfd/bfdver.h -ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' - -AC_SUBST(BFDLIB) AC_SUBST(OPCODES_LIB) -AC_SUBST(BFDVER_H) -AC_SUBST(ALL_OBJ_DEPS) - AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}", [Target alias.]) AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}", [Canonical target.]) AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", [Target CPU.]) @@ -578,9 +601,11 @@ AC_PROG_YACC AM_PROG_LEX ALL_LINGUAS="fr tr es rw" -CY_GNU_GETTEXT +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) AC_EXEEXT AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h) @@ -609,7 +634,7 @@ AC_CHECK_FUNCS(sbrk) # do we need the math library? case "${need_libm}" in -yes) +yes) AC_CHECK_LIBM AC_SUBST(LIBM) ;; @@ -669,6 +694,8 @@ GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers) AC_CHECK_DECLS([vsnprintf]) +BFD_BINARY_FOPEN + dnl Required for html and install-html targets. AC_SUBST(datarootdir) AC_SUBST(docdir) @@ -691,9 +718,7 @@ AC_CONFIG_COMMANDS([default], echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h if test "x$cgen_cpu_prefix" != x ; then echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h - fi - - sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile], + fi], [target_cpu_type=${target_cpu_type} cgen_cpu_prefix=${cgen_cpu_prefix} obj_format=${obj_format} diff --git a/contrib/binutils/gas/debug.c b/contrib/binutils/gas/debug.c index fe2ed8c6536..3218fff538a 100644 --- a/contrib/binutils/gas/debug.c +++ b/contrib/binutils/gas/debug.c @@ -1,5 +1,5 @@ /* This file is debug.c - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000 + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -25,26 +25,28 @@ dmp_frags () { + asection *s; frchainS *chp; char *p; - for (chp = frchain_root; chp; chp = chp->frch_next) - { - switch (chp->frch_seg) - { - case SEG_DATA: - p = "Data"; - break; - case SEG_TEXT: - p = "Text"; - break; - default: - p = "???"; - break; - } - printf ("\nSEGMENT %s %d\n", p, chp->frch_subseg); - dmp_frag (chp->frch_root, "\t"); - } + for (s = stdoutput->sections; s; s = s->next) + for (chp = seg_info (s)->frchainP; chp; chp = chp->frch_next) + { + switch (s) + { + case SEG_DATA: + p = "Data"; + break; + case SEG_TEXT: + p = "Text"; + break; + default: + p = "???"; + break; + } + printf ("\nSEGMENT %s %d\n", p, chp->frch_subseg); + dmp_frag (chp->frch_root, "\t"); + } } dmp_frag (fp, indent) diff --git a/contrib/binutils/gas/dep-in.sed b/contrib/binutils/gas/dep-in.sed index f23c2018fe9..d81c4609b9c 100644 --- a/contrib/binutils/gas/dep-in.sed +++ b/contrib/binutils/gas/dep-in.sed @@ -12,14 +12,13 @@ s!@SRCDIR@/config!$(srcdir)/config!g s!@SRCDIR@/\.\./opcodes!$(srcdir)/../opcodes!g s!@TOPDIR@/opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g -s!\.\./bfd/bfdver\.h!$(BFDVER_H)!g s! \$(srcdir)/config/te-generic\.h!!g -s! \.\./bfd/bfd\.h!!g s! itbl-cpu\.h!!g s! itbl-parse\.h!!g s! \.\./intl/libintl\.h!!g -s! \$(INCDIR)/bin-bugs\.h!!g +s! \.\./bfd/bfd\.h!!g +s! \$(INCDIR)/symcat\.h!!g s! \$(INCDIR)/ansidecl\.h!!g s! \$(INCDIR)/libiberty\.h!!g s! \$(INCDIR)/progress\.h!!g diff --git a/contrib/binutils/gas/doc/Makefile.am b/contrib/binutils/gas/doc/Makefile.am index d48a9ccb241..4f6ff9294c0 100644 --- a/contrib/binutils/gas/doc/Makefile.am +++ b/contrib/binutils/gas/doc/Makefile.am @@ -16,9 +16,12 @@ POD2MAN = pod2man --center="GNU Development Tools" \ man_MANS = as.1 info_TEXINFOS = as.texinfo +as_TEXINFOS = asconfig.texi $(CPU_DOCS) -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc asconfig.texi: $(CONFIG).texi rm -f asconfig.texi @@ -29,7 +32,9 @@ CPU_DOCS = \ c-alpha.texi \ c-arc.texi \ c-arm.texi \ + c-avr.texi \ c-bfin.texi \ + c-cr16.texi \ c-d10v.texi \ c-cris.texi \ c-h8300.texi \ @@ -61,13 +66,6 @@ CPU_DOCS = \ c-z80.texi \ c-z8k.texi -gasver.texi: $(srcdir)/../../bfd/configure - rm -f $@ - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - -$(srcdir)/as.info as.dvi as.html: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) - # We want install to imply install-info as per GNU standards, despite the # cygnus option. install-data-local: install-info @@ -97,7 +95,7 @@ install-html-am: $(HTMLS) noinst_TEXINFOS = internals.texi -MAINTAINERCLEANFILES = asconfig.texi gasver.texi +MAINTAINERCLEANFILES = asconfig.texi BASEDIR = $(srcdir)/../.. BFDDIR = $(BASEDIR)/bfd @@ -112,7 +110,7 @@ info-local: $(MANS) # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that # the man output looks standard. -as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) +as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) touch $@ -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod -($(POD2MAN) as.pod | \ @@ -120,3 +118,12 @@ as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) mv -f $@.T$$$$ $@) || \ (rm -f $@.T$$$$ && exit 1) rm -f as.pod + +MAINTAINERCLEANFILES += as.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 = as.info +endif diff --git a/contrib/binutils/gas/doc/Makefile.in b/contrib/binutils/gas/doc/Makefile.in index cd9dad2baaf..86f3d7a4269 100644 --- a/contrib/binutils/gas/doc/Makefile.in +++ b/contrib/binutils/gas/doc/Makefile.in @@ -37,11 +37,19 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(as_TEXINFOS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.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/lead-dot.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)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -50,7 +58,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/as.info +INFO_DEPS = as.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = as.dvi @@ -68,16 +76,14 @@ NROFF = nroff MANS = $(man_MANS) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ -ALL_OBJ_DEPS = @ALL_OBJ_DEPS@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -BFDLIB = @BFDLIB@ -BFDVER_H = @BFDVER_H@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ @@ -89,29 +95,32 @@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GDBINIT = @GDBINIT@ -GMOFILES = @GMOFILES@ +GENCAT = @GENCAT@ +GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@ +GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@ GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +GREP = @GREP@ +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@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -124,6 +133,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ NO_WERROR = @NO_WERROR@ OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ @@ -134,19 +145,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@ @@ -179,10 +191,10 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ install_tooldir = @install_tooldir@ -l = @l@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ obj_format = @obj_format@ @@ -212,13 +224,20 @@ POD2MAN = pod2man --center="GNU Development Tools" \ man_MANS = as.1 info_TEXINFOS = as.texinfo -AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" -TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" +as_TEXINFOS = asconfig.texi $(CPU_DOCS) +AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + +TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../libiberty" \ + -I ../../bfd/doc + CPU_DOCS = \ c-alpha.texi \ c-arc.texi \ c-arm.texi \ + c-avr.texi \ c-bfin.texi \ + c-cr16.texi \ c-d10v.texi \ c-cris.texi \ c-h8300.texi \ @@ -254,14 +273,19 @@ html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; # This one isn't ready for prime time yet. Not even a little bit. noinst_TEXINFOS = internals.texi -MAINTAINERCLEANFILES = asconfig.texi gasver.texi +MAINTAINERCLEANFILES = asconfig.texi as.info BASEDIR = $(srcdir)/../.. BFDDIR = $(BASEDIR)/bfd CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in + +# 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 = as.info all: all-am .SUFFIXES: -.SUFFIXES: .dvi .html .info .pdf .ps .texinfo +.SUFFIXES: .dvi .ps $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -271,9 +295,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 \ @@ -301,42 +325,38 @@ clean-libtool: distclean-libtool: -rm -f libtool -.texinfo.info: +as.info: as.texinfo $(as_TEXINFOS) 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 'as.texinfo' || echo '$(srcdir)/'`as.texinfo; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc -.texinfo.dvi: +as.dvi: as.texinfo $(as_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo -.texinfo.pdf: +as.pdf: as.texinfo $(as_TEXINFOS) TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) $< + $(TEXI2PDF) -o $@ `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo -.texinfo.html: +as.html: as.texinfo $(as_TEXINFOS) rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) $<; \ + -o $(@:.html=.htp) `test -f 'as.texinfo' || echo '$(srcdir)/'`as.texinfo; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ @@ -346,10 +366,6 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/as.info: as.texinfo -as.dvi: as.texinfo -as.pdf: as.texinfo -as.html: as.texinfo .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< @@ -481,6 +497,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" @@ -586,13 +603,6 @@ asconfig.texi: $(CONFIG).texi cp $(srcdir)/$(CONFIG).texi ./asconfig.texi chmod u+w ./asconfig.texi -gasver.texi: $(srcdir)/../../bfd/configure - rm -f $@ - eval `grep '^ *VERSION=' $(srcdir)/../../bfd/configure`; \ - echo "@set VERSION $$VERSION" > $@ - -$(srcdir)/as.info as.dvi as.html: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) - # We want install to imply install-info as per GNU standards, despite the # cygnus option. install-data-local: install-info @@ -624,7 +634,7 @@ info-local: $(MANS) # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that # the man output looks standard. -as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) +as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) touch $@ -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod -($(POD2MAN) as.pod | \ diff --git a/contrib/binutils/gas/doc/all.texi b/contrib/binutils/gas/doc/all.texi index 5192f5471c9..b4778bf8b28 100644 --- a/contrib/binutils/gas/doc/all.texi +++ b/contrib/binutils/gas/doc/all.texi @@ -29,7 +29,9 @@ @set ALPHA @set ARC @set ARM +@set AVR @set BFIN +@set CR16 @set CRIS @set D10V @set D30V @@ -63,7 +65,7 @@ @set Z80 @set Z8000 -@c Does this version of the assembler use the difference-table kluge? +@c Does this version of the assembler use the difference-table kludge? @set DIFF-TBL-KLUGE @c Do all machines described use IEEE floating point? diff --git a/contrib/binutils/gas/doc/as.1 b/contrib/binutils/gas/doc/as.1 deleted file mode 100644 index 89e3b4c2c7c..00000000000 --- a/contrib/binutils/gas/doc/as.1 +++ /dev/null @@ -1,1109 +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 "AS 1" -.TH AS 1 "2006-06-23" "binutils-2.17" "GNU Development Tools" -.SH "NAME" -AS \- the portable GNU assembler. -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-\-alternate\fR] [\fB\-D\fR] - [\fB\-\-defsym\fR \fIsym\fR=\fIval\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-\-gstabs\fR] - [\fB\-\-gstabs+\fR] [\fB\-\-gdwarf\-2\fR] [\fB\-\-help\fR] [\fB\-I\fR \fIdir\fR] [\fB\-J\fR] - [\fB\-K\fR] [\fB\-L\fR] [\fB\-\-listing\-lhs\-width\fR=\fI\s-1NUM\s0\fR] - [\fB\-\-listing\-lhs\-width2\fR=\fI\s-1NUM\s0\fR] [\fB\-\-listing\-rhs\-width\fR=\fI\s-1NUM\s0\fR] - [\fB\-\-listing\-cont\-lines\fR=\fI\s-1NUM\s0\fR] [\fB\-\-keep\-locals\fR] [\fB\-o\fR - \fIobjfile\fR] [\fB\-R\fR] [\fB\-\-reduce\-memory\-overheads\fR] [\fB\-\-statistics\fR] - [\fB\-v\fR] [\fB\-version\fR] [\fB\-\-version\fR] [\fB\-W\fR] [\fB\-\-warn\fR] - [\fB\-\-fatal\-warnings\fR] [\fB\-w\fR] [\fB\-x\fR] [\fB\-Z\fR] [\fB@\fR\fI\s-1FILE\s0\fR] - [\fB\-\-target\-help\fR] [\fItarget-options\fR] - [\fB\-\-\fR|\fIfiles\fR ...] -.PP -\&\fITarget Alpha options:\fR - [\fB\-m\fR\fIcpu\fR] - [\fB\-mdebug\fR | \fB\-no\-mdebug\fR] - [\fB\-relax\fR] [\fB\-g\fR] [\fB\-G\fR\fIsize\fR] - [\fB\-F\fR] [\fB\-32addr\fR] -.PP -\&\fITarget \s-1ARC\s0 options:\fR - [\fB\-marc[5|6|7|8]\fR] - [\fB\-EB\fR|\fB\-EL\fR] -.PP -\&\fITarget \s-1ARM\s0 options:\fR - [\fB\-mcpu\fR=\fIprocessor\fR[+\fIextension\fR...]] - [\fB\-march\fR=\fIarchitecture\fR[+\fIextension\fR...]] - [\fB\-mfpu\fR=\fIfloating-point-format\fR] - [\fB\-mfloat\-abi\fR=\fIabi\fR] - [\fB\-meabi\fR=\fIver\fR] - [\fB\-mthumb\fR] - [\fB\-EB\fR|\fB\-EL\fR] - [\fB\-mapcs\-32\fR|\fB\-mapcs\-26\fR|\fB\-mapcs\-float\fR| - \fB\-mapcs\-reentrant\fR] - [\fB\-mthumb\-interwork\fR] [\fB\-k\fR] -.PP -\&\fITarget \s-1CRIS\s0 options:\fR - [\fB\-\-underscore\fR | \fB\-\-no\-underscore\fR] - [\fB\-\-pic\fR] [\fB\-N\fR] - [\fB\-\-emulation=criself\fR | \fB\-\-emulation=crisaout\fR] - [\fB\-\-march=v0_v10\fR | \fB\-\-march=v10\fR | \fB\-\-march=v32\fR | \fB\-\-march=common_v10_v32\fR] -.PP -\&\fITarget D10V options:\fR - [\fB\-O\fR] -.PP -\&\fITarget D30V options:\fR - [\fB\-O\fR|\fB\-n\fR|\fB\-N\fR] -.PP -\&\fITarget i386 options:\fR - [\fB\-\-32\fR|\fB\-\-64\fR] [\fB\-n\fR] -.PP -\&\fITarget i960 options:\fR - [\fB\-ACA\fR|\fB\-ACA_A\fR|\fB\-ACB\fR|\fB\-ACC\fR|\fB\-AKA\fR|\fB\-AKB\fR| - \fB\-AKC\fR|\fB\-AMC\fR] - [\fB\-b\fR] [\fB\-no\-relax\fR] -.PP -\&\fITarget \s-1IA\-64\s0 options:\fR - [\fB\-mconstant\-gp\fR|\fB\-mauto\-pic\fR] - [\fB\-milp32\fR|\fB\-milp64\fR|\fB\-mlp64\fR|\fB\-mp64\fR] - [\fB\-mle\fR|\fBmbe\fR] - [\fB\-mtune=itanium1\fR|\fB\-mtune=itanium2\fR] - [\fB\-munwind\-check=warning\fR|\fB\-munwind\-check=error\fR] - [\fB\-mhint.b=ok\fR|\fB\-mhint.b=warning\fR|\fB\-mhint.b=error\fR] - [\fB\-x\fR|\fB\-xexplicit\fR] [\fB\-xauto\fR] [\fB\-xdebug\fR] -.PP -\&\fITarget \s-1IP2K\s0 options:\fR - [\fB\-mip2022\fR|\fB\-mip2022ext\fR] -.PP -\&\fITarget M32C options:\fR - [\fB\-m32c\fR|\fB\-m16c\fR] -.PP -\&\fITarget M32R options:\fR - [\fB\-\-m32rx\fR|\fB\-\-[no\-]warn\-explicit\-parallel\-conflicts\fR| - \fB\-\-W[n]p\fR] -.PP -\&\fITarget M680X0 options:\fR - [\fB\-l\fR] [\fB\-m68000\fR|\fB\-m68010\fR|\fB\-m68020\fR|...] -.PP -\&\fITarget M68HC11 options:\fR - [\fB\-m68hc11\fR|\fB\-m68hc12\fR|\fB\-m68hcs12\fR] - [\fB\-mshort\fR|\fB\-mlong\fR] - [\fB\-mshort\-double\fR|\fB\-mlong\-double\fR] - [\fB\-\-force\-long\-branchs\fR] [\fB\-\-short\-branchs\fR] - [\fB\-\-strict\-direct\-mode\fR] [\fB\-\-print\-insn\-syntax\fR] - [\fB\-\-print\-opcodes\fR] [\fB\-\-generate\-example\fR] -.PP -\&\fITarget \s-1MCORE\s0 options:\fR - [\fB\-jsri2bsr\fR] [\fB\-sifilter\fR] [\fB\-relax\fR] - [\fB\-mcpu=[210|340]\fR] -.PP -\&\fITarget \s-1MIPS\s0 options:\fR - [\fB\-nocpp\fR] [\fB\-EL\fR] [\fB\-EB\fR] [\fB\-O\fR[\fIoptimization level\fR]] - [\fB\-g\fR[\fIdebug level\fR]] [\fB\-G\fR \fInum\fR] [\fB\-KPIC\fR] [\fB\-call_shared\fR] - [\fB\-non_shared\fR] [\fB\-xgot\fR] - [\fB\-mabi\fR=\fI\s-1ABI\s0\fR] [\fB\-32\fR] [\fB\-n32\fR] [\fB\-64\fR] [\fB\-mfp32\fR] [\fB\-mgp32\fR] - [\fB\-march\fR=\fI\s-1CPU\s0\fR] [\fB\-mtune\fR=\fI\s-1CPU\s0\fR] [\fB\-mips1\fR] [\fB\-mips2\fR] - [\fB\-mips3\fR] [\fB\-mips4\fR] [\fB\-mips5\fR] [\fB\-mips32\fR] [\fB\-mips32r2\fR] - [\fB\-mips64\fR] [\fB\-mips64r2\fR] - [\fB\-construct\-floats\fR] [\fB\-no\-construct\-floats\fR] - [\fB\-trap\fR] [\fB\-no\-break\fR] [\fB\-break\fR] [\fB\-no\-trap\fR] - [\fB\-mfix7000\fR] [\fB\-mno\-fix7000\fR] - [\fB\-mips16\fR] [\fB\-no\-mips16\fR] - [\fB\-mips3d\fR] [\fB\-no\-mips3d\fR] - [\fB\-mdmx\fR] [\fB\-no\-mdmx\fR] - [\fB\-mdsp\fR] [\fB\-mno\-dsp\fR] - [\fB\-mmt\fR] [\fB\-mno\-mt\fR] - [\fB\-mdebug\fR] [\fB\-no\-mdebug\fR] - [\fB\-mpdr\fR] [\fB\-mno\-pdr\fR] -.PP -\&\fITarget \s-1MMIX\s0 options:\fR - [\fB\-\-fixed\-special\-register\-names\fR] [\fB\-\-globalize\-symbols\fR] - [\fB\-\-gnu\-syntax\fR] [\fB\-\-relax\fR] [\fB\-\-no\-predefined\-symbols\fR] - [\fB\-\-no\-expand\fR] [\fB\-\-no\-merge\-gregs\fR] [\fB\-x\fR] - [\fB\-\-linker\-allocated\-gregs\fR] -.PP -\&\fITarget \s-1PDP11\s0 options:\fR - [\fB\-mpic\fR|\fB\-mno\-pic\fR] [\fB\-mall\fR] [\fB\-mno\-extensions\fR] - [\fB\-m\fR\fIextension\fR|\fB\-mno\-\fR\fIextension\fR] - [\fB\-m\fR\fIcpu\fR] [\fB\-m\fR\fImachine\fR] -.PP -\&\fITarget picoJava options:\fR - [\fB\-mb\fR|\fB\-me\fR] -.PP -\&\fITarget PowerPC options:\fR - [\fB\-mpwrx\fR|\fB\-mpwr2\fR|\fB\-mpwr\fR|\fB\-m601\fR|\fB\-mppc\fR|\fB\-mppc32\fR|\fB\-m603\fR|\fB\-m604\fR| - \fB\-m403\fR|\fB\-m405\fR|\fB\-mppc64\fR|\fB\-m620\fR|\fB\-mppc64bridge\fR|\fB\-mbooke\fR| - \fB\-mbooke32\fR|\fB\-mbooke64\fR] - [\fB\-mcom\fR|\fB\-many\fR|\fB\-maltivec\fR] [\fB\-memb\fR] - [\fB\-mregnames\fR|\fB\-mno\-regnames\fR] - [\fB\-mrelocatable\fR|\fB\-mrelocatable\-lib\fR] - [\fB\-mlittle\fR|\fB\-mlittle\-endian\fR|\fB\-mbig\fR|\fB\-mbig\-endian\fR] - [\fB\-msolaris\fR|\fB\-mno\-solaris\fR] -.PP -\&\fITarget \s-1SPARC\s0 options:\fR - [\fB\-Av6\fR|\fB\-Av7\fR|\fB\-Av8\fR|\fB\-Asparclet\fR|\fB\-Asparclite\fR - \fB\-Av8plus\fR|\fB\-Av8plusa\fR|\fB\-Av9\fR|\fB\-Av9a\fR] - [\fB\-xarch=v8plus\fR|\fB\-xarch=v8plusa\fR] [\fB\-bump\fR] - [\fB\-32\fR|\fB\-64\fR] -.PP -\&\fITarget \s-1TIC54X\s0 options:\fR - [\fB\-mcpu=54[123589]\fR|\fB\-mcpu=54[56]lp\fR] [\fB\-mfar\-mode\fR|\fB\-mf\fR] - [\fB\-merrors\-to\-file\fR \fI\fR|\fB\-me\fR \fI\fR] -.PP -\&\fITarget Z80 options:\fR - [\fB\-z80\fR] [\fB\-r800\fR] - [ \fB\-ignore\-undocumented\-instructions\fR] [\fB\-Wnud\fR] - [ \fB\-ignore\-unportable\-instructions\fR] [\fB\-Wnup\fR] - [ \fB\-warn\-undocumented\-instructions\fR] [\fB\-Wud\fR] - [ \fB\-warn\-unportable\-instructions\fR] [\fB\-Wup\fR] - [ \fB\-forbid\-undocumented\-instructions\fR] [\fB\-Fud\fR] - [ \fB\-forbid\-unportable\-instructions\fR] [\fB\-Fup\fR] -.PP -\&\fITarget Xtensa options:\fR - [\fB\-\-[no\-]text\-section\-literals\fR] [\fB\-\-[no\-]absolute\-literals\fR] - [\fB\-\-[no\-]target\-align\fR] [\fB\-\-[no\-]longcalls\fR] - [\fB\-\-[no\-]transform\fR] - [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR] -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\s-1GNU\s0 \fBas\fR is really a family of assemblers. -If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you -should find a fairly similar environment when you use it on another -architecture. Each version has much in common with the others, -including object file formats, most assembler directives (often called -\&\fIpseudo-ops\fR) and assembler syntax. -.PP -\&\fBas\fR is primarily intended to assemble the output of the -\&\s-1GNU\s0 C compiler \f(CW\*(C`gcc\*(C'\fR for use by the linker -\&\f(CW\*(C`ld\*(C'\fR. Nevertheless, we've tried to make \fBas\fR -assemble correctly everything that other assemblers for the same -machine would assemble. -Any exceptions are documented explicitly. -This doesn't mean \fBas\fR always uses the same syntax as another -assembler for the same architecture; for example, we know of several -incompatible versions of 680x0 assembly language syntax. -.PP -Each time you run \fBas\fR it assembles exactly one source -program. The source program is made up of one or more files. -(The standard input is also a file.) -.PP -You give \fBas\fR a command line that has zero or more input file -names. The input files are read (from left file name to right). A -command line argument (in any position) that has no special meaning -is taken to be an input file name. -.PP -If you give \fBas\fR no file names it attempts to read one input file -from the \fBas\fR standard input, which is normally your terminal. You -may have to type \fBctl-D\fR to tell \fBas\fR there is no more program -to assemble. -.PP -Use \fB\-\-\fR if you need to explicitly name the standard input file -in your command line. -.PP -If the source is empty, \fBas\fR produces a small, empty object -file. -.PP -\&\fBas\fR may write warnings and error messages to the standard error -file (usually your terminal). This should not happen when a compiler -runs \fBas\fR automatically. Warnings report an assumption made so -that \fBas\fR could keep assembling a flawed program; errors report a -grave problem that stops the assembly. -.PP -If you are invoking \fBas\fR via the \s-1GNU\s0 C compiler, -you can use the \fB\-Wa\fR option to pass arguments through to the assembler. -The assembler arguments must be separated from each other (and the \fB\-Wa\fR) -by commas. For example: -.PP -.Vb 1 -\& gcc \-c \-g \-O \-Wa,\-alh,\-L file.c -.Ve -.PP -This passes two options to the assembler: \fB\-alh\fR (emit a listing to -standard output with high-level and assembly source) and \fB\-L\fR (retain -local symbols in the symbol table). -.PP -Usually you do not need to use this \fB\-Wa\fR mechanism, since many compiler -command-line options are automatically passed to the assembler by the compiler. -(You can call the \s-1GNU\s0 compiler driver with the \fB\-v\fR option to see -precisely what options it passes to each compilation pass, including the -assembler.) -.SH "OPTIONS" -.IX Header "OPTIONS" -.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. -.IP "\fB\-a[cdhlmns]\fR" 4 -.IX Item "-a[cdhlmns]" -Turn on listings, in any of a variety of ways: -.RS 4 -.IP "\fB\-ac\fR" 4 -.IX Item "-ac" -omit false conditionals -.IP "\fB\-ad\fR" 4 -.IX Item "-ad" -omit debugging directives -.IP "\fB\-ah\fR" 4 -.IX Item "-ah" -include high-level source -.IP "\fB\-al\fR" 4 -.IX Item "-al" -include assembly -.IP "\fB\-am\fR" 4 -.IX Item "-am" -include macro expansions -.IP "\fB\-an\fR" 4 -.IX Item "-an" -omit forms processing -.IP "\fB\-as\fR" 4 -.IX Item "-as" -include symbols -.IP "\fB=file\fR" 4 -.IX Item "=file" -set the name of the listing file -.RE -.RS 4 -.Sp -You may combine these options; for example, use \fB\-aln\fR for assembly -listing without forms processing. The \fB=file\fR option, if used, must be -the last one. By itself, \fB\-a\fR defaults to \fB\-ahls\fR. -.RE -.IP "\fB\-\-alternate\fR" 4 -.IX Item "--alternate" -Begin in alternate macro mode, see \fBAltmacro,,\f(CB\*(C`.altmacro\*(C'\fB\fR. -.IP "\fB\-D\fR" 4 -.IX Item "-D" -Ignored. This option is accepted for script compatibility with calls to -other assemblers. -.IP "\fB\-\-defsym\fR \fIsym\fR\fB=\fR\fIvalue\fR" 4 -.IX Item "--defsym sym=value" -Define the symbol \fIsym\fR to be \fIvalue\fR before assembling the input file. -\&\fIvalue\fR must be an integer constant. As in C, a leading \fB0x\fR -indicates a hexadecimal value, and a leading \fB0\fR indicates an octal value. -.IP "\fB\-f\fR" 4 -.IX Item "-f" -\&\*(L"fast\*(R"\-\-\-skip whitespace and comment preprocessing (assume source is -compiler output). -.IP "\fB\-g\fR" 4 -.IX Item "-g" -.PD 0 -.IP "\fB\-\-gen\-debug\fR" 4 -.IX Item "--gen-debug" -.PD -Generate debugging information for each assembler source line using whichever -debug format is preferred by the target. This currently means either \s-1STABS\s0, -\&\s-1ECOFF\s0 or \s-1DWARF2\s0. -.IP "\fB\-\-gstabs\fR" 4 -.IX Item "--gstabs" -Generate stabs debugging information for each assembler line. This -may help debugging assembler code, if the debugger can handle it. -.IP "\fB\-\-gstabs+\fR" 4 -.IX Item "--gstabs+" -Generate stabs debugging information for each assembler line, with \s-1GNU\s0 -extensions that probably only gdb can handle, and that could make other -debuggers crash or refuse to read your program. This -may help debugging assembler code. Currently the only \s-1GNU\s0 extension is -the location of the current working directory at assembling time. -.IP "\fB\-\-gdwarf\-2\fR" 4 -.IX Item "--gdwarf-2" -Generate \s-1DWARF2\s0 debugging information for each assembler line. This -may help debugging assembler code, if the debugger can handle it. Note\-\-\-this -option is only supported by some targets, not all of them. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a summary of the command line options and exit. -.IP "\fB\-\-target\-help\fR" 4 -.IX Item "--target-help" -Print a summary of all target specific options and exit. -.IP "\fB\-I\fR \fIdir\fR" 4 -.IX Item "-I dir" -Add directory \fIdir\fR to the search list for \f(CW\*(C`.include\*(C'\fR directives. -.IP "\fB\-J\fR" 4 -.IX Item "-J" -Don't warn about signed overflow. -.IP "\fB\-K\fR" 4 -.IX Item "-K" -Issue warnings when difference tables altered for long displacements. -.IP "\fB\-L\fR" 4 -.IX Item "-L" -.PD 0 -.IP "\fB\-\-keep\-locals\fR" 4 -.IX Item "--keep-locals" -.PD -Keep (in the symbol table) local symbols. On traditional a.out systems -these start with \fBL\fR, but different systems have different local -label prefixes. -.IP "\fB\-\-listing\-lhs\-width=\fR\fInumber\fR" 4 -.IX Item "--listing-lhs-width=number" -Set the maximum width, in words, of the output data column for an assembler -listing to \fInumber\fR. -.IP "\fB\-\-listing\-lhs\-width2=\fR\fInumber\fR" 4 -.IX Item "--listing-lhs-width2=number" -Set the maximum width, in words, of the output data column for continuation -lines in an assembler listing to \fInumber\fR. -.IP "\fB\-\-listing\-rhs\-width=\fR\fInumber\fR" 4 -.IX Item "--listing-rhs-width=number" -Set the maximum width of an input source line, as displayed in a listing, to -\&\fInumber\fR bytes. -.IP "\fB\-\-listing\-cont\-lines=\fR\fInumber\fR" 4 -.IX Item "--listing-cont-lines=number" -Set the maximum number of lines printed in a listing for a single line of input -to \fInumber\fR + 1. -.IP "\fB\-o\fR \fIobjfile\fR" 4 -.IX Item "-o objfile" -Name the object-file output from \fBas\fR \fIobjfile\fR. -.IP "\fB\-R\fR" 4 -.IX Item "-R" -Fold the data section into the text section. -.Sp -Set the default size of \s-1GAS\s0's hash tables to a prime number close to -\&\fInumber\fR. Increasing this value can reduce the length of time it takes the -assembler to perform its tasks, at the expense of increasing the assembler's -memory requirements. Similarly reducing this value can reduce the memory -requirements at the expense of speed. -.IP "\fB\-\-reduce\-memory\-overheads\fR" 4 -.IX Item "--reduce-memory-overheads" -This option reduces \s-1GAS\s0's memory requirements, at the expense of making the -assembly processes slower. Currently this switch is a synonym for -\&\fB\-\-hash\-size=4051\fR, but in the future it may have other effects as well. -.IP "\fB\-\-statistics\fR" 4 -.IX Item "--statistics" -Print the maximum space (in bytes) and total time (in seconds) used by -assembly. -.IP "\fB\-\-strip\-local\-absolute\fR" 4 -.IX Item "--strip-local-absolute" -Remove local absolute symbols from the outgoing symbol table. -.IP "\fB\-v\fR" 4 -.IX Item "-v" -.PD 0 -.IP "\fB\-version\fR" 4 -.IX Item "-version" -.PD -Print the \fBas\fR version. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Print the \fBas\fR version and exit. -.IP "\fB\-W\fR" 4 -.IX Item "-W" -.PD 0 -.IP "\fB\-\-no\-warn\fR" 4 -.IX Item "--no-warn" -.PD -Suppress warning messages. -.IP "\fB\-\-fatal\-warnings\fR" 4 -.IX Item "--fatal-warnings" -Treat warnings as errors. -.IP "\fB\-\-warn\fR" 4 -.IX Item "--warn" -Don't suppress warning messages or treat them as errors. -.IP "\fB\-w\fR" 4 -.IX Item "-w" -Ignored. -.IP "\fB\-x\fR" 4 -.IX Item "-x" -Ignored. -.IP "\fB\-Z\fR" 4 -.IX Item "-Z" -Generate an object file even after errors. -.IP "\fB\-\- |\fR \fIfiles\fR \fB...\fR" 4 -.IX Item "-- | files ..." -Standard input, or source files to assemble. -.PP -The following options are available when as is configured for -an \s-1ARC\s0 processor. -.IP "\fB\-marc[5|6|7|8]\fR" 4 -.IX Item "-marc[5|6|7|8]" -This option selects the core processor variant. -.IP "\fB\-EB | \-EL\fR" 4 -.IX Item "-EB | -EL" -Select either big-endian (\-EB) or little-endian (\-EL) output. -.PP -The following options are available when as is configured for the \s-1ARM\s0 -processor family. -.IP "\fB\-mcpu=\fR\fIprocessor\fR\fB[+\fR\fIextension\fR\fB...]\fR" 4 -.IX Item "-mcpu=processor[+extension...]" -Specify which \s-1ARM\s0 processor variant is the target. -.IP "\fB\-march=\fR\fIarchitecture\fR\fB[+\fR\fIextension\fR\fB...]\fR" 4 -.IX Item "-march=architecture[+extension...]" -Specify which \s-1ARM\s0 architecture variant is used by the target. -.IP "\fB\-mfpu=\fR\fIfloating-point-format\fR" 4 -.IX Item "-mfpu=floating-point-format" -Select which Floating Point architecture is the target. -.IP "\fB\-mfloat\-abi=\fR\fIabi\fR" 4 -.IX Item "-mfloat-abi=abi" -Select which floating point \s-1ABI\s0 is in use. -.IP "\fB\-mthumb\fR" 4 -.IX Item "-mthumb" -Enable Thumb only instruction decoding. -.IP "\fB\-mapcs\-32 | \-mapcs\-26 | \-mapcs\-float | \-mapcs\-reentrant\fR" 4 -.IX Item "-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant" -Select which procedure calling convention is in use. -.IP "\fB\-EB | \-EL\fR" 4 -.IX Item "-EB | -EL" -Select either big-endian (\-EB) or little-endian (\-EL) output. -.IP "\fB\-mthumb\-interwork\fR" 4 -.IX Item "-mthumb-interwork" -Specify that the code has been generated with interworking between Thumb and -\&\s-1ARM\s0 code in mind. -.IP "\fB\-k\fR" 4 -.IX Item "-k" -Specify that \s-1PIC\s0 code has been generated. -.PP -See the info pages for documentation of the CRIS-specific options. -.PP -The following options are available when as is configured for -a D10V processor. -.IP "\fB\-O\fR" 4 -.IX Item "-O" -Optimize output by parallelizing instructions. -.PP -The following options are available when as is configured for a D30V -processor. -.IP "\fB\-O\fR" 4 -.IX Item "-O" -Optimize output by parallelizing instructions. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -Warn when nops are generated. -.IP "\fB\-N\fR" 4 -.IX Item "-N" -Warn when a nop after a 32\-bit multiply instruction is generated. -.PP -The following options are available when as is configured for the -Intel 80960 processor. -.IP "\fB\-ACA | \-ACA_A | \-ACB | \-ACC | \-AKA | \-AKB | \-AKC | \-AMC\fR" 4 -.IX Item "-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC" -Specify which variant of the 960 architecture is the target. -.IP "\fB\-b\fR" 4 -.IX Item "-b" -Add code to collect statistics about branches taken. -.IP "\fB\-no\-relax\fR" 4 -.IX Item "-no-relax" -Do not alter compare-and-branch instructions for long displacements; -error if necessary. -.PP -The following options are available when as is configured for the -Ubicom \s-1IP2K\s0 series. -.IP "\fB\-mip2022ext\fR" 4 -.IX Item "-mip2022ext" -Specifies that the extended \s-1IP2022\s0 instructions are allowed. -.IP "\fB\-mip2022\fR" 4 -.IX Item "-mip2022" -Restores the default behaviour, which restricts the permitted instructions to -just the basic \s-1IP2022\s0 ones. -.PP -The following options are available when as is configured for the -Renesas M32C and M16C processors. -.IP "\fB\-m32c\fR" 4 -.IX Item "-m32c" -Assemble M32C instructions. -.IP "\fB\-m16c\fR" 4 -.IX Item "-m16c" -Assemble M16C instructions (the default). -.PP -The following options are available when as is configured for the -Renesas M32R (formerly Mitsubishi M32R) series. -.IP "\fB\-\-m32rx\fR" 4 -.IX Item "--m32rx" -Specify which processor in the M32R family is the target. The default -is normally the M32R, but this option changes it to the M32RX. -.IP "\fB\-\-warn\-explicit\-parallel\-conflicts or \-\-Wp\fR" 4 -.IX Item "--warn-explicit-parallel-conflicts or --Wp" -Produce warning messages when questionable parallel constructs are -encountered. -.IP "\fB\-\-no\-warn\-explicit\-parallel\-conflicts or \-\-Wnp\fR" 4 -.IX Item "--no-warn-explicit-parallel-conflicts or --Wnp" -Do not produce warning messages when questionable parallel constructs are -encountered. -.PP -The following options are available when as is configured for the -Motorola 68000 series. -.IP "\fB\-l\fR" 4 -.IX Item "-l" -Shorten references to undefined symbols, to one word instead of two. -.IP "\fB\-m68000 | \-m68008 | \-m68010 | \-m68020 | \-m68030\fR" 4 -.IX Item "-m68000 | -m68008 | -m68010 | -m68020 | -m68030" -.PD 0 -.IP "\fB| \-m68040 | \-m68060 | \-m68302 | \-m68331 | \-m68332\fR" 4 -.IX Item "| -m68040 | -m68060 | -m68302 | -m68331 | -m68332" -.IP "\fB| \-m68333 | \-m68340 | \-mcpu32 | \-m5200\fR" 4 -.IX Item "| -m68333 | -m68340 | -mcpu32 | -m5200" -.PD -Specify what processor in the 68000 family is the target. The default -is normally the 68020, but this can be changed at configuration time. -.IP "\fB\-m68881 | \-m68882 | \-mno\-68881 | \-mno\-68882\fR" 4 -.IX Item "-m68881 | -m68882 | -mno-68881 | -mno-68882" -The target machine does (or does not) have a floating-point coprocessor. -The default is to assume a coprocessor for 68020, 68030, and cpu32. Although -the basic 68000 is not compatible with the 68881, a combination of the -two can be specified, since it's possible to do emulation of the -coprocessor instructions with the main processor. -.IP "\fB\-m68851 | \-mno\-68851\fR" 4 -.IX Item "-m68851 | -mno-68851" -The target machine does (or does not) have a memory-management -unit coprocessor. The default is to assume an \s-1MMU\s0 for 68020 and up. -.PP -For details about the \s-1PDP\-11\s0 machine dependent features options, -see \fBPDP\-11\-Options\fR. -.IP "\fB\-mpic | \-mno\-pic\fR" 4 -.IX Item "-mpic | -mno-pic" -Generate position-independent (or position\-dependent) code. The -default is \fB\-mpic\fR. -.IP "\fB\-mall\fR" 4 -.IX Item "-mall" -.PD 0 -.IP "\fB\-mall\-extensions\fR" 4 -.IX Item "-mall-extensions" -.PD -Enable all instruction set extensions. This is the default. -.IP "\fB\-mno\-extensions\fR" 4 -.IX Item "-mno-extensions" -Disable all instruction set extensions. -.IP "\fB\-m\fR\fIextension\fR \fB| \-mno\-\fR\fIextension\fR" 4 -.IX Item "-mextension | -mno-extension" -Enable (or disable) a particular instruction set extension. -.IP "\fB\-m\fR\fIcpu\fR" 4 -.IX Item "-mcpu" -Enable the instruction set extensions supported by a particular \s-1CPU\s0, and -disable all other extensions. -.IP "\fB\-m\fR\fImachine\fR" 4 -.IX Item "-mmachine" -Enable the instruction set extensions supported by a particular machine -model, and disable all other extensions. -.PP -The following options are available when as is configured for -a picoJava processor. -.IP "\fB\-mb\fR" 4 -.IX Item "-mb" -Generate \*(L"big endian\*(R" format output. -.IP "\fB\-ml\fR" 4 -.IX Item "-ml" -Generate \*(L"little endian\*(R" format output. -.PP -The following options are available when as is configured for the -Motorola 68HC11 or 68HC12 series. -.IP "\fB\-m68hc11 | \-m68hc12 | \-m68hcs12\fR" 4 -.IX Item "-m68hc11 | -m68hc12 | -m68hcs12" -Specify what processor is the target. The default is -defined by the configuration option when building the assembler. -.IP "\fB\-mshort\fR" 4 -.IX Item "-mshort" -Specify to use the 16\-bit integer \s-1ABI\s0. -.IP "\fB\-mlong\fR" 4 -.IX Item "-mlong" -Specify to use the 32\-bit integer \s-1ABI\s0. -.IP "\fB\-mshort\-double\fR" 4 -.IX Item "-mshort-double" -Specify to use the 32\-bit double \s-1ABI\s0. -.IP "\fB\-mlong\-double\fR" 4 -.IX Item "-mlong-double" -Specify to use the 64\-bit double \s-1ABI\s0. -.IP "\fB\-\-force\-long\-branchs\fR" 4 -.IX Item "--force-long-branchs" -Relative branches are turned into absolute ones. This concerns -conditional branches, unconditional branches and branches to a -sub routine. -.IP "\fB\-S | \-\-short\-branchs\fR" 4 -.IX Item "-S | --short-branchs" -Do not turn relative branchs into absolute ones -when the offset is out of range. -.IP "\fB\-\-strict\-direct\-mode\fR" 4 -.IX Item "--strict-direct-mode" -Do not turn the direct addressing mode into extended addressing mode -when the instruction does not support direct addressing mode. -.IP "\fB\-\-print\-insn\-syntax\fR" 4 -.IX Item "--print-insn-syntax" -Print the syntax of instruction in case of error. -.IP "\fB\-\-print\-opcodes\fR" 4 -.IX Item "--print-opcodes" -print the list of instructions with syntax and then exit. -.IP "\fB\-\-generate\-example\fR" 4 -.IX Item "--generate-example" -print an example of instruction for each possible instruction and then exit. -This option is only useful for testing \fBas\fR. -.PP -The following options are available when \fBas\fR is configured -for the \s-1SPARC\s0 architecture: -.IP "\fB\-Av6 | \-Av7 | \-Av8 | \-Asparclet | \-Asparclite\fR" 4 -.IX Item "-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite" -.PD 0 -.IP "\fB\-Av8plus | \-Av8plusa | \-Av9 | \-Av9a\fR" 4 -.IX Item "-Av8plus | -Av8plusa | -Av9 | -Av9a" -.PD -Explicitly select a variant of the \s-1SPARC\s0 architecture. -.Sp -\&\fB\-Av8plus\fR and \fB\-Av8plusa\fR select a 32 bit environment. -\&\fB\-Av9\fR and \fB\-Av9a\fR select a 64 bit environment. -.Sp -\&\fB\-Av8plusa\fR and \fB\-Av9a\fR enable the \s-1SPARC\s0 V9 instruction set with -UltraSPARC extensions. -.IP "\fB\-xarch=v8plus | \-xarch=v8plusa\fR" 4 -.IX Item "-xarch=v8plus | -xarch=v8plusa" -For compatibility with the Solaris v9 assembler. These options are -equivalent to \-Av8plus and \-Av8plusa, respectively. -.IP "\fB\-bump\fR" 4 -.IX Item "-bump" -Warn when the assembler switches to another architecture. -.PP -The following options are available when as is configured for the 'c54x -architecture. -.IP "\fB\-mfar\-mode\fR" 4 -.IX Item "-mfar-mode" -Enable extended addressing mode. All addresses and relocations will assume -extended addressing (usually 23 bits). -.IP "\fB\-mcpu=\fR\fI\s-1CPU_VERSION\s0\fR" 4 -.IX Item "-mcpu=CPU_VERSION" -Sets the \s-1CPU\s0 version being compiled for. -.IP "\fB\-merrors\-to\-file\fR \fI\s-1FILENAME\s0\fR" 4 -.IX Item "-merrors-to-file FILENAME" -Redirect error output to a file, for broken systems which don't support such -behaviour in the shell. -.PP -The following options are available when as is configured for -a \s-1MIPS\s0 processor. -.IP "\fB\-G\fR \fInum\fR" 4 -.IX Item "-G num" -This option sets the largest size of an object that can be referenced -implicitly with the \f(CW\*(C`gp\*(C'\fR register. It is only accepted for targets that -use \s-1ECOFF\s0 format, such as a DECstation running Ultrix. The default value is 8. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -Generate \*(L"big endian\*(R" format output. -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -Generate \*(L"little endian\*(R" format output. -.IP "\fB\-mips1\fR" 4 -.IX Item "-mips1" -.PD 0 -.IP "\fB\-mips2\fR" 4 -.IX Item "-mips2" -.IP "\fB\-mips3\fR" 4 -.IX Item "-mips3" -.IP "\fB\-mips4\fR" 4 -.IX Item "-mips4" -.IP "\fB\-mips5\fR" 4 -.IX Item "-mips5" -.IP "\fB\-mips32\fR" 4 -.IX Item "-mips32" -.IP "\fB\-mips32r2\fR" 4 -.IX Item "-mips32r2" -.IP "\fB\-mips64\fR" 4 -.IX Item "-mips64" -.IP "\fB\-mips64r2\fR" 4 -.IX Item "-mips64r2" -.PD -Generate code for a particular \s-1MIPS\s0 Instruction Set Architecture level. -\&\fB\-mips1\fR is an alias for \fB\-march=r3000\fR, \fB\-mips2\fR is an -alias for \fB\-march=r6000\fR, \fB\-mips3\fR is an alias for -\&\fB\-march=r4000\fR and \fB\-mips4\fR is an alias for \fB\-march=r8000\fR. -\&\fB\-mips5\fR, \fB\-mips32\fR, \fB\-mips32r2\fR, \fB\-mips64\fR, and -\&\fB\-mips64r2\fR -correspond to generic -\&\fB\s-1MIPS\s0 V\fR, \fB\s-1MIPS32\s0\fR, \fB\s-1MIPS32\s0 Release 2\fR, \fB\s-1MIPS64\s0\fR, -and \fB\s-1MIPS64\s0 Release 2\fR -\&\s-1ISA\s0 processors, respectively. -.IP "\fB\-march=\fR\fI\s-1CPU\s0\fR" 4 -.IX Item "-march=CPU" -Generate code for a particular \s-1MIPS\s0 cpu. -.IP "\fB\-mtune=\fR\fIcpu\fR" 4 -.IX Item "-mtune=cpu" -Schedule and tune for a particular \s-1MIPS\s0 cpu. -.IP "\fB\-mfix7000\fR" 4 -.IX Item "-mfix7000" -.PD 0 -.IP "\fB\-mno\-fix7000\fR" 4 -.IX Item "-mno-fix7000" -.PD -Cause nops to be inserted if the read of the destination register -of an mfhi or mflo instruction occurs in the following two instructions. -.IP "\fB\-mdebug\fR" 4 -.IX Item "-mdebug" -.PD 0 -.IP "\fB\-no\-mdebug\fR" 4 -.IX Item "-no-mdebug" -.PD -Cause stabs-style debugging output to go into an ECOFF-style .mdebug -section instead of the standard \s-1ELF\s0 .stabs sections. -.IP "\fB\-mpdr\fR" 4 -.IX Item "-mpdr" -.PD 0 -.IP "\fB\-mno\-pdr\fR" 4 -.IX Item "-mno-pdr" -.PD -Control generation of \f(CW\*(C`.pdr\*(C'\fR sections. -.IP "\fB\-mgp32\fR" 4 -.IX Item "-mgp32" -.PD 0 -.IP "\fB\-mfp32\fR" 4 -.IX Item "-mfp32" -.PD -The register sizes are normally inferred from the \s-1ISA\s0 and \s-1ABI\s0, but these -flags force a certain group of registers to be treated as 32 bits wide at -all times. \fB\-mgp32\fR controls the size of general-purpose registers -and \fB\-mfp32\fR controls the size of floating-point registers. -.IP "\fB\-mips16\fR" 4 -.IX Item "-mips16" -.PD 0 -.IP "\fB\-no\-mips16\fR" 4 -.IX Item "-no-mips16" -.PD -Generate code for the \s-1MIPS\s0 16 processor. This is equivalent to putting -\&\f(CW\*(C`.set mips16\*(C'\fR at the start of the assembly file. \fB\-no\-mips16\fR -turns off this option. -.IP "\fB\-mips3d\fR" 4 -.IX Item "-mips3d" -.PD 0 -.IP "\fB\-no\-mips3d\fR" 4 -.IX Item "-no-mips3d" -.PD -Generate code for the \s-1MIPS\-3D\s0 Application Specific Extension. -This tells the assembler to accept \s-1MIPS\-3D\s0 instructions. -\&\fB\-no\-mips3d\fR turns off this option. -.IP "\fB\-mdmx\fR" 4 -.IX Item "-mdmx" -.PD 0 -.IP "\fB\-no\-mdmx\fR" 4 -.IX Item "-no-mdmx" -.PD -Generate code for the \s-1MDMX\s0 Application Specific Extension. -This tells the assembler to accept \s-1MDMX\s0 instructions. -\&\fB\-no\-mdmx\fR turns off this option. -.IP "\fB\-mdsp\fR" 4 -.IX Item "-mdsp" -.PD 0 -.IP "\fB\-mno\-dsp\fR" 4 -.IX Item "-mno-dsp" -.PD -Generate code for the \s-1DSP\s0 Application Specific Extension. -This tells the assembler to accept \s-1DSP\s0 instructions. -\&\fB\-mno\-dsp\fR turns off this option. -.IP "\fB\-mmt\fR" 4 -.IX Item "-mmt" -.PD 0 -.IP "\fB\-mno\-mt\fR" 4 -.IX Item "-mno-mt" -.PD -Generate code for the \s-1MT\s0 Application Specific Extension. -This tells the assembler to accept \s-1MT\s0 instructions. -\&\fB\-mno\-mt\fR turns off this option. -.IP "\fB\-\-construct\-floats\fR" 4 -.IX Item "--construct-floats" -.PD 0 -.IP "\fB\-\-no\-construct\-floats\fR" 4 -.IX Item "--no-construct-floats" -.PD -The \fB\-\-no\-construct\-floats\fR option disables the construction of -double width floating point constants by loading the two halves of the -value into the two single width floating point registers that make up -the double width register. By default \fB\-\-construct\-floats\fR is -selected, allowing construction of these floating point constants. -.IP "\fB\-\-emulation=\fR\fIname\fR" 4 -.IX Item "--emulation=name" -This option causes \fBas\fR to emulate \fBas\fR configured -for some other target, in all respects, including output format (choosing -between \s-1ELF\s0 and \s-1ECOFF\s0 only), handling of pseudo-opcodes which may generate -debugging information or store symbol table information, and default -endianness. The available configuration names are: \fBmipsecoff\fR, -\&\fBmipself\fR, \fBmipslecoff\fR, \fBmipsbecoff\fR, \fBmipslelf\fR, -\&\fBmipsbelf\fR. The first two do not alter the default endianness from that -of the primary target for which the assembler was configured; the others change -the default to little\- or big-endian as indicated by the \fBb\fR or \fBl\fR -in the name. Using \fB\-EB\fR or \fB\-EL\fR will override the endianness -selection in any case. -.Sp -This option is currently supported only when the primary target -\&\fBas\fR is configured for is a \s-1MIPS\s0 \s-1ELF\s0 or \s-1ECOFF\s0 target. -Furthermore, the primary target or others specified with -\&\fB\-\-enable\-targets=...\fR at configuration time must include support for -the other format, if both are to be available. For example, the Irix 5 -configuration includes support for both. -.Sp -Eventually, this option will support more configurations, with more -fine-grained control over the assembler's behavior, and will be supported for -more processors. -.IP "\fB\-nocpp\fR" 4 -.IX Item "-nocpp" -\&\fBas\fR ignores this option. It is accepted for compatibility with -the native tools. -.IP "\fB\-\-trap\fR" 4 -.IX Item "--trap" -.PD 0 -.IP "\fB\-\-no\-trap\fR" 4 -.IX Item "--no-trap" -.IP "\fB\-\-break\fR" 4 -.IX Item "--break" -.IP "\fB\-\-no\-break\fR" 4 -.IX Item "--no-break" -.PD -Control how to deal with multiplication overflow and division by zero. -\&\fB\-\-trap\fR or \fB\-\-no\-break\fR (which are synonyms) take a trap exception -(and only work for Instruction Set Architecture level 2 and higher); -\&\fB\-\-break\fR or \fB\-\-no\-trap\fR (also synonyms, and the default) take a -break exception. -.IP "\fB\-n\fR" 4 -.IX Item "-n" -When this option is used, \fBas\fR will issue a warning every -time it generates a nop instruction from a macro. -.PP -The following options are available when as is configured for -an MCore processor. -.IP "\fB\-jsri2bsr\fR" 4 -.IX Item "-jsri2bsr" -.PD 0 -.IP "\fB\-nojsri2bsr\fR" 4 -.IX Item "-nojsri2bsr" -.PD -Enable or disable the \s-1JSRI\s0 to \s-1BSR\s0 transformation. By default this is enabled. -The command line option \fB\-nojsri2bsr\fR can be used to disable it. -.IP "\fB\-sifilter\fR" 4 -.IX Item "-sifilter" -.PD 0 -.IP "\fB\-nosifilter\fR" 4 -.IX Item "-nosifilter" -.PD -Enable or disable the silicon filter behaviour. By default this is disabled. -The default can be overridden by the \fB\-sifilter\fR command line option. -.IP "\fB\-relax\fR" 4 -.IX Item "-relax" -Alter jump instructions for long displacements. -.IP "\fB\-mcpu=[210|340]\fR" 4 -.IX Item "-mcpu=[210|340]" -Select the cpu type on the target hardware. This controls which instructions -can be assembled. -.IP "\fB\-EB\fR" 4 -.IX Item "-EB" -Assemble for a big endian target. -.IP "\fB\-EL\fR" 4 -.IX Item "-EL" -Assemble for a little endian target. -.PP -See the info pages for documentation of the MMIX-specific options. -.PP -The following options are available when as is configured for -an Xtensa processor. -.IP "\fB\-\-text\-section\-literals | \-\-no\-text\-section\-literals\fR" 4 -.IX Item "--text-section-literals | --no-text-section-literals" -With \fB\-\-text\-section\-literals\fR, literal pools are interspersed -in the text section. The default is -\&\fB\-\-no\-text\-section\-literals\fR, which places literals in a -separate section in the output file. These options only affect literals -referenced via PC-relative \f(CW\*(C`L32R\*(C'\fR instructions; literals for -absolute mode \f(CW\*(C`L32R\*(C'\fR instructions are handled separately. -.IP "\fB\-\-absolute\-literals | \-\-no\-absolute\-literals\fR" 4 -.IX Item "--absolute-literals | --no-absolute-literals" -Indicate to the assembler whether \f(CW\*(C`L32R\*(C'\fR instructions use absolute -or PC-relative addressing. The default is to assume absolute addressing -if the Xtensa processor includes the absolute \f(CW\*(C`L32R\*(C'\fR addressing -option. Otherwise, only the PC-relative \f(CW\*(C`L32R\*(C'\fR mode can be used. -.IP "\fB\-\-target\-align | \-\-no\-target\-align\fR" 4 -.IX Item "--target-align | --no-target-align" -Enable or disable automatic alignment to reduce branch penalties at the -expense of some code density. The default is \fB\-\-target\-align\fR. -.IP "\fB\-\-longcalls | \-\-no\-longcalls\fR" 4 -.IX Item "--longcalls | --no-longcalls" -Enable or disable transformation of call instructions to allow calls -across a greater range of addresses. The default is -\&\fB\-\-no\-longcalls\fR. -.IP "\fB\-\-transform | \-\-no\-transform\fR" 4 -.IX Item "--transform | --no-transform" -Enable or disable all assembler transformations of Xtensa instructions. -The default is \fB\-\-transform\fR; -\&\fB\-\-no\-transform\fR should be used only in the rare cases when the -instructions must be exactly as specified in the assembly source. -.PP -The following options are available when as is configured for -a Z80 family processor. -.IP "\fB\-z80\fR" 4 -.IX Item "-z80" -Assemble for Z80 processor. -.IP "\fB\-r800\fR" 4 -.IX Item "-r800" -Assemble for R800 processor. -.IP "\fB\-ignore\-undocumented\-instructions\fR" 4 -.IX Item "-ignore-undocumented-instructions" -.PD 0 -.IP "\fB\-Wnud\fR" 4 -.IX Item "-Wnud" -.PD -Assemble undocumented Z80 instructions that also work on R800 without warning. -.IP "\fB\-ignore\-unportable\-instructions\fR" 4 -.IX Item "-ignore-unportable-instructions" -.PD 0 -.IP "\fB\-Wnup\fR" 4 -.IX Item "-Wnup" -.PD -Assemble all undocumented Z80 instructions without warning. -.IP "\fB\-warn\-undocumented\-instructions\fR" 4 -.IX Item "-warn-undocumented-instructions" -.PD 0 -.IP "\fB\-Wud\fR" 4 -.IX Item "-Wud" -.PD -Issue a warning for undocumented Z80 instructions that also work on R800. -.IP "\fB\-warn\-unportable\-instructions\fR" 4 -.IX Item "-warn-unportable-instructions" -.PD 0 -.IP "\fB\-Wup\fR" 4 -.IX Item "-Wup" -.PD -Issue a warning for undocumented Z80 instructions that do notwork on R800. -.IP "\fB\-forbid\-undocumented\-instructions\fR" 4 -.IX Item "-forbid-undocumented-instructions" -.PD 0 -.IP "\fB\-Fud\fR" 4 -.IX Item "-Fud" -.PD -Treat all undocumented instructions as errors. -.IP "\fB\-forbid\-unportable\-instructions\fR" 4 -.IX Item "-forbid-unportable-instructions" -.PD 0 -.IP "\fB\-Fup\fR" 4 -.IX Item "-Fup" -.PD -Treat undocumented Z80 intructions that do notwork on R800 as errors. -.SH "SEE ALSO" -.IX Header "SEE ALSO" -\&\fIgcc\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIbinutils\fR and \fIld\fR. -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 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/contrib/binutils/gas/doc/as.texinfo b/contrib/binutils/gas/doc/as.texinfo index 6daaed028c7..b6f7f321717 100644 --- a/contrib/binutils/gas/doc/as.texinfo +++ b/contrib/binutils/gas/doc/as.texinfo @@ -1,6 +1,6 @@ \input texinfo @c -*-Texinfo-*- @c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -@c 2001, 2002, 2003, 2004, 2005 +@c 2001, 2002, 2003, 2004, 2005, 2006, 2007 @c Free Software Foundation, Inc. @c UPDATE!! On future updates-- @c (1) check for new machine-dep cmdline options in @@ -22,7 +22,7 @@ @c man begin NAME @c --- @include asconfig.texi -@include gasver.texi +@include bfdver.texi @c --- @c man end @c --- @@ -96,11 +96,12 @@ END-INFO-DIR-ENTRY @finalout @syncodeindex ky cp -@ifinfo +@copying This file documents the GNU Assembler "@value{AS}". @c man begin COPYRIGHT -Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, +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 @@ -110,15 +111,7 @@ 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 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 @titlepage @title Using @value{AS} @@ -126,11 +119,15 @@ notice identical to this one except for the removal of this paragraph @ifclear GENERIC @subtitle for the @value{TARGET} family @end ifclear +@ifset VERSION_PACKAGE +@sp 1 +@subtitle @value{VERSION_PACKAGE} +@end ifset @sp 1 @subtitle Version @value{VERSION} @sp 1 @sp 13 -The Free Software Foundation Inc. thanks The Nice Computer +The Free Software Foundation Inc.@: thanks The Nice Computer Company of Australia for loaning Dean Elsner to write the first (Vax) version of @command{as} for Project @sc{gnu}. The proprietors, management and staff of TNCCA thank FSF for @@ -153,7 +150,8 @@ done. @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, +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 @@ -163,13 +161,17 @@ Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Fr section entitled ``GNU Free Documentation License''. @end titlepage +@contents @ifnottex @node Top @top Using @value{AS} -This file is a user guide to the @sc{gnu} assembler @command{@value{AS}} version -@value{VERSION}. +This file is a user guide to the @sc{gnu} assembler @command{@value{AS}} +@ifset VERSION_PACKAGE +@value{VERSION_PACKAGE} +@end ifset +version @value{VERSION}. @ifclear GENERIC This version of the file describes @command{@value{AS}} configured to generate code for @value{TARGET} architectures. @@ -191,7 +193,7 @@ section entitled ``GNU Free Documentation License''. * Reporting Bugs:: Reporting Bugs * Acknowledgements:: Who Did What * GNU Free Documentation License:: GNU Free Documentation License -* Index:: Index +* AS Index:: AS Index @end menu @end ifnottex @@ -209,7 +211,7 @@ code for @value{TARGET} architectures. @cindex option summary @cindex summary of options Here is a brief summary of how to invoke @command{@value{AS}}. For details, -@pxref{Invoking,,Command-Line Options}. +see @ref{Invoking,,Command-Line Options}. @c man title AS the portable GNU assembler. @@ -296,6 +298,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @emph{Target i386 options:} [@b{--32}|@b{--64}] [@b{-n}] + [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] @end ifset @ifset I960 @@ -343,7 +346,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}] [@b{-mshort}|@b{-mlong}] [@b{-mshort-double}|@b{-mlong-double}] - [@b{--force-long-branchs}] [@b{--short-branchs}] + [@b{--force-long-branches}] [@b{--short-branches}] [@b{--strict-direct-mode}] [@b{--print-insn-syntax}] [@b{--print-opcodes}] [@b{--generate-example}] @end ifset @@ -358,7 +361,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @emph{Target MIPS options:} [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-O}[@var{optimization level}]] [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}] - [@b{-non_shared}] [@b{-xgot}] + [@b{-non_shared}] [@b{-xgot} [@b{-mvxworks-pic}] [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}] [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}] [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}] @@ -367,9 +370,11 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}] [@b{-mfix7000}] [@b{-mno-fix7000}] [@b{-mips16}] [@b{-no-mips16}] + [@b{-msmartmips}] [@b{-mno-smartmips}] [@b{-mips3d}] [@b{-no-mips3d}] [@b{-mdmx}] [@b{-no-mdmx}] [@b{-mdsp}] [@b{-mno-dsp}] + [@b{-mdspr2}] [@b{-mno-dspr2}] [@b{-mmt}] [@b{-mno-mt}] [@b{-mdebug}] [@b{-no-mdebug}] [@b{-mpdr}] [@b{-mno-pdr}] @@ -487,7 +492,10 @@ listing without forms processing. The @samp{=file} option, if used, must be the last one. By itself, @samp{-a} defaults to @samp{-ahls}. @item --alternate -Begin in alternate macro mode, see @ref{Altmacro,,@code{.altmacro}}. +Begin in alternate macro mode. +@ifclear man +@xref{Altmacro,,@code{.altmacro}}. +@end ifclear @item -D Ignored. This option is accepted for script compatibility with calls to @@ -496,7 +504,9 @@ other assemblers. @item --defsym @var{sym}=@var{value} Define the symbol @var{sym} to be @var{value} before assembling the input file. @var{value} must be an integer constant. As in C, a leading @samp{0x} -indicates a hexadecimal value, and a leading @samp{0} indicates an octal value. +indicates a hexadecimal value, and a leading @samp{0} indicates an octal +value. The value of the symbol can be overridden inside a source file via the +use of a @code{.set} pseudo-op. @item -f ``fast''---skip whitespace and comment preprocessing (assume source is @@ -546,9 +556,12 @@ Issue warnings when difference tables altered for long displacements. @item -L @itemx --keep-locals -Keep (in the symbol table) local symbols. On traditional a.out systems -these start with @samp{L}, but different systems have different local -label prefixes. +Keep (in the symbol table) local symbols. These symbols start with +system-specific local label prefixes, typically @samp{.L} for ELF systems +or @samp{L} for traditional a.out systems. +@ifclear man +@xref{Symbol Names}. +@end ifclear @item --listing-lhs-width=@var{number} Set the maximum width, in words, of the output data column for an assembler @@ -866,13 +879,13 @@ Specify to use the 32-bit double ABI. @item -mlong-double Specify to use the 64-bit double ABI. -@item --force-long-branchs +@item --force-long-branches Relative branches are turned into absolute ones. This concerns conditional branches, unconditional branches and branches to a sub routine. -@item -S | --short-branchs -Do not turn relative branchs into absolute ones +@item -S | --short-branches +Do not turn relative branches into absolute ones when the offset is out of range. @item --strict-direct-mode @@ -1006,6 +1019,12 @@ Generate code for the MIPS 16 processor. This is equivalent to putting @code{.set mips16} at the start of the assembly file. @samp{-no-mips16} turns off this option. +@item -msmartmips +@itemx -mno-smartmips +Enables the SmartMIPS extension to the MIPS32 instruction set. This is +equivalent to putting @code{.set smartmips} at the start of the assembly file. +@samp{-mno-smartmips} turns off this option. + @item -mips3d @itemx -no-mips3d Generate code for the MIPS-3D Application Specific Extension. @@ -1020,10 +1039,17 @@ This tells the assembler to accept MDMX instructions. @item -mdsp @itemx -mno-dsp -Generate code for the DSP Application Specific Extension. -This tells the assembler to accept DSP instructions. +Generate code for the DSP Release 1 Application Specific Extension. +This tells the assembler to accept DSP Release 1 instructions. @samp{-mno-dsp} turns off this option. +@item -mdspr2 +@itemx -mno-dspr2 +Generate code for the DSP Release 2 Application Specific Extension. +This option implies -mdsp. +This tells the assembler to accept DSP Release 2 instructions. +@samp{-mno-dspr2} turns off this option. + @item -mmt @itemx -mno-mt Generate code for the MT Application Specific Extension. @@ -1173,13 +1199,13 @@ Assemble all undocumented Z80 instructions without warning. Issue a warning for undocumented Z80 instructions that also work on R800. @item -warn-unportable-instructions @itemx -Wup -Issue a warning for undocumented Z80 instructions that do notwork on R800. +Issue a warning for undocumented Z80 instructions that do not work on R800. @item -forbid-undocumented-instructions @itemx -Fud Treat all undocumented instructions as errors. @item -forbid-unportable-instructions @itemx -Fup -Treat undocumented Z80 intructions that do notwork on R800 as errors. +Treat undocumented Z80 instructions that do not work on R800 as errors. @end table @end ifset @@ -1504,7 +1530,8 @@ because many of them aren't supposed to happen. @cindex options, all versions of assembler This chapter describes command-line options available in @emph{all} -versions of the @sc{gnu} assembler; @pxref{Machine Dependencies}, for options specific +versions of the @sc{gnu} assembler; see @ref{Machine Dependencies}, +for options specific @ifclear GENERIC to the @value{TARGET} target. @end ifclear @@ -1549,7 +1576,7 @@ assembler.) * K:: -K for difference tables @end ifset -* L:: -L to retain local labels +* L:: -L to retain local symbols * listing:: --listing-XXX to configure listing output * M:: -M or --mri to assemble in MRI compatibility mode * MD:: --MD for dependency tracking @@ -1604,7 +1631,8 @@ listing-control directives have no effect. The letters after @samp{-a} may be combined into one option, @emph{e.g.}, @samp{-aln}. -Note if the assembler source is coming from the standard input (eg because it +Note if the assembler source is coming from the standard input (e.g., +because it is being created by @code{@value{GCC}} and the @samp{-pipe} command line switch is being used) then the listing will not contain any comments or preprocessor directives. This is because the listing code buffers input source lines from @@ -1674,33 +1702,28 @@ alteration on other platforms. @ifset DIFF-TBL-KLUGE @cindex difference tables, warning @cindex warning for altered difference tables -@command{@value{AS}} sometimes alters the code emitted for directives of the form -@samp{.word @var{sym1}-@var{sym2}}; @pxref{Word,,@code{.word}}. +@command{@value{AS}} sometimes alters the code emitted for directives of the +form @samp{.word @var{sym1}-@var{sym2}}. @xref{Word,,@code{.word}}. You can use the @samp{-K} option if you want a warning issued when this is done. @end ifset @node L -@section Include Local Labels: @option{-L} +@section Include Local Symbols: @option{-L} @kindex -L -@cindex local labels, retaining in output -Labels beginning with @samp{L} (upper case only) are called @dfn{local -labels}. @xref{Symbol Names}. Normally you do not see such labels when -debugging, because they are intended for the use of programs (like -compilers) that compose assembler programs, not for your notice. -Normally both @command{@value{AS}} and @code{@value{LD}} discard such labels, so you do not -normally debug with them. +@cindex local symbols, retaining in output +Symbols beginning with system-specific local label prefixes, typically +@samp{.L} for ELF systems or @samp{L} for traditional a.out systems, are +called @dfn{local symbols}. @xref{Symbol Names}. Normally you do not see +such symbols when debugging, because they are intended for the use of +programs (like compilers) that compose assembler programs, not for your +notice. Normally both @command{@value{AS}} and @code{@value{LD}} discard +such symbols, so you do not normally debug with them. -This option tells @command{@value{AS}} to retain those @samp{L@dots{}} symbols +This option tells @command{@value{AS}} to retain those local symbols in the object file. Usually if you do this you also tell the linker -@code{@value{LD}} to preserve symbols whose names begin with @samp{L}. - -By default, a local label is any label beginning with @samp{L}, but each -target is allowed to redefine the local label prefix. -@ifset HPPA -On the HPPA local labels begin with @samp{L$}. -@end ifset +@code{@value{LD}} to preserve those symbols. @node listing @section Configuring listing output: @option{--listing} @@ -1708,9 +1731,11 @@ On the HPPA local labels begin with @samp{L$}. The listing feature of the assembler can be enabled via the command line switch @samp{-a} (@pxref{a}). This feature combines the input source file(s) with a hex dump of the corresponding locations in the output object file, and displays -them as a listing file. The format of this listing can be controlled by pseudo -ops inside the assembler source (@pxref{List} @pxref{Title} @pxref{Sbttl} -@pxref{Psize} @pxref{Eject}) and also by the following switches: +them as a listing file. The format of this listing can be controlled by +directives inside the assembler source (i.e., @code{.list} (@pxref{List}), +@code{.title} (@pxref{Title}), @code{.sbttl} (@pxref{Sbttl}), +@code{.psize} (@pxref{Psize}), and +@code{.eject} (@pxref{Eject}) and also by the following switches: @table @gcctabopt @item --listing-lhs-width=@samp{number} @@ -2072,7 +2097,7 @@ anything else you may get from your C compiler's preprocessor. You can do include file processing with the @code{.include} directive (@pxref{Include,,@code{.include}}). You can use the @sc{gnu} C compiler driver to get other ``CPP'' style preprocessing by giving the input file a -@samp{.S} suffix. @xref{Overall Options,, Options Controlling the Kind of +@samp{.S} suffix. @xref{Overall Options, ,Options Controlling the Kind of Output, gcc.info, Using GNU CC}. Excess whitespace, comments, and character constants @@ -2209,7 +2234,7 @@ extends to the end of the line. To be compatible with past assemblers, lines that begin with @samp{#} have a special interpretation. Following the @samp{#} should be an absolute expression (@pxref{Expressions}): the logical line number of the @emph{next} -line. Then a string (@pxref{Strings,, Strings}) is allowed: if present it is a +line. Then a string (@pxref{Strings, ,Strings}) is allowed: if present it is a new logical file name. The rest of the line, if any, should be whitespace. If the first non-whitespace characters on the line are not numeric, @@ -2284,8 +2309,8 @@ constants are an exception: they do not end statements. @end ifclear @ifset GENERIC A @dfn{statement} ends at a newline character (@samp{\n}) or line -separator character. (The line separator is usually @samp{;}, unless -this conflicts with the comment character; @pxref{Machine Dependencies}.) The +separator character. (The line separator is usually @samp{;}, unless this +conflicts with the comment character; see @ref{Machine Dependencies}.) The newline or separator character is considered part of the preceding statement. Newlines and separators within character constants are an exception: they do not end statements. @@ -2670,7 +2695,7 @@ independently of any floating point hardware in the computer running @cindex bit fields @cindex constants, bit field You can also define numeric constants as @dfn{bit fields}. -specify two numbers separated by a colon--- +Specify two numbers separated by a colon--- @example @var{mask}:@var{value} @end example @@ -3069,8 +3094,8 @@ You can also use the @code{.subsection} directive (@pxref{SubSection}) to specify a subsection: @samp{.subsection @var{expression}}. @end ifset -@var{Expression} should be an absolute expression. -(@xref{Expressions}.) If you just say @samp{.text} then @samp{.text 0} +@var{Expression} should be an absolute expression +(@pxref{Expressions}). If you just say @samp{.text} then @samp{.text 0} is assumed. Likewise @samp{.data} means @samp{.data 0}. Assembly begins in @code{text 0}. For instance: @smallexample @@ -3109,7 +3134,7 @@ The @code{.lcomm} pseudo-op defines a symbol in the bss section; see @ref{Lcomm,,@code{.lcomm}}. The @code{.comm} pseudo-op may be used to declare a common symbol, which is -another form of uninitialized symbol; see @xref{Comm,,@code{.comm}}. +another form of uninitialized symbol; see @ref{Comm,,@code{.comm}}. @ifset GENERIC When assembling for a target which supports multiple sections, such as ELF or @@ -3180,8 +3205,8 @@ equals sign @samp{=}@samp{=} here represents an equivalent of the Symbol names begin with a letter or with one of @samp{._}. On most machines, you can also use @code{$} in symbol names; exceptions are noted in @ref{Machine Dependencies}. That character may be followed by any -string of digits, letters, dollar signs (unless otherwise noted in -@ref{Machine Dependencies}), and underscores. +string of digits, letters, dollar signs (unless otherwise noted for a +particular target machine), and underscores. @end ifclear @ifset SPECIAL-SYMS @ifset H8 @@ -3203,16 +3228,32 @@ in a program. @cindex local symbol names @cindex symbol names, local +A local symbol is any symbol beginning with certain local label prefixes. +By default, the local label prefix is @samp{.L} for ELF systems or +@samp{L} for traditional a.out systems, but each target may have its own +set of local label prefixes. +@ifset HPPA +On the HPPA local symbols begin with @samp{L$}. +@end ifset + +Local symbols are defined and used within the assembler, but they are +normally not saved in object files. Thus, they are not visible when debugging. +You may use the @samp{-L} option (@pxref{L, ,Include Local Symbols: +@option{-L}}) to retain the local symbols in the object files. + +@subheading Local Labels + +@cindex local labels @cindex temporary symbol names @cindex symbol names, temporary -Local symbols help compilers and programmers use names temporarily. +Local labels help compilers and programmers use names temporarily. They create symbols which are guaranteed to be unique over the entire scope of the input source code and which can be referred to by a simple notation. -To define a local symbol, write a label of the form @samp{@b{N}:} (where @b{N} +To define a local label, write a label of the form @samp{@b{N}:} (where @b{N} represents any positive integer). To refer to the most recent previous -definition of that symbol write @samp{@b{N}b}, using the same number as when +definition of that label write @samp{@b{N}b}, using the same number as when you defined the label. To refer to the next definition of a local label, write -@samp{@b{N}f}--- The @samp{b} stands for``backwards'' and the @samp{f} stands +@samp{@b{N}f}---the @samp{b} stands for ``backwards'' and the @samp{f} stands for ``forwards''. There is no restriction on how you can use these labels, and you can reuse them @@ -3241,16 +3282,17 @@ label_3: branch label_4 label_4: branch label_3 @end smallexample -Local symbol names are only a notational device. They are immediately +Local label names are only a notational device. They are immediately transformed into more conventional symbol names before the assembler uses them. -The symbol names stored in the symbol table, appearing in error messages and -optionally emitted to the object file. The names are constructed using these -parts: +The symbol names are stored in the symbol table, appear in error messages, and +are optionally emitted to the object file. The names are constructed using +these parts: @table @code -@item L -All local labels begin with @samp{L}. Normally both @command{@value{AS}} and -@code{@value{LD}} forget symbols that start with @samp{L}. These labels are +@item @emph{local label prefix} +All local symbols begin with the system-specific local label prefix. +Normally both @command{@value{AS}} and @code{@value{LD}} forget symbols +that start with the local label prefix. These labels are used for symbols you are never intended to see. If you use the @samp{-L} option then @command{@value{AS}} retains these symbols in the object file. If you also instruct @code{@value{LD}} to retain these symbols, @@ -3268,30 +3310,30 @@ of the same name. The character has ASCII value of @samp{\002} (control-B). This is a serial number to keep the labels distinct. The first definition of @samp{0:} gets the number @samp{1}. The 15th definition of @samp{0:} gets the number @samp{15}, and so on. Likewise the first definition of @samp{1:} gets -the number @samp{1} and its 15th defintion gets @samp{15} as well. +the number @samp{1} and its 15th definition gets @samp{15} as well. @end table -So for example, the first @code{1:} is named @code{L1@kbd{C-B}1}, the 44th -@code{3:} is named @code{L3@kbd{C-B}44}. +So for example, the first @code{1:} may be named @code{.L1@kbd{C-B}1}, and +the 44th @code{3:} may be named @code{.L3@kbd{C-B}44}. @subheading Dollar Local Labels @cindex dollar local symbols @code{@value{AS}} also supports an even more local form of local labels called -dollar labels. These labels go out of scope (ie they become undefined) as soon -as a non-local label is defined. Thus they remain valid for only a small +dollar labels. These labels go out of scope (i.e., they become undefined) as +soon as a non-local label is defined. Thus they remain valid for only a small region of the input source code. Normal local labels, by contrast, remain in scope for the entire file, or until they are redefined by another occurrence of the same local label. Dollar labels are defined in exactly the same way as ordinary local labels, except that instead of being terminated by a colon, they are terminated by a -dollar sign. eg @samp{@b{55$}}. +dollar sign, e.g., @samp{@b{55$}}. They can also be distinguished from ordinary local labels by their transformed -name which uses ASCII character @samp{\001} (control-A) as the magic character -to distinguish them from ordinary labels. Thus the 5th defintion of @samp{6$} -is named @samp{L6@kbd{C-A}5}. +names which use ASCII character @samp{\001} (control-A) as the magic character +to distinguish them from ordinary labels. For example, the fifth definition of +@samp{6$} may be named @samp{.L6@kbd{C-A}5}. @node Dot @section The Special Dot Symbol @@ -3722,14 +3764,14 @@ Some machine configurations provide additional directives. @end ifset @ifclear GENERIC @ifset machine-directives -@xref{Machine Dependencies} for additional directives. +@xref{Machine Dependencies}, for additional directives. @end ifset @end ifclear @menu * Abort:: @code{.abort} @ifset COFF -* ABORT:: @code{.ABORT} +* ABORT (COFF):: @code{.ABORT} @end ifset * Align:: @code{.align @var{abs-expr} , @var{abs-expr}} @@ -3740,7 +3782,7 @@ Some machine configurations provide additional directives. * Byte:: @code{.byte @var{expressions}} * Comm:: @code{.comm @var{symbol} , @var{length} } -* CFI directives:: @code{.cfi_startproc}, @code{.cfi_endproc}, etc. +* CFI directives:: @code{.cfi_startproc [simple]}, @code{.cfi_endproc}, etc. * Data:: @code{.data @var{subsection}} @ifset COFF @@ -3818,8 +3860,8 @@ Some machine configurations provide additional directives. * Noaltmacro:: @code{.noaltmacro} * Nolist:: @code{.nolist} * Octa:: @code{.octa @var{bignums}} -* Org:: @code{.org @var{new-lc} , @var{fill}} -* P2align:: @code{.p2align @var{abs-expr} , @var{abs-expr}} +* Org:: @code{.org @var{new-lc}, @var{fill}} +* P2align:: @code{.p2align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}} @ifset ELF * PopSection:: @code{.popsection} * Previous:: @code{.previous} @@ -3837,6 +3879,7 @@ Some machine configurations provide additional directives. @end ifset * Quad:: @code{.quad @var{bignums}} +* Reloc:: @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]} * Rept:: @code{.rept @var{count}} * Sbttl:: @code{.sbttl "@var{subheading}"} @ifset COFF @@ -3907,8 +3950,8 @@ of the source quit, it could use this directive tells @command{@value{AS}} to quit also. One day @code{.abort} will not be supported. @ifset COFF -@node ABORT -@section @code{.ABORT} +@node ABORT (COFF) +@section @code{.ABORT} (COFF) @cindex @code{ABORT} directive When producing COFF output, @command{@value{AS}} accepts this directive as a @@ -4058,19 +4101,40 @@ The syntax for @code{.comm} differs slightly on the HPPA. The syntax is @end ifset @node CFI directives -@section @code{.cfi_startproc} +@section @code{.cfi_startproc [simple]} @cindex @code{cfi_startproc} directive @code{.cfi_startproc} is used at the beginning of each function that should have an entry in @code{.eh_frame}. It initializes some internal -data structures and emits architecture dependent initial CFI instructions. -Don't forget to close the function by +data structures. Don't forget to close the function by @code{.cfi_endproc}. +Unless @code{.cfi_startproc} is used along with parameter @code{simple} +it also emits some architecture dependent initial CFI instructions. + @section @code{.cfi_endproc} @cindex @code{cfi_endproc} directive @code{.cfi_endproc} is used at the end of a function where it closes its unwind entry previously opened by -@code{.cfi_startproc}. and emits it to @code{.eh_frame}. +@code{.cfi_startproc}, and emits it to @code{.eh_frame}. + +@section @code{.cfi_personality @var{encoding} [, @var{exp}]} +@code{.cfi_personality} defines personality routine and its encoding. +@var{encoding} must be a constant determining how the personality +should be encoded. If it is 255 (@code{DW_EH_PE_omit}), second +argument is not present, otherwise second argument should be +a constant or a symbol name. When using indirect encodings, +the symbol provided should be the location where personality +can be loaded from, not the personality routine itself. +The default after @code{.cfi_startproc} is @code{.cfi_personality 0xff}, +no personality routine. + +@section @code{.cfi_lsda @var{encoding} [, @var{exp}]} +@code{.cfi_lsda} defines LSDA and its encoding. +@var{encoding} must be a constant determining how the LSDA +should be encoded. If it is 255 (@code{DW_EH_PE_omit}), second +argument is not present, otherwise second argument should be a constant +or a symbol name. The default after @code{.cfi_startproc} is @code{.cfi_lsda 0xff}, +no LSDA. @section @code{.cfi_def_cfa @var{register}, @var{offset}} @code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take @@ -4102,6 +4166,31 @@ using the known displacement of the CFA register from the CFA. This is often easier to use, because the number will match the code it's annotating. +@section @code{.cfi_register @var{register1}, @var{register2}} +Previous value of @var{register1} is saved in register @var{register2}. + +@section @code{.cfi_restore @var{register}} +@code{.cfi_restore} says that the rule for @var{register} is now the +same as it was at the beginning of the function, after all initial +instruction added by @code{.cfi_startproc} were executed. + +@section @code{.cfi_undefined @var{register}} +From now on the previous value of @var{register} can't be restored anymore. + +@section @code{.cfi_same_value @var{register}} +Current value of @var{register} is the same like in the previous frame, +i.e. no restoration needed. + +@section @code{.cfi_remember_state}, +First save all current rules for all registers by @code{.cfi_remember_state}, +then totally screw them up by subsequent @code{.cfi_*} directives and when +everything is hopelessly bad, use @code{.cfi_restore_state} to restore +the previous saved state. + +@section @code{.cfi_return_column @var{register}} +Change return column @var{register}, i.e. the return address is either +directly in @var{register} or can be accessed by rules for @var{register}. + @section @code{.cfi_signal_frame} Mark current function as signal trampoline. @@ -4121,9 +4210,9 @@ to the @code{.debug_line} file name table. The @var{fileno} operand should be a unique positive integer to use as the index of the entry in the table. The @var{filename} operand is a C string literal. -The detail of filename indicies is exposed to the user because the filename +The detail of filename indices is exposed to the user because the filename table is shared with the @code{.debug_info} section of the dwarf2 debugging -information, and thus the user must know the exact indicies that table +information, and thus the user must know the exact indices that table entries will have. @section @code{.loc @var{fileno} @var{lineno} [@var{column}] [@var{options}]} @@ -4262,7 +4351,7 @@ Force a page break at this point, when generating assembly listings. @cindex @code{else} directive @code{.else} is part of the @command{@value{AS}} support for conditional -assembly; @pxref{If,,@code{.if}}. It marks the beginning of a section +assembly; see @ref{If,,@code{.if}}. It marks the beginning of a section of code to be assembled if the condition for the preceding @code{.if} was false. @@ -4271,7 +4360,7 @@ was false. @cindex @code{elseif} directive @code{.elseif} is part of the @command{@value{AS}} support for conditional -assembly; @pxref{If,,@code{.if}}. It is shorthand for beginning a new +assembly; see @ref{If,,@code{.if}}. It is shorthand for beginning a new @code{.if} block that would otherwise fill the entire @code{.else} section. @node End @@ -4316,7 +4405,7 @@ conditionally. @xref{If,,@code{.if}}. @cindex assigning values to symbols @cindex symbols, assigning values to This directive sets the value of @var{symbol} to @var{expression}. -It is synonymous with @samp{.set}; @pxref{Set,,@code{.set}}. +It is synonymous with @samp{.set}; see @ref{Set,,@code{.set}}. @ifset HPPA The syntax for @code{equ} on the HPPA is @@ -4327,8 +4416,8 @@ The syntax for @code{equ} on the HPPA is The syntax for @code{equ} on the Z80 is @samp{@var{symbol} equ @var{expression}}. On the Z80 it is an eror if @var{symbol} is already defined, -but the symbol is not protected from later redefinition, -compare @xref{Equiv}. +but the symbol is not protected from later redefinition. +Compare @ref{Equiv}. @end ifset @node Equiv @@ -4484,7 +4573,7 @@ compatibility with other assemblers. @ifset HPPA On the HPPA, @code{.global} is not always enough to make it accessible to other partial programs. You may need the HPPA-only @code{.EXPORT} directive as well. -@xref{HPPA Directives,, HPPA Assembler Directives}. +@xref{HPPA Directives, ,HPPA Assembler Directives}. @end ifset @ifset ELF @@ -4721,8 +4810,7 @@ is equivalent to assembling move d3,sp@@- @end example -For some caveats with the spelling of @var{symbol}, see also the discussion -at @xref{Macro}. +For some caveats with the spelling of @var{symbol}, see also @ref{Macro}. @node Irpc @section @code{.irpc @var{symbol},@var{values}}@dots{} @@ -4907,7 +4995,7 @@ the initial value of the listing counter is one. @section @code{.long @var{expressions}} @cindex @code{long} directive -@code{.long} is the same as @samp{.int}, @pxref{Int,,@code{.int}}. +@code{.long} is the same as @samp{.int}. @xref{Int,,@code{.int}}. @ignore @c no one seems to know what this is for or whether this description is @@ -4971,7 +5059,7 @@ indicate whether all invocations must specify a non-blank value (through (through @samp{:@code{vararg}}). You can supply a default value for any macro argument by following the name with @samp{=@var{deflt}}. You cannot define two macros with the same @var{macname} unless it has been -subject to the @code{.purgem} directive (@xref{Purgem}.) between the two +subject to the @code{.purgem} directive (@pxref{Purgem}) between the two definitions. For example, these are all valid @code{.macro} statements: @table @code @@ -4979,7 +5067,7 @@ definitions. For example, these are all valid @code{.macro} statements: Begin the definition of a macro called @code{comm}, which takes no arguments. -@item .macro plus1 p, p1 +@item .macro plus1 p, p1 @itemx .macro plus1 p p1 Either statement begins the definition of a macro called @code{plus1}, which takes two arguments; within the macro definition, write @@ -4993,7 +5081,6 @@ After the definition is complete, you can call the macro either as @var{a} and @samp{\p2} evaluating to @var{b}), or as @samp{reserve_str ,@var{b}} (with @samp{\p1} evaluating as the default, in this case @samp{0}, and @samp{\p2} evaluating to @var{b}). -@end table @item .macro m p1:req, p2=0, p3:vararg Begin the definition of a macro called @code{m}, with at least three @@ -5005,21 +5092,72 @@ When you call a macro, you can specify the argument values either by position, or by keyword. For example, @samp{sum 9,17} is equivalent to @samp{sum to=17, from=9}. +@end table + Note that since each of the @var{macargs} can be an identifier exactly as any other one permitted by the target architecture, there may be occasional problems if the target hand-crafts special meanings to certain -characters when they occur in a special position. For example, if colon +characters when they occur in a special position. For example, if the colon (@code{:}) is generally permitted to be part of a symbol name, but the -architecture specific code special-cases it when occuring as the final +architecture specific code special-cases it when occurring as the final character of a symbol (to denote a label), then the macro parameter replacement code will have no way of knowing that and consider the whole construct (including the colon) an identifier, and check only this -identifier for being the subject to parameter substitution. In this -example, besides the potential of just separating identifier and colon -by white space, using alternate macro syntax (@xref{Altmacro}.) and -ampersand (@code{&}) as the character to separate literal text from macro -parameters (or macro parameters from one another) would provide a way to -achieve the same effect: +identifier for being the subject to parameter substitution. So for example +this macro definition: + +@example + .macro label l +\l: + .endm +@end example + +might not work as expected. Invoking @samp{label foo} might not create a label +called @samp{foo} but instead just insert the text @samp{\l:} into the +assembler source, probably generating an error about an unrecognised +identifier. + +Similarly problems might occur with the period character (@samp{.}) +which is often allowed inside opcode names (and hence identifier names). So +for example constructing a macro to build an opcode from a base name and a +length specifier like this: + +@example + .macro opcode base length + \base.\length + .endm +@end example + +and invoking it as @samp{opcode store l} will not create a @samp{store.l} +instruction but instead generate some kind of error as the assembler tries to +interpret the text @samp{\base.\length}. + +There are several possible ways around this problem: + +@table @code +@item Insert white space +If it is possible to use white space characters then this is the simplest +solution. eg: + +@example + .macro label l +\l : + .endm +@end example + +@item Use @samp{\()} +The string @samp{\()} can be used to separate the end of a macro argument from +the following text. eg: + +@example + .macro opcode base length + \base\().\length + .endm +@end example + +@item Use the alternate macro syntax mode +In the alternative macro syntax mode the ampersand character (@samp{&}) can be +used as a separator. eg: @example .altmacro @@ -5027,9 +5165,11 @@ achieve the same effect: l&: .endm @end example +@end table -This applies identically to the identifiers used in @code{.irp} (@xref{Irp}.) -and @code{.irpc} (@xref{Irpc}.). +Note: this problem of correctly identifying string parameters to pseudo ops +also applies to the identifiers used in @code{.irp} (@pxref{Irp}) +and @code{.irpc} (@pxref{Irpc}) as well. @item .endm @cindex @code{endm} directive @@ -5071,7 +5211,7 @@ You can write strings delimited in these other ways besides @table @code @item '@var{string}' -You can delimit strings with single-quote charaters. +You can delimit strings with single-quote characters. @item <@var{string}> You can delimit strings with matching angle brackets. @@ -5090,7 +5230,7 @@ and use the result as a string. @node Noaltmacro @section @code{.noaltmacro} -Disable alternate macro mode. @ref{Altmacro} +Disable alternate macro mode. @xref{Altmacro}. @node Nolist @section @code{.nolist} @@ -5314,6 +5454,20 @@ warning message; and just takes the lowest order 16 bytes of the bignum. @cindex integer, 16-byte @end ifset +@node Reloc +@section @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]} + +@cindex @code{reloc} directive +Generate a relocation at @var{offset} of type @var{reloc_name} with value +@var{expression}. If @var{offset} is a number, the relocation is generated in +the current section. If @var{offset} is an expression that resolves to a +symbol plus offset, the relocation is generated in the given symbol's section. +@var{expression}, if present, must resolve to a symbol plus addend or to an +absolute value, but note that not all targets support an addend. e.g. ELF REL +targets such as i386 store an addend in the section contents rather than in the +relocation. This low level interface does not support addends stored in the +section. + @node Rept @section @code{.rept @var{count}} @@ -5487,7 +5641,7 @@ ARM) then another character is used instead. For example the ARM port uses the @code{%} character. If @var{flags} contains the @code{M} symbol then the @var{type} argument must -be specified as well as an extra argument - @var{entsize} - like this: +be specified as well as an extra argument---@var{entsize}---like this: @smallexample .section @var{name} , "@var{flags}"M, @@@var{type}, @var{entsize} @@ -5516,7 +5670,7 @@ indicates that only one copy of this section should be retained an alias for comdat @end table -Note - if both the @var{M} and @var{G} flags are present then the fields for +Note: if both the @var{M} and @var{G} flags are present then the fields for the Merge flag should come first, like this: @smallexample @@ -5589,7 +5743,7 @@ On Z80 @code{set} is a real instruction, use @xref{Word,,@code{.word}}. In some configurations, however, @code{.short} and @code{.word} generate -numbers of different lengths; @pxref{Machine Dependencies}. +numbers of different lengths. @xref{Machine Dependencies}. @end ifset @ifclear GENERIC @ifset W16 @@ -5672,7 +5826,7 @@ symbols. @cindex @code{sleb128} directive @var{sleb128} stands for ``signed little endian base 128.'' This is a compact, variable length representation of numbers used by the DWARF -symbolic debugging format. @xref{Uleb128,@code{.uleb128}}. +symbolic debugging format. @xref{Uleb128, ,@code{.uleb128}}. @ifclear no-space-dir @node Skip @@ -5964,9 +6118,21 @@ For ELF targets, the @code{.type} directive is used like this: This sets the type of symbol @var{name} to be either a function symbol or an object symbol. There are five different syntaxes supported for the @var{type description} field, in order to provide -compatibility with various other assemblers. The syntaxes supported are: +compatibility with various other assemblers. + +Because some of the characters used in these syntaxes (such as @samp{@@} and +@samp{#}) are comment characters for some architectures, some of the syntaxes +below do not work on all architectures. The first variant will be accepted by +the GNU assembler on all architectures so that variant should be used for +maximum portability, if you do not need to assemble your code with other +assemblers. + +The syntaxes supported are: @smallexample + .type STT_FUNCTION + .type STT_OBJECT + .type ,#function .type ,#object @@ -5978,9 +6144,6 @@ compatibility with various other assemblers. The syntaxes supported are: .type ,"function" .type ,"object" - - .type STT_FUNCTION - .type STT_OBJECT @end smallexample @end ifset @end ifset @@ -5991,7 +6154,7 @@ compatibility with various other assemblers. The syntaxes supported are: @cindex @code{uleb128} directive @var{uleb128} stands for ``unsigned little endian base 128.'' This is a compact, variable length representation of numbers used by the DWARF -symbolic debugging format. @xref{Sleb128,@code{.sleb128}}. +symbolic debugging format. @xref{Sleb128, ,@code{.sleb128}}. @ifset COFF @node Val @@ -6034,7 +6197,7 @@ This directive finds or creates a symbol @code{table} and creates a This directive finds the symbol @code{child} and finds or creates the symbol @code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the parent whose addend is the value of the child symbol. As a special case the -parent name of @code{0} is treated as refering the @code{*ABS*} section. +parent name of @code{0} is treated as referring to the @code{*ABS*} section. @end ifset @node Warning @@ -6182,9 +6345,15 @@ subject, see the hardware manufacturer's manual. @ifset ARM * ARM-Dependent:: ARM Dependent Features @end ifset +@ifset AVR +* AVR-Dependent:: AVR Dependent Features +@end ifset @ifset BFIN * BFIN-Dependent:: BFIN Dependent Features @end ifset +@ifset CR16 +* CR16-Dependent:: CR16 Dependent Features +@end ifset @ifset CRIS * CRIS-Dependent:: CRIS Dependent Features @end ifset @@ -6298,10 +6467,18 @@ subject, see the hardware manufacturer's manual. @include c-arm.texi @end ifset +@ifset AVR +@include c-avr.texi +@end ifset + @ifset BFIN @include c-bfin.texi @end ifset +@ifset CR16 +@include c-cr16.texi +@end ifset + @ifset CRIS @include c-cris.texi @end ifset @@ -6508,8 +6685,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 @command{@value{AS}} -to @samp{bug-binutils@@gnu.org}. +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 @@ -6583,7 +6762,7 @@ 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 -@command{@value{AS}} is out of synch, or you have encountered a bug in the C +@command{@value{AS}} 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 us. If you had not told us to @@ -6736,7 +6915,7 @@ Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic* flavors. David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica, -Inc. added support for Xtensa processors. +Inc.@: added support for Xtensa processors. Several engineers at Cygnus Support have also provided many small bug fixes and configuration enhancements. @@ -6748,12 +6927,11 @@ intentionally leaving anyone out. @include fdl.texi -@node Index -@unnumbered Index +@node AS Index +@unnumbered AS Index @printindex cp -@contents @bye @c Local Variables: @c fill-column: 79 diff --git a/contrib/binutils/gas/doc/c-arc.texi b/contrib/binutils/gas/doc/c-arc.texi index 04544d1e495..7f8ed6eb400 100644 --- a/contrib/binutils/gas/doc/c-arc.texi +++ b/contrib/binutils/gas/doc/c-arc.texi @@ -230,7 +230,7 @@ Determines the kinds of suffixes to be allowed. Valid values are @code{SUFFIX_FLAG} which indicates the absence or presence of conditional suffixes and flag setting by the extension instruction. It is also possible to specify that an instruction sets the flags and -is conditional by using @code{SUFFIX_CODE} | @code{SUFFIX_FLAG}. +is condtional by using @code{SUFFIX_CODE} | @code{SUFFIX_FLAG}. @item @var{syntaxclass} Determines the syntax class for the instruction. It can have the @@ -251,7 +251,7 @@ Syntax Class Modifiers are: @item @code{OP1_MUST_BE_IMM}: Modifies syntax class SYNTAX_3OP, specifying that the first operand -of a three-operand instruction must be an immediate (i.e. the result +of a three-operand instruction must be an immediate (i.e., the result is discarded). OP1_MUST_BE_IMM is used by bitwise ORing it with SYNTAX_3OP as given in the example below. This could usually be used to set the flags using specific instructions and not retain results. diff --git a/contrib/binutils/gas/doc/c-arm.texi b/contrib/binutils/gas/doc/c-arm.texi index ca0998bea66..8fc2972e575 100644 --- a/contrib/binutils/gas/doc/c-arm.texi +++ b/contrib/binutils/gas/doc/c-arm.texi @@ -155,9 +155,9 @@ names are recognized: @code{armv6z}, @code{armv6zk}, @code{armv7}, -@code{armv7a}, -@code{armv7r}, -@code{armv7m}, +@code{armv7-a}, +@code{armv7-r}, +@code{armv7-m}, @code{iwmmxt} and @code{xscale}. @@ -254,7 +254,7 @@ and @item -meabi=@var{ver} This option specifies which EABI version the produced object files should conform to. -The following values are recognised: +The following values are recognized: @code{gnu}, @code{4} and @@ -284,6 +284,7 @@ as position-independent code (PIC). @menu * ARM-Chars:: Special Characters * ARM-Regs:: Register Names +* ARM-Relocations:: Relocations @end menu @node ARM-Chars @@ -323,7 +324,46 @@ Either @samp{#} or @samp{$} can be used to indicate immediate operands. @cindex ARM floating point (@sc{ieee}) The ARM family uses @sc{ieee} floating-point numbers. +@node ARM-Relocations +@subsection ARM relocation generation +@cindex data relocations, ARM +@cindex ARM data relocations +Specific data relocations can be generated by putting the relocation name +in parentheses after the symbol name. For example: + +@smallexample + .word foo(TARGET1) +@end smallexample + +This will generate an @samp{R_ARM_TARGET1} relocation against the symbol +@var{foo}. +The following relocations are supported: +@code{GOT}, +@code{GOTOFF}, +@code{TARGET1}, +@code{TARGET2}, +@code{SBREL}, +@code{TLSGD}, +@code{TLSLDM}, +@code{TLSLDO}, +@code{GOTTPOFF} +and +@code{TPOFF}. + +For compatibility with older toolchains the assembler also accepts +@code{(PLT)} after branch targets. This will generate the deprecated +@samp{R_ARM_PLT32} relocation. + +@cindex MOVW and MOVT relocations, ARM +Relocations for @samp{MOVW} and @samp{MOVT} instructions can be generated +by prefixing the value with @samp{#:lower16:} and @samp{#:upper16} +respectively. For example to load the 32-bit address of foo into r0: + +@smallexample + MOVW r0, #:lower16:foo + MOVT r0, #:upper16:foo +@end smallexample @node ARM Directives @section ARM Machine Directives @@ -351,7 +391,7 @@ example: @cindex @code{unreq} directive, ARM @item .unreq @var{alias-name} This undefines a register alias which was previously defined using the -@code{req} directive. For example: +@code{req}, @code{dn} or @code{qn} directives. For example: @smallexample foo .req r0 @@ -362,6 +402,36 @@ An error occurs if the name is undefined. Note - this pseudo op can be used to delete builtin in register name aliases (eg 'r0'). This should only be done if it is really necessary. +@cindex @code{dn} and @code{qn} directives, ARM +@item @var{name} .dn @var{register name} [@var{.type}] [@var{[index]}] +@item @var{name} .qn @var{register name} [@var{.type}] [@var{[index]}] + +The @code{dn} and @code{qn} directives are used to create typed +and/or indexed register aliases for use in Advanced SIMD Extension +(Neon) instructions. The former should be used to create aliases +of double-precision registers, and the latter to create aliases of +quad-precision registers. + +If these directives are used to create typed aliases, those aliases can +be used in Neon instructions instead of writing types after the mnemonic +or after each operand. For example: + +@smallexample + x .dn d2.f32 + y .dn d3.f32 + z .dn d4.f32[1] + vmul x,y,z +@end smallexample + +This is equivalent to writing the following: + +@smallexample + vmul.f32 d2,d3,d4[1] +@end smallexample + +Aliases created using @code{dn} or @code{qn} can be destroyed using +@code{unreq}. + @cindex @code{code} directive, ARM @item .code @code{[16|32]} This directive selects the instruction set being generated. The value 16 @@ -389,6 +459,9 @@ between Arm and Thumb instructions and should be used even if interworking is not going to be performed. The presence of this directive also implies @code{.thumb} +This directive is not neccessary when generating EABI objects. On these +targets the encoding is implicit when generating Thumb code. + @cindex @code{thumb_set} directive, ARM @item .thumb_set This performs the equivalent of a @code{.set} directive in that it @@ -466,7 +539,7 @@ instruction. sfmfd f4, 2, [sp]! @exdent @emph{VFP registers} .save @{d8, d9, d10@} - fstmdf sp!, @{d8, d9, d10@} + fstmdx sp!, @{d8, d9, d10@} @exdent @emph{iWMMXt registers} .save @{wr10, wr11@} wstrd wr11, [sp, #-8]! @@ -478,6 +551,26 @@ or wstrd wr10, [sp, #-8]! @end smallexample +@cindex @code{.vsave} directive, ARM +@item .vsave @var{vfp-reglist} +Generate unwinder annotations to restore the VFP registers in @var{vfp-reglist} +using FLDMD. Also works for VFPv3 registers +that are to be restored using VLDM. +The format of @var{vfp-reglist} is the same as the corresponding store-multiple +instruction. + +@smallexample +@exdent @emph{VFP registers} + .vsave @{d8, d9, d10@} + fstmdd sp!, @{d8, d9, d10@} +@exdent @emph{VFPv3 registers} + .vsave @{d15, d16, d17@} + vstm sp!, @{d15, d16, d17@} +@end smallexample + +Since FLDMX and FSTMX are now deprecated, this directive should be +used in favour of @code{.save} for saving VFP registers for ARMv6 and above. + @cindex @code{.pad} directive, ARM @item .pad #@var{count} Generate unwinder annotations for a stack adjustment of @var{count} bytes. @@ -485,8 +578,10 @@ A positive value indicates the function prologue allocated stack space by decrementing the stack pointer. @cindex @code{.movsp} directive, ARM -@item .movsp @var{reg} -Tell the unwinder that @var{reg} contains the current stack pointer. +@item .movsp @var{reg} [, #@var{offset}] +Tell the unwinder that @var{reg} contains an offset from the current +stack pointer. If @var{offset} is not specified then it is assumed to be +zero. @cindex @code{.setfp} directive, ARM @item .setfp @var{fpreg}, @var{spreg} [, #@var{offset}] @@ -523,6 +618,12 @@ for the @option{-mcpu} commandline option. Select the target architecture. Valid values for @var{name} are the same as for the @option{-march} commandline option. +@cindex @code{.object_arch} directive, ARM +@item .object_arch @var{name} +Override the architecture recorded in the EABI object attribute section. +Valid values for @var{name} are the same as for the @code{.arch} directive. +Typically this is useful when code uses runtime detection of CPU features. + @cindex @code{.fpu} directive, ARM @item .fpu @var{name} Select the floating point unit to assemble for. Valid values for @var{name} diff --git a/contrib/binutils/gas/doc/c-avr.texi b/contrib/binutils/gas/doc/c-avr.texi new file mode 100644 index 00000000000..9bf743d77d3 --- /dev/null +++ b/contrib/binutils/gas/doc/c-avr.texi @@ -0,0 +1,364 @@ +@c Copyright 2006 +@c Free Software Foundation, Inc. +@c This is part of the GAS manual. +@c For copying conditions, see the file as.texinfo. + +@ifset GENERIC +@page +@node AVR-Dependent +@chapter AVR Dependent Features +@end ifset + +@ifclear GENERIC +@node Machine Dependencies +@chapter AVR Dependent Features +@end ifclear + +@cindex AVR support +@menu +* AVR Options:: Options +* AVR Syntax:: Syntax +* AVR Opcodes:: Opcodes +@end menu + +@node AVR Options +@section Options +@cindex AVR options (none) +@cindex options for AVR (none) + +@table @code + +@cindex @code{-mmcu=} command line option, AVR +@item -mmcu=@var{mcu} +Specify ATMEL AVR instruction set or MCU type. + +Instruction set avr1 is for the minimal AVR core, not supported by the C +compiler, only for assembler programs (MCU types: at90s1200, attiny10, +attiny11, attiny12, attiny15, attiny28). + +Instruction set avr2 (default) is for the classic AVR core with up to +8K program memory space (MCU types: at90s2313, at90s2323, attiny22, +attiny26, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, +at90s8515, at90c8534, at90s8535, at86rf401, attiny13, attiny2313, +attiny261, attiny461, attiny861, attiny24, attiny44, attiny84, attiny25, +attiny45, attiny85). + +Instruction set avr3 is for the classic AVR core with up to 128K program +memory space (MCU types: atmega103, atmega603, at43usb320, at43usb355, +at76c711). + +Instruction set avr4 is for the enhanced AVR core with up to 8K program +memory space (MCU types: atmega48, atmega8, atmega83, atmega85, atmega88, +atmega8515, atmega8535, atmega8hva, at90pwm1, at90pwm2, at90pwm3). + +Instruction set avr5 is for the enhanced AVR core with up to 128K program +memory space (MCU types: atmega16, atmega161, atmega162, atmega163, +atmega164p, atmega165, atmega165p, atmega168, atmega169, atmega169p, +atmega32, atmega323, atmega324p, atmega325, atmega325p, atmega329, +atmega329p, atmega3250, atmega3250p, atmega3290, atmega3290p, atmega406, +atmega64, atmega640, atmega644, atmega644p, atmega128, atmega1280, +atmega1281, atmega645, atmega649, atmega6450, atmega6490, atmega16hva, +at90can32, at90can64, at90can128, at90usb82, at90usb162, at90usb646, +at90usb647, at90usb1286, at90usb1287, at94k). + +Instruction set avr6 is for the enhanced AVR core with 256K program +memory space (MCU types: atmega2560, atmega2561). + +@cindex @code{-mall-opcodes} command line option, AVR +@item -mall-opcodes +Accept all AVR opcodes, even if not supported by @code{-mmcu}. + +@cindex @code{-mno-skip-bug} command line option, AVR +@item -mno-skip-bug +This option disable warnings for skipping two-word instructions. + +@cindex @code{-mno-wrap} command line option, AVR +@item -mno-wrap +This option reject @code{rjmp/rcall} instructions with 8K wrap-around. + +@end table + + +@node AVR Syntax +@section Syntax +@menu +* AVR-Chars:: Special Characters +* AVR-Regs:: Register Names +* AVR-Modifiers:: Relocatable Expression Modifiers +@end menu + +@node AVR-Chars +@subsection Special Characters + +@cindex line comment character, AVR +@cindex AVR line comment character + +The presence of a @samp{;} on a line indicates the start of a comment +that extends to the end of the current line. If a @samp{#} appears as +the first character of a line, the whole line is treated as a comment. + +@cindex line separator, AVR +@cindex statement separator, AVR +@cindex AVR line separator + +The @samp{$} character can be used instead of a newline to separate +statements. + +@node AVR-Regs +@subsection Register Names + +@cindex AVR register names +@cindex register names, AVR + +The AVR has 32 x 8-bit general purpose working registers @samp{r0}, +@samp{r1}, ... @samp{r31}. +Six of the 32 registers can be used as three 16-bit indirect address +register pointers for Data Space addressing. One of the these address +pointers can also be used as an address pointer for look up tables in +Flash program memory. These added function registers are the 16-bit +@samp{X}, @samp{Y} and @samp{Z} - registers. + +@smallexample +X = @r{r26:r27} +Y = @r{r28:r29} +Z = @r{r30:r31} +@end smallexample + +@node AVR-Modifiers +@subsection Relocatable Expression Modifiers + +@cindex AVR modifiers +@cindex syntax, AVR + +The assembler supports several modifiers when using relocatable addresses +in AVR instruction operands. The general syntax is the following: + +@smallexample +modifier(relocatable-expression) +@end smallexample + +@table @code +@cindex symbol modifiers + +@item lo8 + +This modifier allows you to use bits 0 through 7 of +an address expression as 8 bit relocatable expression. + +@item hi8 + +This modifier allows you to use bits 7 through 15 of an address expression +as 8 bit relocatable expression. This is useful with, for example, the +AVR @samp{ldi} instruction and @samp{lo8} modifier. + +For example + +@smallexample +ldi r26, lo8(sym+10) +ldi r27, hi8(sym+10) +@end smallexample + +@item hh8 + +This modifier allows you to use bits 16 through 23 of +an address expression as 8 bit relocatable expression. +Also, can be useful for loading 32 bit constants. + +@item hlo8 + +Synonym of @samp{hh8}. + +@item hhi8 + +This modifier allows you to use bits 24 through 31 of +an expression as 8 bit expression. This is useful with, for example, the +AVR @samp{ldi} instruction and @samp{lo8}, @samp{hi8}, @samp{hlo8}, +@samp{hhi8}, modifier. + +For example + +@smallexample +ldi r26, lo8(285774925) +ldi r27, hi8(285774925) +ldi r28, hlo8(285774925) +ldi r29, hhi8(285774925) +; r29,r28,r27,r26 = 285774925 +@end smallexample + +@item pm_lo8 + +This modifier allows you to use bits 0 through 7 of +an address expression as 8 bit relocatable expression. +This modifier useful for addressing data or code from +Flash/Program memory. The using of @samp{pm_lo8} similar +to @samp{lo8}. + +@item pm_hi8 + +This modifier allows you to use bits 8 through 15 of +an address expression as 8 bit relocatable expression. +This modifier useful for addressing data or code from +Flash/Program memory. + +@item pm_hh8 + +This modifier allows you to use bits 15 through 23 of +an address expression as 8 bit relocatable expression. +This modifier useful for addressing data or code from +Flash/Program memory. + +@end table + +@node AVR Opcodes +@section Opcodes + +@cindex AVR opcode summary +@cindex opcode summary, AVR +@cindex mnemonics, AVR +@cindex instruction summary, AVR +For detailed information on the AVR machine instruction set, see +@url{www.atmel.com/products/AVR}. + +@code{@value{AS}} implements all the standard AVR opcodes. +The following table summarizes the AVR opcodes, and their arguments. + +@smallexample +@i{Legend:} + r @r{any register} + d @r{`ldi' register (r16-r31)} + v @r{`movw' even register (r0, r2, ..., r28, r30)} + a @r{`fmul' register (r16-r23)} + w @r{`adiw' register (r24,r26,r28,r30)} + e @r{pointer registers (X,Y,Z)} + b @r{base pointer register and displacement ([YZ]+disp)} + z @r{Z pointer register (for [e]lpm Rd,Z[+])} + M @r{immediate value from 0 to 255} + n @r{immediate value from 0 to 255 ( n = ~M ). Relocation impossible} + s @r{immediate value from 0 to 7} + P @r{Port address value from 0 to 63. (in, out)} + p @r{Port address value from 0 to 31. (cbi, sbi, sbic, sbis)} + K @r{immediate value from 0 to 63 (used in `adiw', `sbiw')} + i @r{immediate value} + l @r{signed pc relative offset from -64 to 63} + L @r{signed pc relative offset from -2048 to 2047} + h @r{absolute code address (call, jmp)} + S @r{immediate value from 0 to 7 (S = s << 4)} + ? @r{use this opcode entry if no parameters, else use next opcode entry} + +1001010010001000 clc +1001010011011000 clh +1001010011111000 cli +1001010010101000 cln +1001010011001000 cls +1001010011101000 clt +1001010010111000 clv +1001010010011000 clz +1001010000001000 sec +1001010001011000 seh +1001010001111000 sei +1001010000101000 sen +1001010001001000 ses +1001010001101000 set +1001010000111000 sev +1001010000011000 sez +100101001SSS1000 bclr S +100101000SSS1000 bset S +1001010100001001 icall +1001010000001001 ijmp +1001010111001000 lpm ? +1001000ddddd010+ lpm r,z +1001010111011000 elpm ? +1001000ddddd011+ elpm r,z +0000000000000000 nop +1001010100001000 ret +1001010100011000 reti +1001010110001000 sleep +1001010110011000 break +1001010110101000 wdr +1001010111101000 spm +000111rdddddrrrr adc r,r +000011rdddddrrrr add r,r +001000rdddddrrrr and r,r +000101rdddddrrrr cp r,r +000001rdddddrrrr cpc r,r +000100rdddddrrrr cpse r,r +001001rdddddrrrr eor r,r +001011rdddddrrrr mov r,r +100111rdddddrrrr mul r,r +001010rdddddrrrr or r,r +000010rdddddrrrr sbc r,r +000110rdddddrrrr sub r,r +001001rdddddrrrr clr r +000011rdddddrrrr lsl r +000111rdddddrrrr rol r +001000rdddddrrrr tst r +0111KKKKddddKKKK andi d,M +0111KKKKddddKKKK cbr d,n +1110KKKKddddKKKK ldi d,M +11101111dddd1111 ser d +0110KKKKddddKKKK ori d,M +0110KKKKddddKKKK sbr d,M +0011KKKKddddKKKK cpi d,M +0100KKKKddddKKKK sbci d,M +0101KKKKddddKKKK subi d,M +1111110rrrrr0sss sbrc r,s +1111111rrrrr0sss sbrs r,s +1111100ddddd0sss bld r,s +1111101ddddd0sss bst r,s +10110PPdddddPPPP in r,P +10111PPrrrrrPPPP out P,r +10010110KKddKKKK adiw w,K +10010111KKddKKKK sbiw w,K +10011000pppppsss cbi p,s +10011010pppppsss sbi p,s +10011001pppppsss sbic p,s +10011011pppppsss sbis p,s +111101lllllll000 brcc l +111100lllllll000 brcs l +111100lllllll001 breq l +111101lllllll100 brge l +111101lllllll101 brhc l +111100lllllll101 brhs l +111101lllllll111 brid l +111100lllllll111 brie l +111100lllllll000 brlo l +111100lllllll100 brlt l +111100lllllll010 brmi l +111101lllllll001 brne l +111101lllllll010 brpl l +111101lllllll000 brsh l +111101lllllll110 brtc l +111100lllllll110 brts l +111101lllllll011 brvc l +111100lllllll011 brvs l +111101lllllllsss brbc s,l +111100lllllllsss brbs s,l +1101LLLLLLLLLLLL rcall L +1100LLLLLLLLLLLL rjmp L +1001010hhhhh111h call h +1001010hhhhh110h jmp h +1001010rrrrr0101 asr r +1001010rrrrr0000 com r +1001010rrrrr1010 dec r +1001010rrrrr0011 inc r +1001010rrrrr0110 lsr r +1001010rrrrr0001 neg r +1001000rrrrr1111 pop r +1001001rrrrr1111 push r +1001010rrrrr0111 ror r +1001010rrrrr0010 swap r +00000001ddddrrrr movw v,v +00000010ddddrrrr muls d,d +000000110ddd0rrr mulsu a,a +000000110ddd1rrr fmul a,a +000000111ddd0rrr fmuls a,a +000000111ddd1rrr fmulsu a,a +1001001ddddd0000 sts i,r +1001000ddddd0000 lds r,i +10o0oo0dddddbooo ldd r,b +100!000dddddee-+ ld r,e +10o0oo1rrrrrbooo std b,r +100!001rrrrree-+ st e,r +1001010100011001 eicall +1001010000011001 eijmp +@end smallexample diff --git a/contrib/binutils/gas/doc/c-cr16.texi b/contrib/binutils/gas/doc/c-cr16.texi new file mode 100644 index 00000000000..4748d5679ec --- /dev/null +++ b/contrib/binutils/gas/doc/c-cr16.texi @@ -0,0 +1,80 @@ +@c Copyright 2007 Free Software Foundation, Inc. +@c This is part of the GAS manual. +@c For copying conditions, see the file as.texinfo. + +@ifset GENERIC +@page +@node CR16-Dependent +@chapter CR16 Dependent Features +@end ifset +@ifclear GENERIC +@node Machine Dependencies +@chapter CR16 Dependent Features +@end ifclear + +@cindex CR16 support +@menu +* CR16 Operand Qualifiers:: CR16 Machine Operand Qualifiers +@end menu + +@node CR16 Operand Qualifiers +@section CR16 Operand Qualifiers +@cindex CR16 Operand Qualifiers + +The National Semiconductor CR16 target of @code{@value{AS}} has a few machine dependent operand qualifiers. + +Operand expression type qualifier is an optional field in the instruction operand, to determines the type of the expression field of an operand. The @code{@@} is required. CR16 architecture uses one of the following expression qualifiers: + +@table @code +@item s +- @code{Specifies expression operand type as small} +@item m +- @code{Specifies expression operand type as medium} +@item l +- @code{Specifies expression operand type as large} +@item c +- @code{Specifies the CR16 Assembler generates a relocation entry for the operand, where pc has implied bit, the expression is adjusted accordingly. The linker uses the relocation entry to update the operand address at link time.} +@end table + +CR16 target operand qualifiers and its size (in bits): + +@table @samp +@item Immediate Operand +- s ---- 4 bits +@item +- m ---- 16 bits, for movb and movw instructions. +@item +- m ---- 20 bits, movd instructions. +@item +- l ---- 32 bits + +@item Absolute Operand +- s ---- Illegal specifier for this operand. +@item +- m ---- 20 bits, movd instructions. + +@item Displacement Operand +- s ---- 8 bits +@item +- m ---- 16 bits +@item +- l ---- 24 bits +@end table + +For example: +@example +1 @code{movw $_myfun@@c,r1} + + This loads the address of _myfun, shifted right by 1, into r1. + +2 @code{movd $_myfun@@c,(r2,r1)} + + This loads the address of _myfun, shifted right by 1, into register-pair r2-r1. + +3 @code{_myfun_ptr:} + @code{.long _myfun@@c} + @code{loadd _myfun_ptr, (r1,r0)} + @code{jal (r1,r0)} + + This .long directive, the address of _myfunc, shifted right by 1 at link time. +@end example diff --git a/contrib/binutils/gas/doc/c-i386.texi b/contrib/binutils/gas/doc/c-i386.texi index 81039c4dbe7..48b251a25fc 100644 --- a/contrib/binutils/gas/doc/c-i386.texi +++ b/contrib/binutils/gas/doc/c-i386.texi @@ -76,6 +76,49 @@ character, which means that it cannot be used in expressions. The not disable @samp{/} at the beginning of a line starting a comment, or affect using @samp{#} for starting a comment. +@cindex @samp{-march=} option, i386 +@cindex @samp{-march=} option, x86-64 +@item -march=@var{CPU} +This option specifies an instruction set architecture for generating +instructions. The following architectures are recognized: +@code{i8086}, +@code{i186}, +@code{i286}, +@code{i386}, +@code{i486}, +@code{i586}, +@code{i686}, +@code{pentium}, +@code{pentiumpro}, +@code{pentiumii}, +@code{pentiumiii}, +@code{pentium4}, +@code{prescott}, +@code{nocona}, +@code{core}, +@code{core2}, +@code{k6}, +@code{k6_2}, +@code{athlon}, +@code{sledgehammer}, +@code{opteron}, +@code{k8}, +@code{generic32} and +@code{generic64}. + +This option only affects instructions generated by the assembler. The +@code{.arch} directive will take precedent. + +@cindex @samp{-mtune=} option, i386 +@cindex @samp{-mtune=} option, x86-64 +@item -mtune=@var{CPU} +This option specifies a processor to optimize for. When used in +conjunction with the @option{-march} option, only instructions +of the processor specified by the @option{-march} option will be +generated. + +Valid @var{CPU} values are identical to @option{-march=@var{CPU}}. + @end table @node i386-Syntax @@ -604,7 +647,7 @@ then stores the result in the 4 byte location @samp{mem}) @code{@value{AS}} supports Intel's MMX instruction set (SIMD instructions for integer data), available on Intel's Pentium MMX processors and Pentium II processors, AMD's K6 and K6-2 processors, -Cyrix' M2 processor, and probably others. It also supports AMD's 3DNow! +Cyrix' M2 processor, and probably others. It also supports AMD's 3DNow!@: instruction set (SIMD instructions for 32-bit floating point data) available on AMD's K6-2 processor and possibly others in the future. @@ -667,7 +710,7 @@ value @samp{4} onto the stack, decrementing @samp{%esp} by 2. @end smallexample The same code in a 16-bit code section would generate the machine -opcode bytes @samp{6a 04} (ie. without the operand size prefix), which +opcode bytes @samp{6a 04} (i.e., without the operand size prefix), which is correct since the processor default operand size is assumed to be 16 bits in a 16-bit code section. @@ -709,8 +752,13 @@ supported on the CPU specified. The choices for @var{cpu_type} are: @item @samp{i8086} @tab @samp{i186} @tab @samp{i286} @tab @samp{i386} @item @samp{i486} @tab @samp{i586} @tab @samp{i686} @tab @samp{pentium} @item @samp{pentiumpro} @tab @samp{pentiumii} @tab @samp{pentiumiii} @tab @samp{pentium4} -@item @samp{k6} @tab @samp{athlon} @samp{sledgehammer} -@item @samp{.mmx} @samp{.sse} @samp{.sse2} @samp{.sse3} @samp{.3dnow} +@item @samp{prescott} @tab @samp{nocona} @tab @samp{core} @tab @samp{core2} +@item @samp{amdfam10} +@item @samp{k6} @tab @samp{athlon} @tab @samp{sledgehammer} @tab @samp{k8} +@item @samp{.mmx} @tab @samp{.sse} @tab @samp{.sse2} @tab @samp{.sse3} +@item @samp{.ssse3} @tab @samp{.sse4.1} @tab @samp{.sse4.2} @tab @samp{.sse4} +@item @samp{.sse4a} @tab @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.padlock} +@item @samp{.pacifica} @tab @samp{.svme} @tab @samp{.abm} @end multitable Apart from the warning, there are only two other effects on diff --git a/contrib/binutils/gas/doc/c-mips.texi b/contrib/binutils/gas/doc/c-mips.texi index 3c70ff29bc0..f92cb0098d5 100644 --- a/contrib/binutils/gas/doc/c-mips.texi +++ b/contrib/binutils/gas/doc/c-mips.texi @@ -60,6 +60,18 @@ little-endian output at run time (unlike the other @sc{gnu} development tools, which must be configured for one or the other). Use @samp{-EB} to select big-endian output, and @samp{-EL} for little-endian. +@item -KPIC +@cindex PIC selection, MIPS +@cindex @option{-KPIC} option, MIPS +Generate SVR4-style PIC. This option tells the assembler to generate +SVR4-style position-independent macro expansions. It also tells the +assembler to mark the output file as PIC. + +@item -mvxworks-pic +@cindex @option{-mvxworks-pic} option, MIPS +Generate VxWorks PIC. This option tells the assembler to generate +VxWorks-style position-independent macro expansions. + @cindex MIPS architecture options @item -mips1 @itemx -mips2 @@ -91,21 +103,38 @@ flags force a certain group of registers to be treated as 32 bits wide at all times. @samp{-mgp32} controls the size of general-purpose registers and @samp{-mfp32} controls the size of floating-point registers. +The @code{.set gp=32} and @code{.set fp=32} directives allow the size +of registers to be changed for parts of an object. The default value is +restored by @code{.set gp=default} and @code{.set fp=default}. + On some MIPS variants there is a 32-bit mode flag; when this flag is set, 64-bit instructions generate a trap. Also, some 32-bit OSes only save the 32-bit registers on a context switch, so it is essential never to use the 64-bit registers. @item -mgp64 -Assume that 64-bit general purpose registers are available. This is -provided in the interests of symmetry with -gp32. +@itemx -mfp64 +Assume that 64-bit registers are available. This is provided in the +interests of symmetry with @samp{-mgp32} and @samp{-mfp32}. + +The @code{.set gp=64} and @code{.set fp=64} directives allow the size +of registers to be changed for parts of an object. The default value is +restored by @code{.set gp=default} and @code{.set fp=default}. @item -mips16 @itemx -no-mips16 Generate code for the MIPS 16 processor. This is equivalent to putting -@samp{.set mips16} at the start of the assembly file. @samp{-no-mips16} +@code{.set mips16} at the start of the assembly file. @samp{-no-mips16} turns off this option. +@item -msmartmips +@itemx -mno-smartmips +Enables the SmartMIPS extensions to the MIPS32 instruction set, which +provides a number of new instructions which target smartcard and +cryptographic applications. This is equivalent to putting +@code{.set smartmips} at the start of the assembly file. +@samp{-mno-smartmips} turns off this option. + @item -mips3d @itemx -no-mips3d Generate code for the MIPS-3D Application Specific Extension. @@ -120,10 +149,17 @@ This tells the assembler to accept MDMX instructions. @item -mdsp @itemx -mno-dsp -Generate code for the DSP Application Specific Extension. -This tells the assembler to accept DSP instructions. +Generate code for the DSP Release 1 Application Specific Extension. +This tells the assembler to accept DSP Release 1 instructions. @samp{-mno-dsp} turns off this option. +@item -mdspr2 +@itemx -mno-dspr2 +Generate code for the DSP Release 2 Application Specific Extension. +This option implies -mdsp. +This tells the assembler to accept DSP Release 2 instructions. +@samp{-mno-dspr2} turns off this option. + @item -mmt @itemx -mno-mt Generate code for the MT Application Specific Extension. @@ -202,8 +238,34 @@ rm7000, rm9000, 10000, 12000, -mips32-4k, -sb1 +4kc, +4km, +4kp, +4ksc, +4kec, +4kem, +4kep, +4ksd, +m4k, +m4kp, +24kc, +24kf, +24kx, +24kec, +24kef, +24kex, +34kc, +34kf, +34kx, +74kc, +74kf, +74kx, +5kc, +5kf, +20kc, +25kf, +sb1, +sb1a @end quotation @item -mtune=@var{cpu} @@ -391,13 +453,21 @@ assembly. @code{.set mips@var{n}} affects not only which instructions are permitted, but also how certain macros are expanded. @code{.set mips0} restores the @sc{isa} level to its original level: either the level you selected with command line options, or the default for your -configuration. You can use this feature to permit specific @sc{r4000} +configuration. You can use this feature to permit specific @sc{mips3} instructions while assembling in 32 bit mode. Use this directive with care! -The directive @samp{.set mips16} puts the assembler into MIPS 16 mode, +@cindex MIPS CPU override +@kindex @code{.set arch=@var{cpu}} +The @code{.set arch=@var{cpu}} directive provides even finer control. +It changes the effective CPU target and allows the assembler to use +instructions specific to a particular CPU. All CPUs supported by the +@samp{-march} command line option are also selectable by this directive. +The original value is restored by @code{.set arch=default}. + +The directive @code{.set mips16} puts the assembler into MIPS 16 mode, in which it will assemble instructions for the MIPS 16 processor. Use -@samp{.set nomips16} to return to normal 32 bit mode. +@code{.set nomips16} to return to normal 32 bit mode. Traditional @sc{mips} assemblers do not support this directive. @@ -407,10 +477,10 @@ Traditional @sc{mips} assemblers do not support this directive. @kindex @code{.set autoextend} @kindex @code{.set noautoextend} By default, MIPS 16 instructions are automatically extended to 32 bits -when necessary. The directive @samp{.set noautoextend} will turn this -off. When @samp{.set noautoextend} is in effect, any 32 bit instruction -must be explicitly extended with the @samp{.e} modifier (e.g., -@samp{li.e $4,1000}). The directive @samp{.set autoextend} may be used +when necessary. The directive @code{.set noautoextend} will turn this +off. When @code{.set noautoextend} is in effect, any 32 bit instruction +must be explicitly extended with the @code{.e} modifier (e.g., +@code{li.e $4,1000}). The directive @code{.set autoextend} may be used to once again automatically extend instructions when necessary. This directive is only meaningful when in MIPS 16 mode. Traditional @@ -455,6 +525,15 @@ from the MIPS-3D Application Specific Extension from that point on in the assembly. The @code{.set nomips3d} directive prevents MIPS-3D instructions from being accepted. +@cindex SmartMIPS instruction generation override +@kindex @code{.set smartmips} +@kindex @code{.set nosmartmips} +The directive @code{.set smartmips} makes the assembler accept +instructions from the SmartMIPS Application Specific Extension to the +MIPS32 @sc{isa} from that point on in the assembly. The +@code{.set nosmartmips} directive prevents SmartMIPS instructions from +being accepted. + @cindex MIPS MDMX instruction generation override @kindex @code{.set mdmx} @kindex @code{.set nomdmx} @@ -463,13 +542,22 @@ from the MDMX Application Specific Extension from that point on in the assembly. The @code{.set nomdmx} directive prevents MDMX instructions from being accepted. -@cindex MIPS DSP instruction generation override +@cindex MIPS DSP Release 1 instruction generation override @kindex @code{.set dsp} @kindex @code{.set nodsp} The directive @code{.set dsp} makes the assembler accept instructions -from the DSP Application Specific Extension from that point on -in the assembly. The @code{.set nodsp} directive prevents DSP -instructions from being accepted. +from the DSP Release 1 Application Specific Extension from that point +on in the assembly. The @code{.set nodsp} directive prevents DSP +Release 1 instructions from being accepted. + +@cindex MIPS DSP Release 2 instruction generation override +@kindex @code{.set dspr2} +@kindex @code{.set nodspr2} +The directive @code{.set dspr2} makes the assembler accept instructions +from the DSP Release 2 Application Specific Extension from that point +on in the assembly. This dirctive implies @code{.set dsp}. The +@code{.set nodspr2} directive prevents DSP Release 2 instructions from +being accepted. @cindex MIPS MT instruction generation override @kindex @code{.set mt} diff --git a/contrib/binutils/gas/doc/c-ppc.texi b/contrib/binutils/gas/doc/c-ppc.texi index 4c9c096c055..a41e1dd5f9a 100644 --- a/contrib/binutils/gas/doc/c-ppc.texi +++ b/contrib/binutils/gas/doc/c-ppc.texi @@ -1,4 +1,4 @@ -@c Copyright 2001, 2002, 2003, 2005 +@c Copyright 2001, 2002, 2003, 2005, 2006 @c Free Software Foundation, Inc. @c This is part of the GAS manual. @c For copying conditions, see the file as.texinfo. @@ -58,6 +58,12 @@ Generate code for PowerPC 7400/7410/7450/7455. @item -mppc64, -m620 Generate code for PowerPC 620/625/630. +@item -me500, -me500x2 +Generate code for Motorola e500 core complex. + +@item -mspe +Generate code for Motorola SPE instructions. + @item -mppc64bridge Generate code for PowerPC 64, including bridge insns. @@ -79,6 +85,12 @@ Generate code for Power4 architecture. @item -mpower5 Generate code for Power5 architecture. +@item -mpower6 +Generate code for Power6 architecture. + +@item -mcell +Generate code for Cell Broadband Engine architecture. + @item -mcom Generate code Power/PowerPC common instructions. @@ -92,10 +104,10 @@ Allow symbolic names for registers. Do not allow symbolic names for registers. @item -mrelocatable -Support for GCC's -mrelocatble option. +Support for GCC's -mrelocatable option. @item -mrelocatable-lib -Support for GCC's -mrelocatble-lib option. +Support for GCC's -mrelocatable-lib option. @item -memb Set PPC_EMB bit in ELF flags. diff --git a/contrib/binutils/gas/doc/gasver.texi b/contrib/binutils/gas/doc/gasver.texi deleted file mode 100644 index 11d1801d6e6..00000000000 --- a/contrib/binutils/gas/doc/gasver.texi +++ /dev/null @@ -1 +0,0 @@ -@set VERSION 2.17 diff --git a/contrib/binutils/gas/doc/internals.texi b/contrib/binutils/gas/doc/internals.texi index dffdb1e04fa..c63a2dbd770 100644 --- a/contrib/binutils/gas/doc/internals.texi +++ b/contrib/binutils/gas/doc/internals.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -@c 2001, 2002, 2003, 2004, 2005 +@c 2001, 2002, 2003, 2004, 2005, 2006 @c Free Software Foundation, Inc. @setfilename internals.info @node Top @@ -838,7 +838,7 @@ GAS will call @code{md_parse_option} whenever @code{getopt} returns an unrecognized code, presumably indicating a special code value which appears in @code{md_longopts}. This function should return non-zero if it handled the option and zero otherwise. There is no need to print a message about an option -not being recognised. This will be handled by the generic code. +not being recognized. This will be handled by the generic code. GAS will call @code{md_show_usage} when a usage message is printed; it should print a description of the machine specific options. @code{md_after_pase_args}, @@ -891,7 +891,7 @@ If this macro is defined, GAS will use it instead of @code{comment_chars}. @cindex tc_symbol_chars If this macro is defined, it is a pointer to a null terminated list of characters which may appear in an operand. GAS already assumes that all -alphanumberic characters, and @samp{$}, @samp{.}, and @samp{_} may appear in an +alphanumeric characters, and @samp{$}, @samp{.}, and @samp{_} may appear in an operand (see @samp{symbol_chars} in @file{app.c}). This macro may be defined to treat additional characters as appearing in an operand. This affects the way in which GAS removes whitespace before passing the string to @@ -1279,7 +1279,7 @@ absolute symbol. If undefined, @code{TC_FORCE_RELOCATION} will be used. @cindex TC_FORCE_RELOCATION_LOCAL Like @code{TC_FORCE_RELOCATION}, but used only for fixup expressions against a symbol in the current section. If undefined, fixups that are not -@code{fx_pcrel} or @code{fx_plt} or for which @code{TC_FORCE_RELOCATION} +@code{fx_pcrel} or for which @code{TC_FORCE_RELOCATION} returns non-zero, will emit relocs. @item TC_FORCE_RELOCATION_SUB_SAME (@var{fix}, @var{seg}) @@ -1609,7 +1609,7 @@ symbol's flags. @item obj_clear_weak_hook @cindex obj_clear_weak_hook -If you define this macro, @code{S_CLEAR_WEAKREFD} will call it after clearning +If you define this macro, @code{S_CLEAR_WEAKREFD} will call it after cleaning the @code{weakrefd} flag, but before modifying any other flags. @item obj_frob_file @@ -1844,10 +1844,6 @@ Returns non-zero if any warnings or errors, respectively, have been printed during this invocation. @end deftypefun -@deftypefun @{@} void as_perror (const char *@var{gripe}, const char *@var{filename}) -Displays a BFD or system error, then clears the error status. -@end deftypefun - @deftypefun @{@} void as_tsktsk (const char *@var{format}, ...) @deftypefunx @{@} void as_warn (const char *@var{format}, ...) @deftypefunx @{@} void as_bad (const char *@var{format}, ...) diff --git a/contrib/binutils/gas/dw2gencfi.c b/contrib/binutils/gas/dw2gencfi.c index bfa5d5cf45a..97e12377e76 100644 --- a/contrib/binutils/gas/dw2gencfi.c +++ b/contrib/binutils/gas/dw2gencfi.c @@ -21,6 +21,7 @@ #include "as.h" #include "dw2gencfi.h" +#include "subsegs.h" /* We re-use DWARF2_LINE_MIN_INSN_LENGTH for the code alignment field @@ -87,6 +88,10 @@ struct fde_entry symbolS *end_address; struct cfi_insn_data *data; struct cfi_insn_data **last; + unsigned char per_encoding; + unsigned char lsda_encoding; + expressionS personality; + expressionS lsda; unsigned int return_column; unsigned int signal_frame; }; @@ -97,15 +102,13 @@ struct cie_entry symbolS *start_address; unsigned int return_column; unsigned int signal_frame; + unsigned char per_encoding; + unsigned char lsda_encoding; + expressionS personality; struct cfi_insn_data *first, *last; }; -/* Current open FDE entry. */ -static struct fde_entry *cur_fde_data; -static symbolS *last_address; -static offsetT cur_cfa_offset; - /* List of FDE entries. */ static struct fde_entry *all_fde_data; static struct fde_entry **last_fde_data = &all_fde_data; @@ -120,7 +123,14 @@ struct cfa_save_data offsetT cfa_offset; }; -static struct cfa_save_data *cfa_save_stack; +/* Current open FDE entry. */ +struct frch_cfi_data +{ + struct fde_entry *cur_fde_data; + symbolS *last_address; + offsetT cur_cfa_offset; + struct cfa_save_data *cfa_save_stack; +}; /* Construct a new FDE structure and add it to the end of the fde list. */ @@ -129,12 +139,15 @@ alloc_fde_entry (void) { struct fde_entry *fde = xcalloc (1, sizeof (struct fde_entry)); - cur_fde_data = fde; + frchain_now->frch_cfi_data = xcalloc (1, sizeof (struct frch_cfi_data)); + frchain_now->frch_cfi_data->cur_fde_data = fde; *last_fde_data = fde; last_fde_data = &fde->next; fde->last = &fde->data; fde->return_column = DWARF2_DEFAULT_RETURN_COLUMN; + fde->per_encoding = DW_EH_PE_omit; + fde->lsda_encoding = DW_EH_PE_omit; return fde; } @@ -149,6 +162,7 @@ static struct cfi_insn_data * alloc_cfi_insn_data (void) { struct cfi_insn_data *insn = xcalloc (1, sizeof (struct cfi_insn_data)); + struct fde_entry *cur_fde_data = frchain_now->frch_cfi_data->cur_fde_data; *cur_fde_data->last = insn; cur_fde_data->last = &insn->next; @@ -163,7 +177,7 @@ cfi_new_fde (symbolS *label) { struct fde_entry *fde = alloc_fde_entry (); fde->start_address = label; - last_address = label; + frchain_now->frch_cfi_data->last_address = label; } /* End the currently open FDE. */ @@ -171,8 +185,9 @@ cfi_new_fde (symbolS *label) void cfi_end_fde (symbolS *label) { - cur_fde_data->end_address = label; - cur_fde_data = NULL; + frchain_now->frch_cfi_data->cur_fde_data->end_address = label; + free (frchain_now->frch_cfi_data); + frchain_now->frch_cfi_data = NULL; } /* Set the return column for the current FDE. */ @@ -180,7 +195,7 @@ cfi_end_fde (symbolS *label) void cfi_set_return_column (unsigned regno) { - cur_fde_data->return_column = regno; + frchain_now->frch_cfi_data->cur_fde_data->return_column = regno; } /* Universal functions to store new instructions. */ @@ -239,10 +254,10 @@ cfi_add_advance_loc (symbolS *label) struct cfi_insn_data *insn = alloc_cfi_insn_data (); insn->insn = DW_CFA_advance_loc; - insn->u.ll.lab1 = last_address; + insn->u.ll.lab1 = frchain_now->frch_cfi_data->last_address; insn->u.ll.lab2 = label; - last_address = label; + frchain_now->frch_cfi_data->last_address = label; } /* Add a DW_CFA_offset record to the CFI data. */ @@ -252,6 +267,7 @@ cfi_add_CFA_offset (unsigned regno, offsetT offset) { unsigned int abs_data_align; + assert (DWARF2_CIE_DATA_ALIGNMENT != 0); cfi_add_CFA_insn_reg_offset (DW_CFA_offset, regno, offset); abs_data_align = (DWARF2_CIE_DATA_ALIGNMENT < 0 @@ -266,7 +282,7 @@ void cfi_add_CFA_def_cfa (unsigned regno, offsetT offset) { cfi_add_CFA_insn_reg_offset (DW_CFA_def_cfa, regno, offset); - cur_cfa_offset = offset; + frchain_now->frch_cfi_data->cur_cfa_offset = offset; } /* Add a DW_CFA_register record to the CFI data. */ @@ -291,7 +307,7 @@ void cfi_add_CFA_def_cfa_offset (offsetT offset) { cfi_add_CFA_insn_offset (DW_CFA_def_cfa_offset, offset); - cur_cfa_offset = offset; + frchain_now->frch_cfi_data->cur_cfa_offset = offset; } void @@ -320,9 +336,9 @@ cfi_add_CFA_remember_state (void) cfi_add_CFA_insn (DW_CFA_remember_state); p = xmalloc (sizeof (*p)); - p->cfa_offset = cur_cfa_offset; - p->next = cfa_save_stack; - cfa_save_stack = p; + p->cfa_offset = frchain_now->frch_cfi_data->cur_cfa_offset; + p->next = frchain_now->frch_cfi_data->cfa_save_stack; + frchain_now->frch_cfi_data->cfa_save_stack = p; } void @@ -332,11 +348,11 @@ cfi_add_CFA_restore_state (void) cfi_add_CFA_insn (DW_CFA_restore_state); - p = cfa_save_stack; + p = frchain_now->frch_cfi_data->cfa_save_stack; if (p) { - cur_cfa_offset = p->cfa_offset; - cfa_save_stack = p->next; + frchain_now->frch_cfi_data->cur_cfa_offset = p->cfa_offset; + frchain_now->frch_cfi_data->cfa_save_stack = p->next; free (p); } else @@ -350,6 +366,8 @@ static void dot_cfi (int); static void dot_cfi_escape (int); static void dot_cfi_startproc (int); static void dot_cfi_endproc (int); +static void dot_cfi_personality (int); +static void dot_cfi_lsda (int); /* Fake CFI type; outside the byte range of any real CFI insn. */ #define CFI_adjust_cfa_offset 0x100 @@ -378,6 +396,8 @@ const pseudo_typeS cfi_pseudo_table[] = { "cfi_window_save", dot_cfi, DW_CFA_GNU_window_save }, { "cfi_escape", dot_cfi_escape, 0 }, { "cfi_signal_frame", dot_cfi, CFI_signal_frame }, + { "cfi_personality", dot_cfi_personality, 0 }, + { "cfi_lsda", dot_cfi_lsda, 0 }, { NULL, NULL, 0 } }; @@ -448,7 +468,7 @@ dot_cfi (int arg) offsetT offset; unsigned reg1, reg2; - if (!cur_fde_data) + if (frchain_now->frch_cfi_data == NULL) { as_bad (_("CFI instruction used without previous .cfi_startproc")); ignore_rest_of_line (); @@ -456,8 +476,9 @@ dot_cfi (int arg) } /* If the last address was not at the current PC, advance to current. */ - if (symbol_get_frag (last_address) != frag_now - || S_GET_VALUE (last_address) != frag_now_fix ()) + if (symbol_get_frag (frchain_now->frch_cfi_data->last_address) != frag_now + || S_GET_VALUE (frchain_now->frch_cfi_data->last_address) + != frag_now_fix ()) cfi_add_advance_loc (symbol_temp_new_now ()); switch (arg) @@ -473,7 +494,8 @@ dot_cfi (int arg) reg1 = cfi_parse_reg (); cfi_parse_separator (); offset = cfi_parse_const (); - cfi_add_CFA_offset (reg1, offset - cur_cfa_offset); + cfi_add_CFA_offset (reg1, + offset - frchain_now->frch_cfi_data->cur_cfa_offset); break; case DW_CFA_def_cfa: @@ -502,7 +524,8 @@ dot_cfi (int arg) case CFI_adjust_cfa_offset: offset = cfi_parse_const (); - cfi_add_CFA_def_cfa_offset (cur_cfa_offset + offset); + cfi_add_CFA_def_cfa_offset (frchain_now->frch_cfi_data->cur_cfa_offset + + offset); break; case DW_CFA_restore: @@ -552,7 +575,7 @@ dot_cfi (int arg) break; case CFI_signal_frame: - cur_fde_data->signal_frame = 1; + frchain_now->frch_cfi_data->cur_fde_data->signal_frame = 1; break; default: @@ -568,7 +591,7 @@ dot_cfi_escape (int ignored ATTRIBUTE_UNUSED) struct cfi_escape_data *head, **tail, *e; struct cfi_insn_data *insn; - if (!cur_fde_data) + if (frchain_now->frch_cfi_data == NULL) { as_bad (_("CFI instruction used without previous .cfi_startproc")); ignore_rest_of_line (); @@ -576,8 +599,9 @@ dot_cfi_escape (int ignored ATTRIBUTE_UNUSED) } /* If the last address was not at the current PC, advance to current. */ - if (symbol_get_frag (last_address) != frag_now - || S_GET_VALUE (last_address) != frag_now_fix ()) + if (symbol_get_frag (frchain_now->frch_cfi_data->last_address) != frag_now + || S_GET_VALUE (frchain_now->frch_cfi_data->last_address) + != frag_now_fix ()) cfi_add_advance_loc (symbol_temp_new_now ()); tail = &head; @@ -599,12 +623,154 @@ dot_cfi_escape (int ignored ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +static void +dot_cfi_personality (int ignored ATTRIBUTE_UNUSED) +{ + struct fde_entry *fde; + offsetT encoding; + + if (frchain_now->frch_cfi_data == NULL) + { + as_bad (_("CFI instruction used without previous .cfi_startproc")); + ignore_rest_of_line (); + return; + } + + fde = frchain_now->frch_cfi_data->cur_fde_data; + encoding = get_absolute_expression (); + if (encoding == DW_EH_PE_omit) + { + demand_empty_rest_of_line (); + fde->per_encoding = encoding; + return; + } + + if ((encoding & 0xff) != encoding + || ((encoding & 0x70) != 0 +#if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr + && (encoding & 0x70) != DW_EH_PE_pcrel +#endif + ) + /* leb128 can be handled, but does something actually need it? */ + || (encoding & 7) == DW_EH_PE_uleb128 + || (encoding & 7) > DW_EH_PE_udata8) + { + as_bad (_("invalid or unsupported encoding in .cfi_personality")); + ignore_rest_of_line (); + return; + } + + if (*input_line_pointer++ != ',') + { + as_bad (_(".cfi_personality requires encoding and symbol arguments")); + ignore_rest_of_line (); + return; + } + + expression_and_evaluate (&fde->personality); + switch (fde->personality.X_op) + { + case O_symbol: + break; + case O_constant: + if ((encoding & 0x70) == DW_EH_PE_pcrel) + encoding = DW_EH_PE_omit; + break; + default: + encoding = DW_EH_PE_omit; + break; + } + + fde->per_encoding = encoding; + + if (encoding == DW_EH_PE_omit) + { + as_bad (_("wrong second argument to .cfi_personality")); + ignore_rest_of_line (); + return; + } + + demand_empty_rest_of_line (); +} + +static void +dot_cfi_lsda (int ignored ATTRIBUTE_UNUSED) +{ + struct fde_entry *fde; + offsetT encoding; + + if (frchain_now->frch_cfi_data == NULL) + { + as_bad (_("CFI instruction used without previous .cfi_startproc")); + ignore_rest_of_line (); + return; + } + + fde = frchain_now->frch_cfi_data->cur_fde_data; + encoding = get_absolute_expression (); + if (encoding == DW_EH_PE_omit) + { + demand_empty_rest_of_line (); + fde->lsda_encoding = encoding; + return; + } + + if ((encoding & 0xff) != encoding + || ((encoding & 0x70) != 0 +#if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr + && (encoding & 0x70) != DW_EH_PE_pcrel +#endif + ) + /* leb128 can be handled, but does something actually need it? */ + || (encoding & 7) == DW_EH_PE_uleb128 + || (encoding & 7) > DW_EH_PE_udata8) + { + as_bad (_("invalid or unsupported encoding in .cfi_lsda")); + ignore_rest_of_line (); + return; + } + + if (*input_line_pointer++ != ',') + { + as_bad (_(".cfi_lsda requires encoding and symbol arguments")); + ignore_rest_of_line (); + return; + } + + fde->lsda_encoding = encoding; + + expression_and_evaluate (&fde->lsda); + switch (fde->lsda.X_op) + { + case O_symbol: + break; + case O_constant: + if ((encoding & 0x70) == DW_EH_PE_pcrel) + encoding = DW_EH_PE_omit; + break; + default: + encoding = DW_EH_PE_omit; + break; + } + + fde->lsda_encoding = encoding; + + if (encoding == DW_EH_PE_omit) + { + as_bad (_("wrong second argument to .cfi_lsda")); + ignore_rest_of_line (); + return; + } + + demand_empty_rest_of_line (); +} + static void dot_cfi_startproc (int ignored ATTRIBUTE_UNUSED) { int simple = 0; - if (cur_fde_data) + if (frchain_now->frch_cfi_data != NULL) { as_bad (_("previous CFI entry not closed (missing .cfi_endproc)")); ignore_rest_of_line (); @@ -631,7 +797,7 @@ dot_cfi_startproc (int ignored ATTRIBUTE_UNUSED) } demand_empty_rest_of_line (); - cur_cfa_offset = 0; + frchain_now->frch_cfi_data->cur_cfa_offset = 0; if (!simple) tc_cfi_frame_initial_instructions (); } @@ -639,7 +805,7 @@ dot_cfi_startproc (int ignored ATTRIBUTE_UNUSED) static void dot_cfi_endproc (int ignored ATTRIBUTE_UNUSED) { - if (! cur_fde_data) + if (frchain_now->frch_cfi_data == NULL) { as_bad (_(".cfi_endproc without corresponding .cfi_startproc")); ignore_rest_of_line (); @@ -714,18 +880,18 @@ output_cfi_insn (struct cfi_insn_data *insn) out_one (DW_CFA_advance_loc + scaled); else if (delta <= 0xFF) { - out_one (DW_CFA_advance_loc1); - out_one (delta); + out_one (DW_CFA_advance_loc1); + out_one (delta); } else if (delta <= 0xFFFF) { - out_one (DW_CFA_advance_loc2); - out_two (delta); + out_one (DW_CFA_advance_loc2); + out_two (delta); } else { - out_one (DW_CFA_advance_loc4); - out_four (delta); + out_one (DW_CFA_advance_loc4); + out_four (delta); } } else @@ -850,12 +1016,33 @@ output_cfi_insn (struct cfi_insn_data *insn) } } +static offsetT +encoding_size (unsigned char encoding) +{ + if (encoding == DW_EH_PE_omit) + return 0; + switch (encoding & 0x7) + { + case 0: + return bfd_get_arch_size (stdoutput) == 64 ? 8 : 4; + case DW_EH_PE_udata2: + return 2; + case DW_EH_PE_udata4: + return 4; + case DW_EH_PE_udata8: + return 8; + default: + abort (); + } +} + static void output_cie (struct cie_entry *cie) { symbolS *after_size_address, *end_address; expressionS exp; struct cfi_insn_data *i; + offsetT augmentation_size; cie->start_address = symbol_temp_new_now (); after_size_address = symbol_temp_make (); @@ -871,6 +1058,10 @@ output_cie (struct cie_entry *cie) out_four (0); /* CIE id. */ out_one (DW_CIE_VERSION); /* Version. */ out_one ('z'); /* Augmentation. */ + if (cie->per_encoding != DW_EH_PE_omit) + out_one ('P'); + if (cie->lsda_encoding != DW_EH_PE_omit) + out_one ('L'); out_one ('R'); if (cie->signal_frame) out_one ('S'); @@ -881,7 +1072,32 @@ output_cie (struct cie_entry *cie) out_one (cie->return_column); else out_uleb128 (cie->return_column); - out_uleb128 (1); /* Augmentation size. */ + augmentation_size = 1 + (cie->lsda_encoding != DW_EH_PE_omit); + if (cie->per_encoding != DW_EH_PE_omit) + augmentation_size += 1 + encoding_size (cie->per_encoding); + out_uleb128 (augmentation_size); /* Augmentation size. */ + if (cie->per_encoding != DW_EH_PE_omit) + { + offsetT size = encoding_size (cie->per_encoding); + out_one (cie->per_encoding); + exp = cie->personality; + if ((cie->per_encoding & 0x70) == DW_EH_PE_pcrel) + { +#ifdef DIFF_EXPR_OK + exp.X_op = O_subtract; + exp.X_op_symbol = symbol_temp_new_now (); + emit_expr (&exp, size); +#elif defined (tc_cfi_emit_pcrel_expr) + tc_cfi_emit_pcrel_expr (&exp, size); +#else + abort (); +#endif + } + else + emit_expr (&exp, size); + } + if (cie->lsda_encoding != DW_EH_PE_omit) + out_one (cie->lsda_encoding); #if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr out_one (DW_EH_PE_pcrel | DW_EH_PE_sdata4); #else @@ -902,6 +1118,7 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie, { symbolS *after_size_address, *end_address; expressionS exp; + offsetT augmentation_size; after_size_address = symbol_temp_make (); end_address = symbol_temp_make (); @@ -917,7 +1134,7 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie, exp.X_op_symbol = cie->start_address; emit_expr (&exp, 4); /* CIE offset. */ -#ifdef DIFF_EXPR_OK +#ifdef DIFF_EXPR_OK exp.X_add_symbol = fde->start_address; exp.X_op_symbol = symbol_temp_new_now (); emit_expr (&exp, 4); /* Code offset. */ @@ -937,7 +1154,27 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie, exp.X_op_symbol = fde->start_address; /* Code length. */ emit_expr (&exp, 4); - out_uleb128 (0); /* Augmentation size. */ + augmentation_size = encoding_size (fde->lsda_encoding); + out_uleb128 (augmentation_size); /* Augmentation size. */ + + if (fde->lsda_encoding != DW_EH_PE_omit) + { + exp = fde->lsda; + if ((fde->lsda_encoding & 0x70) == DW_EH_PE_pcrel) + { +#ifdef DIFF_EXPR_OK + exp.X_op = O_subtract; + exp.X_op_symbol = symbol_temp_new_now (); + emit_expr (&exp, augmentation_size); +#elif defined (tc_cfi_emit_pcrel_expr) + tc_cfi_emit_pcrel_expr (&exp, augmentation_size); +#else + abort (); +#endif + } + else + emit_expr (&exp, augmentation_size); + } for (; first; first = first->next) output_cfi_insn (first); @@ -955,8 +1192,31 @@ select_cie_for_fde (struct fde_entry *fde, struct cfi_insn_data **pfirst) for (cie = cie_root; cie; cie = cie->next) { if (cie->return_column != fde->return_column - || cie->signal_frame != fde->signal_frame) + || cie->signal_frame != fde->signal_frame + || cie->per_encoding != fde->per_encoding + || cie->lsda_encoding != fde->lsda_encoding) continue; + if (cie->per_encoding != DW_EH_PE_omit) + { + if (cie->personality.X_op != fde->personality.X_op + || cie->personality.X_add_number + != fde->personality.X_add_number) + continue; + switch (cie->personality.X_op) + { + case O_constant: + if (cie->personality.X_unsigned != fde->personality.X_unsigned) + continue; + break; + case O_symbol: + if (cie->personality.X_add_symbol + != fde->personality.X_add_symbol) + continue; + break; + default: + abort (); + } + } for (i = cie->first, j = fde->data; i != cie->last && j != NULL; i = i->next, j = j->next) @@ -1029,6 +1289,9 @@ select_cie_for_fde (struct fde_entry *fde, struct cfi_insn_data **pfirst) cie_root = cie; cie->return_column = fde->return_column; cie->signal_frame = fde->signal_frame; + cie->per_encoding = fde->per_encoding; + cie->lsda_encoding = fde->lsda_encoding; + cie->personality = fde->personality; cie->first = fde->data; for (i = cie->first; i ; i = i->next) @@ -1052,12 +1315,6 @@ cfi_finish (void) struct fde_entry *fde; int save_flag_traditional_format; - if (cur_fde_data) - { - as_bad (_("open CFI at the end of file; missing .cfi_endproc directive")); - cur_fde_data->end_address = cur_fde_data->start_address; - } - if (all_fde_data == 0) return; @@ -1077,6 +1334,12 @@ cfi_finish (void) struct cfi_insn_data *first; struct cie_entry *cie; + if (fde->end_address == NULL) + { + as_bad (_("open CFI at the end of file; missing .cfi_endproc directive")); + fde->end_address = fde->start_address; + } + cie = select_cie_for_fde (fde, &first); output_fde (fde, cie, first, fde->next == NULL ? EH_FRAME_ALIGNMENT : 2); } diff --git a/contrib/binutils/gas/dwarf2dbg.c b/contrib/binutils/gas/dwarf2dbg.c index 16666fa4f28..671a9b030d4 100644 --- a/contrib/binutils/gas/dwarf2dbg.c +++ b/contrib/binutils/gas/dwarf2dbg.c @@ -28,7 +28,6 @@ [epilogue_begin] [is_stmt VALUE] [isa VALUE] */ -#include "ansidecl.h" #include "as.h" #include "safe-ctype.h" @@ -46,6 +45,29 @@ #include "dwarf2dbg.h" #include +#ifdef HAVE_DOS_BASED_FILE_SYSTEM +/* We need to decide which character to use as a directory separator. + Just because HAVE_DOS_BASED_FILE_SYSTEM is defined, it does not + necessarily mean that the backslash character is the one to use. + Some environments, eg Cygwin, can support both naming conventions. + So we use the heuristic that we only need to use the backslash if + the path is an absolute path starting with a DOS style drive + selector. eg C: or D: */ +# define INSERT_DIR_SEPARATOR(string, offset) \ + do \ + { \ + if (offset > 1 \ + && string[0] != 0 \ + && string[1] == ':') \ + string [offset] = '\\'; \ + else \ + string [offset] = '/'; \ + } \ + while (0) +#else +# define INSERT_DIR_SEPARATOR(string, offset) string[offset] = '/' +#endif + #ifndef DWARF2_FORMAT # define DWARF2_FORMAT() dwarf2_format_32bit #endif @@ -66,6 +88,13 @@ #define DL_FILES 1 #define DL_BODY 2 +/* If linker relaxation might change offsets in the code, the DWARF special + opcodes and variable-length operands cannot be used. If this macro is + nonzero, use the DW_LNS_fixed_advance_pc opcode instead. */ +#ifndef DWARF2_USE_FIXED_ADVANCE_PC +# define DWARF2_USE_FIXED_ADVANCE_PC 0 +#endif + /* First special line opcde - leave room for the standard opcodes. Note: If you want to change this, you'll have to update the "standard_opcode_lengths" table that is emitted below in @@ -169,22 +198,22 @@ static void out_two (int); static void out_four (int); static void out_abbrev (int, int); static void out_uleb128 (addressT); -static offsetT get_frag_fix (fragS *); +static void out_sleb128 (addressT); +static offsetT get_frag_fix (fragS *, segT); static void out_set_addr (symbolS *); static int size_inc_line_addr (int, addressT); static void emit_inc_line_addr (int, addressT, char *, int); static void out_inc_line_addr (int, addressT); +static void out_fixed_inc_line_addr (int, symbolS *, symbolS *); static void relax_inc_line_addr (int, symbolS *, symbolS *); static void process_entries (segT, struct line_entry *); static void out_file_list (void); static void out_debug_line (segT); static void out_debug_aranges (segT, segT); static void out_debug_abbrev (segT); -static void out_debug_info (segT, segT, segT); #ifndef TC_DWARF2_EMIT_OFFSET -# define TC_DWARF2_EMIT_OFFSET generic_dwarf2_emit_offset -static void generic_dwarf2_emit_offset (symbolS *, unsigned int); +#define TC_DWARF2_EMIT_OFFSET generic_dwarf2_emit_offset /* Create an offset to .dwarf2_*. */ @@ -569,7 +598,7 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) char *cp = (char *) alloca (dir_len + 1 + file_len + 1); memcpy (cp, dirs[files[filenum].dir], dir_len); - cp[dir_len] = '/'; + INSERT_DIR_SEPARATOR (cp, dir_len); memcpy (cp + dir_len + 1, files[filenum].filename, file_len); cp[dir_len + file_len + 1] = '\0'; listing_source_file (cp); @@ -670,27 +699,18 @@ dwarf2_directive_loc_mark_labels (int dummy ATTRIBUTE_UNUSED) static struct frag * first_frag_for_seg (segT seg) { - frchainS *f, *first = NULL; - - for (f = frchain_root; f; f = f->frch_next) - if (f->frch_seg == seg - && (! first || first->frch_subseg > f->frch_subseg)) - first = f; - - return first ? first->frch_root : NULL; + return seg_info (seg)->frchainP->frch_root; } static struct frag * last_frag_for_seg (segT seg) { - frchainS *f, *last = NULL; + frchainS *f = seg_info (seg)->frchainP; - for (f = frchain_root; f; f = f->frch_next) - if (f->frch_seg == seg - && (! last || last->frch_subseg < f->frch_subseg)) - last= f; + while (f->frch_next != NULL) + f = f->frch_next; - return last ? last->frch_last : NULL; + return f->frch_last; } /* Emit a single byte into the current segment. */ @@ -733,6 +753,14 @@ out_uleb128 (addressT value) output_leb128 (frag_more (sizeof_leb128 (value, 0)), value, 0); } +/* Emit a signed "little-endian base 128" number. */ + +static void +out_sleb128 (addressT value) +{ + output_leb128 (frag_more (sizeof_leb128 (value, 1)), value, 1); +} + /* Emit a tuple for .debug_abbrev. */ static inline void @@ -745,7 +773,7 @@ out_abbrev (int name, int form) /* Get the size of a fragment. */ static offsetT -get_frag_fix (fragS *frag) +get_frag_fix (fragS *frag, segT seg) { frchainS *fr; @@ -755,7 +783,7 @@ get_frag_fix (fragS *frag) /* If a fragment is the last in the chain, special measures must be taken to find its size before relaxation, since it may be pending on some subsegment chain. */ - for (fr = frchain_root; fr; fr = fr->frch_next) + for (fr = seg_info (seg)->frchainP; fr; fr = fr->frch_next) if (fr->frch_last == frag) return (char *) obstack_next_free (&fr->frch_obstack) - frag->fr_literal; @@ -966,6 +994,45 @@ out_inc_line_addr (int line_delta, addressT addr_delta) emit_inc_line_addr (line_delta, addr_delta, frag_more (len), len); } +/* Write out an alternative form of line and address skips using + DW_LNS_fixed_advance_pc opcodes. This uses more space than the default + line and address information, but it helps support linker relaxation that + changes the code offsets. */ + +static void +out_fixed_inc_line_addr (int line_delta, symbolS *to_sym, symbolS *from_sym) +{ + expressionS expr; + + /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence. */ + if (line_delta == INT_MAX) + { + out_opcode (DW_LNS_fixed_advance_pc); + expr.X_op = O_subtract; + expr.X_add_symbol = to_sym; + expr.X_op_symbol = from_sym; + expr.X_add_number = 0; + emit_expr (&expr, 2); + + out_opcode (DW_LNS_extended_op); + out_byte (1); + out_opcode (DW_LNE_end_sequence); + return; + } + + out_opcode (DW_LNS_advance_line); + out_sleb128 (line_delta); + + out_opcode (DW_LNS_fixed_advance_pc); + expr.X_op = O_subtract; + expr.X_add_symbol = to_sym; + expr.X_op_symbol = from_sym; + expr.X_add_number = 0; + emit_expr (&expr, 2); + + out_opcode (DW_LNS_copy); +} + /* Generate a variant frag that we can use to relax address/line increments between fragments of the target segment. */ @@ -1116,6 +1183,8 @@ process_entries (segT seg, struct line_entry *e) out_set_addr (lab); out_inc_line_addr (line_delta, 0); } + else if (DWARF2_USE_FIXED_ADVANCE_PC) + out_fixed_inc_line_addr (line_delta, lab, last_lab); else if (frag == last_frag) out_inc_line_addr (line_delta, frag_ofs - last_frag_ofs); else @@ -1134,8 +1203,13 @@ process_entries (segT seg, struct line_entry *e) /* Emit a DW_LNE_end_sequence for the end of the section. */ frag = last_frag_for_seg (seg); - frag_ofs = get_frag_fix (frag); - if (frag == last_frag) + frag_ofs = get_frag_fix (frag, seg); + if (DWARF2_USE_FIXED_ADVANCE_PC) + { + lab = symbol_temp_new (seg, frag_ofs, frag); + out_fixed_inc_line_addr (INT_MAX, lab, last_lab); + } + else if (frag == last_frag) out_inc_line_addr (INT_MAX, frag_ofs - last_frag_ofs); else { @@ -1277,6 +1351,54 @@ out_debug_line (segT line_seg) symbol_set_value_now (line_end); } +static void +out_debug_ranges (segT ranges_seg) +{ + unsigned int addr_size = sizeof_address; + struct line_seg *s; + expressionS expr; + unsigned int i; + + subseg_set (ranges_seg, 0); + + /* Base Address Entry. */ + for (i = 0; i < addr_size; i++) + out_byte (0xff); + for (i = 0; i < addr_size; i++) + out_byte (0); + + /* Range List Entry. */ + for (s = all_segs; s; s = s->next) + { + fragS *frag; + symbolS *beg, *end; + + frag = first_frag_for_seg (s->seg); + beg = symbol_temp_new (s->seg, 0, frag); + s->text_start = beg; + + frag = last_frag_for_seg (s->seg); + end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag); + s->text_end = end; + + expr.X_op = O_symbol; + expr.X_add_symbol = beg; + expr.X_add_number = 0; + emit_expr (&expr, addr_size); + + expr.X_op = O_symbol; + expr.X_add_symbol = end; + expr.X_add_number = 0; + emit_expr (&expr, addr_size); + } + + /* End of Range Entry. */ + for (i = 0; i < addr_size; i++) + out_byte (0); + for (i = 0; i < addr_size; i++) + out_byte (0); +} + /* Emit data for .debug_aranges. */ static void @@ -1332,7 +1454,7 @@ out_debug_aranges (segT aranges_seg, segT info_seg) s->text_start = beg; frag = last_frag_for_seg (s->seg); - end = symbol_temp_new (s->seg, get_frag_fix (frag), frag); + end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag); s->text_end = end; expr.X_op = O_symbol; @@ -1369,6 +1491,13 @@ out_debug_abbrev (segT abbrev_seg) out_abbrev (DW_AT_low_pc, DW_FORM_addr); out_abbrev (DW_AT_high_pc, DW_FORM_addr); } + else + { + if (DWARF2_FORMAT () == dwarf2_format_32bit) + out_abbrev (DW_AT_ranges, DW_FORM_data4); + else + out_abbrev (DW_AT_ranges, DW_FORM_data8); + } out_abbrev (DW_AT_name, DW_FORM_string); out_abbrev (DW_AT_comp_dir, DW_FORM_string); out_abbrev (DW_AT_producer, DW_FORM_string); @@ -1382,7 +1511,7 @@ out_debug_abbrev (segT abbrev_seg) /* Emit a description of this compilation unit for .debug_info. */ static void -out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg) +out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg) { char producer[128]; char *comp_dir; @@ -1445,8 +1574,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg) /* ??? sizeof_offset */ TC_DWARF2_EMIT_OFFSET (section_symbol (line_seg), 4); - /* These two attributes may only be emitted if all of the code is - contiguous. Multiple sections are not that. */ + /* These two attributes are emitted if all of the code is contiguous. */ if (all_segs->next == NULL) { /* DW_AT_low_pc */ @@ -1461,6 +1589,12 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg) expr.X_add_number = 0; emit_expr (&expr, sizeof_address); } + else + { + /* This attribute is emitted if the code is disjoint. */ + /* DW_AT_ranges. */ + TC_DWARF2_EMIT_OFFSET (section_symbol (ranges_seg), sizeof_offset); + } /* DW_AT_name. We don't have the actual file name that was present on the command line, so assume files[1] is the main input file. @@ -1473,7 +1607,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg) len = strlen (dirs[files[1].dir]); p = frag_more (len + 1); memcpy (p, dirs[files[1].dir], len); - p[len] = '/'; + INSERT_DIR_SEPARATOR (p, len); } len = strlen (files[1].filename) + 1; p = frag_more (len); @@ -1551,6 +1685,7 @@ dwarf2_finish (void) { segT abbrev_seg; segT aranges_seg; + segT ranges_seg; assert (all_segs); @@ -1567,8 +1702,19 @@ dwarf2_finish (void) record_alignment (aranges_seg, ffs (2 * sizeof_address) - 1); + if (all_segs->next == NULL) + ranges_seg = NULL; + else + { + ranges_seg = subseg_new (".debug_ranges", 0); + bfd_set_section_flags (stdoutput, ranges_seg, + SEC_READONLY | SEC_DEBUGGING); + record_alignment (ranges_seg, ffs (2 * sizeof_address) - 1); + out_debug_ranges (ranges_seg); + } + out_debug_aranges (aranges_seg, info_seg); out_debug_abbrev (abbrev_seg); - out_debug_info (info_seg, abbrev_seg, line_seg); + out_debug_info (info_seg, abbrev_seg, line_seg, ranges_seg); } } diff --git a/contrib/binutils/gas/ecoff.c b/contrib/binutils/gas/ecoff.c index 45116e86db0..2f9f71f8ebe 100644 --- a/contrib/binutils/gas/ecoff.c +++ b/contrib/binutils/gas/ecoff.c @@ -1,6 +1,6 @@ /* ECOFF debugging support. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor . A @@ -2778,7 +2778,7 @@ ecoff_directive_val (int ignore ATTRIBUTE_UNUSED) expression (&exp); if (exp.X_op != O_constant && exp.X_op != O_symbol) { - as_bad (_(".val expression is too copmlex")); + as_bad (_(".val expression is too complex")); demand_empty_rest_of_line (); return; } diff --git a/contrib/binutils/gas/expr.c b/contrib/binutils/gas/expr.c index 69f0aaccdb6..11f2942672c 100644 --- a/contrib/binutils/gas/expr.c +++ b/contrib/binutils/gas/expr.c @@ -1,6 +1,6 @@ /* expr.c -operands, expressions- Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -25,7 +25,6 @@ (It also gives smaller files to re-compile.) Here, "operand"s are of expressions, not instructions. */ -#include #define min(a, b) ((a) < (b) ? (a) : (b)) #include "as.h" @@ -1003,11 +1002,6 @@ operand (expressionS *expressionP, enum expr_mode mode) case '-': case '+': { - /* Do not accept ++e or --e as +(+e) or -(-e) - Disabled, since the preprocessor removes whitespace. */ - if (0 && (c == '-' || c == '+') && *input_line_pointer == c) - goto target_op; - operand (expressionP, mode); if (expressionP->X_op == O_constant) { @@ -1291,7 +1285,6 @@ operand (expressionS *expressionP, enum expr_mode mode) } else { - target_op: /* Let the target try to parse it. Success is indicated by changing the X_op field to something other than O_absent and pointing input_line_pointer past the expression. If it can't parse the @@ -1552,11 +1545,7 @@ operator (int *num_chars) case '+': case '-': - /* Do not allow a++b and a--b to be a + (+b) and a - (-b) - Disabled, since the preprocessor removes whitespace. */ - if (1 || input_line_pointer[1] != c) - return op_encoding[c]; - return O_illegal; + return op_encoding[c]; case '<': switch (input_line_pointer[1]) @@ -1647,7 +1636,7 @@ expr (int rankarg, /* Larger # is higher rank. */ operatorT op_right; int op_chars; - know (rank >= 0); + know (rankarg >= 0); /* Save the value of dot for the fixup code. */ if (rank == 0) @@ -1796,7 +1785,9 @@ expr (int rankarg, /* Larger # is higher rank. */ case O_bit_or_not: resultP->X_add_number |= ~v; break; case O_bit_exclusive_or: resultP->X_add_number ^= v; break; case O_bit_and: resultP->X_add_number &= v; break; - case O_add: resultP->X_add_number += v; break; + /* Constant + constant (O_add) is handled by the + previous if statement for constant + X, so is omitted + here. */ case O_subtract: resultP->X_add_number -= v; break; case O_eq: resultP->X_add_number = diff --git a/contrib/binutils/gas/frags.c b/contrib/binutils/gas/frags.c index b08ef502cbf..adb9b198630 100644 --- a/contrib/binutils/gas/frags.c +++ b/contrib/binutils/gas/frags.c @@ -389,9 +389,9 @@ frag_append_1_char (int datum) not already accounted for in the frag FR_ADDRESS. */ bfd_boolean -frag_offset_fixed_p (fragS *frag1, fragS *frag2, bfd_vma *offset) +frag_offset_fixed_p (const fragS *frag1, const fragS *frag2, bfd_vma *offset) { - fragS *frag; + const fragS *frag; bfd_vma off; /* Start with offset initialised to difference between the two frags. diff --git a/contrib/binutils/gas/frags.h b/contrib/binutils/gas/frags.h index 880446763a4..66630dbd164 100644 --- a/contrib/binutils/gas/frags.h +++ b/contrib/binutils/gas/frags.h @@ -148,6 +148,6 @@ char *frag_var (relax_stateT type, offsetT offset, char *opcode); -bfd_boolean frag_offset_fixed_p (fragS *, fragS *, bfd_vma *); +bfd_boolean frag_offset_fixed_p (const fragS *, const fragS *, bfd_vma *); #endif /* FRAGS_H */ diff --git a/contrib/binutils/gas/gdbinit.in b/contrib/binutils/gas/gdbinit.in index e946726ec67..fb1046da531 100644 --- a/contrib/binutils/gas/gdbinit.in +++ b/contrib/binutils/gas/gdbinit.in @@ -6,7 +6,6 @@ break as_warn_where break as_bad break as_bad_where break as_fatal -break as_perror break as_assert break as_abort diff --git a/contrib/binutils/gas/input-file.c b/contrib/binutils/gas/input-file.c index 343f0494087..0907bad37c8 100644 --- a/contrib/binutils/gas/input-file.c +++ b/contrib/binutils/gas/input-file.c @@ -1,6 +1,6 @@ /* input_file.c - Deal with Input Files - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, - 2002, 2003, 2005 + 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -25,9 +25,6 @@ What we lose in "efficiency" we gain in modularity. Note we don't need to #include the "as.h" file. No common coupling! */ -#include -#include -#include #include "as.h" #include "input-file.h" #include "safe-ctype.h" @@ -143,8 +140,8 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ if (f_in == NULL) { - bfd_set_error (bfd_error_system_call); - as_perror (_("Can't open %s for reading"), file_name); + as_bad (_("can't open %s for reading: %s"), + file_name, xstrerror (errno)); return; } @@ -152,8 +149,8 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ if (ferror (f_in)) { - bfd_set_error (bfd_error_system_call); - as_perror (_("Can't open %s for reading"), file_name); + as_bad (_("can't read from %s: %s"), + file_name, xstrerror (errno)); fclose (f_in); f_in = NULL; @@ -166,8 +163,8 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ c = getc (f_in); if (c == 'N') { - fgets (buf, 80, f_in); - if (!strncmp (buf, "O_APP", 5) && ISSPACE (buf[5])) + if (fgets (buf, sizeof (buf), f_in) + && !strncmp (buf, "O_APP", 5) && ISSPACE (buf[5])) preprocess = 0; if (!strchr (buf, '\n')) ungetc ('#', f_in); /* It was longer. */ @@ -176,8 +173,8 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ } else if (c == 'A') { - fgets (buf, 80, f_in); - if (!strncmp (buf, "PP", 2) && ISSPACE (buf[2])) + if (fgets (buf, sizeof (buf), f_in) + && !strncmp (buf, "PP", 2) && ISSPACE (buf[2])) preprocess = 1; if (!strchr (buf, '\n')) ungetc ('#', f_in); @@ -215,8 +212,7 @@ input_file_get (char *buf, int buflen) size = fread (buf, sizeof (char), buflen, f_in); if (size < 0) { - bfd_set_error (bfd_error_system_call); - as_perror (_("Can't read from %s"), file_name); + as_bad (_("can't read from %s: %s"), file_name, xstrerror (errno)); size = 0; } return size; @@ -242,8 +238,7 @@ input_file_give_next_buffer (char *where /* Where to place 1st character of new size = fread (where, sizeof (char), BUFFER_SIZE, f_in); if (size < 0) { - bfd_set_error (bfd_error_system_call); - as_perror (_("Can't read from %s"), file_name); + as_bad (_("can't read from %s: %s"), file_name, xstrerror (errno)); size = 0; } if (size) @@ -251,10 +246,8 @@ input_file_give_next_buffer (char *where /* Where to place 1st character of new else { if (fclose (f_in)) - { - bfd_set_error (bfd_error_system_call); - as_perror (_("Can't close %s"), file_name); - } + as_warn (_("can't close %s: %s"), file_name, xstrerror (errno)); + f_in = (FILE *) 0; return_value = 0; } diff --git a/contrib/binutils/gas/input-file.h b/contrib/binutils/gas/input-file.h index bc8289e4e44..0628716b640 100644 --- a/contrib/binutils/gas/input-file.h +++ b/contrib/binutils/gas/input-file.h @@ -1,5 +1,6 @@ /* input_file.h header for input-file.c - Copyright 1987, 1992, 1993, 2000, 2003 Free Software Foundation, Inc. + Copyright 1987, 1992, 1993, 2000, 2003, 2005, 2006 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -51,8 +52,8 @@ * * input_file_close () Closes opened file. * - * All errors are reported (using as_perror) so caller doesn't have to think - * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. + * All errors are reported so caller doesn't have to think + * about I/O errors. */ char *input_file_give_next_buffer (char *where); diff --git a/contrib/binutils/gas/input-scrub.c b/contrib/binutils/gas/input-scrub.c index 8562ee25dff..5698a6dc22a 100644 --- a/contrib/binutils/gas/input-scrub.c +++ b/contrib/binutils/gas/input-scrub.c @@ -1,6 +1,6 @@ /* input_scrub.c - Break up input buffers into whole numbers of lines. Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 2000, 2001, 2003 + 2000, 2001, 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,7 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include /* Need this to make errno declaration right */ #include "as.h" #include "input-file.h" #include "sb.h" @@ -57,6 +56,10 @@ #define BEFORE_SIZE (1) #define AFTER_SIZE (1) +#ifndef TC_EOL_IN_INSN +#define TC_EOL_IN_INSN(P) 0 +#endif + static char *buffer_start; /*->1st char of full buffer area. */ static char *partial_where; /*->after last full line in buffer. */ static int partial_size; /* >=0. Number of chars in partial line in buffer. */ @@ -342,8 +345,9 @@ input_scrub_next_buffer (char **bufp) if (limit) { register char *p; /* Find last newline. */ - - for (p = limit - 1; *p != '\n'; --p) + /* Terminate the buffer to avoid confusing TC_EOL_IN_INSN. */ + *limit = '\0'; + for (p = limit - 1; *p != '\n' || TC_EOL_IN_INSN (p); --p) ; ++p; @@ -369,7 +373,9 @@ input_scrub_next_buffer (char **bufp) return NULL; } - for (p = limit - 1; *p != '\n'; --p) + /* Terminate the buffer to avoid confusing TC_EOL_IN_INSN. */ + *limit = '\0'; + for (p = limit - 1; *p != '\n' || TC_EOL_IN_INSN (p); --p) ; ++p; } @@ -429,13 +435,34 @@ bump_line_counters (void) Returns nonzero if the filename actually changes. */ int -new_logical_line (char *fname, /* DON'T destroy it! We point to it! */ - int line_number) +new_logical_line_flags (char *fname, /* DON'T destroy it! We point to it! */ + int line_number, + int flags) { + switch (flags) + { + case 0: + break; + case 1: + if (line_number != -1) + abort (); + break; + case 1 << 1: + case 1 << 2: + /* FIXME: we could check that include nesting is correct. */ + break; + default: + abort (); + } + if (line_number >= 0) logical_input_line = line_number; - else if (line_number == -2 && logical_input_line > 0) - --logical_input_line; + else if (line_number == -1 && fname && !*fname && (flags & (1 << 2))) + { + logical_input_file = physical_input_file; + logical_input_line = physical_input_line; + fname = NULL; + } if (fname && (logical_input_file == NULL @@ -447,6 +474,13 @@ new_logical_line (char *fname, /* DON'T destroy it! We point to it! */ else return 0; } + +int +new_logical_line (char *fname, int line_number) +{ + return new_logical_line_flags (fname, line_number, 0); +} + /* Return the current file name and line number. namep should be char * const *, but there are compilers which screw diff --git a/contrib/binutils/gas/itbl-lex.l b/contrib/binutils/gas/itbl-lex.l index aceeac4f9f0..185f956ecea 100644 --- a/contrib/binutils/gas/itbl-lex.l +++ b/contrib/binutils/gas/itbl-lex.l @@ -1,5 +1,6 @@ /* itbl-lex.l - Copyright 1997, 1998, 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright 1997, 1998, 2001, 2002, 2005, 2006 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,10 +20,7 @@ 02110-1301, USA. */ %{ -#include -#include -#include - +#include "as.h" #include "itbl-lex.h" #include diff --git a/contrib/binutils/gas/itbl-ops.c b/contrib/binutils/gas/itbl-ops.c index bd1f6473f45..41fa0335e1b 100644 --- a/contrib/binutils/gas/itbl-ops.c +++ b/contrib/binutils/gas/itbl-ops.c @@ -1,5 +1,5 @@ /* itbl-ops.c - Copyright 1997, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright 1997, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -89,9 +89,7 @@ * */ -#include -#include -#include +#include "as.h" #include "itbl-ops.h" #include @@ -147,12 +145,7 @@ struct itbl_entry { static int itbl_num_opcodes = 0; /* Array of entries for each processor and entry type */ -static struct itbl_entry *entries[e_nprocs][e_ntypes] = { - {0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0} -}; +static struct itbl_entry *entries[e_nprocs][e_ntypes]; /* local prototypes */ static unsigned long build_opcode (struct itbl_entry *e); @@ -253,8 +246,6 @@ itbl_add_operand (struct itbl_entry *e, int yytype, int sbit, /* Interfaces for assembler and disassembler */ #ifndef STAND_ALONE -#include "as.h" -#include "symbols.h" static void append_insns_as_macros (void); /* Initialize for gas. */ diff --git a/contrib/binutils/gas/itbl-ops.h b/contrib/binutils/gas/itbl-ops.h index 47dc8b295b1..d9dbf7c3ca4 100644 --- a/contrib/binutils/gas/itbl-ops.h +++ b/contrib/binutils/gas/itbl-ops.h @@ -1,5 +1,5 @@ /* itbl-ops.h - Copyright 1997, 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright 1997, 1999, 2000, 2003, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,14 +20,6 @@ /* External functions, constants and defines for itbl support */ -#include "ansidecl.h" - -/* Include file notes: "expr.h" needed before targ-*.h, - * "targ-env.h" includes the chain of target dependant headers, - * "targ-cpu.h" has the HAVE_ITBL_CPU define, and - * as.h includes them all */ -#include "as.h" - #ifdef HAVE_ITBL_CPU #include "itbl-cpu.h" #endif @@ -77,7 +69,7 @@ typedef enum typedef enum { e_p0, - e_nprocs = NUMBER_OF_PROCESSORS, + e_nprocs = ITBL_NUMBER_OF_PROCESSORS, e_invproc /* invalid processor */ } e_processor; diff --git a/contrib/binutils/gas/itbl-parse.y b/contrib/binutils/gas/itbl-parse.y index a7a52dfabff..ff48657fb36 100644 --- a/contrib/binutils/gas/itbl-parse.y +++ b/contrib/binutils/gas/itbl-parse.y @@ -1,5 +1,5 @@ /* itbl-parse.y - Copyright 1997, 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright 1997, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -246,7 +246,7 @@ FIXME! hex is ambiguous with any digit */ -#include +#include "as.h" #include "itbl-lex.h" #include "itbl-ops.h" @@ -274,7 +274,7 @@ FIXME! hex is ambiguous with any digit static int sbit, ebit; static struct itbl_entry *insn=0; -static int yyerror PARAMS ((const char *)); +static int yyerror (const char *); %} diff --git a/contrib/binutils/gas/listing.c b/contrib/binutils/gas/listing.c index 61ef6f55e40..1b55cbf6398 100644 --- a/contrib/binutils/gas/listing.c +++ b/contrib/binutils/gas/listing.c @@ -1,6 +1,6 @@ /* listing.c - maintain assembly listings Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2005 + 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -946,15 +946,6 @@ listing_listing (char *name ATTRIBUTE_UNUSED) buffer = xmalloc (listing_rhs_width); data_buffer = xmalloc (MAX_BYTES); eject = 1; - list = head; - - while (list != (list_info_type *) NULL && 0) - { - if (list->next) - list->frag = list->next->frag; - list = list->next; - } - list = head->next; while (list) @@ -1085,8 +1076,7 @@ listing_print (char *name) using_stdout = 0; else { - bfd_set_error (bfd_error_system_call); - as_perror (_("can't open list file: %s"), name); + as_warn (_("can't open %s: %s"), name, xstrerror (errno)); list_file = stdout; using_stdout = 1; } @@ -1104,10 +1094,7 @@ listing_print (char *name) if (! using_stdout) { if (fclose (list_file) == EOF) - { - bfd_set_error (bfd_error_system_call); - as_perror (_("error closing list file: %s"), name); - } + as_warn (_("can't close %s: %s"), name, xstrerror (errno)); } if (last_open_file) diff --git a/contrib/binutils/gas/macro.c b/contrib/binutils/gas/macro.c index af98bada6a8..d7d470b764e 100644 --- a/contrib/binutils/gas/macro.c +++ b/contrib/binutils/gas/macro.c @@ -1,6 +1,6 @@ /* macro.c - macro support for gas Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, sac@cygnus.com @@ -22,47 +22,11 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "config.h" - -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX -/* Indented so that pre-ansi C compilers will ignore it, rather than - choke on it. Some versions of AIX require this to be the first - thing in the file. */ - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# if !defined (__STDC__) && !defined (__hpux) -extern char *alloca (); -# else -extern void *alloca (); -# endif /* __STDC__, __hpux */ -# endif /* alloca */ -# endif /* _AIX */ -# endif /* HAVE_ALLOCA_H */ -#endif /* __GNUC__ */ - -#include -#ifdef HAVE_STRING_H -#include -#else -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif #include "as.h" -#include "libiberty.h" #include "safe-ctype.h" #include "sb.h" -#include "hash.h" #include "macro.h" -#include "asintl.h" - /* The routines in this file handle macro definition and expansion. They are called by gas. */ @@ -1025,7 +989,6 @@ macro_expand (int idx, sb *in, macro_entry *m, sb *out) sb t; formal_entry *ptr; formal_entry *f; - int is_positional = 0; int is_keyword = 0; int narg = 0; const char *err = NULL; @@ -1116,8 +1079,6 @@ macro_expand (int idx, sb *in, macro_entry *m, sb *out) } else { - /* This is a positional arg. */ - is_positional = 1; if (is_keyword) { err = _("can't mix positional and keyword arguments"); @@ -1364,8 +1325,14 @@ expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) } else { + bfd_boolean in_quotes = FALSE; + if (irpc && in->ptr[idx] == '"') - ++idx; + { + in_quotes = TRUE; + ++idx; + } + while (idx < in->len) { if (!irpc) @@ -1376,6 +1343,9 @@ expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) { int nxt; + if (irpc) + in_quotes = ! in_quotes; + nxt = sb_skip_white (idx + 1, in); if (nxt >= in->len) { @@ -1387,12 +1357,13 @@ expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) sb_add_char (&f.actual, in->ptr[idx]); ++idx; } + err = macro_expand_body (&sub, out, &f, h, 0); if (err != NULL) break; if (!irpc) idx = sb_skip_comma (idx, in); - else + else if (! in_quotes) idx = sb_skip_white (idx, in); } } diff --git a/contrib/binutils/gas/macro.h b/contrib/binutils/gas/macro.h index 4fdaa52d097..104aeae6f02 100644 --- a/contrib/binutils/gas/macro.h +++ b/contrib/binutils/gas/macro.h @@ -1,5 +1,5 @@ /* macro.h - header file for macro support for gas - Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004 + Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, @@ -26,9 +26,6 @@ #define MACRO_H -#include "ansidecl.h" -#include "sb.h" - /* Structures used to store macros. Each macro knows its name and included text. It gets built with a diff --git a/contrib/binutils/gas/messages.c b/contrib/binutils/gas/messages.c index b1b94cdf7c6..c8788dcc32d 100644 --- a/contrib/binutils/gas/messages.c +++ b/contrib/binutils/gas/messages.c @@ -1,6 +1,6 @@ /* messages.c - error reporter - Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2003, 2004, 2005 + 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -116,24 +116,6 @@ as_show_where (void) fprintf (stderr, "%s:%u: ", file, line); } -/* Like perror(3), but with more info. */ - -void -as_perror (const char *gripe, /* Unpunctuated error theme. */ - const char *filename) -{ - const char *errtxt; - int saved_errno = errno; - - as_show_where (); - fprintf (stderr, gripe, filename); - errno = saved_errno; - errtxt = bfd_errmsg (bfd_get_error ()); - fprintf (stderr, ": %s\n", errtxt); - errno = 0; - bfd_set_error (bfd_error_no_error); -} - /* Send to stderr a string as a warning, and locate warning in input file(s). Please only use this for when we have some recovery action. @@ -474,6 +456,24 @@ as_internal_value_out_of_range (char * prefix, if (prefix == NULL) prefix = ""; + if (val >= min && val <= max) + { + addressT right = max & -max; + + if (max <= 1) + abort (); + + /* xgettext:c-format */ + err = _("%s out of domain (%d is not a multiple of %d)"); + if (bad) + as_bad_where (file, line, err, + prefix, (int) val, (int) right); + else + as_warn_where (file, line, err, + prefix, (int) val, (int) right); + return; + } + if ( val < HEX_MAX_THRESHOLD && min < HEX_MAX_THRESHOLD && max < HEX_MAX_THRESHOLD diff --git a/contrib/binutils/gas/output-file.c b/contrib/binutils/gas/output-file.c index f94359ab6b0..9603dc4f38a 100644 --- a/contrib/binutils/gas/output-file.c +++ b/contrib/binutils/gas/output-file.c @@ -1,6 +1,6 @@ /* output-file.c - Deal with the output file Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,17 +19,13 @@ the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "as.h" - #include "output-file.h" #ifndef TARGET_MACH #define TARGET_MACH 0 #endif -#include "bfd.h" bfd *stdoutput; void @@ -40,11 +36,12 @@ output_file_create (char *name) else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT))) { - if (bfd_get_error () == bfd_error_invalid_target) - as_perror (_("Selected target format '%s' unknown"), TARGET_FORMAT); + bfd_error_type err = bfd_get_error (); + + if (err == bfd_error_invalid_target) + as_fatal (_("selected target format '%s' unknown"), TARGET_FORMAT); else - as_perror (_("FATAL: can't create %s"), name); - exit (EXIT_FAILURE); + as_fatal (_("can't create %s: %s"), name, bfd_errmsg (err)); } bfd_set_format (stdoutput, bfd_object); @@ -56,12 +53,19 @@ output_file_create (char *name) void output_file_close (char *filename) { + bfd_boolean res; + + if (stdoutput == NULL) + return; + /* Close the bfd. */ - if (bfd_close (stdoutput) == 0) - { - bfd_perror (filename); - as_perror (_("FATAL: can't close %s\n"), filename); - exit (EXIT_FAILURE); - } - stdoutput = NULL; /* Trust nobody! */ + res = bfd_close (stdoutput); + + /* Prevent an infinite loop - if the close failed we will call as_fatal + which will call xexit() which may call this function again... */ + stdoutput = NULL; + + if (! res) + as_fatal (_("can't close %s: %s"), filename, + bfd_errmsg (bfd_get_error ())); } diff --git a/contrib/binutils/gas/po/Make-in b/contrib/binutils/gas/po/Make-in index be09b4cd788..86ff3143b98 100644 --- a/contrib/binutils/gas/po/Make-in +++ b/contrib/binutils/gas/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/contrib/binutils/gas/po/POTFILES.in b/contrib/binutils/gas/po/POTFILES.in index 3a173a536ff..4215a09c7e8 100644 --- a/contrib/binutils/gas/po/POTFILES.in +++ b/contrib/binutils/gas/po/POTFILES.in @@ -24,8 +24,6 @@ config/obj-elf.c config/obj-elf.h config/obj-evax.c config/obj-evax.h -config/obj-ieee.c -config/obj-ieee.h config/obj-som.c config/obj-som.h config/tc-alpha.c @@ -38,6 +36,8 @@ config/tc-avr.c config/tc-avr.h config/tc-bfin.c config/tc-bfin.h +config/tc-cr16.c +config/tc-cr16.h config/tc-cris.c config/tc-cris.h config/tc-crx.c @@ -78,6 +78,8 @@ config/tc-m68k.c config/tc-m68k.h config/tc-mcore.c config/tc-mcore.h +config/tc-mep.c +config/tc-mep.h config/tc-mips.c config/tc-mips.h config/tc-mmix.c @@ -102,12 +104,16 @@ config/tc-ppc.c config/tc-ppc.h config/tc-s390.c config/tc-s390.h +config/tc-score.c +config/tc-score.h config/tc-sh64.c config/tc-sh64.h config/tc-sh.c config/tc-sh.h config/tc-sparc.c config/tc-sparc.h +config/tc-spu.c +config/tc-spu.h config/tc-tic30.c config/tc-tic30.h config/tc-tic54x.c diff --git a/contrib/binutils/gas/po/gas.pot b/contrib/binutils/gas/po/gas.pot index 122a678aa4a..575f36ef47b 100644 --- a/contrib/binutils/gas/po/gas.pot +++ b/contrib/binutils/gas/po/gas.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-10-25 08:41+0930\n" +"POT-Creation-Date: 2007-07-02 15:56+0930\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,64 +16,64 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: app.c:470 app.c:484 +#: app.c:473 app.c:487 msgid "end of file in comment" msgstr "" -#: app.c:560 app.c:605 +#: app.c:559 app.c:604 #, c-format msgid "end of file in string; '%c' inserted" msgstr "" -#: app.c:631 +#: app.c:630 #, c-format msgid "unknown escape '\\%c' in string; ignored" msgstr "" -#: app.c:786 +#: app.c:793 msgid "end of file not at end of a line; newline inserted" msgstr "" -#: app.c:945 +#: app.c:949 msgid "end of file in multiline comment" msgstr "" -#: app.c:1010 +#: app.c:1014 msgid "end of file after a one-character quote; \\0 inserted" msgstr "" -#: app.c:1018 +#: app.c:1022 msgid "end of file in escape character" msgstr "" -#: app.c:1030 +#: app.c:1034 msgid "missing close quote; (assumed)" msgstr "" -#: app.c:1098 app.c:1152 app.c:1163 app.c:1228 +#: app.c:1102 app.c:1156 app.c:1167 app.c:1241 msgid "end of file in comment; newline inserted" msgstr "" -#: as.c:161 +#: as.c:158 msgid "missing emulation mode name" msgstr "" -#: as.c:176 +#: as.c:173 #, c-format msgid "unrecognized emulation name `%s'" msgstr "" -#: as.c:223 +#: as.c:220 #, c-format msgid "GNU assembler version %s (%s) using BFD version %s\n" msgstr "" -#: as.c:230 +#: as.c:227 #, c-format msgid "Usage: %s [option...] [asmfile...]\n" msgstr "" -#: as.c:232 +#: as.c:229 #, c-format msgid "" "Options:\n" @@ -89,131 +89,131 @@ msgid "" " \t =FILE list to FILE (must be last sub-option)\n" msgstr "" -#: as.c:245 +#: as.c:242 #, c-format msgid " --alternate initially turn on alternate macro syntax\n" msgstr "" -#: as.c:247 +#: as.c:244 #, c-format msgid " -D produce assembler debugging messages\n" msgstr "" -#: as.c:249 +#: as.c:246 #, c-format msgid " --defsym SYM=VAL define symbol SYM to given value\n" msgstr "" -#: as.c:265 +#: as.c:262 #, c-format msgid " emulate output (default %s)\n" msgstr "" -#: as.c:270 +#: as.c:267 #, c-format msgid " --execstack require executable stack for this object\n" msgstr "" -#: as.c:272 +#: as.c:269 #, c-format msgid "" " --noexecstack don't require executable stack for this object\n" msgstr "" -#: as.c:275 +#: as.c:272 #, c-format msgid " -f skip whitespace and comment preprocessing\n" msgstr "" -#: as.c:277 +#: as.c:274 #, c-format msgid " -g --gen-debug generate debugging information\n" msgstr "" -#: as.c:279 +#: as.c:276 #, c-format msgid " --gstabs generate STABS debugging information\n" msgstr "" -#: as.c:281 +#: as.c:278 #, c-format msgid "" " --gstabs+ generate STABS debug info with GNU extensions\n" msgstr "" -#: as.c:283 +#: as.c:280 #, c-format msgid " --gdwarf-2 generate DWARF2 debugging information\n" msgstr "" -#: as.c:285 +#: as.c:282 #, c-format msgid " --hash-size= set the hash table size close to \n" msgstr "" -#: as.c:287 +#: as.c:284 #, c-format msgid " --help show this message and exit\n" msgstr "" -#: as.c:289 +#: as.c:286 #, c-format msgid " --target-help show target specific options\n" msgstr "" -#: as.c:291 +#: as.c:288 #, c-format msgid "" " -I DIR add DIR to search list for .include directives\n" msgstr "" -#: as.c:293 +#: as.c:290 #, c-format msgid " -J don't warn about signed overflow\n" msgstr "" -#: as.c:295 +#: as.c:292 #, c-format msgid "" " -K warn when differences altered for long " "displacements\n" msgstr "" -#: as.c:297 +#: as.c:294 #, c-format msgid " -L,--keep-locals keep local symbols (e.g. starting with `L')\n" msgstr "" -#: as.c:299 +#: as.c:296 #, c-format msgid " -M,--mri assemble in MRI compatibility mode\n" msgstr "" -#: as.c:301 +#: as.c:298 #, c-format msgid "" " --MD FILE write dependency information in FILE (default " "none)\n" msgstr "" -#: as.c:303 +#: as.c:300 #, c-format msgid " -nocpp ignored\n" msgstr "" -#: as.c:305 +#: as.c:302 #, c-format msgid "" " -o OBJFILE name the object-file output OBJFILE (default a." "out)\n" msgstr "" -#: as.c:307 +#: as.c:304 #, c-format msgid " -R fold data section into text section\n" msgstr "" -#: as.c:309 +#: as.c:306 #, c-format msgid "" " --reduce-memory-overheads \n" @@ -221,44 +221,44 @@ msgid "" " assembly times\n" msgstr "" -#: as.c:313 +#: as.c:310 #, c-format msgid "" " --statistics print various measured statistics from execution\n" msgstr "" -#: as.c:315 +#: as.c:312 #, c-format msgid " --strip-local-absolute strip local absolute symbols\n" msgstr "" -#: as.c:317 +#: as.c:314 #, c-format msgid "" " --traditional-format Use same format as native assembler when possible\n" msgstr "" -#: as.c:319 +#: as.c:316 #, c-format msgid " --version print assembler version number and exit\n" msgstr "" -#: as.c:321 +#: as.c:318 #, c-format msgid " -W --no-warn suppress warnings\n" msgstr "" -#: as.c:323 +#: as.c:320 #, c-format msgid " --warn don't suppress warnings\n" msgstr "" -#: as.c:325 +#: as.c:322 #, c-format msgid " --fatal-warnings treat warnings as errors\n" msgstr "" -#: as.c:327 +#: as.c:324 #, c-format msgid "" " --itbl INSTTBL extend instruction set to include instructions\n" @@ -266,22 +266,22 @@ msgid "" "INSTTBL\n" msgstr "" -#: as.c:330 +#: as.c:327 #, c-format msgid " -w ignored\n" msgstr "" -#: as.c:332 +#: as.c:329 #, c-format msgid " -X ignored\n" msgstr "" -#: as.c:334 +#: as.c:331 #, c-format msgid " -Z generate object file even after errors\n" msgstr "" -#: as.c:336 +#: as.c:333 #, c-format msgid "" " --listing-lhs-width set the width in words of the output data column " @@ -289,7 +289,7 @@ msgid "" " the listing\n" msgstr "" -#: as.c:339 +#: as.c:336 #, c-format msgid "" " --listing-lhs-width2 set the width in words of the continuation lines\n" @@ -298,124 +298,129 @@ msgid "" " the width of the first line\n" msgstr "" -#: as.c:343 +#: as.c:340 #, c-format msgid "" " --listing-rhs-width set the max width in characters of the lines from\n" " the source file\n" msgstr "" -#: as.c:346 +#: as.c:343 #, c-format msgid "" " --listing-cont-lines set the maximum number of continuation lines used\n" " for the output data column of the listing\n" msgstr "" -#: as.c:353 +#: as.c:346 +#, c-format +msgid " @FILE read options from FILE\n" +msgstr "" + +#: as.c:354 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: as.c:553 +#: as.c:554 #, c-format msgid "unrecognized option -%c%s" msgstr "" #. This output is intended to follow the GNU standards document. -#: as.c:591 +#: as.c:592 #, c-format msgid "GNU assembler %s\n" msgstr "" -#: as.c:592 +#: as.c:593 #, c-format -msgid "Copyright 2005 Free Software Foundation, Inc.\n" +msgid "Copyright 2007 Free Software Foundation, Inc.\n" msgstr "" -#: as.c:593 +#: as.c:594 #, 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 "" -#: as.c:596 +#: as.c:597 #, c-format msgid "This assembler was configured for a target of `%s'.\n" msgstr "" -#: as.c:603 +#: as.c:604 msgid "multiple emulation names specified" msgstr "" -#: as.c:605 +#: as.c:606 msgid "emulations not handled in this configuration" msgstr "" -#: as.c:610 -#, c-format -msgid "alias = %s\n" -msgstr "" - #: as.c:611 #, c-format -msgid "canonical = %s\n" +msgid "alias = %s\n" msgstr "" #: as.c:612 #, c-format +msgid "canonical = %s\n" +msgstr "" + +#: as.c:613 +#, c-format msgid "cpu-type = %s\n" msgstr "" -#: as.c:614 +#: as.c:615 #, c-format msgid "format = %s\n" msgstr "" -#: as.c:617 +#: as.c:618 #, c-format msgid "bfd-target = %s\n" msgstr "" -#: as.c:630 +#: as.c:631 msgid "bad defsym; format is --defsym name=value" msgstr "" -#: as.c:650 +#: as.c:651 msgid "no file name following -t option" msgstr "" -#: as.c:665 +#: as.c:666 #, c-format msgid "failed to read instruction table %s\n" msgstr "" -#: as.c:832 +#: as.c:833 #, c-format msgid "invalid listing option `%c'" msgstr "" -#: as.c:885 +#: as.c:886 msgid "--hash-size needs a numeric argument" msgstr "" -#: as.c:910 +#: as.c:911 #, c-format msgid "%s: total time in assembly: %ld.%06ld\n" msgstr "" -#: as.c:913 +#: as.c:914 #, c-format msgid "%s: data size %ld\n" msgstr "" -#: as.c:1175 +#: as.c:1222 #, c-format msgid "%d warnings, treating warnings as errors" msgstr "" -#: as.h:200 +#: as.h:237 #, c-format msgid "Case value %ld unexpected at line %d of file \"%s\"\n" msgstr "" @@ -424,71 +429,71 @@ msgstr "" #. * We have a GROSS internal error. #. * This should never happen. #. -#: atof-generic.c:419 config/tc-m68k.c:3118 +#: atof-generic.c:417 config/tc-m68k.c:3342 msgid "failed sanity check" msgstr "" -#: cond.c:82 +#: cond.c:83 msgid "invalid identifier for \".ifdef\"" msgstr "" -#: cond.c:149 +#: cond.c:150 msgid "non-constant expression in \".if\" statement" msgstr "" -#: cond.c:276 +#: cond.c:277 msgid "bad format for ifc or ifnc" msgstr "" -#: cond.c:306 +#: cond.c:307 msgid "\".elseif\" without matching \".if\"" msgstr "" -#: cond.c:310 +#: cond.c:311 msgid "\".elseif\" after \".else\"" msgstr "" -#: cond.c:313 cond.c:419 +#: cond.c:314 cond.c:420 msgid "here is the previous \"else\"" msgstr "" -#: cond.c:316 cond.c:422 +#: cond.c:317 cond.c:423 msgid "here is the previous \"if\"" msgstr "" -#: cond.c:345 +#: cond.c:346 msgid "non-constant expression in \".elseif\" statement" msgstr "" -#: cond.c:383 +#: cond.c:384 msgid "\".endif\" without \".if\"" msgstr "" -#: cond.c:412 +#: cond.c:413 msgid "\".else\" without matching \".if\"" msgstr "" -#: cond.c:416 +#: cond.c:417 msgid "duplicate \"else\"" msgstr "" -#: cond.c:467 +#: cond.c:468 msgid ".ifeqs syntax error" msgstr "" -#: cond.c:548 +#: cond.c:549 msgid "end of macro inside conditional" msgstr "" -#: cond.c:550 +#: cond.c:551 msgid "end of file inside conditional" msgstr "" -#: cond.c:553 +#: cond.c:554 msgid "here is the start of the unterminated conditional" msgstr "" -#: cond.c:557 +#: cond.c:558 msgid "here is the \"else\" of the unterminated conditional" msgstr "" @@ -502,7 +507,7 @@ msgstr "" msgid "Attempt to put an undefined symbol into set %s" msgstr "" -#: config/obj-aout.c:116 config/obj-coff.c:1328 +#: config/obj-aout.c:116 config/obj-coff.c:1340 #, c-format msgid "Symbol `%s' can not be both weak and common" msgstr "" @@ -513,82 +518,82 @@ msgid "Inserting \"%s\" into structure table failed: %s" msgstr "" #. Zero is used as an end marker in the file. -#: config/obj-coff.c:354 +#: config/obj-coff.c:366 msgid "Line numbers must be positive integers\n" msgstr "" -#: config/obj-coff.c:386 +#: config/obj-coff.c:398 msgid ".ln pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:428 ecoff.c:3240 +#: config/obj-coff.c:440 ecoff.c:3240 msgid ".loc outside of .text" msgstr "" -#: config/obj-coff.c:435 +#: config/obj-coff.c:447 msgid ".loc pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:516 +#: config/obj-coff.c:528 msgid ".def pseudo-op used inside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:555 +#: config/obj-coff.c:567 msgid ".endef pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:594 +#: config/obj-coff.c:606 #, c-format msgid "`%s' symbol without preceding function" msgstr "" -#: config/obj-coff.c:681 +#: config/obj-coff.c:693 #, c-format msgid "unexpected storage class %d" msgstr "" -#: config/obj-coff.c:790 +#: config/obj-coff.c:802 msgid ".dim pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:810 +#: config/obj-coff.c:822 msgid "badly formed .dim directive ignored" msgstr "" -#: config/obj-coff.c:859 +#: config/obj-coff.c:871 msgid ".size pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:874 +#: config/obj-coff.c:886 msgid ".scl pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:891 +#: config/obj-coff.c:903 msgid ".tag pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:909 +#: config/obj-coff.c:921 #, c-format msgid "tag not found for .tag %s" msgstr "" -#: config/obj-coff.c:922 +#: config/obj-coff.c:934 msgid ".type pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:941 +#: config/obj-coff.c:953 msgid ".val pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1108 +#: config/obj-coff.c:1120 msgid "badly formed .weak directive ignored" msgstr "" -#: config/obj-coff.c:1286 +#: config/obj-coff.c:1298 msgid "mismatched .eb" msgstr "" -#: config/obj-coff.c:1307 +#: config/obj-coff.c:1319 #, c-format msgid "C_EFCN symbol for %s out of scope" msgstr "" @@ -596,28 +601,28 @@ msgstr "" #. STYP_INFO #. STYP_LIB #. STYP_OVER -#: config/obj-coff.c:1533 +#: config/obj-coff.c:1591 #, c-format msgid "unsupported section attribute '%c'" msgstr "" -#: config/obj-coff.c:1538 config/tc-ppc.c:4610 +#: config/obj-coff.c:1595 config/tc-ppc.c:4617 #, c-format msgid "unknown section attribute '%c'" msgstr "" -#: config/obj-coff.c:1568 config/tc-ppc.c:4628 config/tc-tic54x.c:4287 -#: read.c:2551 +#: config/obj-coff.c:1623 config/tc-ppc.c:4635 config/tc-tic54x.c:4285 +#: read.c:2750 #, c-format msgid "error setting flags for \"%s\": %s" msgstr "" -#: config/obj-coff.c:1579 +#: config/obj-coff.c:1634 #, c-format msgid "Ignoring changed section attributes for %s" msgstr "" -#: config/obj-coff.c:1710 +#: config/obj-coff.c:1765 #, c-format msgid "0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n" msgstr "" @@ -630,192 +635,173 @@ msgstr "" msgid "Can't set register masks" msgstr "" -#: config/obj-elf.c:318 config/tc-sparc.c:3973 config/tc-v850.c:451 +#: config/obj-elf.c:322 config/tc-sparc.c:4053 config/tc-v850.c:450 #, c-format msgid "bad .common segment %s" msgstr "" -#: config/obj-elf.c:596 +#: config/obj-elf.c:600 #, c-format msgid "setting incorrect section type for %s" msgstr "" -#: config/obj-elf.c:601 +#: config/obj-elf.c:605 #, c-format msgid "ignoring incorrect section type for %s" msgstr "" -#: config/obj-elf.c:638 +#: config/obj-elf.c:647 #, c-format msgid "setting incorrect section attributes for %s" msgstr "" -#: config/obj-elf.c:690 +#: config/obj-elf.c:699 #, c-format msgid "ignoring changed section type for %s" msgstr "" -#: config/obj-elf.c:702 +#: config/obj-elf.c:711 #, c-format msgid "ignoring changed section attributes for %s" msgstr "" -#: config/obj-elf.c:704 +#: config/obj-elf.c:713 #, c-format msgid "ignoring changed section entity size for %s" msgstr "" -#: config/obj-elf.c:757 +#: config/obj-elf.c:766 msgid "unrecognized .section attribute: want a,w,x,M,S,G,T" msgstr "" -#: config/obj-elf.c:794 +#: config/obj-elf.c:803 msgid "unrecognized section attribute" msgstr "" -#: config/obj-elf.c:822 read.c:2535 +#: config/obj-elf.c:831 read.c:2734 msgid "unrecognized section type" msgstr "" -#: config/obj-elf.c:852 +#: config/obj-elf.c:861 msgid "missing name" msgstr "" -#: config/obj-elf.c:963 +#: config/obj-elf.c:972 msgid "invalid merge entity size" msgstr "" -#: config/obj-elf.c:970 +#: config/obj-elf.c:979 msgid "entity size for SHF_MERGE not specified" msgstr "" -#: config/obj-elf.c:990 +#: config/obj-elf.c:999 msgid "group name for SHF_GROUP not specified" msgstr "" -#: config/obj-elf.c:1003 +#: config/obj-elf.c:1012 msgid "character following name is not '#'" msgstr "" -#: config/obj-elf.c:1118 +#: config/obj-elf.c:1127 msgid ".previous without corresponding .section; ignored" msgstr "" -#: config/obj-elf.c:1144 +#: config/obj-elf.c:1153 msgid ".popsection without corresponding .pushsection; ignored" msgstr "" -#: config/obj-elf.c:1196 +#: config/obj-elf.c:1205 msgid "expected comma after name in .symver" msgstr "" -#: config/obj-elf.c:1220 +#: config/obj-elf.c:1229 #, c-format msgid "missing version name in `%s' for symbol `%s'" msgstr "" -#: config/obj-elf.c:1231 +#: config/obj-elf.c:1240 #, c-format msgid "multiple versions [`%s'|`%s'] for symbol `%s'" msgstr "" -#: config/obj-elf.c:1461 +#: config/obj-elf.c:1470 msgid "expected quoted string" msgstr "" -#: config/obj-elf.c:1481 +#: config/obj-elf.c:1490 #, c-format msgid "expected comma after name `%s' in .size directive" msgstr "" -#: config/obj-elf.c:1490 +#: config/obj-elf.c:1499 msgid "missing expression in .size directive" msgstr "" -#: config/obj-elf.c:1577 +#: config/obj-elf.c:1586 #, c-format msgid "unrecognized symbol type \"%s\"" msgstr "" -#: config/obj-elf.c:1745 +#: config/obj-elf.c:1754 msgid ".size expression too complicated to fix up" msgstr "" -#: config/obj-elf.c:1777 +#: config/obj-elf.c:1786 #, c-format msgid "" "invalid attempt to declare external version name as default in symbol `%s'" msgstr "" -#: config/obj-elf.c:1838 ecoff.c:3598 +#: config/obj-elf.c:1847 ecoff.c:3598 #, c-format msgid "symbol `%s' can not be both weak and common" msgstr "" -#: config/obj-elf.c:1945 +#: config/obj-elf.c:1954 #, c-format msgid "assuming all members of group `%s' are COMDAT" msgstr "" -#: config/obj-elf.c:1967 +#: config/obj-elf.c:1976 #, c-format msgid "can't create group: %s" msgstr "" -#: config/obj-elf.c:2076 +#: config/obj-elf.c:2086 #, c-format msgid "failed to set up debugging information: %s" msgstr "" -#: config/obj-elf.c:2096 +#: config/obj-elf.c:2106 #, c-format msgid "can't start writing .mdebug section: %s" msgstr "" -#: config/obj-elf.c:2104 +#: config/obj-elf.c:2114 #, c-format msgid "could not write .mdebug section: %s" msgstr "" -#: config/obj-elf.h:140 -#, c-format -msgid "can't allocate ELF private section data: %s" -msgstr "" - -#: config/obj-ieee.c:69 -#, c-format -msgid "Out of step\n" -msgstr "" - -#: config/obj-ieee.c:449 -msgid "too many sections" -msgstr "" - -#: config/obj-ieee.c:511 -#, c-format -msgid "FATAL: Can't create %s" -msgstr "" - #: config/obj-som.c:129 msgid "Only one .version pseudo-op per file!" msgstr "" -#: config/obj-som.c:146 config/obj-som.c:191 +#: config/obj-som.c:146 config/obj-som.c:188 msgid "Expected quoted string" msgstr "" -#: config/obj-som.c:155 +#: config/obj-som.c:153 #, c-format -msgid "FATAL: Attaching version header %s" +msgid "attaching version header %s: %s" msgstr "" -#: config/obj-som.c:174 +#: config/obj-som.c:171 msgid "Only one .copyright pseudo-op per file!" msgstr "" -#: config/obj-som.c:200 +#: config/obj-som.c:195 #, c-format -msgid "FATAL: Attaching copyright header %s" +msgid "attaching copyright header %s: %s" msgstr "" #: config/tc-alpha.c:592 @@ -887,8 +873,8 @@ msgstr "" msgid "opcode `%s' not supported for target %s" msgstr "" -#: config/tc-alpha.c:1129 config/tc-alpha.c:3145 config/tc-avr.c:1221 -#: config/tc-msp430.c:1870 +#: config/tc-alpha.c:1129 config/tc-alpha.c:3145 config/tc-avr.c:1321 +#: config/tc-msp430.c:1868 #, c-format msgid "unknown opcode `%s'" msgstr "" @@ -968,17 +954,17 @@ msgstr "" msgid "sequence number in use for !tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:1823 config/tc-arc.c:294 config/tc-mn10200.c:889 -#: config/tc-mn10300.c:2600 config/tc-ppc.c:1476 config/tc-s390.c:614 -#: config/tc-v850.c:1573 +#: config/tc-alpha.c:1823 config/tc-arc.c:292 config/tc-mn10200.c:888 +#: config/tc-mn10300.c:2604 config/tc-ppc.c:1541 config/tc-s390.c:615 +#: config/tc-v850.c:1588 msgid "operand" msgstr "" -#: config/tc-alpha.c:1926 config/tc-alpha.c:1950 config/tc-d10v.c:585 -#: config/tc-d30v.c:573 config/tc-mn10200.c:1133 config/tc-mn10300.c:1893 -#: config/tc-ppc.c:2348 config/tc-ppc.c:2565 config/tc-ppc.c:2577 -#: config/tc-s390.c:1230 config/tc-s390.c:1330 config/tc-s390.c:1459 -#: config/tc-v850.c:1747 config/tc-v850.c:1770 config/tc-v850.c:1973 +#: config/tc-alpha.c:1926 config/tc-alpha.c:1950 config/tc-d10v.c:584 +#: config/tc-d30v.c:572 config/tc-mn10200.c:1132 config/tc-mn10300.c:1892 +#: config/tc-ppc.c:2402 config/tc-ppc.c:2619 config/tc-ppc.c:2631 +#: config/tc-s390.c:1231 config/tc-s390.c:1331 config/tc-s390.c:1460 +#: config/tc-v850.c:1762 config/tc-v850.c:1785 config/tc-v850.c:1988 msgid "too many fixups" msgstr "" @@ -994,17 +980,17 @@ msgstr "" msgid "can not resolve expression" msgstr "" -#: config/tc-alpha.c:3275 config/tc-ppc.c:1781 config/tc-ppc.c:4373 +#: config/tc-alpha.c:3275 config/tc-ppc.c:1840 config/tc-ppc.c:4380 #, c-format msgid ".COMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-alpha.c:3304 config/tc-sparc.c:3843 config/tc-v850.c:246 +#: config/tc-alpha.c:3304 config/tc-sparc.c:3923 config/tc-v850.c:245 msgid "Ignoring attempt to re-define symbol" msgstr "" -#: config/tc-alpha.c:3313 config/tc-alpha.c:3322 config/tc-ppc.c:4410 -#: config/tc-sparc.c:3851 +#: config/tc-alpha.c:3313 config/tc-alpha.c:3322 config/tc-ppc.c:4417 +#: config/tc-sparc.c:3931 #, c-format msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld." msgstr "" @@ -1033,7 +1019,7 @@ msgstr "" msgid ".fmask outside of .ent" msgstr "" -#: config/tc-alpha.c:3547 ecoff.c:3204 +#: config/tc-alpha.c:3547 config/tc-score.c:5886 ecoff.c:3204 msgid ".mask outside of .ent" msgstr "" @@ -1045,7 +1031,8 @@ msgstr "" msgid "bad .mask directive" msgstr "" -#: config/tc-alpha.c:3590 config/tc-mips.c:14022 ecoff.c:3168 +#: config/tc-alpha.c:3590 config/tc-mips.c:14589 config/tc-score.c:6029 +#: ecoff.c:3168 msgid ".frame outside of .ent" msgstr "" @@ -1134,7 +1121,7 @@ msgstr "" msgid "No symbol after .code_address" msgstr "" -#: config/tc-alpha.c:4226 +#: config/tc-alpha.c:4226 config/tc-score.c:5892 msgid "Bad .mask directive" msgstr "" @@ -1168,7 +1155,7 @@ msgstr "" msgid "Alignment too large: %d. assumed" msgstr "" -#: config/tc-alpha.c:4497 config/tc-d30v.c:2083 +#: config/tc-alpha.c:4497 config/tc-d30v.c:2082 msgid "Alignment negative: 0 assumed" msgstr "" @@ -1191,15 +1178,16 @@ msgstr "" msgid "internal error: can't hash macro `%s': %s" msgstr "" -#: config/tc-alpha.c:4998 config/tc-i960.c:710 config/tc-xtensa.c:5112 -#: config/tc-xtensa.c:5181 config/tc-xtensa.c:5227 +#: config/tc-alpha.c:4998 config/tc-arm.c:6012 config/tc-arm.c:6024 +#: config/tc-i960.c:708 config/tc-xtensa.c:5161 config/tc-xtensa.c:5239 +#: config/tc-xtensa.c:5285 config/tc-z80.c:1893 msgid "syntax error" msgstr "" -#: config/tc-alpha.c:5067 config/tc-h8300.c:2055 config/tc-hppa.c:4041 -#: config/tc-i860.c:1059 config/tc-m68hc11.c:558 config/tc-m68k.c:4524 -#: config/tc-ns32k.c:1945 config/tc-or32.c:579 config/tc-sparc.c:2944 -#: config/tc-z8k.c:1310 +#: config/tc-alpha.c:5067 config/tc-h8300.c:2053 config/tc-hppa.c:1381 +#: config/tc-i860.c:1057 config/tc-m68hc11.c:560 config/tc-m68k.c:4654 +#: config/tc-ns32k.c:1943 config/tc-or32.c:580 config/tc-sparc.c:2998 +#: config/tc-spu.c:748 config/tc-z8k.c:1332 msgid "Bad call to MD_ATOF()" msgstr "" @@ -1241,7 +1229,7 @@ msgstr "" msgid "type %d reloc done?\n" msgstr "" -#: config/tc-alpha.c:5420 config/tc-alpha.c:5427 config/tc-mips.c:8657 +#: config/tc-alpha.c:5420 config/tc-alpha.c:5427 msgid "Used $at without \".set noat\"" msgstr "" @@ -1250,12 +1238,12 @@ msgstr "" msgid "!samegp reloc against symbol without .prologue: %s" msgstr "" -#: config/tc-alpha.c:5626 config/tc-xtensa.c:5739 +#: config/tc-alpha.c:5626 config/tc-xtensa.c:5795 #, c-format msgid "cannot represent `%s' relocation in object file" msgstr "" -#: config/tc-alpha.c:5632 config/tc-xtensa.c:5747 +#: config/tc-alpha.c:5632 config/tc-xtensa.c:5803 #, c-format msgid "internal error? cannot generate `%s' relocation" msgstr "" @@ -1265,555 +1253,722 @@ msgstr "" msgid "frame reg expected, using $%d." msgstr "" -#: config/tc-arc.c:1077 config/tc-ip2k.c:249 +#: config/tc-arc.c:1076 config/tc-ip2k.c:248 msgid "md_estimate_size_before_relax\n" msgstr "" -#: config/tc-arc.c:1088 +#: config/tc-arc.c:1087 msgid "md_convert_frag\n" msgstr "" #. We can't actually support subtracting a symbol. -#: config/tc-arc.c:1288 config/tc-arm.c:1021 config/tc-arm.c:5764 -#: config/tc-arm.c:5815 config/tc-arm.c:6614 config/tc-arm.c:7256 -#: config/tc-arm.c:7284 config/tc-arm.c:7536 config/tc-arm.c:7553 -#: config/tc-arm.c:7674 config/tc-avr.c:970 config/tc-cris.c:3928 -#: config/tc-d10v.c:1539 config/tc-d30v.c:1938 config/tc-mips.c:3794 -#: config/tc-mips.c:4902 config/tc-mips.c:5834 config/tc-mips.c:6428 -#: config/tc-msp430.c:1979 config/tc-ppc.c:5562 config/tc-v850.c:2274 -#: config/tc-xstormy16.c:484 +#: config/tc-arc.c:1287 config/tc-arm.c:1522 config/tc-arm.c:8104 +#: config/tc-arm.c:8155 config/tc-arm.c:8388 config/tc-arm.c:9111 +#: config/tc-arm.c:9915 config/tc-arm.c:9943 config/tc-arm.c:10200 +#: config/tc-arm.c:10217 config/tc-arm.c:10339 config/tc-avr.c:1052 +#: config/tc-cris.c:3984 config/tc-d10v.c:1536 config/tc-d30v.c:1937 +#: config/tc-mips.c:4176 config/tc-mips.c:5300 config/tc-mips.c:6239 +#: config/tc-mips.c:6831 config/tc-msp430.c:1976 config/tc-ppc.c:5585 +#: config/tc-spu.c:961 config/tc-spu.c:985 config/tc-v850.c:2303 +#: config/tc-xstormy16.c:484 config/tc-xtensa.c:5597 config/tc-xtensa.c:11559 msgid "expression too complex" msgstr "" -#: config/tc-arm.c:352 +#: config/tc-arm.c:483 msgid "ARM register expected" msgstr "" -#: config/tc-arm.c:353 +#: config/tc-arm.c:484 msgid "bad or missing co-processor number" msgstr "" -#: config/tc-arm.c:354 +#: config/tc-arm.c:485 msgid "co-processor register expected" msgstr "" -#: config/tc-arm.c:355 +#: config/tc-arm.c:486 msgid "FPA register expected" msgstr "" -#: config/tc-arm.c:356 +#: config/tc-arm.c:487 msgid "VFP single precision register expected" msgstr "" -#: config/tc-arm.c:357 -msgid "VFP double precision register expected" +#: config/tc-arm.c:488 +msgid "VFP/Neon double precision register expected" msgstr "" -#: config/tc-arm.c:358 +#: config/tc-arm.c:489 +msgid "Neon quad precision register expected" +msgstr "" + +#: config/tc-arm.c:490 +msgid "VFP single or double precision register expected" +msgstr "" + +#: config/tc-arm.c:491 +msgid "Neon double or quad precision register expected" +msgstr "" + +#: config/tc-arm.c:492 +msgid "VFP single, double or Neon quad precision register expected" +msgstr "" + +#: config/tc-arm.c:493 msgid "VFP system register expected" msgstr "" -#: config/tc-arm.c:359 +#: config/tc-arm.c:494 msgid "Maverick MVF register expected" msgstr "" -#: config/tc-arm.c:360 +#: config/tc-arm.c:495 msgid "Maverick MVD register expected" msgstr "" -#: config/tc-arm.c:361 +#: config/tc-arm.c:496 msgid "Maverick MVFX register expected" msgstr "" -#: config/tc-arm.c:362 +#: config/tc-arm.c:497 msgid "Maverick MVDX register expected" msgstr "" -#: config/tc-arm.c:363 +#: config/tc-arm.c:498 msgid "Maverick MVAX register expected" msgstr "" -#: config/tc-arm.c:364 +#: config/tc-arm.c:499 msgid "Maverick DSPSC register expected" msgstr "" -#: config/tc-arm.c:365 +#: config/tc-arm.c:500 msgid "iWMMXt data register expected" msgstr "" -#: config/tc-arm.c:366 +#: config/tc-arm.c:501 config/tc-arm.c:5821 msgid "iWMMXt control register expected" msgstr "" -#: config/tc-arm.c:367 +#: config/tc-arm.c:502 msgid "iWMMXt scalar register expected" msgstr "" -#: config/tc-arm.c:368 +#: config/tc-arm.c:503 msgid "XScale accumulator register expected" msgstr "" -#: config/tc-arm.c:499 +#. For score5u : div/mul will pop warning message, mmu/alw/asw will pop error message. +#: config/tc-arm.c:652 config/tc-score.c:47 msgid "bad arguments to instruction" msgstr "" -#: config/tc-arm.c:500 +#: config/tc-arm.c:653 config/tc-score.c:48 msgid "r15 not allowed here" msgstr "" -#: config/tc-arm.c:501 +#: config/tc-arm.c:654 msgid "instruction cannot be conditional" msgstr "" -#: config/tc-arm.c:502 +#: config/tc-arm.c:655 msgid "registers may not be the same" msgstr "" -#: config/tc-arm.c:503 +#: config/tc-arm.c:656 msgid "lo register required" msgstr "" -#: config/tc-arm.c:504 +#: config/tc-arm.c:657 msgid "instruction not supported in Thumb16 mode" msgstr "" -#: config/tc-arm.c:640 +#: config/tc-arm.c:658 +msgid "instruction does not accept this addressing mode" +msgstr "" + +#: config/tc-arm.c:659 +msgid "branch must be last instruction in IT block" +msgstr "" + +#: config/tc-arm.c:660 +msgid "instruction not allowed in IT block" +msgstr "" + +#: config/tc-arm.c:661 +msgid "selected FPU does not support instruction" +msgstr "" + +#: config/tc-arm.c:803 msgid "immediate expression requires a # prefix" msgstr "" -#: config/tc-arm.c:666 expr.c:1302 read.c:2228 +#: config/tc-arm.c:830 config/tc-score.c:5675 expr.c:1298 read.c:2435 msgid "bad expression" msgstr "" -#: config/tc-arm.c:677 config/tc-i860.c:1005 config/tc-sparc.c:2844 +#: config/tc-arm.c:841 config/tc-i860.c:1003 config/tc-sparc.c:2898 msgid "bad segment" msgstr "" -#: config/tc-arm.c:693 config/tc-arm.c:3230 config/tc-i960.c:1302 +#: config/tc-arm.c:858 config/tc-arm.c:4346 config/tc-i960.c:1300 +#: config/tc-score.c:985 msgid "invalid constant" msgstr "" -#: config/tc-arm.c:754 +#: config/tc-arm.c:919 config/tc-score.c:4749 msgid "bad call to MD_ATOF()" msgstr "" -#: config/tc-arm.c:821 +#: config/tc-arm.c:986 msgid "expected #constant" msgstr "" -#: config/tc-arm.c:953 +#: config/tc-arm.c:1147 +#, c-format +msgid "unexpected character `%c' in type specifier" +msgstr "" + +#: config/tc-arm.c:1164 +#, c-format +msgid "bad size %d in type specifier" +msgstr "" + +#: config/tc-arm.c:1214 +msgid "only one type should be specified for operand" +msgstr "" + +#: config/tc-arm.c:1220 +msgid "vector type expected" +msgstr "" + +#: config/tc-arm.c:1292 +msgid "can't redefine type for operand" +msgstr "" + +#: config/tc-arm.c:1303 +msgid "only D registers may be indexed" +msgstr "" + +#: config/tc-arm.c:1309 +msgid "can't change index for operand" +msgstr "" + +#: config/tc-arm.c:1325 config/tc-arm.c:3947 +msgid "constant expression required" +msgstr "" + +#: config/tc-arm.c:1369 +msgid "register operand expected, but got scalar" +msgstr "" + +#: config/tc-arm.c:1402 +msgid "scalar must have an index" +msgstr "" + +#: config/tc-arm.c:1407 config/tc-arm.c:13097 config/tc-arm.c:13145 +#: config/tc-arm.c:13547 +msgid "scalar index out of range" +msgstr "" + +#: config/tc-arm.c:1454 msgid "bad range in register list" msgstr "" -#: config/tc-arm.c:961 config/tc-arm.c:970 config/tc-arm.c:1011 +#: config/tc-arm.c:1462 config/tc-arm.c:1471 config/tc-arm.c:1512 #, c-format msgid "Warning: duplicated register (r%d) in register list" msgstr "" -#: config/tc-arm.c:973 +#: config/tc-arm.c:1474 msgid "Warning: register range not in ascending order" msgstr "" -#: config/tc-arm.c:984 +#: config/tc-arm.c:1485 msgid "missing `}'" msgstr "" -#: config/tc-arm.c:1000 +#: config/tc-arm.c:1501 msgid "invalid register mask" msgstr "" -#: config/tc-arm.c:1091 config/tc-arm.c:1126 config/tc-h8300.c:991 -#: config/tc-mips.c:9797 config/tc-mips.c:9827 +#: config/tc-arm.c:1583 +msgid "expecting {" +msgstr "" + +#: config/tc-arm.c:1638 config/tc-arm.c:1682 +msgid "register out of range in list" +msgstr "" + +#: config/tc-arm.c:1654 config/tc-arm.c:1699 config/tc-h8300.c:989 +#: config/tc-mips.c:10168 config/tc-mips.c:10190 msgid "invalid register list" msgstr "" -#: config/tc-arm.c:1097 config/tc-arm.c:2402 config/tc-arm.c:2535 +#: config/tc-arm.c:1660 config/tc-arm.c:3412 config/tc-arm.c:3545 msgid "register list not in ascending order" msgstr "" -#: config/tc-arm.c:1118 +#: config/tc-arm.c:1691 msgid "register range not in ascending order" msgstr "" -#: config/tc-arm.c:1151 +#: config/tc-arm.c:1724 msgid "non-contiguous register range" msgstr "" -#: config/tc-arm.c:1199 +#: config/tc-arm.c:1850 +msgid "don't use Rn-Rm syntax with non-unit stride" +msgstr "" + +#: config/tc-arm.c:1905 +msgid "error parsing element/structure list" +msgstr "" + +#: config/tc-arm.c:1911 +msgid "expected }" +msgstr "" + +#: config/tc-arm.c:1967 #, c-format msgid "ignoring attempt to redefine built-in register '%s'" msgstr "" -#: config/tc-arm.c:1204 +#: config/tc-arm.c:1972 #, c-format msgid "ignoring redefinition of register alias '%s'" msgstr "" -#: config/tc-arm.c:1248 +#: config/tc-arm.c:2000 +msgid "attempt to redefine typed alias" +msgstr "" + +#: config/tc-arm.c:2038 #, c-format msgid "unknown register '%s' -- .req ignored" msgstr "" -#: config/tc-arm.c:1291 +#: config/tc-arm.c:2121 +msgid "bad type for register" +msgstr "" + +#: config/tc-arm.c:2132 +msgid "expression must be constant" +msgstr "" + +#: config/tc-arm.c:2149 +msgid "can't redefine the type of a register alias" +msgstr "" + +#: config/tc-arm.c:2156 +msgid "you must specify a single type only" +msgstr "" + +#: config/tc-arm.c:2169 +msgid "can't redefine the index of a scalar alias" +msgstr "" + +#: config/tc-arm.c:2177 +msgid "scalar index must be constant" +msgstr "" + +#: config/tc-arm.c:2186 +msgid "expecting ]" +msgstr "" + +#: config/tc-arm.c:2223 msgid "invalid syntax for .req directive" msgstr "" -#: config/tc-arm.c:1317 +#: config/tc-arm.c:2229 +msgid "invalid syntax for .dn directive" +msgstr "" + +#: config/tc-arm.c:2235 +msgid "invalid syntax for .qn directive" +msgstr "" + +#: config/tc-arm.c:2261 msgid "invalid syntax for .unreq directive" msgstr "" -#: config/tc-arm.c:1323 +#: config/tc-arm.c:2267 #, c-format msgid "unknown register alias '%s'" msgstr "" -#: config/tc-arm.c:1325 +#: config/tc-arm.c:2269 #, c-format msgid "ignoring attempt to undefine built-in register '%s'" msgstr "" -#: config/tc-arm.c:1456 +#: config/tc-arm.c:2402 msgid "selected processor does not support THUMB opcodes" msgstr "" -#: config/tc-arm.c:1470 +#: config/tc-arm.c:2416 msgid "selected processor does not support ARM opcodes" msgstr "" -#: config/tc-arm.c:1483 +#: config/tc-arm.c:2429 #, c-format msgid "invalid instruction size selected (%d)" msgstr "" -#: config/tc-arm.c:1515 +#: config/tc-arm.c:2461 #, c-format msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" msgstr "" -#: config/tc-arm.c:1571 +#: config/tc-arm.c:2517 #, c-format msgid "expected comma after name \"%s\"" msgstr "" -#: config/tc-arm.c:1621 config/tc-m32r.c:589 +#: config/tc-arm.c:2567 config/tc-m32r.c:588 #, c-format msgid "symbol `%s' already defined" msgstr "" -#: config/tc-arm.c:1655 +#: config/tc-arm.c:2601 #, c-format msgid "unrecognized syntax mode \"%s\"" msgstr "" -#: config/tc-arm.c:1675 +#: config/tc-arm.c:2622 #, c-format msgid "alignment too large: %d assumed" msgstr "" -#: config/tc-arm.c:1678 +#: config/tc-arm.c:2625 msgid "alignment negative. 0 assumed." msgstr "" -#: config/tc-arm.c:1816 +#: config/tc-arm.c:2772 msgid "literal pool overflow" msgstr "" -#: config/tc-arm.c:1972 config/tc-arm.c:3888 +#: config/tc-arm.c:2928 config/tc-arm.c:5756 msgid "unrecognized relocation suffix" msgstr "" -#: config/tc-arm.c:1985 +#: config/tc-arm.c:2941 msgid "(plt) is only valid on branch targets" msgstr "" -#: config/tc-arm.c:1991 config/tc-s390.c:1128 config/tc-s390.c:1742 -#: config/tc-xtensa.c:1601 +#: config/tc-arm.c:2947 config/tc-s390.c:1129 config/tc-s390.c:1743 +#: config/tc-xtensa.c:1545 #, c-format msgid "%s relocations do not fit in %d bytes" msgstr "" -#: config/tc-arm.c:2039 dwarf2dbg.c:659 +#: config/tc-arm.c:2995 dwarf2dbg.c:689 msgid "expected 0 or 1" msgstr "" -#: config/tc-arm.c:2043 +#: config/tc-arm.c:2999 msgid "missing comma" msgstr "" -#: config/tc-arm.c:2098 +#: config/tc-arm.c:3054 msgid "dupicate .handlerdata directive" msgstr "" -#: config/tc-arm.c:2169 +#: config/tc-arm.c:3125 msgid "personality routine specified for cantunwind frame" msgstr "" -#: config/tc-arm.c:2183 +#: config/tc-arm.c:3139 msgid "duplicate .personalityindex directive" msgstr "" -#: config/tc-arm.c:2190 +#: config/tc-arm.c:3146 msgid "bad personality routine number" msgstr "" -#: config/tc-arm.c:2209 +#: config/tc-arm.c:3165 msgid "duplicate .personality directive" msgstr "" -#: config/tc-arm.c:2232 config/tc-arm.c:2354 +#: config/tc-arm.c:3188 config/tc-arm.c:3316 config/tc-arm.c:3364 msgid "expected register list" msgstr "" -#: config/tc-arm.c:2310 +#: config/tc-arm.c:3270 msgid "expected , " msgstr "" -#: config/tc-arm.c:2319 +#: config/tc-arm.c:3279 msgid "number of registers must be in the range [1:4]" msgstr "" -#: config/tc-arm.c:2416 config/tc-arm.c:2549 +#: config/tc-arm.c:3426 config/tc-arm.c:3559 msgid "bad register range" msgstr "" -#: config/tc-arm.c:2602 +#: config/tc-arm.c:3613 msgid "register expected" msgstr "" -#: config/tc-arm.c:2612 +#: config/tc-arm.c:3623 msgid "FPA .unwind_save does not take a register list" msgstr "" -#: config/tc-arm.c:2625 +#: config/tc-arm.c:3641 msgid ".unwind_save does not support this kind of register" msgstr "" -#: config/tc-arm.c:2650 +#: config/tc-arm.c:3677 msgid "SP and PC not permitted in .unwind_movsp directive" msgstr "" -#: config/tc-arm.c:2655 +#: config/tc-arm.c:3682 msgid "unexpected .unwind_movsp directive" msgstr "" -#: config/tc-arm.c:2679 +#: config/tc-arm.c:3706 msgid "stack increment must be multiple of 4" msgstr "" -#: config/tc-arm.c:2708 +#: config/tc-arm.c:3735 msgid "expected , " msgstr "" -#: config/tc-arm.c:2726 +#: config/tc-arm.c:3753 msgid "register must be either sp or set by a previousunwind_movsp directive" msgstr "" -#: config/tc-arm.c:2762 +#: config/tc-arm.c:3789 msgid "expected , " msgstr "" -#: config/tc-arm.c:2774 +#: config/tc-arm.c:3801 msgid "unwind opcode too long" msgstr "" -#: config/tc-arm.c:2779 +#: config/tc-arm.c:3806 msgid "invalid unwind opcode" msgstr "" -#: config/tc-arm.c:2829 -msgid "expected numeric constant" -msgstr "" - -#: config/tc-arm.c:2838 -msgid "expected comma" -msgstr "" - -#: config/tc-arm.c:2877 -msgid "bad string constant" -msgstr "" - -#: config/tc-arm.c:2881 -msgid "expected , " -msgstr "" - -#: config/tc-arm.c:2957 -msgid "constant expression required" -msgstr "" - -#: config/tc-arm.c:2963 config/tc-arm.c:6472 config/tc-arm.c:11799 -#: config/tc-arm.c:11824 config/tc-arm.c:11832 config/tc-z8k.c:1122 -#: config/tc-z8k.c:1132 +#: config/tc-arm.c:3953 config/tc-arm.c:4816 config/tc-arm.c:8391 +#: config/tc-arm.c:8873 config/tc-arm.c:11671 config/tc-arm.c:18619 +#: config/tc-arm.c:18644 config/tc-arm.c:18652 config/tc-z8k.c:1144 +#: config/tc-z8k.c:1154 msgid "immediate value out of range" msgstr "" -#: config/tc-arm.c:3058 +#: config/tc-arm.c:4100 msgid "invalid FPA immediate expression" msgstr "" -#: config/tc-arm.c:3108 config/tc-arm.c:3116 +#: config/tc-arm.c:4224 config/tc-arm.c:4232 msgid "shift expression expected" msgstr "" -#: config/tc-arm.c:3130 +#: config/tc-arm.c:4246 msgid "'LSL' or 'ASR' required" msgstr "" -#: config/tc-arm.c:3138 +#: config/tc-arm.c:4254 msgid "'LSL' required" msgstr "" -#: config/tc-arm.c:3146 +#: config/tc-arm.c:4262 msgid "'ASR' required" msgstr "" -#: config/tc-arm.c:3218 config/tc-arm.c:4349 config/tc-v850.c:1844 -#: config/tc-v850.c:1865 +#: config/tc-arm.c:4334 config/tc-arm.c:4810 config/tc-arm.c:6382 +#: config/tc-v850.c:1859 config/tc-v850.c:1880 msgid "constant expression expected" msgstr "" -#: config/tc-arm.c:3225 +#: config/tc-arm.c:4341 msgid "invalid rotation" msgstr "" -#: config/tc-arm.c:3340 config/tc-arm.c:3640 +#: config/tc-arm.c:4501 config/tc-arm.c:4646 +msgid "unknown group relocation" +msgstr "" + +#: config/tc-arm.c:4614 +msgid "alignment must be constant" +msgstr "" + +#: config/tc-arm.c:4677 +msgid "this group relocation is not allowed on this instruction" +msgstr "" + +#: config/tc-arm.c:4689 config/tc-arm.c:5080 msgid "']' expected" msgstr "" -#: config/tc-arm.c:3358 +#: config/tc-arm.c:4707 msgid "'}' expected at end of 'option' field" msgstr "" -#: config/tc-arm.c:3363 +#: config/tc-arm.c:4712 msgid "cannot combine index with option" msgstr "" -#: config/tc-arm.c:3376 +#: config/tc-arm.c:4725 msgid "cannot combine pre- and post-indexing" msgstr "" -#: config/tc-arm.c:3472 +#: config/tc-arm.c:4886 msgid "flag for {c}psr instruction expected" msgstr "" -#: config/tc-arm.c:3497 +#: config/tc-arm.c:4911 msgid "unrecognized CPS flag" msgstr "" -#: config/tc-arm.c:3504 +#: config/tc-arm.c:4918 msgid "missing CPS flags" msgstr "" -#: config/tc-arm.c:3527 config/tc-arm.c:3533 +#: config/tc-arm.c:4941 config/tc-arm.c:4947 msgid "valid endian specifiers are be or le" msgstr "" -#: config/tc-arm.c:3555 +#: config/tc-arm.c:4969 msgid "missing rotation field after comma" msgstr "" -#: config/tc-arm.c:3570 +#: config/tc-arm.c:4984 msgid "rotation can only be 0, 8, 16, or 24" msgstr "" -#: config/tc-arm.c:3590 +#: config/tc-arm.c:5004 msgid "condition required" msgstr "" -#: config/tc-arm.c:3632 +#: config/tc-arm.c:5042 config/tc-arm.c:6877 +msgid "'[' expected" +msgstr "" + +#: config/tc-arm.c:5055 +msgid "',' expected" +msgstr "" + +#: config/tc-arm.c:5072 msgid "invalid shift" msgstr "" -#: config/tc-arm.c:3929 +#: config/tc-arm.c:5145 +msgid "can't use Neon quad register here" +msgstr "" + +#: config/tc-arm.c:5211 +msgid "expected or or operand" +msgstr "" + +#: config/tc-arm.c:5291 +msgid "parse error" +msgstr "" + +#: config/tc-arm.c:5301 read.c:2092 +msgid "expected comma" +msgstr "" + +#: config/tc-arm.c:5591 config/tc-arm.c:5661 +msgid "immediate value is out of range" +msgstr "" + +#: config/tc-arm.c:5806 msgid "iWMMXt data or control register expected" msgstr "" -#: config/tc-arm.c:4051 +#: config/tc-arm.c:6038 config/tc-score.c:56 msgid "garbage following instruction" msgstr "" -#: config/tc-arm.c:4185 +#: config/tc-arm.c:6125 +msgid "D register out of range for selected VFP version" +msgstr "" + +#: config/tc-arm.c:6204 msgid "instruction does not accept preindexed addressing" msgstr "" #. unindexed - only for coprocessor -#: config/tc-arm.c:4201 config/tc-arm.c:5857 +#: config/tc-arm.c:6220 config/tc-arm.c:8197 msgid "instruction does not accept unindexed addressing" msgstr "" -#: config/tc-arm.c:4209 +#: config/tc-arm.c:6228 msgid "destination register same as write-back base" msgstr "" -#: config/tc-arm.c:4210 +#: config/tc-arm.c:6229 msgid "source register same as write-back base" msgstr "" -#: config/tc-arm.c:4256 +#: config/tc-arm.c:6275 msgid "instruction does not accept scaled register index" msgstr "" -#: config/tc-arm.c:4295 +#: config/tc-arm.c:6315 msgid "instruction does not support unindexed addressing" msgstr "" -#: config/tc-arm.c:4310 +#: config/tc-arm.c:6330 msgid "pc may not be used with write-back" msgstr "" -#: config/tc-arm.c:4315 +#: config/tc-arm.c:6335 msgid "instruction does not support writeback" msgstr "" -#: config/tc-arm.c:4344 +#: config/tc-arm.c:6377 msgid "invalid pseudo operation" msgstr "" -#: config/tc-arm.c:4390 +#: config/tc-arm.c:6423 msgid "literal pool insertion failed" msgstr "" -#: config/tc-arm.c:4448 +#: config/tc-arm.c:6481 msgid "Rn must not overlap other operands" msgstr "" -#: config/tc-arm.c:4534 config/tc-arm.c:4553 config/tc-arm.c:4566 -#: config/tc-arm.c:6360 config/tc-arm.c:6380 config/tc-arm.c:6394 +#: config/tc-arm.c:6581 config/tc-arm.c:6600 config/tc-arm.c:6613 +#: config/tc-arm.c:8740 config/tc-arm.c:8760 config/tc-arm.c:8774 msgid "bit-field extends past end of register" msgstr "" -#: config/tc-arm.c:4595 +#: config/tc-arm.c:6642 msgid "the only suffix valid here is '(plt)'" msgstr "" -#: config/tc-arm.c:4627 +#: config/tc-arm.c:6695 msgid "use of r15 in blx in ARM mode is not really useful" msgstr "" -#: config/tc-arm.c:4645 +#: config/tc-arm.c:6718 msgid "use of r15 in bx in ARM mode is not really useful" msgstr "" -#: config/tc-arm.c:4657 config/tc-arm.c:6508 +#: config/tc-arm.c:6730 config/tc-arm.c:8912 msgid "use of r15 in bxj is not really useful" msgstr "" -#: config/tc-arm.c:4761 config/tc-arm.c:4770 +#: config/tc-arm.c:6844 config/tc-arm.c:6853 msgid "writeback of base register is UNPREDICTABLE" msgstr "" -#: config/tc-arm.c:4764 +#: config/tc-arm.c:6847 msgid "writeback of base register when in register list is UNPREDICTABLE" msgstr "" -#: config/tc-arm.c:4774 +#: config/tc-arm.c:6857 msgid "if writeback register is in list, it must be the lowest reg in the list" msgstr "" -#: config/tc-arm.c:4789 +#: config/tc-arm.c:6872 msgid "first destination register must be even" msgstr "" -#: config/tc-arm.c:4792 config/tc-arm.c:4849 +#: config/tc-arm.c:6875 config/tc-arm.c:6942 msgid "can only load two consecutive registers" msgstr "" @@ -1821,863 +1976,1052 @@ msgstr "" #. have been called in the first place. #. If op 2 were present and equal to PC, this function wouldn't #. have been called in the first place. -#: config/tc-arm.c:4793 config/tc-arm.c:4852 config/tc-arm.c:5299 -#: config/tc-arm.c:6886 +#: config/tc-arm.c:6876 config/tc-arm.c:6945 config/tc-arm.c:7467 +#: config/tc-arm.c:9390 msgid "r14 not allowed here" msgstr "" -#: config/tc-arm.c:4794 -msgid "'[' expected" -msgstr "" - -#: config/tc-arm.c:4807 +#: config/tc-arm.c:6890 msgid "base register written back, and overlaps second destination register" msgstr "" -#: config/tc-arm.c:4815 +#: config/tc-arm.c:6898 msgid "index register overlaps destination register" msgstr "" -#: config/tc-arm.c:4829 config/tc-arm.c:5272 config/tc-arm.c:6706 -#: config/tc-arm.c:7581 -msgid "instruction does not accept this addressing mode" -msgstr "" - -#: config/tc-arm.c:4835 config/tc-arm.c:5281 +#: config/tc-arm.c:6928 config/tc-arm.c:7449 msgid "offset must be zero in ARM encoding" msgstr "" -#: config/tc-arm.c:4846 config/tc-arm.c:5293 +#: config/tc-arm.c:6939 config/tc-arm.c:7461 msgid "even register required" msgstr "" -#: config/tc-arm.c:4877 config/tc-arm.c:4908 +#: config/tc-arm.c:6970 config/tc-arm.c:7001 msgid "this instruction requires a post-indexed address" msgstr "" -#: config/tc-arm.c:4935 -msgid "rd and rm should be different in mla" +#: config/tc-arm.c:7028 +msgid "Rd and Rm should be different in mla" msgstr "" -#: config/tc-arm.c:4967 config/tc-arm.c:7121 +#: config/tc-arm.c:7052 config/tc-arm.c:9648 +msgid ":lower16: not allowed this instruction" +msgstr "" + +#: config/tc-arm.c:7054 +msgid ":upper16: not allowed instruction" +msgstr "" + +#: config/tc-arm.c:7073 +msgid "operand 1 must be FPSCR" +msgstr "" + +#: config/tc-arm.c:7106 config/tc-arm.c:9757 msgid "'CPSR' or 'SPSR' expected" msgstr "" -#: config/tc-arm.c:5000 -msgid "rd and rm should be different in mul" +#: config/tc-arm.c:7143 +msgid "Rd and Rm should be different in mul" msgstr "" -#: config/tc-arm.c:5021 +#: config/tc-arm.c:7164 msgid "rdhi, rdlo and rm must all be different" msgstr "" -#: config/tc-arm.c:5083 +#: config/tc-arm.c:7226 msgid "'[' expected after PLD mnemonic" msgstr "" -#: config/tc-arm.c:5085 +#: config/tc-arm.c:7228 config/tc-arm.c:7243 msgid "post-indexed expression used in preload instruction" msgstr "" -#: config/tc-arm.c:5087 +#: config/tc-arm.c:7230 config/tc-arm.c:7245 msgid "writeback used in preload instruction" msgstr "" -#: config/tc-arm.c:5089 +#: config/tc-arm.c:7232 config/tc-arm.c:7247 msgid "unindexed addressing used in preload instruction" msgstr "" -#: config/tc-arm.c:5188 config/tc-arm.c:7492 -msgid "source1 and dest must be same register" +#: config/tc-arm.c:7241 +msgid "'[' expected after PLI mnemonic" msgstr "" -#: config/tc-arm.c:5238 config/tc-arm.c:7178 +#: config/tc-arm.c:7394 config/tc-arm.c:9837 msgid "rdhi and rdlo must be different" msgstr "" -#: config/tc-arm.c:5296 +#: config/tc-arm.c:7420 +msgid "SRS base register must be r13" +msgstr "" + +#: config/tc-arm.c:7464 msgid "can only store two consecutive registers" msgstr "" -#: config/tc-arm.c:5391 config/tc-arm.c:5408 +#: config/tc-arm.c:7559 config/tc-arm.c:7576 msgid "only two consecutive VFP SP registers allowed here" msgstr "" -#: config/tc-arm.c:5436 config/tc-arm.c:5451 +#: config/tc-arm.c:7604 config/tc-arm.c:7619 msgid "this addressing mode requires base-register writeback" msgstr "" -#: config/tc-arm.c:5529 +#: config/tc-arm.c:7794 msgid "this instruction does not support indexing" msgstr "" -#: config/tc-arm.c:5552 +#: config/tc-arm.c:7818 msgid "only r15 allowed here" msgstr "" -#: config/tc-arm.c:5757 +#: config/tc-arm.c:7953 +msgid "immediate operand requires iWMMXt2" +msgstr "" + +#: config/tc-arm.c:8097 msgid "shift by register not allowed in thumb mode" msgstr "" -#: config/tc-arm.c:5769 config/tc-arm.c:11339 +#: config/tc-arm.c:8109 config/tc-arm.c:18126 msgid "shift expression is too large" msgstr "" -#: config/tc-arm.c:5795 -msgid "Thumb does not support the ldr =N pseudo-operation" +#: config/tc-arm.c:8135 +msgid "Instruction does not support =N addresses" msgstr "" -#: config/tc-arm.c:5800 +#: config/tc-arm.c:8140 msgid "cannot use register index with PC-relative addressing" msgstr "" -#: config/tc-arm.c:5801 +#: config/tc-arm.c:8141 msgid "cannot use register index with this instruction" msgstr "" -#: config/tc-arm.c:5803 +#: config/tc-arm.c:8143 msgid "Thumb does not support negative register indexing" msgstr "" -#: config/tc-arm.c:5805 +#: config/tc-arm.c:8145 msgid "Thumb does not support register post-indexing" msgstr "" -#: config/tc-arm.c:5807 +#: config/tc-arm.c:8147 msgid "Thumb does not support register indexing with writeback" msgstr "" -#: config/tc-arm.c:5809 +#: config/tc-arm.c:8149 msgid "Thumb supports only LSL in shifted register indexing" msgstr "" -#: config/tc-arm.c:5818 +#: config/tc-arm.c:8158 config/tc-arm.c:12899 msgid "shift out of range" msgstr "" -#: config/tc-arm.c:5826 +#: config/tc-arm.c:8166 msgid "cannot use writeback with PC-relative addressing" msgstr "" -#: config/tc-arm.c:5828 +#: config/tc-arm.c:8168 msgid "cannot use writeback with this instruction" msgstr "" -#: config/tc-arm.c:5847 +#: config/tc-arm.c:8187 msgid "cannot use post-indexing with PC-relative addressing" msgstr "" -#: config/tc-arm.c:5848 +#: config/tc-arm.c:8188 msgid "cannot use post-indexing with this instruction" msgstr "" -#: config/tc-arm.c:5975 +#: config/tc-arm.c:8315 msgid "PC not allowed as destination" msgstr "" -#: config/tc-arm.c:6093 config/tc-arm.c:6234 config/tc-arm.c:6326 -#: config/tc-arm.c:7092 +#: config/tc-arm.c:8386 +msgid "only SUBS PC, LR, #const allowed" +msgstr "" + +#: config/tc-arm.c:8459 config/tc-arm.c:8600 config/tc-arm.c:8692 +#: config/tc-arm.c:9712 msgid "shift must be constant" msgstr "" -#: config/tc-arm.c:6120 config/tc-arm.c:6249 config/tc-arm.c:6341 -#: config/tc-arm.c:7105 +#: config/tc-arm.c:8486 config/tc-arm.c:8615 config/tc-arm.c:8707 +#: config/tc-arm.c:9725 msgid "unshifted register required" msgstr "" -#: config/tc-arm.c:6135 config/tc-arm.c:6352 config/tc-arm.c:7165 +#: config/tc-arm.c:8501 config/tc-arm.c:8718 config/tc-arm.c:9824 msgid "dest must overlap one source register" msgstr "" -#: config/tc-arm.c:6252 +#: config/tc-arm.c:8618 msgid "dest and source1 must be the same register" msgstr "" -#: config/tc-arm.c:6537 +#: config/tc-arm.c:8869 +msgid "instruction is always unconditional" +msgstr "" + +#: config/tc-arm.c:8951 +msgid "selected processor does not support 'A' form of this instruction" +msgstr "" + +#: config/tc-arm.c:8954 msgid "Thumb does not support the 2-argument form of this instruction" msgstr "" -#: config/tc-arm.c:6616 -msgid "Thumb load/store multiple does not support {reglist}^" +#: config/tc-arm.c:9053 +msgid "SP not allowed in register list" msgstr "" -#: config/tc-arm.c:6633 config/tc-arm.c:6649 config/tc-arm.c:6680 +#: config/tc-arm.c:9058 +msgid "LR and PC should not both be in register list" +msgstr "" + +#: config/tc-arm.c:9062 +msgid "base register should not be in register list when written back" +msgstr "" + +#: config/tc-arm.c:9068 +msgid "PC not allowed in register list" +msgstr "" + +#: config/tc-arm.c:9071 config/tc-arm.c:9137 config/tc-arm.c:9177 #, c-format msgid "value stored for r%d is UNPREDICTABLE" msgstr "" -#: config/tc-arm.c:6643 -msgid "SP should not be in register list" +#: config/tc-arm.c:9113 +msgid "Thumb load/store multiple does not support {reglist}^" msgstr "" -#: config/tc-arm.c:6647 -msgid "PC should not be in register list" +#: config/tc-arm.c:9170 +msgid "Thumb-2 instruction only valid in unified syntax" msgstr "" -#: config/tc-arm.c:6656 config/tc-arm.c:7311 -msgid "LR and PC should not both be in register list" -msgstr "" - -#: config/tc-arm.c:6659 -msgid "base register should not be in register list when written back" -msgstr "" - -#: config/tc-arm.c:6677 config/tc-arm.c:6687 +#: config/tc-arm.c:9174 config/tc-arm.c:9184 msgid "this instruction will write back the base register" msgstr "" -#: config/tc-arm.c:6690 +#: config/tc-arm.c:9187 msgid "this instruction will not write back the base register" msgstr "" -#: config/tc-arm.c:6719 +#: config/tc-arm.c:9216 msgid "r14 not allowed as first register when second register is omitted" msgstr "" -#: config/tc-arm.c:6809 config/tc-arm.c:6822 config/tc-arm.c:6858 +#: config/tc-arm.c:9313 config/tc-arm.c:9326 config/tc-arm.c:9362 msgid "Thumb does not support this addressing mode" msgstr "" -#: config/tc-arm.c:6826 +#: config/tc-arm.c:9330 msgid "byte or halfword not valid for base register" msgstr "" -#: config/tc-arm.c:6829 +#: config/tc-arm.c:9333 msgid "r15 based store not allowed" msgstr "" -#: config/tc-arm.c:6831 +#: config/tc-arm.c:9335 msgid "invalid base register for register offset" msgstr "" -#: config/tc-arm.c:7032 +#: config/tc-arm.c:9633 msgid "only lo regs allowed with immediate" msgstr "" -#: config/tc-arm.c:7130 +#: config/tc-arm.c:9653 +msgid ":upper16: not allowed this instruction" +msgstr "" + +#: config/tc-arm.c:9747 config/tc-arm.c:9779 config/tc-arm.c:9785 +msgid "selected processor does not support requested special purpose register" +msgstr "" + +#: config/tc-arm.c:9753 +#, c-format +msgid "" +"selected processor does not support requested special purpose register %x" +msgstr "" + +#: config/tc-arm.c:9774 msgid "Thumb encoding does not support an immediate here" msgstr "" -#: config/tc-arm.c:7200 +#: config/tc-arm.c:9859 msgid "Thumb does not support NOP with hints" msgstr "" -#: config/tc-arm.c:7282 +#: config/tc-arm.c:9941 msgid "push/pop do not support {reglist}^" msgstr "" -#: config/tc-arm.c:7301 -msgid "SP not allowed in register list" -msgstr "" - -#: config/tc-arm.c:7305 -msgid "PC not allowed in register list" -msgstr "" - -#: config/tc-arm.c:7328 +#: config/tc-arm.c:9964 msgid "invalid register list to push/pop instruction" msgstr "" -#: config/tc-arm.c:7513 +#: config/tc-arm.c:10156 +msgid "source1 and dest must be same register" +msgstr "" + +#: config/tc-arm.c:10177 msgid "ror #imm not supported" msgstr "" -#: config/tc-arm.c:7638 +#: config/tc-arm.c:10302 msgid "Thumb encoding does not support rotation" msgstr "" -#: config/tc-arm.c:7656 +#: config/tc-arm.c:10321 +msgid "instruction requires register index" +msgstr "" + +#: config/tc-arm.c:10323 msgid "PC is not a valid index register" msgstr "" -#: config/tc-arm.c:7658 +#: config/tc-arm.c:10325 msgid "instruction does not allow shifted index" msgstr "" -#: config/tc-arm.c:7660 -msgid "instruction requires shifted index" +#: config/tc-arm.c:10744 +msgid "invalid instruction shape" msgstr "" -#: config/tc-arm.c:7943 config/tc-arm.c:8015 +#: config/tc-arm.c:10986 +msgid "types specified in both the mnemonic and operands" +msgstr "" + +#: config/tc-arm.c:11023 +msgid "operand types can't be inferred" +msgstr "" + +#: config/tc-arm.c:11029 +msgid "type specifier has the wrong number of parts" +msgstr "" + +#: config/tc-arm.c:11084 +msgid "operand size must match register width" +msgstr "" + +#: config/tc-arm.c:11095 +msgid "bad type in Neon instruction" +msgstr "" + +#: config/tc-arm.c:11106 +msgid "inconsistent types in Neon instruction" +msgstr "" + +#: config/tc-arm.c:12155 +msgid "scalar out of range for multiply instruction" +msgstr "" + +#: config/tc-arm.c:12319 config/tc-arm.c:12331 +msgid "immediate out of range for insert" +msgstr "" + +#: config/tc-arm.c:12343 config/tc-arm.c:13245 +msgid "immediate out of range for shift" +msgstr "" + +#: config/tc-arm.c:12400 config/tc-arm.c:12427 config/tc-arm.c:12745 +#: config/tc-arm.c:13191 +msgid "immediate out of range" +msgstr "" + +#: config/tc-arm.c:12464 +msgid "immediate out of range for narrowing operation" +msgstr "" + +#: config/tc-arm.c:12584 +msgid "operands 0 and 1 must be the same register" +msgstr "" + +#: config/tc-arm.c:12719 +msgid "operand size must be specified for immediate VMOV" +msgstr "" + +#: config/tc-arm.c:12729 +msgid "immediate has bits set outside the operand size" +msgstr "" + +#: config/tc-arm.c:12925 +msgid "elements must be smaller than reversal region" +msgstr "" + +#: config/tc-arm.c:13096 config/tc-arm.c:13144 +msgid "bad type for scalar" +msgstr "" + +#: config/tc-arm.c:13208 config/tc-arm.c:13216 +msgid "VFP registers must be adjacent" +msgstr "" + +#: config/tc-arm.c:13357 +msgid "bad list length for table lookup" +msgstr "" + +#: config/tc-arm.c:13387 +msgid "writeback (!) must be used for VLDMDB and VSTMDB" +msgstr "" + +#: config/tc-arm.c:13390 +msgid "register list must contain at least 1 and at most 16 registers" +msgstr "" + +#: config/tc-arm.c:13467 +msgid "bad alignment" +msgstr "" + +#: config/tc-arm.c:13484 +msgid "bad list type for instruction" +msgstr "" + +#: config/tc-arm.c:13526 +msgid "unsupported alignment for instruction" +msgstr "" + +#: config/tc-arm.c:13545 config/tc-arm.c:13639 config/tc-arm.c:13650 +#: config/tc-arm.c:13660 config/tc-arm.c:13674 +msgid "bad list length" +msgstr "" + +#: config/tc-arm.c:13550 +msgid "stride of 2 unavailable when element size is 8" +msgstr "" + +#: config/tc-arm.c:13583 config/tc-arm.c:13658 +msgid "can't use alignment with this instruction" +msgstr "" + +#: config/tc-arm.c:13722 +msgid "post-index must be a register" +msgstr "" + +#: config/tc-arm.c:13724 +msgid "bad register for post-index" +msgstr "" + +#: config/tc-arm.c:14011 config/tc-arm.c:14097 msgid "conditional infixes are deprecated in unified syntax" msgstr "" -#: config/tc-arm.c:8047 +#: config/tc-arm.c:14130 #, c-format msgid "bad instruction `%s'" msgstr "" -#: config/tc-arm.c:8063 config/tc-arm.c:8126 +#: config/tc-arm.c:14136 +msgid "s suffix on comparison instruction is deprecated" +msgstr "" + +#: config/tc-arm.c:14155 config/tc-arm.c:14236 #, c-format msgid "selected processor does not support `%s'" msgstr "" -#: config/tc-arm.c:8069 +#: config/tc-arm.c:14161 msgid "Thumb does not support conditional execution" msgstr "" -#: config/tc-arm.c:8080 +#: config/tc-arm.c:14184 msgid "incorrect condition in IT block" msgstr "" -#: config/tc-arm.c:8088 +#: config/tc-arm.c:14190 msgid "thumb conditional instrunction not in IT block" msgstr "" -#: config/tc-arm.c:8108 +#: config/tc-arm.c:14210 #, c-format msgid "cannot honor width suffix -- `%s'" msgstr "" -#: config/tc-arm.c:8131 +#: config/tc-arm.c:14241 #, c-format msgid "width suffixes are invalid in ARM mode -- `%s'" msgstr "" -#: config/tc-arm.c:10340 +#: config/tc-arm.c:14265 +#, c-format +msgid "attempt to use an ARM instruction on a Thumb-only processor -- `%s'" +msgstr "" + +#: config/tc-arm.c:16992 msgid "alignments greater than 32 bytes not supported in .text sections." msgstr "" -#: config/tc-arm.c:10634 +#: config/tc-arm.c:17286 msgid "handerdata in cantunwind frame" msgstr "" -#: config/tc-arm.c:10651 +#: config/tc-arm.c:17303 msgid "too many unwind opcodes for personality routine 0" msgstr "" -#: config/tc-arm.c:10683 +#: config/tc-arm.c:17335 msgid "too many unwind opcodes" msgstr "" -#: config/tc-arm.c:11085 config/tc-arm.c:11365 +#: config/tc-arm.c:17869 config/tc-arm.c:18153 #, c-format msgid "undefined symbol %s used as an immediate value" msgstr "" -#: config/tc-arm.c:11099 config/tc-arm.c:11394 +#: config/tc-arm.c:17883 config/tc-arm.c:18192 #, c-format msgid "invalid constant (%lx) after fixup" msgstr "" -#: config/tc-arm.c:11136 +#: config/tc-arm.c:17920 #, c-format msgid "unable to compute ADRL instructions for PC offset of 0x%lx" msgstr "" -#: config/tc-arm.c:11168 config/tc-arm.c:11193 +#: config/tc-arm.c:17955 config/tc-arm.c:17980 msgid "invalid literal constant: pool needs to be closer" msgstr "" -#: config/tc-arm.c:11171 config/tc-arm.c:11209 +#: config/tc-arm.c:17958 config/tc-arm.c:17996 #, c-format msgid "bad immediate value for offset (%ld)" msgstr "" -#: config/tc-arm.c:11195 +#: config/tc-arm.c:17982 #, c-format -msgid "bad immediate value for half-word offset (%ld)" +msgid "bad immediate value for 8-bit offset (%ld)" msgstr "" -#: config/tc-arm.c:11250 +#: config/tc-arm.c:18037 msgid "offset not a multiple of 4" msgstr "" -#: config/tc-arm.c:11257 config/tc-arm.c:11272 config/tc-arm.c:11287 -#: config/tc-arm.c:11298 config/tc-arm.c:11321 config/tc-pj.c:499 -#: config/tc-sh.c:4084 +#: config/tc-arm.c:18044 config/tc-arm.c:18059 config/tc-arm.c:18074 +#: config/tc-arm.c:18085 config/tc-arm.c:18108 config/tc-pj.c:499 +#: config/tc-sh.c:4214 msgid "offset out of range" msgstr "" -#: config/tc-arm.c:11410 +#: config/tc-arm.c:18208 msgid "invalid smc expression" msgstr "" -#: config/tc-arm.c:11421 config/tc-arm.c:11430 +#: config/tc-arm.c:18219 config/tc-arm.c:18228 msgid "invalid swi expression" msgstr "" -#: config/tc-arm.c:11440 +#: config/tc-arm.c:18238 msgid "invalid expression in load/store multiple" msgstr "" -#: config/tc-arm.c:11455 +#: config/tc-arm.c:18268 msgid "misaligned branch destination" msgstr "" -#: config/tc-arm.c:11459 config/tc-arm.c:11479 config/tc-arm.c:11497 -#: config/tc-arm.c:11510 config/tc-arm.c:11523 config/tc-arm.c:11562 -#: config/tc-arm.c:11587 +#: config/tc-arm.c:18272 config/tc-arm.c:18309 config/tc-arm.c:18323 +#: config/tc-arm.c:18336 config/tc-arm.c:18375 config/tc-arm.c:18400 msgid "branch out of range" msgstr "" -#: config/tc-arm.c:11475 -msgid "misaligned BLX destination" -msgstr "" - -#: config/tc-arm.c:11536 +#: config/tc-arm.c:18349 msgid "conditional branch out of range" msgstr "" -#: config/tc-arm.c:11657 +#: config/tc-arm.c:18477 msgid "rel31 relocation overflow" msgstr "" -#: config/tc-arm.c:11669 config/tc-arm.c:11694 +#: config/tc-arm.c:18489 config/tc-arm.c:18512 msgid "co-processor offset out of range" msgstr "" -#: config/tc-arm.c:11710 +#: config/tc-arm.c:18529 #, c-format msgid "invalid offset, target not word aligned (0x%08lX)" msgstr "" -#: config/tc-arm.c:11716 config/tc-arm.c:11725 config/tc-arm.c:11733 -#: config/tc-arm.c:11741 config/tc-arm.c:11749 +#: config/tc-arm.c:18536 config/tc-arm.c:18545 config/tc-arm.c:18553 +#: config/tc-arm.c:18561 config/tc-arm.c:18569 #, c-format msgid "invalid offset, value too big (0x%08lX)" msgstr "" -#: config/tc-arm.c:11790 +#: config/tc-arm.c:18610 msgid "invalid Hi register with immediate" msgstr "" -#: config/tc-arm.c:11806 +#: config/tc-arm.c:18626 msgid "invalid immediate for stack address calculation" msgstr "" -#: config/tc-arm.c:11814 +#: config/tc-arm.c:18634 #, c-format msgid "invalid immediate for address calculation (value = 0x%08lX)" msgstr "" -#: config/tc-arm.c:11844 +#: config/tc-arm.c:18664 #, c-format msgid "invalid immediate: %ld is too large" msgstr "" -#: config/tc-arm.c:11856 +#: config/tc-arm.c:18676 #, c-format msgid "invalid shift value: %ld" msgstr "" -#: config/tc-arm.c:11875 +#: config/tc-arm.c:18703 +msgid "offset too big" +msgstr "" + +#: config/tc-arm.c:18755 +#, c-format +msgid "the offset 0x%08lX is not representable" +msgstr "" + +#: config/tc-arm.c:18795 +#, c-format +msgid "bad offset 0x%08lX (only 12 bits available for the magnitude)" +msgstr "" + +#: config/tc-arm.c:18834 +#, c-format +msgid "bad offset 0x%08lX (only 8 bits available for the magnitude)" +msgstr "" + +#: config/tc-arm.c:18874 +#, c-format +msgid "bad offset 0x%08lX (must be word-aligned)" +msgstr "" + +#: config/tc-arm.c:18879 +#, c-format +msgid "bad offset 0x%08lX (must be an 8-bit number of words)" +msgstr "" + +#: config/tc-arm.c:18905 config/tc-score.c:5480 #, c-format msgid "bad relocation fixup type (%d)" msgstr "" -#: config/tc-arm.c:11943 +#: config/tc-arm.c:19008 msgid "literal referenced across section boundary" msgstr "" -#: config/tc-arm.c:11973 +#: config/tc-arm.c:19068 msgid "internal relocation (type: IMMEDIATE) not fixed up" msgstr "" -#: config/tc-arm.c:11978 +#: config/tc-arm.c:19073 msgid "ADRL used for a symbol not defined in the same file" msgstr "" -#: config/tc-arm.c:11987 +#: config/tc-arm.c:19088 #, c-format msgid "undefined local label `%s'" msgstr "" -#: config/tc-arm.c:11993 +#: config/tc-arm.c:19094 msgid "internal_relocation (type: OFFSET_IMM) not fixed up" msgstr "" -#: config/tc-arm.c:12014 config/tc-cris.c:3869 config/tc-mcore.c:1995 -#: config/tc-mmix.c:2888 config/tc-ns32k.c:2284 +#: config/tc-arm.c:19115 config/tc-cris.c:3925 config/tc-mcore.c:1992 +#: config/tc-mmix.c:2887 config/tc-ns32k.c:2282 config/tc-score.c:5571 msgid "" msgstr "" -#: config/tc-arm.c:12017 config/tc-arm.c:12038 +#: config/tc-arm.c:19118 config/tc-arm.c:19139 config/tc-score.c:5573 #, c-format msgid "cannot represent %s relocation in this object file format" msgstr "" -#: config/tc-arm.c:12254 +#: config/tc-arm.c:19373 #, c-format msgid "%s: unexpected function type: %d" msgstr "" -#: config/tc-arm.c:12331 +#: config/tc-arm.c:19463 config/tc-score.c:6592 config/tc-score.c:6608 +#: config/tc-score.c:6613 msgid "virtual memory exhausted" msgstr "" -#: config/tc-arm.c:12357 +#: config/tc-arm.c:19496 msgid "use of old and new-style options to set CPU type" msgstr "" -#: config/tc-arm.c:12367 +#: config/tc-arm.c:19506 msgid "use of old and new-style options to set FPU type" msgstr "" -#: config/tc-arm.c:12441 +#: config/tc-arm.c:19581 msgid "hard-float conflicts with specified fpu" msgstr "" -#: config/tc-arm.c:12633 +#: config/tc-arm.c:19764 msgid "generate PIC code" msgstr "" -#: config/tc-arm.c:12634 +#: config/tc-arm.c:19765 msgid "assemble Thumb code" msgstr "" -#: config/tc-arm.c:12635 +#: config/tc-arm.c:19766 msgid "support ARM/Thumb interworking" msgstr "" -#: config/tc-arm.c:12637 +#: config/tc-arm.c:19768 msgid "code uses 32-bit program counter" msgstr "" -#: config/tc-arm.c:12638 +#: config/tc-arm.c:19769 msgid "code uses 26-bit program counter" msgstr "" -#: config/tc-arm.c:12639 +#: config/tc-arm.c:19770 msgid "floating point args are in fp regs" msgstr "" -#: config/tc-arm.c:12641 +#: config/tc-arm.c:19772 msgid "re-entrant code" msgstr "" -#: config/tc-arm.c:12642 +#: config/tc-arm.c:19773 msgid "code is ATPCS conformant" msgstr "" -#: config/tc-arm.c:12643 +#: config/tc-arm.c:19774 msgid "assemble for big-endian" msgstr "" -#: config/tc-arm.c:12644 +#: config/tc-arm.c:19775 msgid "assemble for little-endian" msgstr "" #. These are recognized by the assembler, but have no affect on code. -#: config/tc-arm.c:12648 +#: config/tc-arm.c:19779 msgid "use frame pointer" msgstr "" -#: config/tc-arm.c:12649 +#: config/tc-arm.c:19780 msgid "use stack size checking" msgstr "" #. DON'T add any new processors to this list -- we want the whole list #. to go away... Add them to the processors table instead. -#: config/tc-arm.c:12653 config/tc-arm.c:12654 +#: config/tc-arm.c:19796 config/tc-arm.c:19797 msgid "use -mcpu=arm1" msgstr "" -#: config/tc-arm.c:12655 config/tc-arm.c:12656 +#: config/tc-arm.c:19798 config/tc-arm.c:19799 msgid "use -mcpu=arm2" msgstr "" -#: config/tc-arm.c:12657 config/tc-arm.c:12658 +#: config/tc-arm.c:19800 config/tc-arm.c:19801 msgid "use -mcpu=arm250" msgstr "" -#: config/tc-arm.c:12659 config/tc-arm.c:12660 +#: config/tc-arm.c:19802 config/tc-arm.c:19803 msgid "use -mcpu=arm3" msgstr "" -#: config/tc-arm.c:12661 config/tc-arm.c:12662 +#: config/tc-arm.c:19804 config/tc-arm.c:19805 msgid "use -mcpu=arm6" msgstr "" -#: config/tc-arm.c:12663 config/tc-arm.c:12664 +#: config/tc-arm.c:19806 config/tc-arm.c:19807 msgid "use -mcpu=arm600" msgstr "" -#: config/tc-arm.c:12665 config/tc-arm.c:12666 +#: config/tc-arm.c:19808 config/tc-arm.c:19809 msgid "use -mcpu=arm610" msgstr "" -#: config/tc-arm.c:12667 config/tc-arm.c:12668 +#: config/tc-arm.c:19810 config/tc-arm.c:19811 msgid "use -mcpu=arm620" msgstr "" -#: config/tc-arm.c:12669 config/tc-arm.c:12670 +#: config/tc-arm.c:19812 config/tc-arm.c:19813 msgid "use -mcpu=arm7" msgstr "" -#: config/tc-arm.c:12671 config/tc-arm.c:12672 +#: config/tc-arm.c:19814 config/tc-arm.c:19815 msgid "use -mcpu=arm70" msgstr "" -#: config/tc-arm.c:12673 config/tc-arm.c:12674 +#: config/tc-arm.c:19816 config/tc-arm.c:19817 msgid "use -mcpu=arm700" msgstr "" -#: config/tc-arm.c:12675 config/tc-arm.c:12676 +#: config/tc-arm.c:19818 config/tc-arm.c:19819 msgid "use -mcpu=arm700i" msgstr "" -#: config/tc-arm.c:12677 config/tc-arm.c:12678 +#: config/tc-arm.c:19820 config/tc-arm.c:19821 msgid "use -mcpu=arm710" msgstr "" -#: config/tc-arm.c:12679 config/tc-arm.c:12680 +#: config/tc-arm.c:19822 config/tc-arm.c:19823 msgid "use -mcpu=arm710c" msgstr "" -#: config/tc-arm.c:12681 config/tc-arm.c:12682 +#: config/tc-arm.c:19824 config/tc-arm.c:19825 msgid "use -mcpu=arm720" msgstr "" -#: config/tc-arm.c:12683 config/tc-arm.c:12684 +#: config/tc-arm.c:19826 config/tc-arm.c:19827 msgid "use -mcpu=arm7d" msgstr "" -#: config/tc-arm.c:12685 config/tc-arm.c:12686 +#: config/tc-arm.c:19828 config/tc-arm.c:19829 msgid "use -mcpu=arm7di" msgstr "" -#: config/tc-arm.c:12687 config/tc-arm.c:12688 +#: config/tc-arm.c:19830 config/tc-arm.c:19831 msgid "use -mcpu=arm7m" msgstr "" -#: config/tc-arm.c:12689 config/tc-arm.c:12690 +#: config/tc-arm.c:19832 config/tc-arm.c:19833 msgid "use -mcpu=arm7dm" msgstr "" -#: config/tc-arm.c:12691 config/tc-arm.c:12692 +#: config/tc-arm.c:19834 config/tc-arm.c:19835 msgid "use -mcpu=arm7dmi" msgstr "" -#: config/tc-arm.c:12693 config/tc-arm.c:12694 +#: config/tc-arm.c:19836 config/tc-arm.c:19837 msgid "use -mcpu=arm7100" msgstr "" -#: config/tc-arm.c:12695 config/tc-arm.c:12696 +#: config/tc-arm.c:19838 config/tc-arm.c:19839 msgid "use -mcpu=arm7500" msgstr "" -#: config/tc-arm.c:12697 config/tc-arm.c:12698 +#: config/tc-arm.c:19840 config/tc-arm.c:19841 msgid "use -mcpu=arm7500fe" msgstr "" -#: config/tc-arm.c:12699 config/tc-arm.c:12700 config/tc-arm.c:12701 -#: config/tc-arm.c:12702 +#: config/tc-arm.c:19842 config/tc-arm.c:19843 config/tc-arm.c:19844 +#: config/tc-arm.c:19845 msgid "use -mcpu=arm7tdmi" msgstr "" -#: config/tc-arm.c:12703 config/tc-arm.c:12704 +#: config/tc-arm.c:19846 config/tc-arm.c:19847 msgid "use -mcpu=arm710t" msgstr "" -#: config/tc-arm.c:12705 config/tc-arm.c:12706 +#: config/tc-arm.c:19848 config/tc-arm.c:19849 msgid "use -mcpu=arm720t" msgstr "" -#: config/tc-arm.c:12707 config/tc-arm.c:12708 +#: config/tc-arm.c:19850 config/tc-arm.c:19851 msgid "use -mcpu=arm740t" msgstr "" -#: config/tc-arm.c:12709 config/tc-arm.c:12710 +#: config/tc-arm.c:19852 config/tc-arm.c:19853 msgid "use -mcpu=arm8" msgstr "" -#: config/tc-arm.c:12711 config/tc-arm.c:12712 +#: config/tc-arm.c:19854 config/tc-arm.c:19855 msgid "use -mcpu=arm810" msgstr "" -#: config/tc-arm.c:12713 config/tc-arm.c:12714 +#: config/tc-arm.c:19856 config/tc-arm.c:19857 msgid "use -mcpu=arm9" msgstr "" -#: config/tc-arm.c:12715 config/tc-arm.c:12716 +#: config/tc-arm.c:19858 config/tc-arm.c:19859 msgid "use -mcpu=arm9tdmi" msgstr "" -#: config/tc-arm.c:12717 config/tc-arm.c:12718 +#: config/tc-arm.c:19860 config/tc-arm.c:19861 msgid "use -mcpu=arm920" msgstr "" -#: config/tc-arm.c:12719 config/tc-arm.c:12720 +#: config/tc-arm.c:19862 config/tc-arm.c:19863 msgid "use -mcpu=arm940" msgstr "" -#: config/tc-arm.c:12721 +#: config/tc-arm.c:19864 msgid "use -mcpu=strongarm" msgstr "" -#: config/tc-arm.c:12723 +#: config/tc-arm.c:19866 msgid "use -mcpu=strongarm110" msgstr "" -#: config/tc-arm.c:12725 +#: config/tc-arm.c:19868 msgid "use -mcpu=strongarm1100" msgstr "" -#: config/tc-arm.c:12727 +#: config/tc-arm.c:19870 msgid "use -mcpu=strongarm1110" msgstr "" -#: config/tc-arm.c:12728 +#: config/tc-arm.c:19871 msgid "use -mcpu=xscale" msgstr "" -#: config/tc-arm.c:12729 +#: config/tc-arm.c:19872 msgid "use -mcpu=iwmmxt" msgstr "" -#: config/tc-arm.c:12730 +#: config/tc-arm.c:19873 msgid "use -mcpu=all" msgstr "" #. Architecture variants -- don't add any more to this list either. -#: config/tc-arm.c:12733 config/tc-arm.c:12734 +#: config/tc-arm.c:19876 config/tc-arm.c:19877 msgid "use -march=armv2" msgstr "" -#: config/tc-arm.c:12735 config/tc-arm.c:12736 +#: config/tc-arm.c:19878 config/tc-arm.c:19879 msgid "use -march=armv2a" msgstr "" -#: config/tc-arm.c:12737 config/tc-arm.c:12738 +#: config/tc-arm.c:19880 config/tc-arm.c:19881 msgid "use -march=armv3" msgstr "" -#: config/tc-arm.c:12739 config/tc-arm.c:12740 +#: config/tc-arm.c:19882 config/tc-arm.c:19883 msgid "use -march=armv3m" msgstr "" -#: config/tc-arm.c:12741 config/tc-arm.c:12742 +#: config/tc-arm.c:19884 config/tc-arm.c:19885 msgid "use -march=armv4" msgstr "" -#: config/tc-arm.c:12743 config/tc-arm.c:12744 +#: config/tc-arm.c:19886 config/tc-arm.c:19887 msgid "use -march=armv4t" msgstr "" -#: config/tc-arm.c:12745 config/tc-arm.c:12746 +#: config/tc-arm.c:19888 config/tc-arm.c:19889 msgid "use -march=armv5" msgstr "" -#: config/tc-arm.c:12747 config/tc-arm.c:12748 +#: config/tc-arm.c:19890 config/tc-arm.c:19891 msgid "use -march=armv5t" msgstr "" -#: config/tc-arm.c:12749 config/tc-arm.c:12750 +#: config/tc-arm.c:19892 config/tc-arm.c:19893 msgid "use -march=armv5te" msgstr "" #. Floating point variants -- don't add any more to this list either. -#: config/tc-arm.c:12753 +#: config/tc-arm.c:19896 msgid "use -mfpu=fpe" msgstr "" -#: config/tc-arm.c:12754 +#: config/tc-arm.c:19897 msgid "use -mfpu=fpa10" msgstr "" -#: config/tc-arm.c:12755 +#: config/tc-arm.c:19898 msgid "use -mfpu=fpa11" msgstr "" -#: config/tc-arm.c:12757 +#: config/tc-arm.c:19900 msgid "use either -mfpu=softfpa or -mfpu=softvfp" msgstr "" -#: config/tc-arm.c:12986 +#: config/tc-arm.c:20161 msgid "invalid architectural extension" msgstr "" -#: config/tc-arm.c:13000 +#: config/tc-arm.c:20175 msgid "missing architectural extension" msgstr "" -#: config/tc-arm.c:13013 +#: config/tc-arm.c:20188 #, c-format msgid "unknown architectural extnsion `%s'" msgstr "" -#: config/tc-arm.c:13037 +#: config/tc-arm.c:20212 #, c-format msgid "missing cpu name `%s'" msgstr "" -#: config/tc-arm.c:13062 config/tc-arm.c:13389 +#: config/tc-arm.c:20237 config/tc-arm.c:20622 #, c-format msgid "unknown cpu `%s'" msgstr "" -#: config/tc-arm.c:13080 +#: config/tc-arm.c:20255 #, c-format msgid "missing architecture name `%s'" msgstr "" -#: config/tc-arm.c:13097 config/tc-arm.c:13423 +#: config/tc-arm.c:20272 config/tc-arm.c:20656 config/tc-arm.c:20687 #, c-format msgid "unknown architecture `%s'\n" msgstr "" -#: config/tc-arm.c:13113 config/tc-arm.c:13454 +#: config/tc-arm.c:20288 config/tc-arm.c:20718 #, c-format msgid "unknown floating point format `%s'\n" msgstr "" -#: config/tc-arm.c:13129 +#: config/tc-arm.c:20304 #, c-format msgid "unknown floating point abi `%s'\n" msgstr "" -#: config/tc-arm.c:13145 +#: config/tc-arm.c:20320 #, c-format msgid "unknown EABI `%s'\n" msgstr "" -#: config/tc-arm.c:13152 +#: config/tc-arm.c:20327 msgid "\t assemble for CPU " msgstr "" -#: config/tc-arm.c:13154 +#: config/tc-arm.c:20329 msgid "\t assemble for architecture " msgstr "" -#: config/tc-arm.c:13156 +#: config/tc-arm.c:20331 msgid "\t assemble for FPU architecture " msgstr "" -#: config/tc-arm.c:13158 +#: config/tc-arm.c:20333 msgid "\t assemble for floating point ABI " msgstr "" -#: config/tc-arm.c:13161 +#: config/tc-arm.c:20336 msgid "\t assemble for eabi version " msgstr "" -#: config/tc-arm.c:13202 config/tc-arm.c:13224 +#: config/tc-arm.c:20378 config/tc-arm.c:20398 config/tc-arm.c:20420 #, c-format msgid "option `-%c%s' is deprecated: %s" msgstr "" -#: config/tc-arm.c:13245 +#: config/tc-arm.c:20441 #, c-format msgid " ARM-specific assembler options:\n" msgstr "" -#: config/tc-arm.c:13256 +#: config/tc-arm.c:20452 #, c-format msgid " -EB assemble code for a big-endian cpu\n" msgstr "" -#: config/tc-arm.c:13261 +#: config/tc-arm.c:20457 #, c-format msgid " -EL assemble code for a little-endian cpu\n" msgstr "" -#: config/tc-avr.c:209 +#: config/tc-avr.c:258 #, c-format msgid "Known MCU names:" msgstr "" -#: config/tc-avr.c:275 +#: config/tc-avr.c:324 #, c-format msgid "" "AVR options:\n" @@ -2691,7 +3035,7 @@ msgid "" " or immediate microcontroller name.\n" msgstr "" -#: config/tc-avr.c:285 +#: config/tc-avr.c:334 #, c-format msgid "" " -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n" @@ -2701,562 +3045,719 @@ msgid "" " (default for avr3, avr5)\n" msgstr "" -#: config/tc-avr.c:329 config/tc-msp430.c:749 +#: config/tc-avr.c:378 config/tc-msp430.c:747 #, c-format msgid "unknown MCU: %s\n" msgstr "" -#: config/tc-avr.c:338 +#: config/tc-avr.c:387 #, c-format msgid "redefinition of mcu type `%s' to `%s'" msgstr "" -#: config/tc-avr.c:385 config/tc-crx.c:491 config/tc-d10v.c:278 -#: config/tc-d30v.c:312 config/tc-mips.c:10241 config/tc-mmix.c:2264 -#: config/tc-mn10200.c:342 config/tc-msp430.c:873 config/tc-pj.c:342 -#: config/tc-ppc.c:5211 config/tc-sh.c:2986 config/tc-v850.c:1199 +#: config/tc-avr.c:434 config/tc-cr16.c:670 config/tc-crx.c:491 +#: config/tc-d10v.c:277 config/tc-d30v.c:311 config/tc-mips.c:10769 +#: config/tc-mmix.c:2263 config/tc-mn10200.c:341 config/tc-msp430.c:871 +#: config/tc-pj.c:342 config/tc-ppc.c:5206 config/tc-sh.c:3076 +#: config/tc-v850.c:1198 msgid "bad call to md_atof" msgstr "" -#: config/tc-avr.c:447 +#: config/tc-avr.c:501 msgid "constant value required" msgstr "" -#: config/tc-avr.c:450 +#: config/tc-avr.c:504 #, c-format msgid "number must be less than %d" msgstr "" -#: config/tc-avr.c:476 config/tc-avr.c:583 +#: config/tc-avr.c:530 config/tc-avr.c:665 #, c-format msgid "constant out of 8-bit range: %d" msgstr "" -#: config/tc-avr.c:488 config/tc-d10v.c:498 config/tc-d30v.c:490 -#: config/tc-h8300.c:451 config/tc-mcore.c:665 config/tc-mmix.c:489 -#: config/tc-mn10200.c:1078 config/tc-mn10300.c:1820 config/tc-msp430.c:457 -#: config/tc-or32.c:306 config/tc-ppc.c:2382 config/tc-s390.c:1220 -#: config/tc-sh64.c:2213 config/tc-sh.c:1272 config/tc-v850.c:1952 -#: config/tc-z8k.c:328 +#: config/tc-avr.c:542 config/tc-d10v.c:497 config/tc-d30v.c:489 +#: config/tc-h8300.c:449 config/tc-mcore.c:662 config/tc-mmix.c:488 +#: config/tc-mn10200.c:1077 config/tc-mn10300.c:1819 config/tc-msp430.c:455 +#: config/tc-or32.c:307 config/tc-ppc.c:2436 config/tc-s390.c:1221 +#: config/tc-sh64.c:2213 config/tc-sh.c:1359 config/tc-v850.c:1967 +#: config/tc-z80.c:575 config/tc-z8k.c:350 msgid "missing operand" msgstr "" -#: config/tc-avr.c:536 read.c:3345 +#: config/tc-avr.c:598 config/tc-score.c:974 read.c:3560 msgid "illegal expression" msgstr "" -#: config/tc-avr.c:562 config/tc-avr.c:1282 +#: config/tc-avr.c:627 config/tc-avr.c:1386 msgid "`)' required" msgstr "" -#: config/tc-avr.c:638 +#: config/tc-avr.c:648 +msgid "expression dangerous with linker stubs" +msgstr "" + +#: config/tc-avr.c:720 msgid "register r16-r23 required" msgstr "" -#: config/tc-avr.c:644 +#: config/tc-avr.c:726 msgid "register number above 15 required" msgstr "" -#: config/tc-avr.c:650 +#: config/tc-avr.c:732 msgid "even register number required" msgstr "" -#: config/tc-avr.c:656 +#: config/tc-avr.c:738 msgid "register r24, r26, r28 or r30 required" msgstr "" -#: config/tc-avr.c:662 +#: config/tc-avr.c:744 msgid "register name or number from 0 to 31 required" msgstr "" -#: config/tc-avr.c:680 +#: config/tc-avr.c:762 msgid "pointer register (X, Y or Z) required" msgstr "" -#: config/tc-avr.c:687 +#: config/tc-avr.c:769 msgid "cannot both predecrement and postincrement" msgstr "" -#: config/tc-avr.c:695 +#: config/tc-avr.c:777 msgid "addressing mode not supported" msgstr "" -#: config/tc-avr.c:701 +#: config/tc-avr.c:783 msgid "can't predecrement" msgstr "" -#: config/tc-avr.c:704 +#: config/tc-avr.c:786 msgid "pointer register Z required" msgstr "" -#: config/tc-avr.c:722 +#: config/tc-avr.c:804 msgid "pointer register (Y or Z) required" msgstr "" -#: config/tc-avr.c:826 +#: config/tc-avr.c:908 #, c-format msgid "unknown constraint `%c'" msgstr "" -#: config/tc-avr.c:878 +#: config/tc-avr.c:960 msgid "`,' required" msgstr "" -#: config/tc-avr.c:896 +#: config/tc-avr.c:978 msgid "undefined combination of operands" msgstr "" -#: config/tc-avr.c:905 +#: config/tc-avr.c:987 msgid "skipping two-word instruction" msgstr "" -#: config/tc-avr.c:997 config/tc-avr.c:1013 config/tc-avr.c:1135 -#: config/tc-msp430.c:2012 config/tc-msp430.c:2030 +#: config/tc-avr.c:1079 config/tc-avr.c:1095 config/tc-avr.c:1209 +#: config/tc-msp430.c:2009 config/tc-msp430.c:2027 #, c-format msgid "odd address operand: %ld" msgstr "" -#: config/tc-avr.c:1005 config/tc-avr.c:1024 config/tc-avr.c:1046 -#: config/tc-avr.c:1053 config/tc-avr.c:1060 config/tc-d10v.c:538 -#: config/tc-d30v.c:589 config/tc-msp430.c:2020 config/tc-msp430.c:2035 -#: config/tc-msp430.c:2045 +#: config/tc-avr.c:1087 config/tc-avr.c:1106 config/tc-avr.c:1128 +#: config/tc-avr.c:1135 config/tc-avr.c:1142 config/tc-d10v.c:537 +#: config/tc-d30v.c:588 config/tc-msp430.c:2017 config/tc-msp430.c:2032 +#: config/tc-msp430.c:2042 #, c-format msgid "operand out of range: %ld" msgstr "" -#: config/tc-avr.c:1144 config/tc-d10v.c:1622 config/tc-d30v.c:2060 -#: config/tc-msp430.c:2063 +#: config/tc-avr.c:1218 config/tc-d10v.c:1619 config/tc-d30v.c:2059 +#: config/tc-msp430.c:2060 #, c-format msgid "line %d: unknown relocation type: 0x%x" msgstr "" -#: config/tc-avr.c:1158 +#: config/tc-avr.c:1232 msgid "only constant expression allowed" msgstr "" #. xgettext:c-format. -#: config/tc-avr.c:1192 config/tc-bfin.c:689 config/tc-d10v.c:1494 -#: config/tc-d30v.c:1804 config/tc-mn10200.c:814 config/tc-mn10300.c:2308 -#: config/tc-msp430.c:2098 config/tc-or32.c:1019 config/tc-ppc.c:6064 -#: config/tc-v850.c:2190 +#: config/tc-avr.c:1292 config/tc-bfin.c:771 config/tc-d10v.c:1491 +#: config/tc-d30v.c:1803 config/tc-mn10200.c:813 config/tc-mn10300.c:2311 +#: config/tc-msp430.c:2095 config/tc-or32.c:1017 config/tc-ppc.c:6085 +#: config/tc-spu.c:884 config/tc-spu.c:1071 config/tc-v850.c:2219 +#: config/tc-z80.c:2017 #, c-format msgid "reloc %d not supported by object file format" msgstr "" -#: config/tc-avr.c:1215 config/tc-d10v.c:1782 config/tc-d10v.c:1796 -#: config/tc-h8300.c:1868 config/tc-mcore.c:884 config/tc-msp430.c:1862 -#: config/tc-pj.c:254 config/tc-sh.c:2457 config/tc-z8k.c:1194 +#: config/tc-avr.c:1315 config/tc-h8300.c:1866 config/tc-mcore.c:881 +#: config/tc-msp430.c:1860 config/tc-pj.c:254 config/tc-sh.c:2544 +#: config/tc-z8k.c:1216 msgid "can't find opcode " msgstr "" -#: config/tc-avr.c:1232 +#: config/tc-avr.c:1332 #, c-format msgid "illegal opcode %s for mcu %s" msgstr "" -#: config/tc-avr.c:1241 +#: config/tc-avr.c:1341 msgid "garbage at end of line" msgstr "" -#: config/tc-avr.c:1309 config/tc-avr.c:1316 +#: config/tc-avr.c:1413 config/tc-avr.c:1420 #, c-format msgid "illegal %srelocation size: %d" msgstr "" -#: config/tc-bfin.c:263 +#: config/tc-bfin.c:338 #, c-format msgid " BFIN specific command line options:\n" msgstr "" -#: config/tc-bfin.c:646 config/tc-fr30.c:358 config/tc-frv.c:1600 -#: config/tc-i960.c:1756 config/tc-ip2k.c:371 config/tc-m32c.c:912 -#: config/tc-m32r.c:2143 config/tc-openrisc.c:376 config/tc-xstormy16.c:631 +#: config/tc-bfin.c:728 config/tc-fr30.c:357 config/tc-frv.c:1599 +#: config/tc-i960.c:1754 config/tc-ip2k.c:370 config/tc-m32c.c:1236 +#: config/tc-m32r.c:2142 config/tc-mep.c:1713 config/tc-openrisc.c:375 +#: config/tc-xc16x.c:258 config/tc-xstormy16.c:631 msgid "Bad call to md_atof()" msgstr "" -#: config/tc-cris.c:532 config/tc-m68hc11.c:2794 +#: config/tc-cr16.c:159 read.c:4266 +msgid "using a bit field width of zero" +msgstr "" + +#: config/tc-cr16.c:167 read.c:4274 +#, c-format +msgid "field width \"%s\" too complex for a bitfield" +msgstr "" + +#: config/tc-cr16.c:176 read.c:4282 +#, c-format +msgid "field width %lu too big to fit in %d bytes: truncated to %d bits" +msgstr "" + +#: config/tc-cr16.c:198 read.c:4304 +#, c-format +msgid "field value \"%s\" too complex for a bitfield" +msgstr "" + +#: config/tc-cr16.c:379 +#, c-format +msgid "Unknown register pair - index relative mode: `%d'" +msgstr "" + +#: config/tc-cr16.c:558 config/tc-crx.c:344 config/tc-mn10200.c:800 +#: write.c:959 +#, c-format +msgid "can't resolve `%s' {%s section} - `%s' {%s section}" +msgstr "" + +#: config/tc-cr16.c:574 config/tc-crx.c:360 +#, c-format +msgid "internal error: reloc %d (`%s') not supported by object file format" +msgstr "" + +#: config/tc-cr16.c:762 config/tc-cr16.c:785 config/tc-cris.c:1181 +#: config/tc-crx.c:582 config/tc-crx.c:609 config/tc-crx.c:627 +msgid "Virtual memory exhausted" +msgstr "" + +#: config/tc-cr16.c:770 config/tc-crx.c:619 config/tc-crx.c:637 +#: config/tc-i386.c:1230 config/tc-i386.c:1252 config/tc-m68k.c:4387 +#, c-format +msgid "Internal Error: Can't hash %s: %s" +msgstr "" + +#: config/tc-cr16.c:796 config/tc-cris.c:1215 config/tc-crx.c:592 +#, c-format +msgid "Can't hash `%s': %s\n" +msgstr "" + +#: config/tc-cr16.c:797 config/tc-cris.c:1216 config/tc-crx.c:593 +msgid "(unknown reason)" +msgstr "" + +#. Missing or bad expr becomes absolute 0. +#: config/tc-cr16.c:847 config/tc-crx.c:665 config/tc-i386.c:4865 +#, c-format +msgid "missing or invalid displacement expression `%s' taken as 0" +msgstr "" + +#: config/tc-cr16.c:959 +#, c-format +msgid "operand %d: illegal use expression: `%s`" +msgstr "" + +#: config/tc-cr16.c:1016 config/tc-crx.c:1173 +#, c-format +msgid "Unknown register: `%d'" +msgstr "" + +#. Issue a error message when register is illegal. +#: config/tc-cr16.c:1024 config/tc-crx.c:1181 +#, c-format +msgid "Illegal register (`%s') in Instruction: `%s'" +msgstr "" + +#: config/tc-cr16.c:1095 config/tc-cr16.c:1170 config/tc-crx.c:803 +#: config/tc-crx.c:823 config/tc-crx.c:838 +#, c-format +msgid "Illegal register `%s' in Instruction `%s'" +msgstr "" + +#: config/tc-cr16.c:1123 config/tc-cr16.c:1134 +#, c-format +msgid "Illegal register pair `%s' in Instruction `%s'" +msgstr "" + +#: config/tc-cr16.c:1159 config/tc-i960.c:835 +msgid "unmatched '['" +msgstr "" + +#: config/tc-cr16.c:1165 config/tc-i960.c:842 +msgid "garbage after index spec ignored" +msgstr "" + +#: config/tc-cr16.c:1313 config/tc-crx.c:982 +#, c-format +msgid "Illegal operands (whitespace): `%s'" +msgstr "" + +#: config/tc-cr16.c:1325 config/tc-cr16.c:1332 config/tc-cr16.c:1349 +#: config/tc-crx.c:994 config/tc-crx.c:1001 config/tc-crx.c:1018 +#: config/tc-crx.c:1810 +#, c-format +msgid "Missing matching brackets : `%s'" +msgstr "" + +#: config/tc-cr16.c:1381 config/tc-crx.c:1044 +#, c-format +msgid "Unknown exception: `%s'" +msgstr "" + +#: config/tc-cr16.c:1468 config/tc-crx.c:1140 +#, c-format +msgid "Illegal `cinv' parameter: `%c'" +msgstr "" + +#: config/tc-cr16.c:1490 config/tc-cr16.c:1529 +#, c-format +msgid "Unknown register pair: `%d'" +msgstr "" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1498 +#, c-format +msgid "Illegal register pair (`%s') in Instruction: `%s'" +msgstr "" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1537 +#, c-format +msgid "Illegal index register pair (`%s') in Instruction: `%s'" +msgstr "" + +#: config/tc-cr16.c:1576 +#, c-format +msgid "Unknown processor register : `%d'" +msgstr "" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1584 +#, c-format +msgid "Illegal processor register (`%s') in Instruction: `%s'" +msgstr "" + +#: config/tc-cr16.c:1632 +#, c-format +msgid "Unknown processor register (32 bit) : `%d'" +msgstr "" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1640 +#, c-format +msgid "Illegal 32 bit - processor register (`%s') in Instruction: `%s'" +msgstr "" + +#: config/tc-cr16.c:2004 config/tc-crx.c:1708 config/tc-crx.c:1725 +#, c-format +msgid "Same src/dest register is used (`r%d'), result is undefined" +msgstr "" + +#: config/tc-cr16.c:2025 +msgid "RA register is saved twice." +msgstr "" + +#: config/tc-cr16.c:2029 +#, c-format +msgid "`%s' Illegal use of registers." +msgstr "" + +#: config/tc-cr16.c:2043 +#, c-format +msgid "`%s' Illegal count-register combination." +msgstr "" + +#: config/tc-cr16.c:2049 +#, c-format +msgid "`%s' Illegal use of register." +msgstr "" + +#: config/tc-cr16.c:2058 config/tc-crx.c:1717 +#, c-format +msgid "`%s' has undefined result" +msgstr "" + +#: config/tc-cr16.c:2066 +#, c-format +msgid "Same src/dest register is used (`r%d'),result is undefined" +msgstr "" + +#: config/tc-cr16.c:2237 config/tc-crx.c:1622 +msgid "Incorrect number of operands" +msgstr "" + +#: config/tc-cr16.c:2239 config/tc-crx.c:1624 +#, c-format +msgid "Illegal type of operand (arg %d)" +msgstr "" + +#: config/tc-cr16.c:2245 config/tc-crx.c:1630 +#, c-format +msgid "Operand out of range (arg %d)" +msgstr "" + +#: config/tc-cr16.c:2248 config/tc-crx.c:1633 +#, c-format +msgid "Operand has odd displacement (arg %d)" +msgstr "" + +#: config/tc-cr16.c:2251 config/tc-cr16.c:2282 config/tc-crx.c:1646 +#: config/tc-crx.c:1677 +#, c-format +msgid "Illegal operand (arg %d)" +msgstr "" + +#. Give an error if a frag containing code is not aligned to a 2-byte +#. boundary. +#: config/tc-cr16.c:2351 config/tc-cr16.h:71 config/tc-crx.c:1999 +#: config/tc-crx.h:76 +msgid "instruction address is not a multiple of 2" +msgstr "" + +#: config/tc-cr16.c:2428 config/tc-cris.c:1529 config/tc-cris.c:1537 +#: config/tc-crx.c:2035 config/tc-dlx.c:685 config/tc-hppa.c:3261 +#: config/tc-i860.c:490 config/tc-i860.c:507 config/tc-i860.c:987 +#: config/tc-sparc.c:1431 config/tc-sparc.c:1439 +#, c-format +msgid "Unknown opcode: `%s'" +msgstr "" + +#: config/tc-cris.c:547 config/tc-m68hc11.c:2796 #, c-format msgid "internal inconsistency problem in %s: fr_symbol %lx" msgstr "" -#: config/tc-cris.c:536 config/tc-m68hc11.c:2798 config/tc-msp430.c:2289 +#: config/tc-cris.c:551 config/tc-m68hc11.c:2800 config/tc-msp430.c:2286 #, c-format msgid "internal inconsistency problem in %s: resolved symbol" msgstr "" -#: config/tc-cris.c:546 config/tc-m68hc11.c:2804 +#: config/tc-cris.c:561 config/tc-m68hc11.c:2806 #, c-format msgid "internal inconsistency problem in %s: fr_subtype %d" msgstr "" -#: config/tc-cris.c:872 +#: config/tc-cris.c:901 msgid "Relaxation to long branches for .arch common_v10_v32 not implemented" msgstr "" -#: config/tc-cris.c:902 +#: config/tc-cris.c:931 msgid "Complicated LAPC target operand is not a multiple of two. Use LAPC.D" msgstr "" -#: config/tc-cris.c:907 +#: config/tc-cris.c:936 #, c-format msgid "" "Internal error found in md_convert_frag: offset %ld. Please report this." msgstr "" -#: config/tc-cris.c:932 +#: config/tc-cris.c:961 #, c-format msgid "internal inconsistency in %s: bdapq no symbol" msgstr "" -#: config/tc-cris.c:945 +#: config/tc-cris.c:974 #, c-format msgid "internal inconsistency in %s: bdap.w with no symbol" msgstr "" -#: config/tc-cris.c:969 +#: config/tc-cris.c:998 msgid "section alignment must be >= 4 bytes to check MULS/MULU safeness" msgstr "" -#: config/tc-cris.c:978 +#: config/tc-cris.c:1007 msgid "dangerous MULS/MULU location; give it higher alignment" msgstr "" -#: config/tc-cris.c:1083 +#: config/tc-cris.c:1112 msgid "" "Out-of-range .word offset handling is not implemented for .arch " "common_v10_v32" msgstr "" -#: config/tc-cris.c:1148 config/tc-crx.c:582 config/tc-crx.c:609 -#: config/tc-crx.c:627 -msgid "Virtual memory exhausted" -msgstr "" - -#: config/tc-cris.c:1182 config/tc-crx.c:592 -#, c-format -msgid "Can't hash `%s': %s\n" -msgstr "" - -#: config/tc-cris.c:1183 config/tc-crx.c:593 -msgid "(unknown reason)" -msgstr "" - -#: config/tc-cris.c:1187 +#: config/tc-cris.c:1220 #, c-format msgid "Buggy opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-cris.c:1493 config/tc-cris.c:1501 config/tc-crx.c:2029 -#: config/tc-dlx.c:685 config/tc-hppa.c:1625 config/tc-i860.c:492 -#: config/tc-i860.c:509 config/tc-i860.c:989 config/tc-sparc.c:1417 -#: config/tc-sparc.c:1425 -#, c-format -msgid "Unknown opcode: `%s'" -msgstr "" - -#: config/tc-cris.c:1599 +#: config/tc-cris.c:1635 #, c-format msgid "Immediate value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1615 +#: config/tc-cris.c:1651 #, c-format msgid "Immediate value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1667 +#: config/tc-cris.c:1703 #, c-format msgid "Immediate value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:1682 +#: config/tc-cris.c:1718 #, c-format msgid "Immediate value not in 6 bit unsigned range: %ld" msgstr "" #. Others have a generic warning. -#: config/tc-cris.c:1790 +#: config/tc-cris.c:1826 #, c-format msgid "Unimplemented register `%s' specified" msgstr "" #. We've come to the end of instructions with this #. opcode, so it must be an error. -#: config/tc-cris.c:2033 +#: config/tc-cris.c:2069 msgid "Illegal operands" msgstr "" -#: config/tc-cris.c:2074 config/tc-cris.c:2114 +#: config/tc-cris.c:2110 config/tc-cris.c:2150 #, c-format msgid "Immediate value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:2084 config/tc-cris.c:2135 +#: config/tc-cris.c:2120 config/tc-cris.c:2171 #, c-format msgid "Immediate value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:2119 +#: config/tc-cris.c:2155 #, c-format msgid "Immediate value not in 8 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:2124 +#: config/tc-cris.c:2160 #, c-format msgid "Immediate value not in 8 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2140 +#: config/tc-cris.c:2176 #, c-format msgid "Immediate value not in 16 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:2145 +#: config/tc-cris.c:2181 #, c-format msgid "Immediate value not in 16 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2167 +#: config/tc-cris.c:2203 msgid "PIC relocation size does not match operand size" msgstr "" -#: config/tc-cris.c:3304 +#: config/tc-cris.c:3346 msgid "Calling gen_cond_branch_32 for .arch common_v10_v32\n" msgstr "" -#: config/tc-cris.c:3308 +#: config/tc-cris.c:3350 msgid "32-bit conditional branch generated" msgstr "" -#: config/tc-cris.c:3367 +#: config/tc-cris.c:3411 msgid "Complex expression not supported" msgstr "" #. FIXME: Is this function mentioned in the internals.texi manual? If #. not, add it. -#: config/tc-cris.c:3490 +#: config/tc-cris.c:3537 msgid "Bad call to md_atof () - floating point formats are not supported" msgstr "" -#: config/tc-cris.c:3531 +#: config/tc-cris.c:3578 msgid "PC-relative relocation must be trivially resolved" msgstr "" -#: config/tc-cris.c:3584 +#: config/tc-cris.c:3631 #, c-format msgid "Value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:3595 +#: config/tc-cris.c:3642 #, c-format msgid "Value not in 16 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:3606 +#: config/tc-cris.c:3653 #, c-format msgid "Value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:3614 +#: config/tc-cris.c:3661 #, c-format msgid "Value not in 8 bit signed range: %ld" msgstr "" -#: config/tc-cris.c:3625 +#: config/tc-cris.c:3672 #, c-format msgid "Value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:3633 +#: config/tc-cris.c:3680 #, c-format msgid "Value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:3641 +#: config/tc-cris.c:3688 #, c-format msgid "Value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:3649 +#: config/tc-cris.c:3696 #, c-format msgid "Value not in 6 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:3695 +#: config/tc-cris.c:3742 #, c-format msgid "Please use --help to see usage and options for this assembler.\n" msgstr "" -#: config/tc-cris.c:3707 +#: config/tc-cris.c:3754 msgid "--no-underscore is invalid with a.out format" msgstr "" -#: config/tc-cris.c:3727 +#: config/tc-cris.c:3778 #, c-format msgid "invalid in --march=: %s" msgstr "" -#: config/tc-cris.c:3821 +#: config/tc-cris.c:3877 msgid "" "Semantics error. This type of operand can not be relocated, it must be an " "assembly-time constant" msgstr "" -#: config/tc-cris.c:3870 +#: config/tc-cris.c:3926 #, c-format msgid "Cannot generate relocation type for symbol %s, code %s" msgstr "" #. The messages are formatted to line up with the generic options. -#: config/tc-cris.c:3883 +#: config/tc-cris.c:3939 #, c-format msgid "CRIS-specific options:\n" msgstr "" -#: config/tc-cris.c:3885 +#: config/tc-cris.c:3941 msgid "" " -h, -H Don't execute, print this help text. Deprecated.\n" msgstr "" -#: config/tc-cris.c:3887 +#: config/tc-cris.c:3943 msgid " -N Warn when branches are expanded to jumps.\n" msgstr "" -#: config/tc-cris.c:3889 +#: config/tc-cris.c:3945 msgid "" " --underscore User symbols are normally prepended with " "underscore.\n" msgstr "" -#: config/tc-cris.c:3891 +#: config/tc-cris.c:3947 msgid " Registers will not need any prefix.\n" msgstr "" -#: config/tc-cris.c:3893 +#: config/tc-cris.c:3949 msgid " --no-underscore User symbols do not have any prefix.\n" msgstr "" -#: config/tc-cris.c:3895 +#: config/tc-cris.c:3951 msgid " Registers will require a `$'-prefix.\n" msgstr "" -#: config/tc-cris.c:3897 +#: config/tc-cris.c:3953 msgid " --pic\t\t\tEnable generation of position-independent code.\n" msgstr "" -#: config/tc-cris.c:3899 +#: config/tc-cris.c:3955 msgid "" " --march=\t\tGenerate code for . Valid choices for \n" "\t\t\t\tare v0_v10, v10, v32 and common_v10_v32.\n" msgstr "" -#: config/tc-cris.c:3920 +#: config/tc-cris.c:3976 msgid "Invalid relocation" msgstr "" -#: config/tc-cris.c:3957 +#: config/tc-cris.c:4013 msgid "Invalid pc-relative relocation" msgstr "" -#: config/tc-cris.c:4002 +#: config/tc-cris.c:4058 #, c-format msgid "Adjusted signed .word (%ld) overflows: `switch'-statement too large." msgstr "" -#: config/tc-cris.c:4032 +#: config/tc-cris.c:4088 #, c-format msgid ".syntax %s requires command-line option `--underscore'" msgstr "" -#: config/tc-cris.c:4041 +#: config/tc-cris.c:4097 #, c-format msgid ".syntax %s requires command-line option `--no-underscore'" msgstr "" -#: config/tc-cris.c:4078 +#: config/tc-cris.c:4134 msgid "Unknown .syntax operand" msgstr "" -#: config/tc-cris.c:4088 +#: config/tc-cris.c:4144 msgid "Pseudodirective .file is only valid when generating ELF" msgstr "" -#: config/tc-cris.c:4100 +#: config/tc-cris.c:4156 msgid "Pseudodirective .loc is only valid when generating ELF" msgstr "" -#: config/tc-cris.c:4243 +#: config/tc-cris.c:4299 msgid "unknown operand to .arch" msgstr "" -#: config/tc-cris.c:4252 +#: config/tc-cris.c:4308 msgid ".arch requires a matching --march=... option" msgstr "" -#: config/tc-crx.c:344 config/tc-mn10200.c:801 write.c:2209 -#, c-format -msgid "can't resolve `%s' {%s section} - `%s' {%s section}" -msgstr "" - -#: config/tc-crx.c:360 -#, c-format -msgid "internal error: reloc %d (`%s') not supported by object file format" -msgstr "" - -#: config/tc-crx.c:619 config/tc-crx.c:637 config/tc-i386.c:953 -#: config/tc-i386.c:976 config/tc-m68k.c:4149 -#, c-format -msgid "Internal Error: Can't hash %s: %s" -msgstr "" - -#. Missing or bad expr becomes absolute 0. -#: config/tc-crx.c:665 config/tc-i386.c:4259 -#, c-format -msgid "missing or invalid displacement expression `%s' taken as 0" -msgstr "" - -#: config/tc-crx.c:803 config/tc-crx.c:823 config/tc-crx.c:838 -#, c-format -msgid "Illegal register `%s' in Instruction `%s'" -msgstr "" - #: config/tc-crx.c:866 #, c-format msgid "Illegal Scale - `%d'" msgstr "" -#: config/tc-crx.c:982 -#, c-format -msgid "Illegal operands (whitespace): `%s'" -msgstr "" - -#: config/tc-crx.c:994 config/tc-crx.c:1001 config/tc-crx.c:1018 -#: config/tc-crx.c:1804 -#, c-format -msgid "Missing matching brackets : `%s'" -msgstr "" - -#: config/tc-crx.c:1044 -#, c-format -msgid "Unknown exception: `%s'" -msgstr "" - -#: config/tc-crx.c:1140 -#, c-format -msgid "Illegal `cinv' parameter: `%c'" -msgstr "" - -#: config/tc-crx.c:1173 -#, c-format -msgid "Unknown register: `%d'" -msgstr "" - -#. Issue a error message when register is illegal. -#: config/tc-crx.c:1181 -#, c-format -msgid "Illegal register (`%s') in Instruction: `%s'" -msgstr "" - #: config/tc-crx.c:1310 #, c-format msgid "Illegal Co-processor register in Instruction `%s' " @@ -3267,110 +3768,70 @@ msgstr "" msgid "Illegal Co-processor special register in Instruction `%s' " msgstr "" -#: config/tc-crx.c:1616 -msgid "Incorrect number of operands" -msgstr "" - -#: config/tc-crx.c:1618 -#, c-format -msgid "Illegal type of operand (arg %d)" -msgstr "" - -#: config/tc-crx.c:1624 -#, c-format -msgid "Operand out of range (arg %d)" -msgstr "" - -#: config/tc-crx.c:1627 -#, c-format -msgid "Operand has odd displacement (arg %d)" -msgstr "" - -#: config/tc-crx.c:1630 +#: config/tc-crx.c:1636 #, c-format msgid "Invalid DISPU4 operand value (arg %d)" msgstr "" -#: config/tc-crx.c:1633 +#: config/tc-crx.c:1639 #, c-format msgid "Invalid CST4 operand value (arg %d)" msgstr "" -#: config/tc-crx.c:1636 +#: config/tc-crx.c:1642 #, c-format msgid "Operand value is not within upper 64 KB (arg %d)" msgstr "" -#: config/tc-crx.c:1640 config/tc-crx.c:1671 -#, c-format -msgid "Illegal operand (arg %d)" -msgstr "" - -#: config/tc-crx.c:1702 config/tc-crx.c:1719 -#, c-format -msgid "Same src/dest register is used (`r%d'), result is undefined" -msgstr "" - -#: config/tc-crx.c:1711 -#, c-format -msgid "`%s' has undefined result" -msgstr "" - -#: config/tc-crx.c:1773 +#: config/tc-crx.c:1779 msgid "Invalid Register in Register List" msgstr "" -#: config/tc-crx.c:1827 +#: config/tc-crx.c:1833 #, c-format msgid "Illegal register `%s' in cop-register list" msgstr "" -#: config/tc-crx.c:1835 +#: config/tc-crx.c:1841 #, c-format msgid "Illegal register `%s' in cop-special-register list" msgstr "" -#: config/tc-crx.c:1854 +#: config/tc-crx.c:1860 #, c-format msgid "Illegal register `%s' in user register list" msgstr "" -#: config/tc-crx.c:1873 +#: config/tc-crx.c:1879 #, c-format msgid "Illegal register `%s' in register list" msgstr "" -#: config/tc-crx.c:1879 +#: config/tc-crx.c:1885 #, c-format msgid "Maximum %d bits may be set in `mask16' operand" msgstr "" -#: config/tc-crx.c:1888 +#: config/tc-crx.c:1894 #, c-format msgid "rest of line ignored; first ignored character is `%c'" msgstr "" -#: config/tc-crx.c:1896 +#: config/tc-crx.c:1902 #, c-format msgid "Illegal `mask16' operand, operation is undefined - `%s'" msgstr "" #. HI can't be specified without LO (and vise-versa). -#: config/tc-crx.c:1902 +#: config/tc-crx.c:1908 msgid "HI/LO registers should be specified together" msgstr "" -#: config/tc-crx.c:1908 +#: config/tc-crx.c:1914 msgid "HI/LO registers should be specified without additional registers" msgstr "" -#. Give an error if a frag containing code is not aligned to a 2-byte -#. boundary. -#: config/tc-crx.c:1993 config/tc-crx.h:76 -msgid "instruction address is not a multiple of 2" -msgstr "" - -#: config/tc-d10v.c:217 +#: config/tc-d10v.c:216 #, c-format msgid "" "D10V options:\n" @@ -3381,140 +3842,144 @@ msgid "" " instructions together.\n" msgstr "" -#: config/tc-d10v.c:496 config/tc-d30v.c:488 config/tc-mn10200.c:1075 -#: config/tc-mn10300.c:1817 config/tc-ppc.c:2380 config/tc-s390.c:1218 -#: config/tc-v850.c:1949 +#: config/tc-d10v.c:495 config/tc-d30v.c:487 config/tc-mn10200.c:1074 +#: config/tc-mn10300.c:1816 config/tc-ppc.c:2434 config/tc-s390.c:1219 +#: config/tc-v850.c:1964 config/tc-z80.c:422 msgid "illegal operand" msgstr "" -#: config/tc-d10v.c:608 +#: config/tc-d10v.c:607 msgid "operand is not an immediate" msgstr "" -#: config/tc-d10v.c:626 +#: config/tc-d10v.c:625 #, c-format msgid "operand out of range: %lu" msgstr "" -#: config/tc-d10v.c:684 +#: config/tc-d10v.c:683 msgid "Instruction must be executed in parallel with another instruction." msgstr "" -#: config/tc-d10v.c:738 config/tc-d10v.c:746 +#: config/tc-d10v.c:737 config/tc-d10v.c:745 #, c-format msgid "packing conflict: %s must dispatch sequentially" msgstr "" -#: config/tc-d10v.c:845 +#: config/tc-d10v.c:844 #, c-format msgid "resource conflict (R%d)" msgstr "" -#: config/tc-d10v.c:848 +#: config/tc-d10v.c:847 #, c-format msgid "resource conflict (A%d)" msgstr "" -#: config/tc-d10v.c:850 +#: config/tc-d10v.c:849 msgid "resource conflict (PSW)" msgstr "" -#: config/tc-d10v.c:852 +#: config/tc-d10v.c:851 msgid "resource conflict (C flag)" msgstr "" -#: config/tc-d10v.c:854 +#: config/tc-d10v.c:853 msgid "resource conflict (F flag)" msgstr "" -#: config/tc-d10v.c:1004 +#: config/tc-d10v.c:1003 msgid "Instruction must be executed in parallel" msgstr "" -#: config/tc-d10v.c:1007 +#: config/tc-d10v.c:1006 msgid "Long instructions may not be combined." msgstr "" -#: config/tc-d10v.c:1040 +#: config/tc-d10v.c:1039 msgid "One of these instructions may not be executed in parallel." msgstr "" -#: config/tc-d10v.c:1044 config/tc-d30v.c:1071 +#: config/tc-d10v.c:1043 config/tc-d30v.c:1070 msgid "Two IU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:1046 config/tc-d10v.c:1054 config/tc-d10v.c:1068 -#: config/tc-d10v.c:1083 config/tc-d30v.c:1072 config/tc-d30v.c:1081 +#: config/tc-d10v.c:1045 config/tc-d10v.c:1053 config/tc-d10v.c:1067 +#: config/tc-d10v.c:1082 config/tc-d30v.c:1071 config/tc-d30v.c:1080 msgid "Swapping instruction order" msgstr "" -#: config/tc-d10v.c:1052 config/tc-d30v.c:1078 +#: config/tc-d10v.c:1051 config/tc-d30v.c:1077 msgid "Two MU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:1072 config/tc-d30v.c:1098 +#: config/tc-d10v.c:1071 config/tc-d30v.c:1097 msgid "IU instruction may not be in the left container" msgstr "" -#: config/tc-d10v.c:1074 config/tc-d10v.c:1089 +#: config/tc-d10v.c:1073 config/tc-d10v.c:1088 msgid "" "Instruction in R container is squashed by flow control instruction in L " "container." msgstr "" -#: config/tc-d10v.c:1087 config/tc-d30v.c:1109 +#: config/tc-d10v.c:1086 config/tc-d30v.c:1108 msgid "MU instruction may not be in the right container" msgstr "" -#: config/tc-d10v.c:1093 config/tc-d30v.c:1121 +#: config/tc-d10v.c:1092 config/tc-d30v.c:1120 msgid "unknown execution type passed to write_2_short()" msgstr "" -#: config/tc-d10v.c:1221 config/tc-d10v.c:1394 +#: config/tc-d10v.c:1220 config/tc-d10v.c:1393 msgid "bad opcode or operands" msgstr "" -#: config/tc-d10v.c:1296 config/tc-m68k.c:4625 +#: config/tc-d10v.c:1295 msgid "value out of range" msgstr "" -#: config/tc-d10v.c:1370 +#: config/tc-d10v.c:1369 msgid "illegal operand - register name found where none expected" msgstr "" -#: config/tc-d10v.c:1405 +#: config/tc-d10v.c:1404 msgid "Register number must be EVEN" msgstr "" -#: config/tc-d10v.c:1408 +#: config/tc-d10v.c:1407 msgid "Unsupported use of sp" msgstr "" -#: config/tc-d10v.c:1427 +#: config/tc-d10v.c:1426 #, c-format msgid "cr%ld is a reserved control register" msgstr "" -#: config/tc-d10v.c:1466 config/tc-d30v.c:1430 -#, c-format -msgid "unknown opcode: %s" -msgstr "" - -#: config/tc-d10v.c:1602 +#: config/tc-d10v.c:1599 #, c-format msgid "line %d: rep or repi must include at least 4 instructions" msgstr "" -#: config/tc-d10v.c:1810 config/tc-d10v.c:1832 config/tc-d30v.c:1777 +#: config/tc-d10v.c:1779 +msgid "can't find previous opcode " +msgstr "" + +#: config/tc-d10v.c:1791 +#, c-format +msgid "could not assemble: %s" +msgstr "" + +#: config/tc-d10v.c:1806 config/tc-d10v.c:1828 config/tc-d30v.c:1776 msgid "Unable to mix instructions as specified" msgstr "" -#: config/tc-d30v.c:150 +#: config/tc-d30v.c:149 #, c-format msgid "Register name %s conflicts with symbol of the same name" msgstr "" -#: config/tc-d30v.c:240 +#: config/tc-d30v.c:239 #, c-format msgid "" "\n" @@ -3528,126 +3993,131 @@ msgid "" "-C Opposite of -C. -c is the default.\n" msgstr "" -#: config/tc-d30v.c:402 +#: config/tc-d30v.c:401 msgid "unexpected 12-bit reloc type" msgstr "" -#: config/tc-d30v.c:409 +#: config/tc-d30v.c:408 msgid "unexpected 18-bit reloc type" msgstr "" -#: config/tc-d30v.c:659 +#: config/tc-d30v.c:658 #, c-format msgid "%s NOP inserted" msgstr "" -#: config/tc-d30v.c:660 +#: config/tc-d30v.c:659 msgid "sequential" msgstr "" -#: config/tc-d30v.c:660 +#: config/tc-d30v.c:659 msgid "parallel" msgstr "" -#: config/tc-d30v.c:1067 +#: config/tc-d30v.c:1066 msgid "Instructions may not be executed in parallel" msgstr "" -#: config/tc-d30v.c:1080 +#: config/tc-d30v.c:1079 #, c-format msgid "Executing %s in IU may not work" msgstr "" -#: config/tc-d30v.c:1087 +#: config/tc-d30v.c:1086 #, c-format msgid "Executing %s in IU may not work in parallel execution" msgstr "" -#: config/tc-d30v.c:1100 +#: config/tc-d30v.c:1099 #, c-format msgid "special left instruction `%s' kills instruction `%s' in right container" msgstr "" -#: config/tc-d30v.c:1111 +#: config/tc-d30v.c:1110 #, c-format msgid "Executing %s in reverse serial with %s may not work" msgstr "" -#: config/tc-d30v.c:1114 +#: config/tc-d30v.c:1113 #, c-format msgid "Executing %s in IU in reverse serial may not work" msgstr "" -#: config/tc-d30v.c:1303 +#: config/tc-d30v.c:1302 msgid "Odd numbered register used as target of multi-register instruction" msgstr "" -#: config/tc-d30v.c:1367 config/tc-d30v.c:1402 +#: config/tc-d30v.c:1366 config/tc-d30v.c:1401 #, c-format msgid "unknown condition code: %s" msgstr "" -#: config/tc-d30v.c:1395 +#: config/tc-d30v.c:1394 #, c-format msgid "cmpu doesn't support condition code %s" msgstr "" -#: config/tc-d30v.c:1441 +#: config/tc-d30v.c:1429 +#, c-format +msgid "unknown opcode: %s" +msgstr "" + +#: config/tc-d30v.c:1440 #, c-format msgid "operands for opcode `%s' do not match any valid format" msgstr "" -#: config/tc-d30v.c:1656 config/tc-d30v.c:1673 +#: config/tc-d30v.c:1655 config/tc-d30v.c:1672 msgid "Cannot assemble instruction" msgstr "" -#: config/tc-d30v.c:1658 +#: config/tc-d30v.c:1657 msgid "First opcode is long. Unable to mix instructions as specified." msgstr "" -#: config/tc-d30v.c:1727 +#: config/tc-d30v.c:1726 msgid "word of NOPs added between word multiply and load" msgstr "" -#: config/tc-d30v.c:1729 +#: config/tc-d30v.c:1728 msgid "word of NOPs added between word multiply and 16-bit multiply" msgstr "" -#: config/tc-d30v.c:1761 +#: config/tc-d30v.c:1760 msgid "Instruction uses long version, so it cannot be mixed as specified" msgstr "" -#: config/tc-d30v.c:1888 +#: config/tc-d30v.c:1887 #, c-format msgid "value too large to fit in %d bits" msgstr "" -#: config/tc-d30v.c:1949 +#: config/tc-d30v.c:1948 #, c-format msgid "line %d: unable to place address of symbol '%s' into a byte" msgstr "" -#: config/tc-d30v.c:1952 +#: config/tc-d30v.c:1951 #, c-format msgid "line %d: unable to place value %lx into a byte" msgstr "" -#: config/tc-d30v.c:1960 +#: config/tc-d30v.c:1959 #, c-format msgid "line %d: unable to place address of symbol '%s' into a short" msgstr "" -#: config/tc-d30v.c:1963 +#: config/tc-d30v.c:1962 #, c-format msgid "line %d: unable to place value %lx into a short" msgstr "" -#: config/tc-d30v.c:1971 +#: config/tc-d30v.c:1970 #, c-format msgid "line %d: unable to place address of symbol '%s' into a quad" msgstr "" -#: config/tc-d30v.c:2079 +#: config/tc-d30v.c:2078 #, c-format msgid "Alignment too large: %d assumed" msgstr "" @@ -3661,8 +4131,8 @@ msgid ".endfunc missing for previous .proc" msgstr "" #. Probably a memory allocation problem? Give up now. -#: config/tc-dlx.c:297 config/tc-hppa.c:1489 config/tc-mips.c:1415 -#: config/tc-mips.c:1467 config/tc-or32.c:210 config/tc-sparc.c:855 +#: config/tc-dlx.c:297 config/tc-hppa.c:8306 config/tc-mips.c:1764 +#: config/tc-mips.c:1816 config/tc-or32.c:211 config/tc-sparc.c:869 msgid "Broken assembler. No assembly attempted." msgstr "" @@ -3681,7 +4151,7 @@ msgstr "" msgid "Expression Error for operand modifier %%hi/%%lo\n" msgstr "" -#: config/tc-dlx.c:634 config/tc-or32.c:873 +#: config/tc-dlx.c:634 config/tc-or32.c:871 #, c-format msgid "Invalid expression after %%%%\n" msgstr "" @@ -3718,7 +4188,7 @@ msgstr "" msgid "failed general register sanity check." msgstr "" -#: config/tc-dlx.c:1175 config/tc-or32.c:835 +#: config/tc-dlx.c:1175 config/tc-or32.c:833 #, c-format msgid "label \"$%d\" redefined" msgstr "" @@ -3727,314 +4197,315 @@ msgstr "" msgid "Invalid expression after # number\n" msgstr "" -#: config/tc-fr30.c:83 +#: config/tc-fr30.c:82 #, c-format msgid " FR30 specific command line options:\n" msgstr "" -#: config/tc-fr30.c:136 +#: config/tc-fr30.c:135 #, c-format msgid "Instruction %s not allowed in a delay slot." msgstr "" -#: config/tc-frv.c:461 +#: config/tc-frv.c:460 #, c-format msgid "FRV specific command line options:\n" msgstr "" -#: config/tc-frv.c:462 +#: config/tc-frv.c:461 #, c-format msgid "-G n Data >= n bytes is in small data area\n" msgstr "" -#: config/tc-frv.c:463 +#: config/tc-frv.c:462 #, c-format msgid "-mgpr-32 Note 32 gprs are used\n" msgstr "" -#: config/tc-frv.c:464 +#: config/tc-frv.c:463 #, c-format msgid "-mgpr-64 Note 64 gprs are used\n" msgstr "" -#: config/tc-frv.c:465 +#: config/tc-frv.c:464 #, c-format msgid "-mfpr-32 Note 32 fprs are used\n" msgstr "" -#: config/tc-frv.c:466 +#: config/tc-frv.c:465 #, c-format msgid "-mfpr-64 Note 64 fprs are used\n" msgstr "" -#: config/tc-frv.c:467 +#: config/tc-frv.c:466 #, c-format msgid "-msoft-float Note software fp is used\n" msgstr "" -#: config/tc-frv.c:468 +#: config/tc-frv.c:467 #, c-format msgid "-mdword Note stack is aligned to a 8 byte boundary\n" msgstr "" -#: config/tc-frv.c:469 +#: config/tc-frv.c:468 #, c-format msgid "-mno-dword Note stack is aligned to a 4 byte boundary\n" msgstr "" -#: config/tc-frv.c:470 +#: config/tc-frv.c:469 #, c-format msgid "-mdouble Note fp double insns are used\n" msgstr "" -#: config/tc-frv.c:471 +#: config/tc-frv.c:470 #, c-format msgid "-mmedia Note media insns are used\n" msgstr "" -#: config/tc-frv.c:472 +#: config/tc-frv.c:471 #, c-format msgid "-mmuladd Note multiply add/subtract insns are used\n" msgstr "" -#: config/tc-frv.c:473 +#: config/tc-frv.c:472 #, c-format msgid "-mpack Note instructions are packed\n" msgstr "" -#: config/tc-frv.c:474 +#: config/tc-frv.c:473 #, c-format msgid "-mno-pack Do not allow instructions to be packed\n" msgstr "" -#: config/tc-frv.c:475 +#: config/tc-frv.c:474 #, c-format msgid "-mpic Note small position independent code\n" msgstr "" -#: config/tc-frv.c:476 +#: config/tc-frv.c:475 #, c-format msgid "-mPIC Note large position independent code\n" msgstr "" -#: config/tc-frv.c:477 +#: config/tc-frv.c:476 #, c-format msgid "-mlibrary-pic Compile library for large position indepedent code\n" msgstr "" -#: config/tc-frv.c:478 +#: config/tc-frv.c:477 #, c-format msgid "-mfdpic Assemble for the FDPIC ABI\n" msgstr "" -#: config/tc-frv.c:479 +#: config/tc-frv.c:478 #, c-format msgid "-mnopic Disable -mpic, -mPIC, -mlibrary-pic and -mfdpic\n" msgstr "" -#: config/tc-frv.c:480 +#: config/tc-frv.c:479 #, c-format msgid "-mcpu={fr500|fr550|fr400|fr405|fr450|fr300|frv|simple|tomcat}\n" msgstr "" -#: config/tc-frv.c:481 +#: config/tc-frv.c:480 #, c-format msgid " Record the cpu type\n" msgstr "" -#: config/tc-frv.c:482 +#: config/tc-frv.c:481 #, c-format msgid "-mtomcat-stats Print out stats for tomcat workarounds\n" msgstr "" -#: config/tc-frv.c:483 +#: config/tc-frv.c:482 #, c-format msgid "-mtomcat-debug Debug tomcat workarounds\n" msgstr "" -#: config/tc-frv.c:1187 +#: config/tc-frv.c:1186 msgid "VLIW packing used for -mno-pack" msgstr "" -#: config/tc-frv.c:1197 +#: config/tc-frv.c:1196 msgid "Instruction not supported by this architecture" msgstr "" -#: config/tc-frv.c:1207 +#: config/tc-frv.c:1206 msgid "VLIW packing constraint violation" msgstr "" -#: config/tc-frv.c:1874 +#: config/tc-frv.c:1873 #, c-format msgid "Relocation %s is not safe for %s" msgstr "" -#: config/tc-h8300.c:78 config/tc-h8300.c:87 config/tc-h8300.c:97 -#: config/tc-h8300.c:107 config/tc-h8300.c:117 config/tc-h8300.c:128 -#: config/tc-h8300.c:195 config/tc-hppa.c:1449 config/tc-hppa.c:6926 -#: config/tc-hppa.c:6932 config/tc-hppa.c:6938 config/tc-hppa.c:6944 -#: config/tc-mn10300.c:1223 config/tc-mn10300.c:1228 config/tc-mn10300.c:2725 +#: config/tc-h8300.c:76 config/tc-h8300.c:85 config/tc-h8300.c:95 +#: config/tc-h8300.c:105 config/tc-h8300.c:115 config/tc-h8300.c:126 +#: config/tc-h8300.c:193 config/tc-hppa.c:6839 config/tc-hppa.c:6845 +#: config/tc-hppa.c:6851 config/tc-hppa.c:6857 config/tc-hppa.c:8264 +#: config/tc-mn10300.c:1222 config/tc-mn10300.c:1227 config/tc-mn10300.c:2729 +#: config/tc-xc16x.c:79 config/tc-xc16x.c:86 config/tc-xc16x.c:93 msgid "could not set architecture and machine" msgstr "" -#: config/tc-h8300.c:397 config/tc-h8300.c:405 +#: config/tc-h8300.c:395 config/tc-h8300.c:403 msgid "Reg not valid for H8/300" msgstr "" -#: config/tc-h8300.c:486 +#: config/tc-h8300.c:484 msgid "invalid operand size requested" msgstr "" -#: config/tc-h8300.c:585 +#: config/tc-h8300.c:583 msgid "Invalid register list for ldm/stm\n" msgstr "" -#: config/tc-h8300.c:611 config/tc-h8300.c:616 config/tc-h8300.c:623 +#: config/tc-h8300.c:609 config/tc-h8300.c:614 config/tc-h8300.c:621 msgid "mismatch between register and suffix" msgstr "" -#: config/tc-h8300.c:650 +#: config/tc-h8300.c:648 msgid "address too high for vector table jmp/jsr" msgstr "" -#: config/tc-h8300.c:677 config/tc-h8300.c:789 config/tc-h8300.c:799 +#: config/tc-h8300.c:675 config/tc-h8300.c:787 config/tc-h8300.c:797 msgid "Wrong size pointer register for architecture." msgstr "" -#: config/tc-h8300.c:736 config/tc-h8300.c:744 config/tc-h8300.c:773 +#: config/tc-h8300.c:734 config/tc-h8300.c:742 config/tc-h8300.c:771 msgid "expected @(exp, reg16)" msgstr "" -#: config/tc-h8300.c:762 +#: config/tc-h8300.c:760 msgid "expected .L, .W or .B for register in indexed addressing mode" msgstr "" -#: config/tc-h8300.c:956 +#: config/tc-h8300.c:954 msgid "expected valid addressing mode for mova: \"@(disp, ea.sz),ERn\"" msgstr "" -#: config/tc-h8300.c:974 config/tc-h8300.c:983 +#: config/tc-h8300.c:972 config/tc-h8300.c:981 msgid "expected register" msgstr "" -#: config/tc-h8300.c:999 +#: config/tc-h8300.c:997 msgid "expected closing paren" msgstr "" -#: config/tc-h8300.c:1058 +#: config/tc-h8300.c:1056 #, c-format msgid "can't use high part of register in operand %d" msgstr "" -#: config/tc-h8300.c:1215 +#: config/tc-h8300.c:1213 #, c-format msgid "Opcode `%s' with these operand types not available in %s mode" msgstr "" -#: config/tc-h8300.c:1224 +#: config/tc-h8300.c:1222 msgid "mismatch between opcode size and operand size" msgstr "" -#: config/tc-h8300.c:1260 +#: config/tc-h8300.c:1258 #, c-format msgid "operand %s0x%lx out of range." msgstr "" -#: config/tc-h8300.c:1356 +#: config/tc-h8300.c:1354 msgid "Can't work out size of operand.\n" msgstr "" -#: config/tc-h8300.c:1405 +#: config/tc-h8300.c:1403 #, c-format msgid "Opcode `%s' with these operand types not available in H8/300 mode" msgstr "" -#: config/tc-h8300.c:1410 +#: config/tc-h8300.c:1408 #, c-format msgid "Opcode `%s' with these operand types not available in H8/300H mode" msgstr "" -#: config/tc-h8300.c:1416 +#: config/tc-h8300.c:1414 #, c-format msgid "Opcode `%s' with these operand types not available in H8/300S mode" msgstr "" -#: config/tc-h8300.c:1477 config/tc-h8300.c:1497 +#: config/tc-h8300.c:1475 config/tc-h8300.c:1495 msgid "Need #1 or #2 here" msgstr "" -#: config/tc-h8300.c:1492 +#: config/tc-h8300.c:1490 msgid "#4 not valid on H8/300." msgstr "" -#: config/tc-h8300.c:1598 config/tc-h8300.c:1680 +#: config/tc-h8300.c:1596 config/tc-h8300.c:1678 #, c-format msgid "branch operand has odd offset (%lx)\n" msgstr "" -#: config/tc-h8300.c:1718 +#: config/tc-h8300.c:1716 msgid "destination operand must be 16 bit register" msgstr "" -#: config/tc-h8300.c:1727 +#: config/tc-h8300.c:1725 msgid "source operand must be 8 bit register" msgstr "" -#: config/tc-h8300.c:1735 +#: config/tc-h8300.c:1733 msgid "destination operand must be 16bit absolute address" msgstr "" -#: config/tc-h8300.c:1742 +#: config/tc-h8300.c:1740 msgid "destination operand must be 8 bit register" msgstr "" -#: config/tc-h8300.c:1750 +#: config/tc-h8300.c:1748 msgid "source operand must be 16bit absolute address" msgstr "" #. This seems more sane than saying "too many operands". We'll #. get here only if the trailing trash starts with a comma. #. Types or values of args don't match. -#: config/tc-h8300.c:1758 config/tc-mmix.c:473 config/tc-mmix.c:485 -#: config/tc-mmix.c:2526 config/tc-mmix.c:2550 config/tc-mmix.c:2823 -#: config/tc-or32.c:527 +#: config/tc-h8300.c:1756 config/tc-mmix.c:472 config/tc-mmix.c:484 +#: config/tc-mmix.c:2525 config/tc-mmix.c:2549 config/tc-mmix.c:2822 +#: config/tc-or32.c:528 msgid "invalid operands" msgstr "" -#: config/tc-h8300.c:1789 +#: config/tc-h8300.c:1787 msgid "operand/size mis-match" msgstr "" -#: config/tc-h8300.c:1885 config/tc-mips.c:9358 config/tc-sh64.c:2795 -#: config/tc-sh.c:2838 config/tc-z8k.c:1204 +#: config/tc-h8300.c:1883 config/tc-mips.c:9767 config/tc-sh64.c:2795 +#: config/tc-sh.c:2925 config/tc-z8k.c:1226 msgid "unknown opcode" msgstr "" -#: config/tc-h8300.c:1918 +#: config/tc-h8300.c:1916 msgid "invalid operand in ldm" msgstr "" -#: config/tc-h8300.c:1927 +#: config/tc-h8300.c:1925 msgid "invalid operand in stm" msgstr "" -#: config/tc-h8300.c:2093 +#: config/tc-h8300.c:2091 #, c-format msgid "call to tc_aout_fix_to_chars \n" msgstr "" -#: config/tc-h8300.c:2102 +#: config/tc-h8300.c:2100 config/tc-xc16x.c:389 #, c-format msgid "call to md_convert_frag \n" msgstr "" -#: config/tc-h8300.c:2146 +#: config/tc-h8300.c:2144 config/tc-xc16x.c:293 #, c-format msgid "call tomd_estimate_size_before_relax \n" msgstr "" -#: config/tc-h8300.c:2197 config/tc-mcore.c:2282 config/tc-pj.c:538 -#: config/tc-sh.c:4270 +#: config/tc-h8300.c:2195 config/tc-mcore.c:2265 config/tc-pj.c:538 +#: config/tc-sh.c:4401 config/tc-xc16x.c:357 #, c-format msgid "Cannot represent relocation type %s" msgstr "" @@ -4043,619 +4514,625 @@ msgstr "" #. IGNORE is used to suppress the error message. #. Variant of CHECK_FIELD for use in md_apply_fix and other places where #. the current file and line number are not valid. -#: config/tc-hppa.c:1176 config/tc-hppa.c:1190 +#: config/tc-hppa.c:1015 config/tc-hppa.c:1029 #, c-format msgid "Field out of range [%d..%d] (%d)." msgstr "" #. Simple alignment checking for FIELD against ALIGN (a power of two). #. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1204 +#: config/tc-hppa.c:1043 #, c-format msgid "Field not properly aligned [%d] (%d)." msgstr "" -#: config/tc-hppa.c:1233 +#: config/tc-hppa.c:1092 msgid "Missing .exit\n" msgstr "" -#: config/tc-hppa.c:1236 +#: config/tc-hppa.c:1095 msgid "Missing .procend\n" msgstr "" -#: config/tc-hppa.c:1422 +#: config/tc-hppa.c:1277 #, c-format msgid "Invalid field selector. Assuming F%%." msgstr "" -#: config/tc-hppa.c:1455 -msgid "-R option not supported on this target." -msgstr "" - -#: config/tc-hppa.c:1471 config/tc-sparc.c:811 config/tc-sparc.c:847 -#, c-format -msgid "Internal error: can't hash `%s': %s\n" -msgstr "" - -#: config/tc-hppa.c:1479 config/tc-i860.c:238 -#, c-format -msgid "internal error: losing opcode: `%s' \"%s\"\n" -msgstr "" - -#: config/tc-hppa.c:1550 config/tc-hppa.c:7065 config/tc-hppa.c:7122 -msgid "Missing function name for .PROC (corrupted label chain)" -msgstr "" - -#: config/tc-hppa.c:1553 config/tc-hppa.c:7125 -msgid "Missing function name for .PROC" -msgstr "" - -#: config/tc-hppa.c:1857 -msgid "Invalid Indexed Load Completer." -msgstr "" - -#: config/tc-hppa.c:1862 -msgid "Invalid Indexed Load Completer Syntax." -msgstr "" - -#: config/tc-hppa.c:1896 -msgid "Invalid Short Load/Store Completer." -msgstr "" - -#: config/tc-hppa.c:1956 config/tc-hppa.c:1961 -msgid "Invalid Store Bytes Short Completer" -msgstr "" - -#: config/tc-hppa.c:2272 config/tc-hppa.c:2278 -msgid "Invalid left/right combination completer" -msgstr "" - -#: config/tc-hppa.c:2327 config/tc-hppa.c:2334 -msgid "Invalid permutation completer" -msgstr "" - -#: config/tc-hppa.c:2434 -#, c-format -msgid "Invalid Add Condition: %s" -msgstr "" - -#: config/tc-hppa.c:2445 config/tc-hppa.c:2455 -msgid "Invalid Add and Branch Condition" -msgstr "" - -#: config/tc-hppa.c:2476 config/tc-hppa.c:2613 -msgid "Invalid Compare/Subtract Condition" -msgstr "" - -#: config/tc-hppa.c:2516 -#, c-format -msgid "Invalid Bit Branch Condition: %c" -msgstr "" - -#: config/tc-hppa.c:2601 -#, c-format -msgid "Invalid Compare/Subtract Condition: %s" -msgstr "" - -#: config/tc-hppa.c:2628 -msgid "Invalid Compare and Branch Condition" -msgstr "" - -#: config/tc-hppa.c:2724 -msgid "Invalid Logical Instruction Condition." -msgstr "" - -#: config/tc-hppa.c:2779 -msgid "Invalid Shift/Extract/Deposit Condition." -msgstr "" - -#: config/tc-hppa.c:2891 -msgid "Invalid Unit Instruction Condition." -msgstr "" - -#: config/tc-hppa.c:3270 config/tc-hppa.c:3302 config/tc-hppa.c:3333 -#: config/tc-hppa.c:3363 -msgid "Branch to unaligned address" -msgstr "" - -#: config/tc-hppa.c:3541 -msgid "Invalid SFU identifier" -msgstr "" - -#: config/tc-hppa.c:3591 -msgid "Invalid COPR identifier" -msgstr "" - -#: config/tc-hppa.c:3720 -msgid "Invalid Floating Point Operand Format." -msgstr "" - -#: config/tc-hppa.c:3837 config/tc-hppa.c:3857 config/tc-hppa.c:3877 -#: config/tc-hppa.c:3897 config/tc-hppa.c:3917 -msgid "Invalid register for single precision fmpyadd or fmpysub" -msgstr "" - -#: config/tc-hppa.c:3968 config/tc-hppa.c:4928 -msgid "could not update architecture and machine" -msgstr "" - -#: config/tc-hppa.c:3985 -#, c-format -msgid "Invalid operands %s" -msgstr "" - -#: config/tc-hppa.c:4103 -msgid "Cannot handle fixup" -msgstr "" - -#: config/tc-hppa.c:4404 -#, c-format -msgid " -Q ignored\n" -msgstr "" - -#: config/tc-hppa.c:4408 -#, c-format -msgid " -c print a warning if a comment is found\n" -msgstr "" - -#: config/tc-hppa.c:4479 -#, c-format -msgid "no hppa_fixup entry for fixup type 0x%x" -msgstr "" - -#: config/tc-hppa.c:4650 -msgid "Unknown relocation encountered in md_apply_fix." -msgstr "" - -#: config/tc-hppa.c:4792 config/tc-hppa.c:4817 -#, c-format -msgid "Undefined register: '%s'." -msgstr "" - -#: config/tc-hppa.c:4851 -#, c-format -msgid "Non-absolute symbol: '%s'." -msgstr "" - -#: config/tc-hppa.c:4866 -#, c-format -msgid "Undefined absolute constant: '%s'." -msgstr "" - -#: config/tc-hppa.c:4967 -#, c-format -msgid "Invalid FP Compare Condition: %s" -msgstr "" - -#: config/tc-hppa.c:5023 -#, c-format -msgid "Invalid FTEST completer: %s" -msgstr "" - -#: config/tc-hppa.c:5090 config/tc-hppa.c:5128 -#, c-format -msgid "Invalid FP Operand Format: %3s" -msgstr "" - -#: config/tc-hppa.c:5207 +#: config/tc-hppa.c:1304 msgid "Bad segment in expression." msgstr "" -#: config/tc-hppa.c:5266 -msgid "Bad segment (should be absolute)." -msgstr "" - -#: config/tc-hppa.c:5309 -#, c-format -msgid "Invalid argument location: %s\n" -msgstr "" - -#: config/tc-hppa.c:5340 -#, c-format -msgid "Invalid argument description: %d" -msgstr "" - -#: config/tc-hppa.c:5363 +#: config/tc-hppa.c:1329 #, c-format msgid "Invalid Nullification: (%c)" msgstr "" -#: config/tc-hppa.c:5960 +#: config/tc-hppa.c:1438 +msgid "Cannot handle fixup" +msgstr "" + +#: config/tc-hppa.c:1736 +#, c-format +msgid " -Q ignored\n" +msgstr "" + +#: config/tc-hppa.c:1740 +#, c-format +msgid " -c print a warning if a comment is found\n" +msgstr "" + +#: config/tc-hppa.c:1806 +#, c-format +msgid "no hppa_fixup entry for fixup type 0x%x" +msgstr "" + +#: config/tc-hppa.c:1985 +msgid "Unknown relocation encountered in md_apply_fix." +msgstr "" + +#: config/tc-hppa.c:2173 config/tc-hppa.c:2198 +#, c-format +msgid "Undefined register: '%s'." +msgstr "" + +#: config/tc-hppa.c:2232 +#, c-format +msgid "Non-absolute symbol: '%s'." +msgstr "" + +#: config/tc-hppa.c:2247 +#, c-format +msgid "Undefined absolute constant: '%s'." +msgstr "" + +#: config/tc-hppa.c:2278 config/tc-hppa.c:5697 +msgid "could not update architecture and machine" +msgstr "" + +#: config/tc-hppa.c:2316 +#, c-format +msgid "Invalid FP Compare Condition: %s" +msgstr "" + +#: config/tc-hppa.c:2371 +#, c-format +msgid "Invalid FTEST completer: %s" +msgstr "" + +#: config/tc-hppa.c:2437 config/tc-hppa.c:2474 +#, c-format +msgid "Invalid FP Operand Format: %3s" +msgstr "" + +#: config/tc-hppa.c:2609 +msgid "Bad segment (should be absolute)." +msgstr "" + +#: config/tc-hppa.c:2635 +#, c-format +msgid "Invalid argument location: %s\n" +msgstr "" + +#: config/tc-hppa.c:2664 +#, c-format +msgid "Invalid argument description: %d" +msgstr "" + +#: config/tc-hppa.c:3490 +msgid "Invalid Indexed Load Completer." +msgstr "" + +#: config/tc-hppa.c:3495 +msgid "Invalid Indexed Load Completer Syntax." +msgstr "" + +#: config/tc-hppa.c:3529 +msgid "Invalid Short Load/Store Completer." +msgstr "" + +#: config/tc-hppa.c:3589 config/tc-hppa.c:3594 +msgid "Invalid Store Bytes Short Completer" +msgstr "" + +#: config/tc-hppa.c:3905 config/tc-hppa.c:3911 +msgid "Invalid left/right combination completer" +msgstr "" + +#: config/tc-hppa.c:3960 config/tc-hppa.c:3967 +msgid "Invalid permutation completer" +msgstr "" + +#: config/tc-hppa.c:4067 +#, c-format +msgid "Invalid Add Condition: %s" +msgstr "" + +#: config/tc-hppa.c:4078 config/tc-hppa.c:4088 +msgid "Invalid Add and Branch Condition" +msgstr "" + +#: config/tc-hppa.c:4109 config/tc-hppa.c:4246 +msgid "Invalid Compare/Subtract Condition" +msgstr "" + +#: config/tc-hppa.c:4149 +#, c-format +msgid "Invalid Bit Branch Condition: %c" +msgstr "" + +#: config/tc-hppa.c:4234 +#, c-format +msgid "Invalid Compare/Subtract Condition: %s" +msgstr "" + +#: config/tc-hppa.c:4261 +msgid "Invalid Compare and Branch Condition" +msgstr "" + +#: config/tc-hppa.c:4357 +msgid "Invalid Logical Instruction Condition." +msgstr "" + +#: config/tc-hppa.c:4412 +msgid "Invalid Shift/Extract/Deposit Condition." +msgstr "" + +#: config/tc-hppa.c:4524 +msgid "Invalid Unit Instruction Condition." +msgstr "" + +#: config/tc-hppa.c:4999 config/tc-hppa.c:5031 config/tc-hppa.c:5062 +#: config/tc-hppa.c:5092 +msgid "Branch to unaligned address" +msgstr "" + +#: config/tc-hppa.c:5270 +msgid "Invalid SFU identifier" +msgstr "" + +#: config/tc-hppa.c:5320 +msgid "Invalid COPR identifier" +msgstr "" + +#: config/tc-hppa.c:5449 +msgid "Invalid Floating Point Operand Format." +msgstr "" + +#: config/tc-hppa.c:5566 config/tc-hppa.c:5586 config/tc-hppa.c:5606 +#: config/tc-hppa.c:5626 config/tc-hppa.c:5646 +msgid "Invalid register for single precision fmpyadd or fmpysub" +msgstr "" + +#: config/tc-hppa.c:5714 +#, c-format +msgid "Invalid operands %s" +msgstr "" + +#: config/tc-hppa.c:5769 config/tc-hppa.c:6975 config/tc-hppa.c:7030 +msgid "Missing function name for .PROC (corrupted label chain)" +msgstr "" + +#: config/tc-hppa.c:5772 config/tc-hppa.c:7033 +msgid "Missing function name for .PROC" +msgstr "" + +#: config/tc-hppa.c:5831 msgid "Argument to .BLOCK/.BLOCKZ must be between 0 and 0x3fffffff" msgstr "" -#: config/tc-hppa.c:6076 +#: config/tc-hppa.c:5927 #, c-format msgid "Invalid .CALL argument: %s" msgstr "" -#: config/tc-hppa.c:6198 +#: config/tc-hppa.c:6061 msgid ".callinfo is not within a procedure definition" msgstr "" -#: config/tc-hppa.c:6218 +#: config/tc-hppa.c:6081 #, c-format msgid "FRAME parameter must be a multiple of 8: %d\n" msgstr "" -#: config/tc-hppa.c:6237 +#: config/tc-hppa.c:6100 msgid "Value for ENTRY_GR must be in the range 3..18\n" msgstr "" -#: config/tc-hppa.c:6249 +#: config/tc-hppa.c:6112 msgid "Value for ENTRY_FR must be in the range 12..21\n" msgstr "" -#: config/tc-hppa.c:6259 +#: config/tc-hppa.c:6122 msgid "Value for ENTRY_SR must be 3\n" msgstr "" -#: config/tc-hppa.c:6315 +#: config/tc-hppa.c:6178 #, c-format msgid "Invalid .CALLINFO argument: %s" msgstr "" -#: config/tc-hppa.c:6427 +#: config/tc-hppa.c:6288 msgid "The .ENTER pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6443 +#: config/tc-hppa.c:6304 msgid "Misplaced .entry. Ignored." msgstr "" -#: config/tc-hppa.c:6447 +#: config/tc-hppa.c:6308 msgid "Missing .callinfo." msgstr "" -#: config/tc-hppa.c:6513 +#: config/tc-hppa.c:6372 msgid ".REG expression must be a register" msgstr "" -#: config/tc-hppa.c:6529 +#: config/tc-hppa.c:6388 msgid "bad or irreducible absolute expression; zero assumed" msgstr "" -#: config/tc-hppa.c:6540 +#: config/tc-hppa.c:6399 msgid ".REG must use a label" msgstr "" -#: config/tc-hppa.c:6542 +#: config/tc-hppa.c:6401 msgid ".EQU must use a label" msgstr "" -#: config/tc-hppa.c:6595 -msgid ".EXIT must appear within a procedure" -msgstr "" - -#: config/tc-hppa.c:6599 -msgid "Missing .callinfo" -msgstr "" - -#: config/tc-hppa.c:6603 -msgid "No .ENTRY for this .EXIT" -msgstr "" - -#: config/tc-hppa.c:6630 -#, c-format -msgid "Cannot define export symbol: %s\n" -msgstr "" - -#: config/tc-hppa.c:6688 -#, c-format -msgid "Using ENTRY rather than CODE in export directive for %s" -msgstr "" - -#: config/tc-hppa.c:6805 -#, c-format -msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" -msgstr "" - -#: config/tc-hppa.c:6887 -msgid "Missing label name on .LABEL" -msgstr "" - -#: config/tc-hppa.c:6892 -msgid "extra .LABEL arguments ignored." -msgstr "" - -#: config/tc-hppa.c:6909 -msgid "The .LEAVE pseudo-op is not supported" -msgstr "" - -#: config/tc-hppa.c:6948 -msgid "Unrecognized .LEVEL argument\n" -msgstr "" - -#: config/tc-hppa.c:6984 -#, c-format -msgid "Cannot define static symbol: %s\n" -msgstr "" - -#: config/tc-hppa.c:7019 -msgid "Nested procedures" -msgstr "" - -#: config/tc-hppa.c:7029 -msgid "Cannot allocate unwind descriptor\n" -msgstr "" - -#: config/tc-hppa.c:7129 -msgid "misplaced .procend" -msgstr "" - -#: config/tc-hppa.c:7132 -msgid "Missing .callinfo for this procedure" -msgstr "" - -#: config/tc-hppa.c:7135 -msgid "Missing .EXIT for a .ENTRY" -msgstr "" - -#: config/tc-hppa.c:7173 -msgid "Not in a space.\n" -msgstr "" - -#: config/tc-hppa.c:7176 -msgid "Not in a subspace.\n" -msgstr "" - -#: config/tc-hppa.c:7267 -msgid "Invalid .SPACE argument" -msgstr "" - -#: config/tc-hppa.c:7314 -msgid "Can't change spaces within a procedure definition. Ignored" -msgstr "" - -#: config/tc-hppa.c:7443 -#, c-format -msgid "Undefined space: '%s' Assuming space number = 0." -msgstr "" - -#: config/tc-hppa.c:7467 -msgid "Must be in a space before changing or declaring subspaces.\n" -msgstr "" - -#: config/tc-hppa.c:7471 -msgid "Can't change subspaces within a procedure definition. Ignored" -msgstr "" - -#: config/tc-hppa.c:7507 -msgid "Parameters of an existing subspace can't be modified" -msgstr "" - -#: config/tc-hppa.c:7559 -msgid "Alignment must be a power of 2" -msgstr "" - -#: config/tc-hppa.c:7606 -msgid "FIRST not supported as a .SUBSPACE argument" -msgstr "" - -#: config/tc-hppa.c:7608 -msgid "Invalid .SUBSPACE argument" -msgstr "" - -#: config/tc-hppa.c:7797 -#, c-format -msgid "Internal error: Unable to find containing space for %s." -msgstr "" - -#: config/tc-hppa.c:7837 -#, c-format -msgid "Out of memory: could not allocate new space chain entry: %s\n" -msgstr "" - -#: config/tc-hppa.c:7926 -#, c-format -msgid "Out of memory: could not allocate new subspace chain entry: %s\n" -msgstr "" - -#: config/tc-hppa.c:8662 +#: config/tc-hppa.c:6463 #, c-format msgid "Symbol '%s' could not be created." msgstr "" -#: config/tc-hppa.c:8666 +#: config/tc-hppa.c:6467 msgid "No memory for symbol name." msgstr "" -#: config/tc-i386.c:721 +#: config/tc-hppa.c:6516 +msgid ".EXIT must appear within a procedure" +msgstr "" + +#: config/tc-hppa.c:6520 +msgid "Missing .callinfo" +msgstr "" + +#: config/tc-hppa.c:6524 +msgid "No .ENTRY for this .EXIT" +msgstr "" + +#: config/tc-hppa.c:6564 +#, c-format +msgid "Using ENTRY rather than CODE in export directive for %s" +msgstr "" + +#: config/tc-hppa.c:6681 +#, c-format +msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" +msgstr "" + +#: config/tc-hppa.c:6705 +#, c-format +msgid "Cannot define export symbol: %s\n" +msgstr "" + +#: config/tc-hppa.c:6802 +msgid "Missing label name on .LABEL" +msgstr "" + +#: config/tc-hppa.c:6807 +msgid "extra .LABEL arguments ignored." +msgstr "" + +#: config/tc-hppa.c:6823 +msgid "The .LEAVE pseudo-op is not supported" +msgstr "" + +#: config/tc-hppa.c:6861 +msgid "Unrecognized .LEVEL argument\n" +msgstr "" + +#: config/tc-hppa.c:6895 +#, c-format +msgid "Cannot define static symbol: %s\n" +msgstr "" + +#: config/tc-hppa.c:6929 +msgid "Nested procedures" +msgstr "" + +#: config/tc-hppa.c:6939 +msgid "Cannot allocate unwind descriptor\n" +msgstr "" + +#: config/tc-hppa.c:7037 +msgid "misplaced .procend" +msgstr "" + +#: config/tc-hppa.c:7040 +msgid "Missing .callinfo for this procedure" +msgstr "" + +#: config/tc-hppa.c:7043 +msgid "Missing .EXIT for a .ENTRY" +msgstr "" + +#: config/tc-hppa.c:7080 +msgid "Not in a space.\n" +msgstr "" + +#: config/tc-hppa.c:7083 +msgid "Not in a subspace.\n" +msgstr "" + +#: config/tc-hppa.c:7172 +msgid "Invalid .SPACE argument" +msgstr "" + +#: config/tc-hppa.c:7218 +msgid "Can't change spaces within a procedure definition. Ignored" +msgstr "" + +#: config/tc-hppa.c:7346 +#, c-format +msgid "Undefined space: '%s' Assuming space number = 0." +msgstr "" + +#: config/tc-hppa.c:7369 +msgid "Must be in a space before changing or declaring subspaces.\n" +msgstr "" + +#: config/tc-hppa.c:7373 +msgid "Can't change subspaces within a procedure definition. Ignored" +msgstr "" + +#: config/tc-hppa.c:7409 +msgid "Parameters of an existing subspace can't be modified" +msgstr "" + +#: config/tc-hppa.c:7461 +msgid "Alignment must be a power of 2" +msgstr "" + +#: config/tc-hppa.c:7508 +msgid "FIRST not supported as a .SUBSPACE argument" +msgstr "" + +#: config/tc-hppa.c:7510 +msgid "Invalid .SUBSPACE argument" +msgstr "" + +#: config/tc-hppa.c:7699 +#, c-format +msgid "Internal error: Unable to find containing space for %s." +msgstr "" + +#: config/tc-hppa.c:7737 +#, c-format +msgid "Out of memory: could not allocate new space chain entry: %s\n" +msgstr "" + +#: config/tc-hppa.c:7825 +#, c-format +msgid "Out of memory: could not allocate new subspace chain entry: %s\n" +msgstr "" + +#: config/tc-hppa.c:8270 +msgid "-R option not supported on this target." +msgstr "" + +#: config/tc-hppa.c:8287 config/tc-sparc.c:825 config/tc-sparc.c:861 +#, c-format +msgid "Internal error: can't hash `%s': %s\n" +msgstr "" + +#: config/tc-hppa.c:8296 config/tc-i860.c:236 +#, c-format +msgid "internal error: losing opcode: `%s' \"%s\"\n" +msgstr "" + +#: config/tc-i386.c:983 #, c-format msgid "%s shortened to %s" msgstr "" -#: config/tc-i386.c:777 +#: config/tc-i386.c:1053 msgid "same type of prefix used twice" msgstr "" -#: config/tc-i386.c:795 +#: config/tc-i386.c:1066 msgid "64bit mode not supported on this CPU." msgstr "" -#: config/tc-i386.c:799 +#: config/tc-i386.c:1070 msgid "32bit mode not supported on this CPU." msgstr "" -#: config/tc-i386.c:832 +#: config/tc-i386.c:1101 msgid "bad argument to syntax directive." msgstr "" -#: config/tc-i386.c:884 +#: config/tc-i386.c:1161 #, c-format msgid "no such architecture: `%s'" msgstr "" -#: config/tc-i386.c:889 +#: config/tc-i386.c:1166 msgid "missing cpu architecture" msgstr "" -#: config/tc-i386.c:903 +#: config/tc-i386.c:1180 #, c-format msgid "no such architecture modifier: `%s'" msgstr "" -#: config/tc-i386.c:919 config/tc-i386.c:5342 +#: config/tc-i386.c:1196 config/tc-i386.c:6133 config/tc-i386.c:6167 msgid "Unknown architecture" msgstr "" -#: config/tc-i386.c:1247 +#: config/tc-i386.c:1528 #, c-format msgid "unknown relocation (%u)" msgstr "" -#: config/tc-i386.c:1249 +#: config/tc-i386.c:1530 #, c-format msgid "%u-byte relocation cannot be applied to %u-byte field" msgstr "" -#: config/tc-i386.c:1253 +#: config/tc-i386.c:1534 msgid "non-pc-relative relocation for pc-relative field" msgstr "" -#: config/tc-i386.c:1258 +#: config/tc-i386.c:1539 msgid "relocated field and relocation type differ in signedness" msgstr "" -#: config/tc-i386.c:1267 +#: config/tc-i386.c:1548 msgid "there are no unsigned pc-relative relocations" msgstr "" -#: config/tc-i386.c:1275 +#: config/tc-i386.c:1556 #, c-format msgid "cannot do %u byte pc-relative relocation" msgstr "" -#: config/tc-i386.c:1292 +#: config/tc-i386.c:1573 #, c-format msgid "cannot do %s %u byte relocation" msgstr "" -#: config/tc-i386.c:1496 config/tc-i386.c:2527 +#: config/tc-i386.c:1790 config/tc-i386.c:2963 #, c-format msgid "ambiguous operand size for `%s'" msgstr "" -#: config/tc-i386.c:1544 +#: config/tc-i386.c:1838 #, c-format -msgid "can't use register '%%%s' as operand %d in '%s'." +msgid "can't use register '%s%s' as operand %d in '%s'." msgstr "" #. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. -#: config/tc-i386.c:1573 +#: config/tc-i386.c:1870 #, c-format msgid "translating to `%sp'" msgstr "" -#: config/tc-i386.c:1618 +#: config/tc-i386.c:1915 #, c-format -msgid "can't encode register '%%%s' in an instruction requiring REX prefix." +msgid "can't encode register '%s%s' in an instruction requiring REX prefix." msgstr "" -#: config/tc-i386.c:1659 config/tc-i386.c:1767 +#: config/tc-i386.c:1955 config/tc-i386.c:2063 #, c-format msgid "no such instruction: `%s'" msgstr "" -#: config/tc-i386.c:1670 config/tc-i386.c:1799 +#: config/tc-i386.c:1966 config/tc-i386.c:2095 #, c-format msgid "invalid character %s in mnemonic" msgstr "" -#: config/tc-i386.c:1677 +#: config/tc-i386.c:1973 msgid "expecting prefix; got nothing" msgstr "" -#: config/tc-i386.c:1679 +#: config/tc-i386.c:1975 msgid "expecting mnemonic; got nothing" msgstr "" -#: config/tc-i386.c:1695 config/tc-i386.c:1818 +#: config/tc-i386.c:1991 config/tc-i386.c:2114 #, c-format msgid "`%s' is only supported in 64-bit mode" msgstr "" -#: config/tc-i386.c:1696 config/tc-i386.c:1817 +#: config/tc-i386.c:1992 config/tc-i386.c:2113 #, c-format msgid "`%s' is not supported in 64-bit mode" msgstr "" -#: config/tc-i386.c:1707 +#: config/tc-i386.c:2003 #, c-format msgid "redundant %s prefix" msgstr "" -#: config/tc-i386.c:1824 +#: config/tc-i386.c:2120 #, c-format msgid "`%s' is not supported on `%s%s'" msgstr "" -#: config/tc-i386.c:1831 +#: config/tc-i386.c:2127 msgid "use .code16 to ensure correct addressing mode" msgstr "" -#: config/tc-i386.c:1844 +#: config/tc-i386.c:2140 #, c-format msgid "expecting string instruction after `%s'" msgstr "" -#: config/tc-i386.c:1878 +#: config/tc-i386.c:2172 #, c-format msgid "invalid character %s before operand %d" msgstr "" -#: config/tc-i386.c:1892 +#: config/tc-i386.c:2186 #, c-format msgid "unbalanced parenthesis in operand %d." msgstr "" -#: config/tc-i386.c:1895 +#: config/tc-i386.c:2189 #, c-format msgid "unbalanced brackets in operand %d." msgstr "" -#: config/tc-i386.c:1904 +#: config/tc-i386.c:2198 #, c-format msgid "invalid character %s in operand %d" msgstr "" -#: config/tc-i386.c:1931 +#: config/tc-i386.c:2225 #, c-format msgid "spurious operands; (%d operands/instruction max)" msgstr "" -#: config/tc-i386.c:1954 +#: config/tc-i386.c:2248 msgid "expecting operand after ','; got nothing" msgstr "" -#: config/tc-i386.c:1959 +#: config/tc-i386.c:2253 msgid "expecting operand before ','; got nothing" msgstr "" #. We found no match. -#: config/tc-i386.c:2336 +#: config/tc-i386.c:2741 #, c-format msgid "suffix or operands invalid for `%s'" msgstr "" -#: config/tc-i386.c:2347 +#: config/tc-i386.c:2752 #, c-format msgid "indirect %s without `*'" msgstr "" #. Warn them that a data or address size prefix doesn't #. affect assembly of the next line of code. -#: config/tc-i386.c:2355 +#: config/tc-i386.c:2760 #, c-format msgid "stand-alone `%s' prefix" msgstr "" -#: config/tc-i386.c:2384 config/tc-i386.c:2399 +#: config/tc-i386.c:2794 config/tc-i386.c:2809 #, c-format msgid "`%s' operand %d must use `%%es' segment" msgstr "" -#: config/tc-i386.c:2509 +#. We have to know the operand size for crc32. +#: config/tc-i386.c:2862 +#, c-format +msgid "ambiguous memory operand size for `%s`" +msgstr "" + +#: config/tc-i386.c:2944 msgid "" "no instruction mnemonic suffix given and no register operands; can't size " "instruction" @@ -4663,385 +5140,444 @@ msgstr "" #. Prohibit these changes in the 64bit mode, since the #. lowering is more complicated. -#: config/tc-i386.c:2610 config/tc-i386.c:2669 config/tc-i386.c:2686 -#: config/tc-i386.c:2718 config/tc-i386.c:2751 +#: config/tc-i386.c:3068 config/tc-i386.c:3131 config/tc-i386.c:3150 +#: config/tc-i386.c:3183 config/tc-i386.c:3217 #, c-format -msgid "Incorrect register `%%%s' used with `%c' suffix" +msgid "Incorrect register `%s%s' used with `%c' suffix" msgstr "" -#: config/tc-i386.c:2618 config/tc-i386.c:2676 config/tc-i386.c:2758 +#: config/tc-i386.c:3076 config/tc-i386.c:3138 config/tc-i386.c:3224 #, c-format -msgid "using `%%%s' instead of `%%%s' due to `%c' suffix" +msgid "using `%s%s' instead of `%s%s' due to `%c' suffix" msgstr "" -#: config/tc-i386.c:2633 config/tc-i386.c:2654 config/tc-i386.c:2705 -#: config/tc-i386.c:2736 +#: config/tc-i386.c:3093 config/tc-i386.c:3115 config/tc-i386.c:3169 +#: config/tc-i386.c:3201 #, c-format -msgid "`%%%s' not allowed with `%s%c'" +msgid "`%s%s' not allowed with `%s%c'" msgstr "" -#: config/tc-i386.c:2799 +#: config/tc-i386.c:3267 msgid "no instruction mnemonic suffix given; can't determine immediate size" msgstr "" -#: config/tc-i386.c:2832 +#: config/tc-i386.c:3301 #, c-format msgid "" "no instruction mnemonic suffix given; can't determine immediate size %x %c" msgstr "" -#. Reversed arguments on faddp, fsubp, etc. -#: config/tc-i386.c:2881 +#: config/tc-i386.c:3339 #, c-format -msgid "translating to `%s %%%s,%%%s'" +msgid "the last operand of `%s' must be `%sxmm0'" msgstr "" -#. Extraneous `l' suffix on fp insn. -#: config/tc-i386.c:2888 +#: config/tc-i386.c:3342 #, c-format -msgid "translating to `%s %%%s'" +msgid "the first operand of `%s' must be `%sxmm0'" msgstr "" -#: config/tc-i386.c:2906 +#: config/tc-i386.c:3379 #, c-format msgid "you can't `pop %%cs'" msgstr "" -#: config/tc-i386.c:2927 +#. Reversed arguments on faddp, fsubp, etc. +#: config/tc-i386.c:3401 +#, c-format +msgid "translating to `%s %s%s,%s%s'" +msgstr "" + +#. Extraneous `l' suffix on fp insn. +#: config/tc-i386.c:3408 +#, c-format +msgid "translating to `%s %s%s'" +msgstr "" + +#: config/tc-i386.c:3436 #, c-format msgid "segment override on `%s' is ineffectual" msgstr "" -#: config/tc-i386.c:3236 config/tc-i386.c:3330 config/tc-i386.c:3375 +#: config/tc-i386.c:3777 config/tc-i386.c:3871 config/tc-i386.c:3916 msgid "skipping prefixes on this instruction" msgstr "" -#: config/tc-i386.c:3395 +#: config/tc-i386.c:3936 msgid "16-bit jump out of range" msgstr "" -#: config/tc-i386.c:3404 +#: config/tc-i386.c:3945 #, c-format msgid "can't handle non absolute segment in `%s'" msgstr "" -#: config/tc-i386.c:3897 +#: config/tc-i386.c:4501 #, c-format msgid "@%s reloc is not supported with %d-bit output format" msgstr "" -#: config/tc-i386.c:3986 -msgid "only 1 or 2 immediate operands are allowed" +#: config/tc-i386.c:4585 +#, c-format +msgid "at most %d immediate operands are allowed" msgstr "" -#: config/tc-i386.c:4007 config/tc-i386.c:4218 +#: config/tc-i386.c:4607 config/tc-i386.c:4824 #, c-format msgid "junk `%s' after expression" msgstr "" #. Missing or bad expr becomes absolute 0. -#: config/tc-i386.c:4016 +#: config/tc-i386.c:4616 #, c-format msgid "missing or invalid immediate expression `%s' taken as 0" msgstr "" -#: config/tc-i386.c:4041 config/tc-i386.c:4277 +#: config/tc-i386.c:4642 config/tc-i386.c:4883 #, c-format msgid "unimplemented segment %s in operand" msgstr "" -#: config/tc-i386.c:4088 +#: config/tc-i386.c:4648 +#, c-format +msgid "illegal immediate register operand %s" +msgstr "" + +#: config/tc-i386.c:4691 #, c-format msgid "expecting scale factor of 1, 2, 4, or 8: got `%s'" msgstr "" -#: config/tc-i386.c:4097 +#: config/tc-i386.c:4700 #, c-format msgid "scale factor of %d without an index register" msgstr "" -#: config/tc-i386.c:4236 +#: config/tc-i386.c:4723 +#, c-format +msgid "at most %d displacement operands are allowed" +msgstr "" + +#: config/tc-i386.c:4842 #, c-format msgid "bad expression used with @%s" msgstr "" -#: config/tc-i386.c:4386 +#: config/tc-i386.c:4990 #, c-format msgid "`%s' is not a valid base/index expression" msgstr "" -#: config/tc-i386.c:4390 +#: config/tc-i386.c:4994 #, c-format msgid "`%s' is not a valid %s bit base/index expression" msgstr "" -#: config/tc-i386.c:4464 +#: config/tc-i386.c:5066 #, c-format msgid "bad memory operand `%s'" msgstr "" -#: config/tc-i386.c:4479 +#: config/tc-i386.c:5081 #, c-format msgid "junk `%s' after register" msgstr "" -#: config/tc-i386.c:4488 config/tc-i386.c:4603 config/tc-i386.c:4641 +#: config/tc-i386.c:5090 config/tc-i386.c:5206 config/tc-i386.c:5247 #, c-format msgid "bad register name `%s'" msgstr "" -#: config/tc-i386.c:4496 +#: config/tc-i386.c:5098 msgid "immediate operand illegal with absolute jump" msgstr "" -#: config/tc-i386.c:4518 +#: config/tc-i386.c:5120 #, c-format msgid "too many memory references for `%s'" msgstr "" -#: config/tc-i386.c:4596 +#: config/tc-i386.c:5198 #, c-format msgid "expecting `,' or `)' after index register in `%s'" msgstr "" -#: config/tc-i386.c:4620 +#: config/tc-i386.c:5223 #, c-format msgid "expecting `)' after scale factor in `%s'" msgstr "" -#: config/tc-i386.c:4627 +#: config/tc-i386.c:5231 #, c-format msgid "expecting index register or scale factor after `,'; got '%c'" msgstr "" -#: config/tc-i386.c:4634 +#: config/tc-i386.c:5239 #, c-format msgid "expecting `,' or `)' after base register in `%s'" msgstr "" #. It's not a memory operand; argh! -#: config/tc-i386.c:4675 +#: config/tc-i386.c:5281 #, c-format msgid "invalid char %s beginning operand %d `%s'" msgstr "" -#: config/tc-i386.c:4850 +#: config/tc-i386.c:5457 msgid "long jump required" msgstr "" -#: config/tc-i386.c:5127 +#: config/tc-i386.c:5512 +msgid "jump target out of range" +msgstr "" + +#: config/tc-i386.c:5757 msgid "Bad call to md_atof ()" msgstr "" -#: config/tc-i386.c:5294 +#: config/tc-i386.c:6012 msgid "No compiled in support for x86_64" msgstr "" -#: config/tc-i386.c:5315 +#: config/tc-i386.c:6041 config/tc-i386.c:6057 +#, c-format +msgid "Invalid -march= option: `%s'" +msgstr "" + +#: config/tc-i386.c:6062 config/tc-i386.c:6074 +#, c-format +msgid "Invalid -mtune= option: `%s'" +msgstr "" + +#: config/tc-i386.c:6088 #, c-format msgid "" " -Q ignored\n" " -V print assembler version number\n" " -k ignored\n" -" -n Do not optimize code alignment\n" -" -q quieten some warnings\n" -" -s ignored\n" msgstr "" -#: config/tc-i386.c:5323 +#: config/tc-i386.c:6093 #, c-format msgid "" " -n Do not optimize code alignment\n" " -q quieten some warnings\n" msgstr "" -#: config/tc-i386.c:5425 config/tc-s390.c:1861 +#: config/tc-i386.c:6097 +#, c-format +msgid " -s ignored\n" +msgstr "" + +#: config/tc-i386.c:6101 +#, c-format +msgid " --32/--64 generate 32bit/64bit code\n" +msgstr "" + +#: config/tc-i386.c:6105 +#, c-format +msgid " --divide do not treat `/' as a comment character\n" +msgstr "" + +#: config/tc-i386.c:6108 +#, c-format +msgid " --divide ignored\n" +msgstr "" + +#: config/tc-i386.c:6111 +#, c-format +msgid "" +" -march=CPU/-mtune=CPU generate code/optimize for CPU, where CPU is one " +"of:\n" +" i386, i486, pentium, pentiumpro, pentium4, " +"nocona,\n" +" core, core2, k6, athlon, k8, generic32, " +"generic64\n" +msgstr "" + +#: config/tc-i386.c:6251 config/tc-s390.c:1862 msgid "GOT already in symbol table" msgstr "" -#: config/tc-i386.c:5568 +#: config/tc-i386.c:6400 #, c-format msgid "can not do %d byte pc-relative relocation" msgstr "" -#: config/tc-i386.c:5586 +#: config/tc-i386.c:6418 #, c-format msgid "can not do %d byte relocation" msgstr "" -#: config/tc-i386.c:5657 config/tc-s390.c:2307 +#: config/tc-i386.c:6497 config/tc-s390.c:2308 #, c-format msgid "cannot represent relocation type %s" msgstr "" -#: config/tc-i386.c:5912 +#: config/tc-i386.c:6749 #, c-format msgid "invalid operand for '%s' ('%s' unexpected)" msgstr "" -#: config/tc-i386.c:5924 +#: config/tc-i386.c:6761 #, c-format msgid "too many memory references for '%s'" msgstr "" #. See the comments in intel_bracket_expr. -#: config/tc-i386.c:5935 +#: config/tc-i386.c:6772 #, c-format msgid "Treating `%s' as memory reference" msgstr "" -#: config/tc-i386.c:6247 +#: config/tc-i386.c:7088 #, c-format msgid "Unknown operand modifier `%s'" msgstr "" -#: config/tc-i386.c:6262 +#: config/tc-i386.c:7103 msgid "Conflicting operand modifiers" msgstr "" -#: config/tc-i386.c:6311 +#: config/tc-i386.c:7152 msgid "Invalid operand to `OFFSET'" msgstr "" -#: config/tc-i386.c:6384 +#: config/tc-i386.c:7225 #, c-format msgid "`[%.*s]' taken to mean just `%.*s'" msgstr "" -#: config/tc-i386.c:6474 +#: config/tc-i386.c:7316 #, c-format msgid "`%s' is not a valid segment register" msgstr "" -#: config/tc-i386.c:6478 +#: config/tc-i386.c:7321 msgid "Extra segment override ignored" msgstr "" -#: config/tc-i386.c:6512 config/tc-i386.c:6681 +#: config/tc-i386.c:7355 config/tc-i386.c:7517 msgid "Register scaling only allowed in memory operands" msgstr "" -#: config/tc-i386.c:6534 config/tc-i386.c:6658 +#: config/tc-i386.c:7377 config/tc-i386.c:7493 #, c-format msgid "Syntax error: Expecting a constant, got `%s'" msgstr "" -#: config/tc-i386.c:6562 +#: config/tc-i386.c:7405 msgid "Too many register references in memory operand" msgstr "" -#: config/tc-i386.c:6573 -msgid "Using register names in OFFSET expressions is deprecated" -msgstr "" - -#: config/tc-i386.c:6586 +#: config/tc-i386.c:7421 msgid "Invalid use of register" msgstr "" -#: config/tc-i386.c:6731 +#: config/tc-i386.c:7570 #, c-format msgid "Unrecognized token '%s'" msgstr "" -#: config/tc-i386.c:6748 +#: config/tc-i386.c:7586 #, c-format msgid "Unexpected token `%s'" msgstr "" -#: config/tc-i386.c:6910 +#: config/tc-i386.c:7744 msgid "`:' expected" msgstr "" -#: config/tc-i386.c:6935 +#: config/tc-i386.c:7769 #, c-format msgid "Unrecognized token `%s'" msgstr "" -#: config/tc-i386.c:7070 +#: config/tc-i386.c:7904 msgid "Bad .section directive: want a,l,w,x,M,S,G,T in string" msgstr "" -#: config/tc-i386.c:7073 +#: config/tc-i386.c:7907 msgid "Bad .section directive: want a,w,x,M,S,G,T in string" msgstr "" -#: config/tc-i386.c:7092 +#: config/tc-i386.c:7926 msgid ".largecomm supported only in 64bit mode, producing .comm" msgstr "" -#: config/tc-i860.c:124 +#: config/tc-i860.c:122 msgid "Directive .dual available only with -mintel-syntax option" msgstr "" -#: config/tc-i860.c:134 +#: config/tc-i860.c:132 msgid "Directive .enddual available only with -mintel-syntax option" msgstr "" -#: config/tc-i860.c:147 +#: config/tc-i860.c:145 msgid "Directive .atmp available only with -mintel-syntax option" msgstr "" -#: config/tc-i860.c:169 config/tc-i860.c:173 +#: config/tc-i860.c:167 config/tc-i860.c:171 msgid "Unknown temporary pseudo register" msgstr "" -#: config/tc-i860.c:229 config/tc-mips.c:1412 +#: config/tc-i860.c:227 config/tc-mips.c:1761 #, c-format msgid "internal error: can't hash `%s': %s\n" msgstr "" -#: config/tc-i860.c:249 +#: config/tc-i860.c:247 msgid "Defective assembler. No assembly attempted." msgstr "" -#: config/tc-i860.c:395 config/tc-i860.c:940 config/tc-m68k.c:3443 -#: config/tc-m68k.c:3475 config/tc-sparc.c:2657 +#: config/tc-i860.c:393 config/tc-i860.c:938 config/tc-m68k.c:3667 +#: config/tc-m68k.c:3699 config/tc-sparc.c:2711 msgid "failed sanity check." msgstr "" -#: config/tc-i860.c:402 +#: config/tc-i860.c:400 #, c-format msgid "Expanded opcode after delayed branch: `%s'" msgstr "" -#: config/tc-i860.c:406 +#: config/tc-i860.c:404 #, c-format msgid "Expanded opcode in dual mode: `%s'" msgstr "" -#: config/tc-i860.c:410 +#: config/tc-i860.c:408 #, c-format msgid "An instruction was expanded (%s)" msgstr "" -#: config/tc-i860.c:676 +#: config/tc-i860.c:674 msgid "Pipelined instruction: fsrc1 = fdest" msgstr "" -#: config/tc-i860.c:879 config/tc-i860.c:886 config/tc-i860.c:893 +#: config/tc-i860.c:877 config/tc-i860.c:884 config/tc-i860.c:891 msgid "Assembler does not yet support PIC" msgstr "" -#: config/tc-i860.c:957 +#: config/tc-i860.c:955 #, c-format msgid "Illegal operands for %s" msgstr "" -#: config/tc-i860.c:974 +#: config/tc-i860.c:972 #, c-format msgid "'d.%s' must be 8-byte aligned" msgstr "" -#: config/tc-i860.c:982 +#: config/tc-i860.c:980 #, c-format msgid "Prefix 'd.' invalid for instruction `%s'" msgstr "" -#: config/tc-i860.c:1088 +#: config/tc-i860.c:1086 msgid "i860_estimate_size_before_relax\n" msgstr "" -#: config/tc-i860.c:1187 +#: config/tc-i860.c:1185 #, c-format msgid "" " -EL\t\t\t generate code for little endian mode (default)\n" @@ -5052,42 +5588,42 @@ msgid "" msgstr "" #. SVR4 compatibility flags. -#: config/tc-i860.c:1195 +#: config/tc-i860.c:1193 #, c-format msgid "" " -V\t\t\t print assembler version number\n" " -Qy, -Qn\t\t ignored\n" msgstr "" -#: config/tc-i860.c:1258 +#: config/tc-i860.c:1256 msgid "This immediate requires 0 MOD 2 alignment" msgstr "" -#: config/tc-i860.c:1261 +#: config/tc-i860.c:1259 msgid "This immediate requires 0 MOD 4 alignment" msgstr "" -#: config/tc-i860.c:1264 +#: config/tc-i860.c:1262 msgid "This immediate requires 0 MOD 8 alignment" msgstr "" -#: config/tc-i860.c:1267 +#: config/tc-i860.c:1265 msgid "This immediate requires 0 MOD 16 alignment" msgstr "" -#: config/tc-i860.c:1362 +#: config/tc-i860.c:1360 msgid "5-bit immediate too large" msgstr "" -#: config/tc-i860.c:1365 +#: config/tc-i860.c:1363 msgid "5-bit field must be absolute" msgstr "" -#: config/tc-i860.c:1410 config/tc-i860.c:1433 +#: config/tc-i860.c:1408 config/tc-i860.c:1431 msgid "A branch offset requires 0 MOD 4 alignment" msgstr "" -#: config/tc-i860.c:1454 +#: config/tc-i860.c:1452 #, c-format msgid "Unrecognized fix-up (0x%08lx)" msgstr "" @@ -5096,95 +5632,87 @@ msgstr "" msgid "i860_convert_frag\n" msgstr "" -#: config/tc-i960.c:488 +#: config/tc-i960.c:486 #, c-format msgid "Hashing returned \"%s\"." msgstr "" -#: config/tc-i960.c:584 config/tc-i960.c:1114 +#: config/tc-i960.c:582 config/tc-i960.c:1112 msgid "expression syntax error" msgstr "" -#: config/tc-i960.c:620 +#: config/tc-i960.c:618 msgid "attempt to branch into different segment" msgstr "" -#: config/tc-i960.c:624 +#: config/tc-i960.c:622 #, c-format msgid "target of %s instruction must be a label" msgstr "" -#: config/tc-i960.c:734 +#: config/tc-i960.c:732 msgid "unaligned register" msgstr "" -#: config/tc-i960.c:756 +#: config/tc-i960.c:754 msgid "no such sfr in this architecture" msgstr "" -#: config/tc-i960.c:794 +#: config/tc-i960.c:792 msgid "illegal literal" msgstr "" -#: config/tc-i960.c:837 -msgid "unmatched '['" -msgstr "" - -#: config/tc-i960.c:844 -msgid "garbage after index spec ignored" -msgstr "" - -#: config/tc-i960.c:944 +#: config/tc-i960.c:942 msgid "invalid index register" msgstr "" -#: config/tc-i960.c:967 +#: config/tc-i960.c:965 msgid "invalid scale factor" msgstr "" -#: config/tc-i960.c:1191 +#: config/tc-i960.c:1189 msgid "architecture of opcode conflicts with that of earlier instruction(s)" msgstr "" -#: config/tc-i960.c:1425 config/tc-xtensa.c:11295 +#: config/tc-i960.c:1423 config/tc-xtensa.c:11325 msgid "too many operands" msgstr "" #. We never moved: there was no opcode either! -#: config/tc-i960.c:1473 +#: config/tc-i960.c:1471 msgid "missing opcode" msgstr "" -#: config/tc-i960.c:1613 +#: config/tc-i960.c:1611 msgid "branch prediction invalid on this opcode" msgstr "" -#: config/tc-i960.c:1651 +#: config/tc-i960.c:1649 #, c-format msgid "invalid opcode, \"%s\"." msgstr "" -#: config/tc-i960.c:1653 +#: config/tc-i960.c:1651 #, c-format msgid "improper number of operands. expecting %d, got %d" msgstr "" -#: config/tc-i960.c:1810 +#: config/tc-i960.c:1808 #, c-format msgid "Fixup of %ld too large for field width of %d" msgstr "" -#: config/tc-i960.c:1920 +#: config/tc-i960.c:1918 #, c-format msgid "invalid architecture %s" msgstr "" -#: config/tc-i960.c:1940 +#: config/tc-i960.c:1938 #, c-format msgid "I960 options:\n" msgstr "" -#: config/tc-i960.c:1943 +#: config/tc-i960.c:1941 #, c-format msgid "" "\n" @@ -5196,153 +5724,153 @@ msgid "" "\t\t\tlong displacements\n" msgstr "" -#: config/tc-i960.c:2207 +#: config/tc-i960.c:2205 msgid "should have 1 or 2 operands" msgstr "" -#: config/tc-i960.c:2215 config/tc-i960.c:2230 +#: config/tc-i960.c:2213 config/tc-i960.c:2228 #, c-format msgid "Redefining leafproc %s" msgstr "" -#: config/tc-i960.c:2260 +#: config/tc-i960.c:2258 msgid "should have two operands" msgstr "" -#: config/tc-i960.c:2270 +#: config/tc-i960.c:2268 msgid "'entry_num' must be absolute number in [0,31]" msgstr "" -#: config/tc-i960.c:2278 +#: config/tc-i960.c:2276 #, c-format msgid "Redefining entrynum for sysproc %s" msgstr "" #. Should not happen: see block comment above. -#: config/tc-i960.c:2378 +#: config/tc-i960.c:2376 #, c-format msgid "Trying to 'bal' to %s" msgstr "" -#: config/tc-i960.c:2388 +#: config/tc-i960.c:2386 msgid "Looks like a proc, but can't tell what kind.\n" msgstr "" -#: config/tc-i960.c:2407 +#: config/tc-i960.c:2405 msgid "big endian mode is not supported" msgstr "" -#: config/tc-i960.c:2409 +#: config/tc-i960.c:2407 #, c-format msgid "ignoring unrecognized .endian type `%s'" msgstr "" -#: config/tc-i960.c:2454 +#: config/tc-i960.c:2452 msgid "can't use COBR format with external label" msgstr "" -#: config/tc-i960.c:2629 +#: config/tc-i960.c:2627 msgid "option --link-relax is only supported in b.out format" msgstr "" -#: config/tc-i960.c:2656 +#: config/tc-i960.c:2654 #, c-format msgid "No 'bal' entry point for leafproc %s" msgstr "" -#: config/tc-ia64.c:1008 +#: config/tc-ia64.c:1030 msgid "Bad .section directive: want a,o,s,w,x,M,S,G,T in string" msgstr "" -#: config/tc-ia64.c:1151 +#: config/tc-ia64.c:1173 msgid "Unwind directive not followed by an instruction." msgstr "" -#: config/tc-ia64.c:5114 +#: config/tc-ia64.c:5123 msgid "Register name expected" msgstr "" -#: config/tc-ia64.c:5119 config/tc-ia64.c:5435 +#: config/tc-ia64.c:5128 config/tc-ia64.c:5444 msgid "Comma expected" msgstr "" -#: config/tc-ia64.c:5127 +#: config/tc-ia64.c:5136 msgid "Register value annotation ignored" msgstr "" -#: config/tc-ia64.c:5168 +#: config/tc-ia64.c:5177 msgid "Directive invalid within a bundle" msgstr "" -#: config/tc-ia64.c:5261 +#: config/tc-ia64.c:5270 msgid "Missing predicate relation type" msgstr "" -#: config/tc-ia64.c:5267 +#: config/tc-ia64.c:5276 msgid "Unrecognized predicate relation type" msgstr "" -#: config/tc-ia64.c:5314 +#: config/tc-ia64.c:5323 msgid "Bad register range" msgstr "" -#: config/tc-ia64.c:5323 +#: config/tc-ia64.c:5332 msgid "Predicate register expected" msgstr "" -#: config/tc-ia64.c:5328 +#: config/tc-ia64.c:5337 msgid "Duplicate predicate register ignored" msgstr "" -#: config/tc-ia64.c:5346 +#: config/tc-ia64.c:5355 msgid "Predicate source and target required" msgstr "" -#: config/tc-ia64.c:5348 config/tc-ia64.c:5360 +#: config/tc-ia64.c:5357 config/tc-ia64.c:5369 msgid "Use of p0 is not valid in this context" msgstr "" -#: config/tc-ia64.c:5355 +#: config/tc-ia64.c:5364 msgid "At least two PR arguments expected" msgstr "" -#: config/tc-ia64.c:5369 +#: config/tc-ia64.c:5378 msgid "At least one PR argument expected" msgstr "" -#: config/tc-ia64.c:5405 +#: config/tc-ia64.c:5414 #, c-format msgid "Inserting \"%s\" into entry hint table failed: %s" msgstr "" #. FIXME -- need 62-bit relocation type -#: config/tc-ia64.c:5881 +#: config/tc-ia64.c:5890 msgid "62-bit relocation not yet implemented" msgstr "" #. XXX technically, this is wrong: we should not be issuing warning #. messages until we're sure this instruction pattern is going to #. be used! -#: config/tc-ia64.c:5954 +#: config/tc-ia64.c:5974 msgid "lower 16 bits of mask ignored" msgstr "" -#: config/tc-ia64.c:6569 +#: config/tc-ia64.c:6589 msgid "Value truncated to 62 bits" msgstr "" #. Give an error if a frag containing code is not aligned to a 16 byte #. boundary. -#: config/tc-ia64.c:6707 config/tc-ia64.h:171 +#: config/tc-ia64.c:6727 config/tc-ia64.h:171 msgid "instruction address is not a multiple of 16" msgstr "" -#: config/tc-ia64.c:7249 +#: config/tc-ia64.c:7277 #, c-format msgid "Unrecognized option '-x%s'" msgstr "" -#: config/tc-ia64.c:7277 +#: config/tc-ia64.c:7305 msgid "" "IA-64 options:\n" " --mconstant-gp\t mark output file as using the constant-GP model\n" @@ -5368,370 +5896,370 @@ msgid "" "\t\t\t dependency violation checking\n" msgstr "" -#: config/tc-ia64.c:7307 +#: config/tc-ia64.c:7335 msgid "--gstabs is not supported for ia64" msgstr "" -#: config/tc-ia64.c:7641 config/tc-mips.c:1401 +#: config/tc-ia64.c:7640 config/tc-mips.c:1750 msgid "Could not set architecture and machine" msgstr "" -#: config/tc-ia64.c:7767 +#: config/tc-ia64.c:7766 msgid "Explicit stops are ignored in auto mode" msgstr "" -#: config/tc-ia64.c:7789 +#: config/tc-ia64.c:7788 msgid "Found '{' after explicit switch to automatic mode" msgstr "" -#: config/tc-ia64.c:8392 +#: config/tc-ia64.c:8393 #, c-format msgid "Unhandled dependency %s for %s (%s), note %d" msgstr "" -#: config/tc-ia64.c:9667 +#: config/tc-ia64.c:9669 #, c-format msgid "Unrecognized dependency specifier %d\n" msgstr "" -#: config/tc-ia64.c:10561 +#: config/tc-ia64.c:10566 msgid "Only the first path encountering the conflict is reported" msgstr "" -#: config/tc-ia64.c:10564 +#: config/tc-ia64.c:10569 msgid "This is the location of the conflicting usage" msgstr "" -#: config/tc-ia64.c:11788 +#: config/tc-ia64.c:11793 msgid "Can't add stop bit to mark end of instruction group" msgstr "" -#: config/tc-ia64.c:11888 read.c:1440 read.c:2206 read.c:2846 read.c:3173 -#: read.c:3204 +#: config/tc-ia64.c:11893 config/tc-score.c:6398 read.c:1442 read.c:2413 +#: read.c:3042 read.c:3375 read.c:3419 msgid "expected symbol name" msgstr "" -#: config/tc-ia64.c:11898 read.c:2216 read.c:2856 read.c:3188 stabs.c:466 +#: config/tc-ia64.c:11903 read.c:2423 read.c:3052 read.c:3403 stabs.c:466 #, c-format msgid "expected comma after \"%s\"" msgstr "" -#: config/tc-ia64.c:11940 +#: config/tc-ia64.c:11945 #, c-format msgid "`%s' is already the alias of %s `%s'" msgstr "" -#: config/tc-ia64.c:11950 +#: config/tc-ia64.c:11955 #, c-format msgid "%s `%s' already has an alias `%s'" msgstr "" -#: config/tc-ia64.c:11961 +#: config/tc-ia64.c:11966 #, c-format msgid "inserting \"%s\" into %s alias hash table failed: %s" msgstr "" -#: config/tc-ia64.c:11969 +#: config/tc-ia64.c:11974 #, c-format msgid "inserting \"%s\" into %s name hash table failed: %s" msgstr "" -#: config/tc-ia64.c:11988 +#: config/tc-ia64.c:11993 #, c-format msgid "symbol `%s' aliased to `%s' is not used" msgstr "" -#: config/tc-ia64.c:12010 +#: config/tc-ia64.c:12015 #, c-format msgid "section `%s' aliased to `%s' is not used" msgstr "" -#: config/tc-ip2k.c:158 +#: config/tc-ip2k.c:157 #, c-format msgid "IP2K specific command line options:\n" msgstr "" -#: config/tc-ip2k.c:159 +#: config/tc-ip2k.c:158 #, c-format msgid " -mip2022 restrict to IP2022 insns \n" msgstr "" -#: config/tc-ip2k.c:160 +#: config/tc-ip2k.c:159 #, c-format msgid " -mip2022ext permit extended IP2022 insn\n" msgstr "" -#: config/tc-ip2k.c:274 +#: config/tc-ip2k.c:273 msgid "md_pcrel_from\n" msgstr "" -#: config/tc-m32c.c:128 +#: config/tc-m32c.c:137 #, c-format msgid " M32C specific command line options:\n" msgstr "" #. Pretend that we do not recognise this option. -#: config/tc-m32r.c:332 +#: config/tc-m32r.c:331 msgid "Unrecognised option: -hidden" msgstr "" -#: config/tc-m32r.c:359 config/tc-sparc.c:593 +#: config/tc-m32r.c:358 config/tc-sparc.c:595 msgid "Unrecognized option following -K" msgstr "" -#: config/tc-m32r.c:374 +#: config/tc-m32r.c:373 #, c-format msgid " M32R specific command line options:\n" msgstr "" -#: config/tc-m32r.c:376 +#: config/tc-m32r.c:375 #, c-format msgid "" " -m32r disable support for the m32rx instruction set\n" msgstr "" -#: config/tc-m32r.c:378 +#: config/tc-m32r.c:377 #, c-format msgid " -m32rx support the extended m32rx instruction set\n" msgstr "" -#: config/tc-m32r.c:380 +#: config/tc-m32r.c:379 #, c-format msgid " -m32r2 support the extended m32r2 instruction set\n" msgstr "" -#: config/tc-m32r.c:382 +#: config/tc-m32r.c:381 #, c-format msgid " -EL,-little produce little endian code and data\n" msgstr "" -#: config/tc-m32r.c:384 +#: config/tc-m32r.c:383 #, c-format msgid " -EB,-big produce big endian code and data\n" msgstr "" -#: config/tc-m32r.c:386 +#: config/tc-m32r.c:385 #, c-format msgid " -parallel try to combine instructions in parallel\n" msgstr "" -#: config/tc-m32r.c:388 +#: config/tc-m32r.c:387 #, c-format msgid " -no-parallel disable -parallel\n" msgstr "" -#: config/tc-m32r.c:390 +#: config/tc-m32r.c:389 #, c-format msgid "" " -no-bitinst disallow the M32R2's extended bit-field " "instructions\n" msgstr "" -#: config/tc-m32r.c:392 +#: config/tc-m32r.c:391 #, c-format msgid " -O try to optimize code. Implies -parallel\n" msgstr "" -#: config/tc-m32r.c:395 +#: config/tc-m32r.c:394 #, c-format msgid "" " -warn-explicit-parallel-conflicts warn when parallel instructions\n" msgstr "" -#: config/tc-m32r.c:397 +#: config/tc-m32r.c:396 #, c-format msgid " might violate contraints\n" msgstr "" -#: config/tc-m32r.c:399 +#: config/tc-m32r.c:398 #, c-format msgid " -no-warn-explicit-parallel-conflicts do not warn when parallel\n" msgstr "" -#: config/tc-m32r.c:401 +#: config/tc-m32r.c:400 #, c-format msgid "" " instructions might violate " "contraints\n" msgstr "" -#: config/tc-m32r.c:403 +#: config/tc-m32r.c:402 #, c-format msgid "" " -Wp synonym for -warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:405 +#: config/tc-m32r.c:404 #, c-format msgid "" " -Wnp synonym for -no-warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:407 +#: config/tc-m32r.c:406 #, c-format msgid "" " -ignore-parallel-conflicts do not check parallel instructions\n" msgstr "" -#: config/tc-m32r.c:409 +#: config/tc-m32r.c:408 #, c-format msgid " fo contraint violations\n" msgstr "" -#: config/tc-m32r.c:411 +#: config/tc-m32r.c:410 #, c-format msgid "" " -no-ignore-parallel-conflicts check parallel instructions for\n" msgstr "" -#: config/tc-m32r.c:413 +#: config/tc-m32r.c:412 #, c-format msgid " contraint violations\n" msgstr "" -#: config/tc-m32r.c:415 +#: config/tc-m32r.c:414 #, c-format msgid " -Ip synonym for -ignore-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:417 +#: config/tc-m32r.c:416 #, c-format msgid " -nIp synonym for -no-ignore-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:420 +#: config/tc-m32r.c:419 #, c-format msgid "" " -warn-unmatched-high warn when an (s)high reloc has no matching low " "reloc\n" msgstr "" -#: config/tc-m32r.c:422 +#: config/tc-m32r.c:421 #, c-format msgid " -no-warn-unmatched-high do not warn about missing low relocs\n" msgstr "" -#: config/tc-m32r.c:424 +#: config/tc-m32r.c:423 #, c-format msgid " -Wuh synonym for -warn-unmatched-high\n" msgstr "" -#: config/tc-m32r.c:426 +#: config/tc-m32r.c:425 #, c-format msgid " -Wnuh synonym for -no-warn-unmatched-high\n" msgstr "" -#: config/tc-m32r.c:429 +#: config/tc-m32r.c:428 #, c-format msgid " -KPIC generate PIC\n" msgstr "" -#: config/tc-m32r.c:850 +#: config/tc-m32r.c:849 msgid "instructions write to the same destination register." msgstr "" -#: config/tc-m32r.c:858 +#: config/tc-m32r.c:857 msgid "Instructions do not use parallel execution pipelines." msgstr "" -#: config/tc-m32r.c:866 +#: config/tc-m32r.c:865 msgid "Instructions share the same execution pipeline" msgstr "" -#: config/tc-m32r.c:931 config/tc-m32r.c:1045 +#: config/tc-m32r.c:930 config/tc-m32r.c:1044 #, c-format msgid "not a 16 bit instruction '%s'" msgstr "" -#: config/tc-m32r.c:943 config/tc-m32r.c:1057 config/tc-m32r.c:1241 +#: config/tc-m32r.c:942 config/tc-m32r.c:1056 config/tc-m32r.c:1240 #, c-format msgid "instruction '%s' is for the M32R2 only" msgstr "" -#: config/tc-m32r.c:956 config/tc-m32r.c:1070 config/tc-m32r.c:1254 +#: config/tc-m32r.c:955 config/tc-m32r.c:1069 config/tc-m32r.c:1253 #, c-format msgid "unknown instruction '%s'" msgstr "" -#: config/tc-m32r.c:965 config/tc-m32r.c:1077 config/tc-m32r.c:1261 +#: config/tc-m32r.c:964 config/tc-m32r.c:1076 config/tc-m32r.c:1260 #, c-format msgid "instruction '%s' is for the M32RX only" msgstr "" -#: config/tc-m32r.c:974 config/tc-m32r.c:1086 +#: config/tc-m32r.c:973 config/tc-m32r.c:1085 #, c-format msgid "instruction '%s' cannot be executed in parallel." msgstr "" -#: config/tc-m32r.c:1029 config/tc-m32r.c:1111 config/tc-m32r.c:1318 +#: config/tc-m32r.c:1028 config/tc-m32r.c:1110 config/tc-m32r.c:1317 msgid "internal error: lookup/get operands failed" msgstr "" -#: config/tc-m32r.c:1096 +#: config/tc-m32r.c:1095 #, c-format msgid "'%s': only the NOP instruction can be issued in parallel on the m32r" msgstr "" -#: config/tc-m32r.c:1125 +#: config/tc-m32r.c:1124 #, c-format msgid "" "%s: output of 1st instruction is the same as an input to 2nd instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:1129 +#: config/tc-m32r.c:1128 #, c-format msgid "" "%s: output of 2nd instruction is the same as an input to 1st instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:1493 config/tc-ppc.c:1773 config/tc-ppc.c:4365 +#: config/tc-m32r.c:1492 config/tc-ppc.c:1832 config/tc-ppc.c:4372 msgid "Expected comma after symbol-name: rest of line ignored." msgstr "" -#: config/tc-m32r.c:1503 +#: config/tc-m32r.c:1502 #, c-format msgid ".SCOMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-m32r.c:1517 config/tc-ppc.c:1795 config/tc-ppc.c:2952 -#: config/tc-ppc.c:4389 +#: config/tc-m32r.c:1516 config/tc-ppc.c:1854 config/tc-ppc.c:2993 +#: config/tc-ppc.c:4396 msgid "ignoring bad alignment" msgstr "" -#: config/tc-m32r.c:1529 config/tc-ppc.c:1832 config/tc-v850.c:323 +#: config/tc-m32r.c:1528 config/tc-ppc.c:1891 config/tc-v850.c:322 msgid "Common alignment not a power of 2" msgstr "" -#: config/tc-m32r.c:1544 config/tc-ppc.c:1806 config/tc-ppc.c:4401 +#: config/tc-m32r.c:1543 config/tc-ppc.c:1865 config/tc-ppc.c:4408 #, c-format msgid "Ignoring attempt to re-define symbol `%s'." msgstr "" -#: config/tc-m32r.c:1553 +#: config/tc-m32r.c:1552 #, c-format msgid "Length of .scomm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-m32r.c:1789 +#: config/tc-m32r.c:1788 msgid "Addend to unresolved symbol not on word boundary." msgstr "" -#: config/tc-m32r.c:1930 config/tc-m32r.c:1983 config/tc-sh.c:749 +#: config/tc-m32r.c:1929 config/tc-m32r.c:1982 config/tc-sh.c:747 msgid "Invalid PIC expression." msgstr "" -#: config/tc-m32r.c:2074 +#: config/tc-m32r.c:2073 msgid "Unmatched high/shigh reloc" msgstr "" -#: config/tc-m32r.c:2334 config/tc-sparc.c:3524 +#: config/tc-m32r.c:2333 config/tc-sparc.c:3604 #, c-format msgid "internal error: can't export reloc type %d (`%s')" msgstr "" -#: config/tc-m68hc11.c:369 +#: config/tc-m68hc11.c:371 #, c-format msgid "" "Motorola 68HC11/68HC12/68HCS12 options:\n" @@ -5741,8 +6269,8 @@ msgid "" " -mlong use 32-bit int ABI\n" " -mshort-double use 32-bit double ABI\n" " -mlong-double use 64-bit double ABI (default)\n" -" --force-long-branchs always turn relative branchs into absolute ones\n" -" -S,--short-branchs do not turn relative branchs into absolute ones\n" +" --force-long-branches always turn relative branches into absolute ones\n" +" -S,--short-branches do not turn relative branches into absolute ones\n" " when the offset is out of range\n" " --strict-direct-mode do not turn the direct mode into extended mode\n" " when the instruction does not support direct mode\n" @@ -5752,56 +6280,56 @@ msgid "" " (used for testing)\n" msgstr "" -#: config/tc-m68hc11.c:415 +#: config/tc-m68hc11.c:417 #, c-format msgid "Default target `%s' is not supported." msgstr "" #. Dump the opcode statistics table. -#: config/tc-m68hc11.c:433 +#: config/tc-m68hc11.c:435 #, c-format msgid "Name # Modes Min ops Max ops Modes mask # Used\n" msgstr "" -#: config/tc-m68hc11.c:499 +#: config/tc-m68hc11.c:501 #, c-format msgid "Option `%s' is not recognized." msgstr "" -#: config/tc-m68hc11.c:721 +#: config/tc-m68hc11.c:723 msgid "#" msgstr "" -#: config/tc-m68hc11.c:730 +#: config/tc-m68hc11.c:732 msgid "#" msgstr "" -#: config/tc-m68hc11.c:739 config/tc-m68hc11.c:748 +#: config/tc-m68hc11.c:741 config/tc-m68hc11.c:750 msgid ",X" msgstr "" -#: config/tc-m68hc11.c:775 +#: config/tc-m68hc11.c:777 msgid "*" msgstr "" -#: config/tc-m68hc11.c:787 +#: config/tc-m68hc11.c:789 msgid "#" msgstr "" -#: config/tc-m68hc11.c:797 +#: config/tc-m68hc11.c:799 #, c-format msgid "symbol%d" msgstr "" -#: config/tc-m68hc11.c:799 +#: config/tc-m68hc11.c:801 msgid "" msgstr "" -#: config/tc-m68hc11.c:818 +#: config/tc-m68hc11.c:820 msgid "