diff options
author | David Carlton <carlton@bactrian.org> | 2003-03-06 00:56:43 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2003-03-06 00:56:43 +0000 |
commit | ea00b6ec6bf5ed83e0c0310feaa6c6559ee7e84a (patch) | |
tree | 6f941d2e6c4a8d032dcc1f9d7a3684171bd716c9 | |
parent | 07297283f46fcad05679b32b8109625b0c7d8670 (diff) | |
download | gdb-ea00b6ec6bf5ed83e0c0310feaa6c6559ee7e84a.zip gdb-ea00b6ec6bf5ed83e0c0310feaa6c6559ee7e84a.tar.gz gdb-ea00b6ec6bf5ed83e0c0310feaa6c6559ee7e84a.tar.bz2 |
2003-03-05 David Carlton <carlton@math.stanford.edu>
* Merge with mainline. Tag is carlton_dictionary-20030305-merge.
323 files changed, 17505 insertions, 11280 deletions
@@ -1,3 +1,104 @@ +2003-03-05 David Carlton <carlton@math.stanford.edu> + + * Merge with mainline. Tag is carlton_dictionary-20030305-merge. + +2003-03-04 Daniel Jacobowitz <drow@mvista.com> + + * configure.in: Include $(build_tooldir)/sys-include in + FLAGS_FOR_TARGET. + * configure: Regenerated. + +2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org> + + * Makefile.tpl: Reindent. + * Makefile.in: Regenerate. + * configure.in: Reindent. Don't set unused variables. + * configure: Regenerate. + + * Makefile.tpl: Always pass down RANLIB. + * Makefile.in: Regenerate. + + * Makefile.tpl: Don't set unused enable_shared, enable_threads macros. + * Makefile.in: Regenerate. + * configure.in: Remove unused logic relating to --enable-shared + and --enable-threads. Remove bogus comments. Remove redundant + noconfigdirs. + * configure: Regenerate. + + * configure.in: Replace ${libstdcxx_version} by its value. + Remove reference to mh-dgux. + * configure: Regenerate. + +2003-02-28 Nathanael Nerode <neroden@gcc.gnu.org> + + * Makefile.tpl: Rearrange. + * Makefile.in: Regenerate. + +2003-02-25 Nick Clifton <nickc@redhat.com> + + * configure: Remove site-file supprot - it is obsolete. + +2003-02-24 Uwe Stieber <uwe@wwws.de> + + * configure.in: Add support for kaOS as cross build target system. + * configure: Regenerated. + +2003-02-20 Sean McNeil <sean@blue.mcneil.com> + + * Makefile.tpl: Add definition of CPPFLAGS to pass into + configure-target-* as some target builds may require additional + flags for preprocessor tests. + * Makefile.in: Regenerated. + +2003-02-19 Alexandre Oliva <aoliva@redhat.com> + + * libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld. + * ltconfig: Handle it. + * ltcf-cxx.sh: Use with_gnu_ld passed as a shell variable instead of + auto-detecting it. + +2003-02-19 Alexandre Oliva <aoliva@redhat.com> + + * ltcf-cxx.sh: Replace $linker_flags with $compiler_flags wherever + it is used as argument to $CC. + * ltcf-gcj.sh: Likewise. + +2003-02-19 Alexandre Oliva <aoliva@redhat.com> + + * configure.in: Introduce --enable-maintainer-mode. + * configure: Rebuilt. + * Makefile.tpl (Makefile.in, configure): Enable dependencies only + for maintainer mode. + * Makefile.in: Rebuilt. + +2003-02-19 Andrew Cagney <ac131313@redhat.com> + + * configure: Regenerate using autoconf 2.13. + +2003-02-19 Alan Modra <amodra@bigpond.net.au> + + * config.guess: Import latest version. + * config.sub: Import latest version. + +2003-02-18 Jason Merrill <jason@redhat.com> + + * Makefile.tpl (check-c++): Allow parallelism. + +2003-02-17 Andrew Cagney <ac131313@redhat.com> + + * configure: Regenerate using autoconf 000227. + +2003-02-15 Geoffrey Keating <geoffk@apple.com> + + * configure.in (*-*-darwin*): Rename from powerpc*-*-darwin*, + don't configure target-libobjc. + * configure: Regenerate. + +2003-02-14 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + + * Makefile.tpl (RANLIB): Define. + * Makefile.in: Regenerate. + 2003-02-06 Keith R Seitz <keiths@redhat.com> * Makefile.def: Remove "snavigator", "grep", and "db" modules. diff --git a/Makefile.in b/Makefile.in index 4a5ad2e..41b1b64 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,8 +20,10 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +# ------------------------------- +# Standard Autoconf-set variables +# ------------------------------- VPATH=@srcdir@ -links=@configlinks@ build_alias=@build_alias@ build_cpu=@build_cpu@ @@ -39,21 +41,13 @@ target_vendor=@target_vendor@ target_os=@target_os@ target_canonical=@target_cpu@-@target_vendor@-@target_os@ -enable_shared = @enable_shared@ -enable_threads = @enable_threads@ -enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@ -# The file containing GCC's version number. -gcc_version_trigger = @gcc_version_trigger@ -gcc_version = @gcc_version@ - -# The gcc driver likes to know the arguments it was configured with. -TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ - -srcdir = @srcdir@ +program_transform_name = @program_transform_name@ prefix = @prefix@ exec_prefix = @exec_prefix@ +srcdir = @srcdir@ + bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ @@ -66,14 +60,6 @@ includedir = @includedir@ oldincludedir = @oldincludedir@ infodir = @infodir@ mandir = @mandir@ -gxx_include_dir = @gxx_include_dir@ -libstdcxx_incdir = @libstdcxx_incdir@ - -tooldir = @tooldir@ -build_tooldir = @build_tooldir@ - -program_transform_name = @program_transform_name@ - man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 @@ -83,17 +69,6 @@ man6dir = $(mandir)/man6 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 -# Directory in which the compiler finds executables, libraries, etc. -libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) -GDB_NLM_DEPS = - -SHELL = @config_shell@ - -# pwd command to use. Allow user to override default by setting PWDCMD in -# the environment to account for automounters. The make variable must not -# be called PWDCMD, otherwise the value set here is passed to make -# subprocesses and overrides the setting from the user's environment. -PWD = $${PWDCMD-pwd} # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a # cygwin host. @@ -104,51 +79,90 @@ INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS) INSTALL_SCRIPT = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 -AS = @AS@ -AR = @AR@ -AR_FLAGS = rc -CC = @CC@ +# ------------------------------------------------- +# Miscellaneous non-standard autoconf-set variables +# ------------------------------------------------- -# Special variables passed down in EXTRA_GCC_FLAGS. They are defined -# here so that they can be overridden by Makefile fragments. -BUILD_CC = $(CC_FOR_BUILD) -BUILD_PREFIX = @BUILD_PREFIX@ -BUILD_PREFIX_1 = @BUILD_PREFIX_1@ +links=@configlinks@ +enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@ +# The file containing GCC's version number. +gcc_version_trigger = @gcc_version_trigger@ +gcc_version = @gcc_version@ -CFLAGS = @CFLAGS@ -CXXFLAGS = @CXXFLAGS@ +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ -LDFLAGS = -LIBCFLAGS = $(CFLAGS) -CFLAGS_FOR_BUILD = $(CFLAGS) -# During gcc bootstrap, if we use some random cc for stage1 then -# CFLAGS will be just -g. We want to ensure that TARGET libraries -# (which we know are built with gcc) are built with optimizations so -# prepend -O2 when setting CFLAGS_FOR_TARGET. -CFLAGS_FOR_TARGET = -O2 $(CFLAGS) -LDFLAGS_FOR_TARGET = -LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) -PICFLAG = -PICFLAG_FOR_TARGET = +gxx_include_dir = @gxx_include_dir@ +libstdcxx_incdir = @libstdcxx_incdir@ -CXX = @CXX@ +tooldir = @tooldir@ +build_tooldir = @build_tooldir@ -# Use -O2 to stress test the compiler. -LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates +# Directory in which the compiler finds executables, libraries, etc. +libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) +GDB_NLM_DEPS = -DLLTOOL = @DLLTOOL@ -WINDRES = @WINDRES@ +# This is the name of the environment variable used for the path to +# the libraries. +RPATH_ENVVAR = @RPATH_ENVVAR@ -NM = @NM@ +# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared +# was used. +SET_LIB_PATH = @SET_LIB_PATH@ -LD = @LD@ +# configure.in sets SET_LIB_PATH to this if --enable-shared was used. +# Some platforms don't like blank entries, so we remove duplicate, +# leading and trailing colons. +REALLY_SET_LIB_PATH = \ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); -# These values are substituted by configure. -DEFAULT_YACC = @DEFAULT_YACC@ -DEFAULT_LEX = @DEFAULT_LEX@ -DEFAULT_M4 = @DEFAULT_M4@ +# This is the list of directories to be built for the build system. +BUILD_CONFIGDIRS = libiberty +# Build programs are put under this directory. +BUILD_SUBDIR = @build_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the build system. +BUILD_CONFIGARGS = @build_configargs@ + +# This is the list of directories to built for the host system. +SUBDIRS = @configdirs@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the host system. +HOST_CONFIGARGS = @host_configargs@ + +# This is set by the configure script to the list of directories which +# should be built using the target tools. +TARGET_CONFIGDIRS = @target_configdirs@ +# Target libraries are put under this directory: +TARGET_SUBDIR = @target_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = @target_configargs@ + +# ---------------------------------------------- +# Programs producing files for the BUILD machine +# ---------------------------------------------- + +SHELL = @config_shell@ + +# pwd command to use. Allow user to override default by setting PWDCMD in +# the environment to account for automounters. The make variable must not +# be called PWDCMD, otherwise the value set here is passed to make +# subprocesses and overrides the setting from the user's environment. +PWD = $${PWDCMD-pwd} + +# compilers to use to create programs which must be run in the build +# environment. +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = $(CFLAGS) + +CXX_FOR_BUILD = $(CXX) + +# Special variables passed down in EXTRA_GCC_FLAGS. They are defined +# here so that they can be overridden by Makefile fragments. +BUILD_CC = $(CC_FOR_BUILD) +BUILD_PREFIX = @BUILD_PREFIX@ +BUILD_PREFIX_1 = @BUILD_PREFIX_1@ BISON=@BISON@ USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ @@ -157,6 +171,7 @@ USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ echo bison ; \ fi` +DEFAULT_YACC = @DEFAULT_YACC@ YACC=@YACC@ USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ echo $$r/bison/bison -y -L $$s/bison/ ; \ @@ -166,11 +181,13 @@ USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ echo ${DEFAULT_YACC} ; \ fi` +DEFAULT_LEX = @DEFAULT_LEX@ LEX=@LEX@ USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ then echo $$r/flex/flex ; \ else echo ${DEFAULT_LEX} ; fi` +DEFAULT_M4 = @DEFAULT_M4@ M4 = `if [ -f $$r/m4/m4 ] ; \ then echo $$r/m4/m4 ; \ else echo ${DEFAULT_M4} ; fi` @@ -197,74 +214,61 @@ RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ then echo $$s/dejagnu/runtest ; \ else echo runtest ; fi` +# --------------------------------------------- +# Programs producing files for the HOST machine +# --------------------------------------------- -# compilers to use to create programs which must be run in the build -# environment. -CC_FOR_BUILD = @CC_FOR_BUILD@ -CXX_FOR_BUILD = $(CXX) +# 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 = $$r/bfd:$$r/opcodes -SUBDIRS = @configdirs@ +AS = @AS@ -# This is set by the configure script to the list of directories which -# should be built using the target tools. -TARGET_CONFIGDIRS = @target_configdirs@ +AR = @AR@ +AR_FLAGS = rc -# Target libraries are put under this directory: -# Changed by configure to $(target_alias) if cross. -TARGET_SUBDIR = @target_subdir@ +CC = @CC@ +CFLAGS = @CFLAGS@ +LIBCFLAGS = $(CFLAGS) -BUILD_CONFIGDIRS = libiberty -BUILD_SUBDIR = @build_subdir@ +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -# This is set by the configure script to the arguments to use when configuring -# directories built for the build system. -BUILD_CONFIGARGS = @build_configargs@ +DLLTOOL = @DLLTOOL@ -# This is set by the configure script to the arguments to use when configuring -# directories built for the host system. -HOST_CONFIGARGS = @host_configargs@ +NM = @NM@ -# This is set by the configure script to the arguments to use when configuring -# directories built for the target. -TARGET_CONFIGARGS = @target_configargs@ +LD = @LD@ +LDFLAGS = -# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared -# was used. -SET_LIB_PATH = @SET_LIB_PATH@ +RANLIB = @RANLIB@ -# This is the name of the environment variable used for the path to -# the libraries. This may be changed by configure.in. -RPATH_ENVVAR = @RPATH_ENVVAR@ +WINDRES = @WINDRES@ -# 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 = $$r/bfd:$$r/opcodes +PICFLAG = + +# ----------------------------------------------- +# Programs producing files for the TARGET machine +# ----------------------------------------------- # 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 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs: -# configure.in sets SET_LIB_PATH to this if --enable-shared was used. -# Some platforms don't like blank entries, so we remove duplicate, -# leading and trailing colons. -REALLY_SET_LIB_PATH = \ - $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); - -# Should be substed by configure.in FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ -CC_FOR_TARGET = @CC_FOR_TARGET@ -CXX_FOR_TARGET = @CXX_FOR_TARGET@ -RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ -CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ -RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ -GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ -# If GCC_FOR_TARGET is not overriden on the command line, then this -# variable is passed down to the gcc Makefile, where it is used to -# build libgcc2.a. We define it here so that it can itself be -# overridden on the command line. -GCC_FOR_TARGET=@GCC_FOR_TARGET@ -USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) +AR_FOR_TARGET=@AR_FOR_TARGET@ +USUAL_AR_FOR_TARGET = ` \ + if [ -f $$r/binutils/ar ] ; then \ + echo $$r/binutils/ar ; \ + else \ + if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + echo $(AR); \ + else \ + echo ar | sed '$(program_transform_name)' ; \ + fi; \ + fi` AS_FOR_TARGET=@AS_FOR_TARGET@ USUAL_AS_FOR_TARGET = ` \ @@ -280,19 +284,26 @@ USUAL_AS_FOR_TARGET = ` \ fi; \ fi` -LD_FOR_TARGET=@LD_FOR_TARGET@ -USUAL_LD_FOR_TARGET = ` \ - if [ -f $$r/ld/ld-new ] ; then \ - echo $$r/ld/ld-new ; \ - elif [ -f $$r/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=ld ; \ - else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(LD); \ - else \ - echo ld | sed '$(program_transform_name)' ; \ - fi; \ - fi` +CC_FOR_TARGET = @CC_FOR_TARGET@ +# During gcc bootstrap, if we use some random cc for stage1 then +# CFLAGS will be just -g. We want to ensure that TARGET libraries +# (which we know are built with gcc) are built with optimizations so +# prepend -O2 when setting CFLAGS_FOR_TARGET. +CFLAGS_FOR_TARGET = -O2 $(CFLAGS) +# If GCC_FOR_TARGET is not overriden on the command line, then this +# variable is passed down to the gcc Makefile, where it is used to +# build libgcc2.a. We define it here so that it can itself be +# overridden on the command line. +GCC_FOR_TARGET=@GCC_FOR_TARGET@ +USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) +LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) + +CXX_FOR_TARGET = @CXX_FOR_TARGET@ +RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ +CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +CXXFLAGS_FOR_TARGET = $(CXXFLAGS) +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ USUAL_DLLTOOL_FOR_TARGET = ` \ @@ -306,27 +317,35 @@ USUAL_DLLTOOL_FOR_TARGET = ` \ fi; \ fi` -WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ -USUAL_WINDRES_FOR_TARGET = ` \ - if [ -f $$r/binutils/windres ] ; then \ - echo $$r/binutils/windres ; \ +GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ + +LD_FOR_TARGET=@LD_FOR_TARGET@ +USUAL_LD_FOR_TARGET = ` \ + if [ -f $$r/ld/ld-new ] ; then \ + echo $$r/ld/ld-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=ld ; \ else \ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(WINDRES); \ + echo $(LD); \ else \ - echo windres | sed '$(program_transform_name)' ; \ + echo ld | sed '$(program_transform_name)' ; \ fi; \ fi` -AR_FOR_TARGET=@AR_FOR_TARGET@ -USUAL_AR_FOR_TARGET = ` \ - if [ -f $$r/binutils/ar ] ; then \ - echo $$r/binutils/ar ; \ +LDFLAGS_FOR_TARGET = + +NM_FOR_TARGET=@NM_FOR_TARGET@ +USUAL_NM_FOR_TARGET = ` \ + if [ -f $$r/binutils/nm-new ] ; then \ + echo $$r/binutils/nm-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=nm ; \ else \ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(AR); \ + echo $(NM); \ else \ - echo ar | sed '$(program_transform_name)' ; \ + echo nm | sed '$(program_transform_name)' ; \ fi; \ fi` @@ -346,20 +365,24 @@ USUAL_RANLIB_FOR_TARGET = ` \ fi; \ fi` -NM_FOR_TARGET=@NM_FOR_TARGET@ -USUAL_NM_FOR_TARGET = ` \ - if [ -f $$r/binutils/nm-new ] ; then \ - echo $$r/binutils/nm-new ; \ - elif [ -f $$r/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=nm ; \ +WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +USUAL_WINDRES_FOR_TARGET = ` \ + if [ -f $$r/binutils/windres ] ; then \ + echo $$r/binutils/windres ; \ else \ if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(NM); \ + echo $(WINDRES); \ else \ - echo nm | sed '$(program_transform_name)' ; \ + echo windres | sed '$(program_transform_name)' ; \ fi; \ fi` +PICFLAG_FOR_TARGET = + +# ------------------------------------ +# Miscellaneous targets and flag lists +# ------------------------------------ + # The first rule in the file had better be this one. Don't put any above it. # This lives here to allow makefile fragments to contain dependencies. all: all.normal @@ -458,7 +481,7 @@ EXTRA_HOST_FLAGS = \ 'DLLTOOL=$(DLLTOOL)' \ 'LD=$(LD)' \ 'NM=$(NM)' \ - "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ + 'RANLIB=$(RANLIB)' \ 'WINDRES=$(WINDRES)' FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) @@ -512,7 +535,7 @@ EXTRA_GCC_FLAGS = \ 'BUILD_PREFIX=$(BUILD_PREFIX)' \ 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ 'NM=$(NM)' \ - "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ + 'RANLIB=$(RANLIB)' \ 'WINDRES=$$(WINDRES_FOR_TARGET)' \ "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ @@ -658,7 +681,7 @@ do-clean: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ clean) \ || exit 1; \ @@ -676,7 +699,7 @@ do-clean: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ clean) \ || exit 1; \ @@ -705,7 +728,7 @@ do-distclean: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ distclean) \ || exit 1; \ @@ -723,7 +746,7 @@ do-distclean: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ distclean) \ || exit 1; \ @@ -752,7 +775,7 @@ do-dvi: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ dvi) \ || exit 1; \ @@ -770,7 +793,7 @@ do-dvi: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ dvi) \ || exit 1; \ @@ -799,7 +822,7 @@ do-info: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ info) \ || exit 1; \ @@ -817,7 +840,7 @@ do-info: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ info) \ || exit 1; \ @@ -846,7 +869,7 @@ do-install-info: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ install-info) \ || exit 1; \ @@ -864,7 +887,7 @@ do-install-info: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ install-info) \ || exit 1; \ @@ -893,7 +916,7 @@ do-installcheck: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ installcheck) \ || exit 1; \ @@ -911,7 +934,7 @@ do-installcheck: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ installcheck) \ || exit 1; \ @@ -940,7 +963,7 @@ do-mostlyclean: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ mostlyclean) \ || exit 1; \ @@ -958,7 +981,7 @@ do-mostlyclean: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ mostlyclean) \ || exit 1; \ @@ -987,7 +1010,7 @@ do-maintainer-clean: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ maintainer-clean) \ || exit 1; \ @@ -1005,7 +1028,7 @@ do-maintainer-clean: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ maintainer-clean) \ || exit 1; \ @@ -1034,7 +1057,7 @@ do-TAGS: (cd ./$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ TAGS) \ || exit 1; \ @@ -1052,7 +1075,7 @@ do-TAGS: (cd $(TARGET_SUBDIR)/$$i && \ $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ + "RANLIB=$${RANLIB}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ TAGS) \ || exit 1; \ @@ -1235,70 +1258,70 @@ TAGS: do-TAGS maybe-configure-build-libiberty: configure-build-libiberty: @test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \ - [ -d $(BUILD_SUBDIR)/libiberty ] || \ - mkdir $(BUILD_SUBDIR)/libiberty;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - AR="$(AR_FOR_BUILD)"; export AR; \ - AS="$(AS_FOR_BUILD)"; export AS; \ - CC="$(CC_FOR_BUILD)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ - CXX="$(CXX_FOR_BUILD)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ - LD="$(LD_FOR_BUILD)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ - NM="$(NM_FOR_BUILD)"; export NM; \ - RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ - echo Configuring in $(BUILD_SUBDIR)/libiberty; \ - cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(BUILD_SUBDIR)" in \ + [ -d $(BUILD_SUBDIR)/libiberty ] || \ + mkdir $(BUILD_SUBDIR)/libiberty;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ + LD="$(LD_FOR_BUILD)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ + NM="$(NM_FOR_BUILD)"; export NM; \ + RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ + echo Configuring in $(BUILD_SUBDIR)/libiberty; \ + cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(BUILD_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 .PHONY: all-build-libiberty maybe-all-build-libiberty maybe-all-build-libiberty: all-build-libiberty: configure-build-libiberty @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - (cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + (cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all) # -------------------------------------- @@ -1349,17 +1372,17 @@ configure-ash: maybe-all-ash: all-ash: configure-ash @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd ash && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd ash && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-ash check-ash: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd ash && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd ash && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1367,9 +1390,9 @@ check-ash: maybe-install-ash: install-ash: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd ash && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd ash && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-autoconf maybe-configure-autoconf @@ -1416,17 +1439,17 @@ configure-autoconf: maybe-all-autoconf: all-autoconf: configure-autoconf @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-autoconf check-autoconf: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1434,9 +1457,9 @@ check-autoconf: maybe-install-autoconf: install-autoconf: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-automake maybe-configure-automake @@ -1483,17 +1506,17 @@ configure-automake: maybe-all-automake: all-automake: configure-automake @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd automake && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd automake && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-automake check-automake: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd automake && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd automake && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1501,9 +1524,9 @@ check-automake: maybe-install-automake: install-automake: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd automake && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd automake && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-bash maybe-configure-bash @@ -1550,17 +1573,17 @@ configure-bash: maybe-all-bash: all-bash: configure-bash @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bash && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bash && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-bash check-bash: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bash && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bash && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1568,9 +1591,9 @@ check-bash: maybe-install-bash: install-bash: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bash && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bash && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-bfd maybe-configure-bfd @@ -1617,17 +1640,17 @@ configure-bfd: maybe-all-bfd: all-bfd: configure-bfd @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bfd && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bfd && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-bfd check-bfd: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bfd && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bfd && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1635,9 +1658,9 @@ check-bfd: maybe-install-bfd: install-bfd: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bfd && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bfd && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-opcodes maybe-configure-opcodes @@ -1684,17 +1707,17 @@ configure-opcodes: maybe-all-opcodes: all-opcodes: configure-opcodes @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-opcodes check-opcodes: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1702,9 +1725,9 @@ check-opcodes: maybe-install-opcodes: install-opcodes: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-binutils maybe-configure-binutils @@ -1751,17 +1774,17 @@ configure-binutils: maybe-all-binutils: all-binutils: configure-binutils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd binutils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd binutils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-binutils check-binutils: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd binutils && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd binutils && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1769,9 +1792,9 @@ check-binutils: maybe-install-binutils: install-binutils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd binutils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd binutils && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-bison maybe-configure-bison @@ -1818,19 +1841,19 @@ configure-bison: maybe-all-bison: all-bison: configure-bison @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bison && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bison && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-bison # This module is only tested in a native toolchain. check-bison: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bison && $(MAKE) $(FLAGS_TO_PASS) check); \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bison && $(MAKE) $(FLAGS_TO_PASS) check); \ fi @@ -1839,9 +1862,9 @@ check-bison: maybe-install-bison: install-bison: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bison && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bison && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-byacc maybe-configure-byacc @@ -1888,19 +1911,19 @@ configure-byacc: maybe-all-byacc: all-byacc: configure-byacc @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd byacc && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd byacc && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-byacc # This module is only tested in a native toolchain. check-byacc: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd byacc && $(MAKE) $(FLAGS_TO_PASS) check); \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd byacc && $(MAKE) $(FLAGS_TO_PASS) check); \ fi @@ -1909,9 +1932,9 @@ check-byacc: maybe-install-byacc: install-byacc: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd byacc && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd byacc && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-bzip2 maybe-configure-bzip2 @@ -1958,17 +1981,17 @@ configure-bzip2: maybe-all-bzip2: all-bzip2: configure-bzip2 @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-bzip2 check-bzip2: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check) @@ -1976,9 +1999,9 @@ check-bzip2: maybe-install-bzip2: install-bzip2: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-dejagnu maybe-configure-dejagnu @@ -2025,17 +2048,17 @@ configure-dejagnu: maybe-all-dejagnu: all-dejagnu: configure-dejagnu @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-dejagnu check-dejagnu: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2043,9 +2066,9 @@ check-dejagnu: maybe-install-dejagnu: install-dejagnu: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-diff maybe-configure-diff @@ -2092,17 +2115,17 @@ configure-diff: maybe-all-diff: all-diff: configure-diff @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd diff && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd diff && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-diff check-diff: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd diff && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd diff && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2110,9 +2133,9 @@ check-diff: maybe-install-diff: install-diff: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd diff && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd diff && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-dosutils maybe-configure-dosutils @@ -2159,9 +2182,9 @@ configure-dosutils: maybe-all-dosutils: all-dosutils: configure-dosutils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-dosutils @@ -2173,9 +2196,9 @@ check-dosutils: maybe-install-dosutils: install-dosutils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-etc maybe-configure-etc @@ -2222,17 +2245,17 @@ configure-etc: maybe-all-etc: all-etc: configure-etc @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd etc && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd etc && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-etc check-etc: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd etc && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd etc && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2240,9 +2263,9 @@ check-etc: maybe-install-etc: install-etc: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd etc && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd etc && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-fastjar maybe-configure-fastjar @@ -2289,19 +2312,19 @@ configure-fastjar: maybe-all-fastjar: all-fastjar: configure-fastjar @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-fastjar # This module is only tested in a native toolchain. check-fastjar: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) check); \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) check); \ fi @@ -2310,9 +2333,9 @@ check-fastjar: maybe-install-fastjar: install-fastjar: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-fileutils maybe-configure-fileutils @@ -2359,17 +2382,17 @@ configure-fileutils: maybe-all-fileutils: all-fileutils: configure-fileutils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-fileutils check-fileutils: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2377,9 +2400,9 @@ check-fileutils: maybe-install-fileutils: install-fileutils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-findutils maybe-configure-findutils @@ -2426,17 +2449,17 @@ configure-findutils: maybe-all-findutils: all-findutils: configure-findutils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd findutils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd findutils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-findutils check-findutils: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd findutils && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd findutils && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2444,9 +2467,9 @@ check-findutils: maybe-install-findutils: install-findutils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd findutils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd findutils && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-find maybe-configure-find @@ -2493,17 +2516,17 @@ configure-find: maybe-all-find: all-find: configure-find @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd find && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd find && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-find check-find: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd find && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd find && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2511,9 +2534,9 @@ check-find: maybe-install-find: install-find: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd find && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd find && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-flex maybe-configure-flex @@ -2560,19 +2583,19 @@ configure-flex: maybe-all-flex: all-flex: configure-flex @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd flex && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd flex && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-flex # This module is only tested in a native toolchain. check-flex: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd flex && $(MAKE) $(FLAGS_TO_PASS) check); \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd flex && $(MAKE) $(FLAGS_TO_PASS) check); \ fi @@ -2581,9 +2604,9 @@ check-flex: maybe-install-flex: install-flex: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd flex && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd flex && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-gas maybe-configure-gas @@ -2630,17 +2653,17 @@ configure-gas: maybe-all-gas: all-gas: configure-gas @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gas && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gas && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-gas check-gas: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gas && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gas && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2648,9 +2671,9 @@ check-gas: maybe-install-gas: install-gas: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gas && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gas && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-gawk maybe-configure-gawk @@ -2697,17 +2720,17 @@ configure-gawk: maybe-all-gawk: all-gawk: configure-gawk @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gawk && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gawk && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-gawk check-gawk: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gawk && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gawk && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2715,9 +2738,9 @@ check-gawk: maybe-install-gawk: install-gawk: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gawk && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gawk && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-gettext maybe-configure-gettext @@ -2764,17 +2787,17 @@ configure-gettext: maybe-all-gettext: all-gettext: configure-gettext @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gettext && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gettext && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-gettext check-gettext: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gettext && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gettext && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2782,9 +2805,9 @@ check-gettext: maybe-install-gettext: install-gettext: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gettext && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gettext && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-gnuserv maybe-configure-gnuserv @@ -2831,17 +2854,17 @@ configure-gnuserv: maybe-all-gnuserv: all-gnuserv: configure-gnuserv @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-gnuserv check-gnuserv: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2849,9 +2872,9 @@ check-gnuserv: maybe-install-gnuserv: install-gnuserv: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-gprof maybe-configure-gprof @@ -2898,17 +2921,17 @@ configure-gprof: maybe-all-gprof: all-gprof: configure-gprof @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gprof && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gprof && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-gprof check-gprof: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gprof && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gprof && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2916,9 +2939,9 @@ check-gprof: maybe-install-gprof: install-gprof: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gprof && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gprof && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-gzip maybe-configure-gzip @@ -2965,17 +2988,17 @@ configure-gzip: maybe-all-gzip: all-gzip: configure-gzip @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gzip && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gzip && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-gzip check-gzip: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gzip && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gzip && $(MAKE) $(FLAGS_TO_PASS) check) @@ -2983,9 +3006,9 @@ check-gzip: maybe-install-gzip: install-gzip: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gzip && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gzip && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-hello maybe-configure-hello @@ -3032,17 +3055,17 @@ configure-hello: maybe-all-hello: all-hello: configure-hello @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd hello && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd hello && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-hello check-hello: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd hello && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd hello && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3050,9 +3073,9 @@ check-hello: maybe-install-hello: install-hello: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd hello && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd hello && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-indent maybe-configure-indent @@ -3099,17 +3122,17 @@ configure-indent: maybe-all-indent: all-indent: configure-indent @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd indent && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd indent && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-indent check-indent: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd indent && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd indent && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3117,9 +3140,9 @@ check-indent: maybe-install-indent: install-indent: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd indent && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd indent && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-intl maybe-configure-intl @@ -3166,17 +3189,17 @@ configure-intl: maybe-all-intl: all-intl: configure-intl @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd intl && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd intl && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-intl check-intl: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd intl && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd intl && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3184,9 +3207,9 @@ check-intl: maybe-install-intl: install-intl: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd intl && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd intl && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-tcl maybe-configure-tcl @@ -3233,17 +3256,17 @@ configure-tcl: maybe-all-tcl: all-tcl: configure-tcl @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tcl && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tcl && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-tcl check-tcl: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tcl && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tcl && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3251,9 +3274,9 @@ check-tcl: maybe-install-tcl: install-tcl: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tcl && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tcl && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-itcl maybe-configure-itcl @@ -3300,17 +3323,17 @@ configure-itcl: maybe-all-itcl: all-itcl: configure-itcl @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd itcl && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd itcl && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-itcl check-itcl: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd itcl && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd itcl && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3318,9 +3341,9 @@ check-itcl: maybe-install-itcl: install-itcl: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd itcl && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd itcl && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-ld maybe-configure-ld @@ -3367,17 +3390,17 @@ configure-ld: maybe-all-ld: all-ld: configure-ld @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd ld && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd ld && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-ld check-ld: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd ld && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd ld && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3385,9 +3408,9 @@ check-ld: maybe-install-ld: install-ld: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd ld && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd ld && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-libgui maybe-configure-libgui @@ -3434,17 +3457,17 @@ configure-libgui: maybe-all-libgui: all-libgui: configure-libgui @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libgui && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libgui && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-libgui check-libgui: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libgui && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libgui && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3452,9 +3475,9 @@ check-libgui: maybe-install-libgui: install-libgui: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libgui && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libgui && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-libiberty maybe-configure-libiberty @@ -3501,17 +3524,17 @@ configure-libiberty: maybe-all-libiberty: all-libiberty: configure-libiberty @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-libiberty check-libiberty: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3519,9 +3542,9 @@ check-libiberty: maybe-install-libiberty: install-libiberty: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-libtool maybe-configure-libtool @@ -3568,17 +3591,17 @@ configure-libtool: maybe-all-libtool: all-libtool: configure-libtool @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libtool && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtool && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-libtool check-libtool: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libtool && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtool && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3586,9 +3609,9 @@ check-libtool: maybe-install-libtool: install-libtool: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libtool && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtool && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-m4 maybe-configure-m4 @@ -3635,17 +3658,17 @@ configure-m4: maybe-all-m4: all-m4: configure-m4 @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd m4 && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd m4 && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-m4 check-m4: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd m4 && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd m4 && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3653,9 +3676,9 @@ check-m4: maybe-install-m4: install-m4: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd m4 && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd m4 && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-make maybe-configure-make @@ -3702,17 +3725,17 @@ configure-make: maybe-all-make: all-make: configure-make @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd make && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd make && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-make check-make: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd make && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd make && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3720,9 +3743,9 @@ check-make: maybe-install-make: install-make: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd make && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd make && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-mmalloc maybe-configure-mmalloc @@ -3769,9 +3792,9 @@ configure-mmalloc: maybe-all-mmalloc: all-mmalloc: configure-mmalloc @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-mmalloc @@ -3783,9 +3806,9 @@ check-mmalloc: maybe-install-mmalloc: install-mmalloc: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-patch maybe-configure-patch @@ -3832,17 +3855,17 @@ configure-patch: maybe-all-patch: all-patch: configure-patch @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd patch && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd patch && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-patch check-patch: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd patch && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd patch && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3850,9 +3873,9 @@ check-patch: maybe-install-patch: install-patch: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd patch && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd patch && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-perl maybe-configure-perl @@ -3899,17 +3922,17 @@ configure-perl: maybe-all-perl: all-perl: configure-perl @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd perl && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd perl && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-perl check-perl: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd perl && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd perl && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3917,9 +3940,9 @@ check-perl: maybe-install-perl: install-perl: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd perl && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd perl && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-prms maybe-configure-prms @@ -3966,17 +3989,17 @@ configure-prms: maybe-all-prms: all-prms: configure-prms @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd prms && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd prms && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-prms check-prms: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd prms && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd prms && $(MAKE) $(FLAGS_TO_PASS) check) @@ -3984,9 +4007,9 @@ check-prms: maybe-install-prms: install-prms: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd prms && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd prms && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-rcs maybe-configure-rcs @@ -4033,17 +4056,17 @@ configure-rcs: maybe-all-rcs: all-rcs: configure-rcs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd rcs && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd rcs && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-rcs check-rcs: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd rcs && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd rcs && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4051,9 +4074,9 @@ check-rcs: maybe-install-rcs: install-rcs: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd rcs && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd rcs && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-readline maybe-configure-readline @@ -4100,17 +4123,17 @@ configure-readline: maybe-all-readline: all-readline: configure-readline @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd readline && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd readline && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-readline check-readline: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd readline && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd readline && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4118,9 +4141,9 @@ check-readline: maybe-install-readline: install-readline: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd readline && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd readline && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-release maybe-configure-release @@ -4167,9 +4190,9 @@ configure-release: maybe-all-release: all-release: configure-release @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd release && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd release && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-release @@ -4226,17 +4249,17 @@ configure-recode: maybe-all-recode: all-recode: configure-recode @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd recode && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd recode && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-recode check-recode: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd recode && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd recode && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4244,9 +4267,9 @@ check-recode: maybe-install-recode: install-recode: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd recode && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd recode && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-sed maybe-configure-sed @@ -4293,17 +4316,17 @@ configure-sed: maybe-all-sed: all-sed: configure-sed @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sed && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sed && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-sed check-sed: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sed && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sed && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4311,9 +4334,9 @@ check-sed: maybe-install-sed: install-sed: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sed && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sed && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-send-pr maybe-configure-send-pr @@ -4360,17 +4383,17 @@ configure-send-pr: maybe-all-send-pr: all-send-pr: configure-send-pr @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-send-pr check-send-pr: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4378,9 +4401,9 @@ check-send-pr: maybe-install-send-pr: install-send-pr: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-shellutils maybe-configure-shellutils @@ -4427,17 +4450,17 @@ configure-shellutils: maybe-all-shellutils: all-shellutils: configure-shellutils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-shellutils check-shellutils: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4445,9 +4468,9 @@ check-shellutils: maybe-install-shellutils: install-shellutils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-sid maybe-configure-sid @@ -4494,17 +4517,17 @@ configure-sid: maybe-all-sid: all-sid: configure-sid @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sid && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sid && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-sid check-sid: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sid && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sid && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4512,9 +4535,9 @@ check-sid: maybe-install-sid: install-sid: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sid && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sid && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-sim maybe-configure-sim @@ -4561,17 +4584,17 @@ configure-sim: maybe-all-sim: all-sim: configure-sim @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sim && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sim && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-sim check-sim: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sim && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sim && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4579,9 +4602,9 @@ check-sim: maybe-install-sim: install-sim: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd sim && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd sim && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-tar maybe-configure-tar @@ -4628,17 +4651,17 @@ configure-tar: maybe-all-tar: all-tar: configure-tar @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tar && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tar && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-tar check-tar: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tar && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tar && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4646,9 +4669,9 @@ check-tar: maybe-install-tar: install-tar: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tar && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tar && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-texinfo maybe-configure-texinfo @@ -4695,17 +4718,17 @@ configure-texinfo: maybe-all-texinfo: all-texinfo: configure-texinfo @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-texinfo check-texinfo: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4758,17 +4781,17 @@ configure-textutils: maybe-all-textutils: all-textutils: configure-textutils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd textutils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd textutils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-textutils check-textutils: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd textutils && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd textutils && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4776,9 +4799,9 @@ check-textutils: maybe-install-textutils: install-textutils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd textutils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd textutils && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-time maybe-configure-time @@ -4825,17 +4848,17 @@ configure-time: maybe-all-time: all-time: configure-time @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd time && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd time && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-time check-time: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd time && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd time && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4843,9 +4866,9 @@ check-time: maybe-install-time: install-time: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd time && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd time && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-uudecode maybe-configure-uudecode @@ -4892,17 +4915,17 @@ configure-uudecode: maybe-all-uudecode: all-uudecode: configure-uudecode @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-uudecode check-uudecode: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4910,9 +4933,9 @@ check-uudecode: maybe-install-uudecode: install-uudecode: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-wdiff maybe-configure-wdiff @@ -4959,17 +4982,17 @@ configure-wdiff: maybe-all-wdiff: all-wdiff: configure-wdiff @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-wdiff check-wdiff: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check) @@ -4977,9 +5000,9 @@ check-wdiff: maybe-install-wdiff: install-wdiff: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-zip maybe-configure-zip @@ -5026,19 +5049,19 @@ configure-zip: maybe-all-zip: all-zip: configure-zip @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd zip && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd zip && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-zip # This module is only tested in a native toolchain. check-zip: @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd zip && $(MAKE) $(FLAGS_TO_PASS) check); \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd zip && $(MAKE) $(FLAGS_TO_PASS) check); \ fi @@ -5047,9 +5070,9 @@ check-zip: maybe-install-zip: install-zip: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd zip && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd zip && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-zlib maybe-configure-zlib @@ -5096,9 +5119,9 @@ configure-zlib: maybe-all-zlib: all-zlib: configure-zlib @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd zlib && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd zlib && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-zlib @@ -5155,17 +5178,17 @@ configure-gdb: maybe-all-gdb: all-gdb: configure-gdb @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) .PHONY: check-gdb check-gdb: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -5173,9 +5196,9 @@ check-gdb: maybe-install-gdb: install-gdb: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) .PHONY: configure-expect maybe-configure-expect @@ -5222,17 +5245,17 @@ configure-expect: maybe-all-expect: all-expect: configure-expect @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) .PHONY: check-expect check-expect: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -5240,9 +5263,9 @@ check-expect: maybe-install-expect: install-expect: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) .PHONY: configure-guile maybe-configure-guile @@ -5289,17 +5312,17 @@ configure-guile: maybe-all-guile: all-guile: configure-guile @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) .PHONY: check-guile check-guile: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -5307,9 +5330,9 @@ check-guile: maybe-install-guile: install-guile: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) .PHONY: configure-tk maybe-configure-tk @@ -5356,17 +5379,17 @@ configure-tk: maybe-all-tk: all-tk: configure-tk @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) .PHONY: check-tk check-tk: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -5374,9 +5397,9 @@ check-tk: maybe-install-tk: install-tk: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) .PHONY: configure-tix maybe-configure-tix @@ -5423,17 +5446,17 @@ configure-tix: maybe-all-tix: all-tix: configure-tix @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) .PHONY: check-tix check-tix: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -5441,9 +5464,9 @@ check-tix: maybe-install-tix: install-tix: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) .PHONY: configure-libtermcap maybe-configure-libtermcap @@ -5490,9 +5513,9 @@ configure-libtermcap: maybe-all-libtermcap: all-libtermcap: configure-libtermcap @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-libtermcap @@ -5504,9 +5527,9 @@ check-libtermcap: maybe-install-libtermcap: install-libtermcap: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install) .PHONY: configure-utils maybe-configure-utils @@ -5553,9 +5576,9 @@ configure-utils: maybe-all-utils: all-utils: configure-utils @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd utils && $(MAKE) $(FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd utils && $(MAKE) $(FLAGS_TO_PASS) all) .PHONY: check-utils @@ -5567,9 +5590,9 @@ check-utils: maybe-install-utils: install-utils: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd utils && $(MAKE) $(FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd utils && $(MAKE) $(FLAGS_TO_PASS) install) @@ -5583,98 +5606,99 @@ maybe-configure-target-libstdc++-v3: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \ - mkdir $(TARGET_SUBDIR)/libstdc++-v3; \ + mkdir $(TARGET_SUBDIR)/libstdc++-v3; \ rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libstdc++-v3/multilib.out configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out @test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \ - mkdir $(TARGET_SUBDIR)/libstdc++-v3;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ - CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \ - cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libstdc++-v3 ] || \ + mkdir $(TARGET_SUBDIR)/libstdc++-v3;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \ + cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libstdc++-v3 "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libstdc++-v3 "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ - libsrcdir="$$s/libstdc++-v3"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3 maybe-all-target-libstdc++-v3: all-target-libstdc++-v3: configure-target-libstdc++-v3 @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) .PHONY: check-target-libstdc++-v3 check-target-libstdc++-v3: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) .PHONY: install-target-libstdc++-v3 maybe-install-target-libstdc++-v3 maybe-install-target-libstdc++-v3: install-target-libstdc++-v3: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-newlib maybe-configure-target-newlib @@ -5683,97 +5707,98 @@ maybe-configure-target-newlib: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/newlib/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/newlib ] || \ - mkdir $(TARGET_SUBDIR)/newlib; \ + mkdir $(TARGET_SUBDIR)/newlib; \ rm -f $(TARGET_SUBDIR)/newlib/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/newlib/multilib.out configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out @test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/newlib ] || \ - mkdir $(TARGET_SUBDIR)/newlib;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/newlib; \ - cd "$(TARGET_SUBDIR)/newlib" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/newlib ] || \ + mkdir $(TARGET_SUBDIR)/newlib;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/newlib; \ + cd "$(TARGET_SUBDIR)/newlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/newlib "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/newlib "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/newlib"; \ - libsrcdir="$$s/newlib"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/newlib"; \ + libsrcdir="$$s/newlib"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-newlib maybe-all-target-newlib maybe-all-target-newlib: all-target-newlib: configure-target-newlib @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/newlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-newlib check-target-newlib: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/newlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-newlib maybe-install-target-newlib maybe-install-target-newlib: install-target-newlib: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/newlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-libf2c maybe-configure-target-libf2c @@ -5782,97 +5807,98 @@ maybe-configure-target-libf2c: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libf2c/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libf2c ] || \ - mkdir $(TARGET_SUBDIR)/libf2c; \ + mkdir $(TARGET_SUBDIR)/libf2c; \ rm -f $(TARGET_SUBDIR)/libf2c/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libf2c/multilib.out configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out @test ! -f $(TARGET_SUBDIR)/libf2c/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libf2c ] || \ - mkdir $(TARGET_SUBDIR)/libf2c;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libf2c; \ - cd "$(TARGET_SUBDIR)/libf2c" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libf2c ] || \ + mkdir $(TARGET_SUBDIR)/libf2c;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libf2c; \ + cd "$(TARGET_SUBDIR)/libf2c" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libf2c "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libf2c "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libf2c"; \ - libsrcdir="$$s/libf2c"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libf2c"; \ + libsrcdir="$$s/libf2c"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libf2c maybe-all-target-libf2c maybe-all-target-libf2c: all-target-libf2c: configure-target-libf2c @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libf2c && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-libf2c check-target-libf2c: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libf2c && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-libf2c maybe-install-target-libf2c maybe-install-target-libf2c: install-target-libf2c: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libf2c && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-libobjc maybe-configure-target-libobjc @@ -5881,97 +5907,98 @@ maybe-configure-target-libobjc: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libobjc ] || \ - mkdir $(TARGET_SUBDIR)/libobjc; \ + mkdir $(TARGET_SUBDIR)/libobjc; \ rm -f $(TARGET_SUBDIR)/libobjc/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libobjc/multilib.out configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out @test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libobjc ] || \ - mkdir $(TARGET_SUBDIR)/libobjc;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libobjc; \ - cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libobjc ] || \ + mkdir $(TARGET_SUBDIR)/libobjc;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libobjc; \ + cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libobjc "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libobjc "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libobjc"; \ - libsrcdir="$$s/libobjc"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libobjc"; \ + libsrcdir="$$s/libobjc"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libobjc maybe-all-target-libobjc maybe-all-target-libobjc: all-target-libobjc: configure-target-libobjc @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libobjc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-libobjc check-target-libobjc: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libobjc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-libobjc maybe-install-target-libobjc maybe-install-target-libobjc: install-target-libobjc: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libobjc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-libtermcap maybe-configure-target-libtermcap @@ -5980,79 +6007,80 @@ maybe-configure-target-libtermcap: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libtermcap ] || \ - mkdir $(TARGET_SUBDIR)/libtermcap; \ + mkdir $(TARGET_SUBDIR)/libtermcap; \ rm -f $(TARGET_SUBDIR)/libtermcap/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libtermcap/multilib.out configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out @test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libtermcap ] || \ - mkdir $(TARGET_SUBDIR)/libtermcap;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libtermcap; \ - cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libtermcap ] || \ + mkdir $(TARGET_SUBDIR)/libtermcap;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libtermcap; \ + cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libtermcap "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libtermcap "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libtermcap"; \ - libsrcdir="$$s/libtermcap"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libtermcap"; \ + libsrcdir="$$s/libtermcap"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libtermcap maybe-all-target-libtermcap maybe-all-target-libtermcap: all-target-libtermcap: configure-target-libtermcap @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libtermcap && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) # Dummy target for uncheckable module. .PHONY: check-target-libtermcap @@ -6063,10 +6091,10 @@ check-target-libtermcap: maybe-install-target-libtermcap: install-target-libtermcap: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libtermcap && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-winsup maybe-configure-target-winsup @@ -6075,97 +6103,98 @@ maybe-configure-target-winsup: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/winsup/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/winsup ] || \ - mkdir $(TARGET_SUBDIR)/winsup; \ + mkdir $(TARGET_SUBDIR)/winsup; \ rm -f $(TARGET_SUBDIR)/winsup/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/winsup/multilib.out configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out @test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/winsup ] || \ - mkdir $(TARGET_SUBDIR)/winsup;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/winsup; \ - cd "$(TARGET_SUBDIR)/winsup" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/winsup ] || \ + mkdir $(TARGET_SUBDIR)/winsup;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/winsup; \ + cd "$(TARGET_SUBDIR)/winsup" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/winsup "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/winsup "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/winsup"; \ - libsrcdir="$$s/winsup"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/winsup"; \ + libsrcdir="$$s/winsup"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-winsup maybe-all-target-winsup maybe-all-target-winsup: all-target-winsup: configure-target-winsup @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/winsup && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-winsup check-target-winsup: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/winsup && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-winsup maybe-install-target-winsup maybe-install-target-winsup: install-target-winsup: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/winsup && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-libgloss maybe-configure-target-libgloss @@ -6174,79 +6203,80 @@ maybe-configure-target-libgloss: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libgloss ] || \ - mkdir $(TARGET_SUBDIR)/libgloss; \ + mkdir $(TARGET_SUBDIR)/libgloss; \ rm -f $(TARGET_SUBDIR)/libgloss/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libgloss/multilib.out configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out @test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libgloss ] || \ - mkdir $(TARGET_SUBDIR)/libgloss;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libgloss; \ - cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libgloss ] || \ + mkdir $(TARGET_SUBDIR)/libgloss;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libgloss; \ + cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libgloss "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libgloss "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libgloss"; \ - libsrcdir="$$s/libgloss"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libgloss"; \ + libsrcdir="$$s/libgloss"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libgloss maybe-all-target-libgloss maybe-all-target-libgloss: all-target-libgloss: configure-target-libgloss @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libgloss && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) # Dummy target for uncheckable module. .PHONY: check-target-libgloss @@ -6257,10 +6287,10 @@ check-target-libgloss: maybe-install-target-libgloss: install-target-libgloss: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libgloss && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-libiberty maybe-configure-target-libiberty @@ -6269,97 +6299,98 @@ maybe-configure-target-libiberty: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libiberty ] || \ - mkdir $(TARGET_SUBDIR)/libiberty; \ + mkdir $(TARGET_SUBDIR)/libiberty; \ rm -f $(TARGET_SUBDIR)/libiberty/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libiberty/multilib.out configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out @test ! -f $(TARGET_SUBDIR)/libiberty/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libiberty ] || \ - mkdir $(TARGET_SUBDIR)/libiberty;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libiberty; \ - cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libiberty ] || \ + mkdir $(TARGET_SUBDIR)/libiberty;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libiberty; \ + cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libiberty maybe-all-target-libiberty maybe-all-target-libiberty: all-target-libiberty: configure-target-libiberty @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libiberty && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-libiberty check-target-libiberty: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libiberty && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-libiberty maybe-install-target-libiberty maybe-install-target-libiberty: install-target-libiberty: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libiberty && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-gperf maybe-configure-target-gperf @@ -6368,97 +6399,98 @@ maybe-configure-target-gperf: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/gperf/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/gperf ] || \ - mkdir $(TARGET_SUBDIR)/gperf; \ + mkdir $(TARGET_SUBDIR)/gperf; \ rm -f $(TARGET_SUBDIR)/gperf/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/gperf/multilib.out configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out @test ! -f $(TARGET_SUBDIR)/gperf/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/gperf ] || \ - mkdir $(TARGET_SUBDIR)/gperf;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/gperf; \ - cd "$(TARGET_SUBDIR)/gperf" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/gperf ] || \ + mkdir $(TARGET_SUBDIR)/gperf;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/gperf; \ + cd "$(TARGET_SUBDIR)/gperf" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/gperf "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/gperf "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/gperf"; \ - libsrcdir="$$s/gperf"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/gperf"; \ + libsrcdir="$$s/gperf"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-gperf maybe-all-target-gperf maybe-all-target-gperf: all-target-gperf: configure-target-gperf @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/gperf && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-gperf check-target-gperf: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/gperf && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-gperf maybe-install-target-gperf maybe-install-target-gperf: install-target-gperf: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/gperf && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-examples maybe-configure-target-examples @@ -6467,79 +6499,80 @@ maybe-configure-target-examples: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/examples/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/examples ] || \ - mkdir $(TARGET_SUBDIR)/examples; \ + mkdir $(TARGET_SUBDIR)/examples; \ rm -f $(TARGET_SUBDIR)/examples/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/examples/multilib.out configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out @test ! -f $(TARGET_SUBDIR)/examples/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/examples ] || \ - mkdir $(TARGET_SUBDIR)/examples;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/examples; \ - cd "$(TARGET_SUBDIR)/examples" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/examples ] || \ + mkdir $(TARGET_SUBDIR)/examples;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/examples; \ + cd "$(TARGET_SUBDIR)/examples" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/examples "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/examples "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/examples"; \ - libsrcdir="$$s/examples"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/examples"; \ + libsrcdir="$$s/examples"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-examples maybe-all-target-examples maybe-all-target-examples: all-target-examples: configure-target-examples @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/examples && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) # Dummy target for uncheckable module. .PHONY: check-target-examples @@ -6558,97 +6591,98 @@ maybe-configure-target-libffi: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libffi/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libffi ] || \ - mkdir $(TARGET_SUBDIR)/libffi; \ + mkdir $(TARGET_SUBDIR)/libffi; \ rm -f $(TARGET_SUBDIR)/libffi/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libffi/multilib.out configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out @test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libffi ] || \ - mkdir $(TARGET_SUBDIR)/libffi;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libffi; \ - cd "$(TARGET_SUBDIR)/libffi" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libffi ] || \ + mkdir $(TARGET_SUBDIR)/libffi;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libffi; \ + cd "$(TARGET_SUBDIR)/libffi" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libffi "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libffi "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libffi"; \ - libsrcdir="$$s/libffi"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libffi"; \ + libsrcdir="$$s/libffi"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libffi maybe-all-target-libffi maybe-all-target-libffi: all-target-libffi: configure-target-libffi @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libffi && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-libffi check-target-libffi: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libffi && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-libffi maybe-install-target-libffi maybe-install-target-libffi: install-target-libffi: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libffi && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-libjava maybe-configure-target-libjava @@ -6657,98 +6691,99 @@ maybe-configure-target-libjava: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/libjava/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/libjava ] || \ - mkdir $(TARGET_SUBDIR)/libjava; \ + mkdir $(TARGET_SUBDIR)/libjava; \ rm -f $(TARGET_SUBDIR)/libjava/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libjava/multilib.out configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out @test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/libjava ] || \ - mkdir $(TARGET_SUBDIR)/libjava;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ - CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/libjava; \ - cd "$(TARGET_SUBDIR)/libjava" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/libjava ] || \ + mkdir $(TARGET_SUBDIR)/libjava;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libjava; \ + cd "$(TARGET_SUBDIR)/libjava" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/libjava "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libjava "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/libjava"; \ - libsrcdir="$$s/libjava"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libjava"; \ + libsrcdir="$$s/libjava"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-libjava maybe-all-target-libjava maybe-all-target-libjava: all-target-libjava: configure-target-libjava @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libjava && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) .PHONY: check-target-libjava check-target-libjava: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libjava && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) .PHONY: install-target-libjava maybe-install-target-libjava maybe-install-target-libjava: install-target-libjava: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/libjava && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-zlib maybe-configure-target-zlib @@ -6757,97 +6792,98 @@ maybe-configure-target-zlib: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/zlib/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/zlib ] || \ - mkdir $(TARGET_SUBDIR)/zlib; \ + mkdir $(TARGET_SUBDIR)/zlib; \ rm -f $(TARGET_SUBDIR)/zlib/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/zlib/multilib.out configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out @test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/zlib ] || \ - mkdir $(TARGET_SUBDIR)/zlib;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/zlib; \ - cd "$(TARGET_SUBDIR)/zlib" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/zlib ] || \ + mkdir $(TARGET_SUBDIR)/zlib;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/zlib; \ + cd "$(TARGET_SUBDIR)/zlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/zlib "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/zlib "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-zlib maybe-all-target-zlib maybe-all-target-zlib: all-target-zlib: configure-target-zlib @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/zlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-zlib check-target-zlib: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/zlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-zlib maybe-install-target-zlib maybe-install-target-zlib: install-target-zlib: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/zlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc @@ -6856,97 +6892,98 @@ maybe-configure-target-boehm-gc: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/boehm-gc ] || \ - mkdir $(TARGET_SUBDIR)/boehm-gc; \ + mkdir $(TARGET_SUBDIR)/boehm-gc; \ rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/boehm-gc/multilib.out configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out @test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/boehm-gc ] || \ - mkdir $(TARGET_SUBDIR)/boehm-gc;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \ - cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/boehm-gc ] || \ + mkdir $(TARGET_SUBDIR)/boehm-gc;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \ + cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/boehm-gc "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/boehm-gc "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ - libsrcdir="$$s/boehm-gc"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-boehm-gc maybe-all-target-boehm-gc maybe-all-target-boehm-gc: all-target-boehm-gc: configure-target-boehm-gc @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/boehm-gc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-boehm-gc check-target-boehm-gc: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/boehm-gc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-boehm-gc maybe-install-target-boehm-gc maybe-install-target-boehm-gc: install-target-boehm-gc: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/boehm-gc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-qthreads maybe-configure-target-qthreads @@ -6955,97 +6992,98 @@ maybe-configure-target-qthreads: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/qthreads ] || \ - mkdir $(TARGET_SUBDIR)/qthreads; \ + mkdir $(TARGET_SUBDIR)/qthreads; \ rm -f $(TARGET_SUBDIR)/qthreads/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/qthreads/multilib.out configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out @test ! -f $(TARGET_SUBDIR)/qthreads/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/qthreads ] || \ - mkdir $(TARGET_SUBDIR)/qthreads;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/qthreads; \ - cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/qthreads ] || \ + mkdir $(TARGET_SUBDIR)/qthreads;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/qthreads; \ + cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/qthreads "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/qthreads "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/qthreads"; \ - libsrcdir="$$s/qthreads"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/qthreads"; \ + libsrcdir="$$s/qthreads"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-qthreads maybe-all-target-qthreads maybe-all-target-qthreads: all-target-qthreads: configure-target-qthreads @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/qthreads && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-qthreads check-target-qthreads: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/qthreads && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-qthreads maybe-install-target-qthreads maybe-install-target-qthreads: install-target-qthreads: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/qthreads && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) .PHONY: configure-target-rda maybe-configure-target-rda @@ -7054,97 +7092,98 @@ maybe-configure-target-rda: # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. $(TARGET_SUBDIR)/rda/multilib.out: multilib.out @[ -d $(TARGET_SUBDIR)/rda ] || \ - mkdir $(TARGET_SUBDIR)/rda; \ + mkdir $(TARGET_SUBDIR)/rda; \ rm -f $(TARGET_SUBDIR)/rda/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/rda/multilib.out configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out @test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \ - [ -d $(TARGET_SUBDIR)/rda ] || \ - mkdir $(TARGET_SUBDIR)/rda;\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/rda; \ - cd "$(TARGET_SUBDIR)/rda" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ + [ -d $(TARGET_SUBDIR)/rda ] || \ + mkdir $(TARGET_SUBDIR)/rda;\ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/rda; \ + cd "$(TARGET_SUBDIR)/rda" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/rda "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/rda "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ else \ - true; \ + true; \ fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ else \ - srcdiroption="--srcdir=$${topdir}/rda"; \ - libsrcdir="$$s/rda"; \ + exit 1; \ fi; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ - || exit 1 + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/rda"; \ + libsrcdir="$$s/rda"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 .PHONY: all-target-rda maybe-all-target-rda maybe-all-target-rda: all-target-rda: configure-target-rda @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/rda && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) .PHONY: check-target-rda check-target-rda: @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/rda && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) .PHONY: install-target-rda maybe-install-target-rda maybe-install-target-rda: install-target-rda: installdirs @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/rda && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + s=`cd $(srcdir); ${PWD}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -7237,14 +7276,17 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b s=`cd $(srcdir); ${PWD}`; 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 ;; \ + 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; \ $(SET_LIB_PATH) \ echo "$$msg"; \ @@ -7292,7 +7334,8 @@ check-gcc-c++: fi .PHONY: check-c++ -check-c++: check-target-libstdc++-v3 check-gcc-c++ +check-c++: + $(MAKE) check-target-libstdc++-v3 check-gcc-c++ NOTPARALLEL=parallel-ok .PHONY: install-gcc maybe-install-gcc maybe-install-gcc: @@ -7468,7 +7511,7 @@ multilib.out: maybe-all-gcc # Rebuilding Makefile.in, using autogen. AUTOGEN = autogen -$(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def +$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def cd $(srcdir) && $(AUTOGEN) Makefile.def # Rebuilding Makefile. @@ -7480,7 +7523,7 @@ config.status: configure $(gcc_version_trigger) # Rebuilding configure. AUTOCONF = autoconf -$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/config/acx.m4 +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 cd $(srcdir) && $(AUTOCONF) # diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 85bffb4..5f949ed 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,388 @@ +2003-03-03 H.J. Lu <hjl@gnu.org> + + * elfxx-ia64.c (USE_BRL): Removed. + (oor_ip): Removed. + +Mon Mar 3 20:48:23 2003 J"orn Rennecke <joern.rennecke@superh.com> + + * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary + relocation (no special function), and make it non-partial_inplace. + (sh_elf_relax_section): When creating a bsr, use a consistent value + no matter if the symbol is extern or not; set addend to -4. + Don't swap load / non-load instructions for SH4. + (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset + rather than if the symbol is external to determine if adjusting the + offset makes sense. Adjust the addend too if appropriate. + (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the + relocation. + +2003-03-03 Nick Clifton <nickc@redhat.com> + + * po/da.po: Installed latest translation. + +2003-03-02 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elf32-mips.c (elf_mips_howto_table_rel): Change definition of + R_MIPS_PC16 to rightshift 2. + (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc. + (bfd_elf32_bfd_reloc_type_lookup): Support + BFD_RELOC_MIPSEMB_16_PCREL_S2. + * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of + R_MIPS_PC16 to rightshift 2. + (mips_elf64_howto_table_rela): Likewise. + (mips_reloc_map): Map to rightshifted BFD reloc. + * elfn32-mips.c: The same as in elf64-mips.c. + * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment. + (mips_elf_calculate_relocation): Handle rightshifted addends for + R_MIPS_PC16. + * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for + MIPS Embedded PIC. Remove superfluous empty COMMENT. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2003-02-28 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds + for ltoff22x relaxation. + +2003-03-01 Alan Modra <amodra@bigpond.net.au> + + * bfd-in.h (_bfd): Don't define. + * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd". + * syms.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-02-27 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx; + (elfNN_ia64_check_relocs): Set it. + (allocate_global_data_got): Check it. + (allocate_local_got): Likewise. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_relax_ldxmov): New. + (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV. + (elfNN_ia64_choose_gp): Split out from ... + (elfNN_ia64_final_link): ... here. + +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * bfd.c (struct bfd): Rename "struct _bfd". + * bfd-in.h: Update copyright. + (struct bfd): Rename "struct _bfd". + (_bfd): Define for backward compatibility. + * bfd-in2.h: Regenerate. + +2003-02-25 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr + and rel_hdr2 when initially counting input relocs rather than after + creating output reloc sections. + (elf_link_read_relocs_from_section): Don't abort with wrong reloc + sizes. + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-02-24 Kris Warkentin <kewarken@qnx.com> + + * elf.c (elfcore_read_notes): Add check for QNX style core file. + (elfcore_grog_nto_note): New function. + (elfcore_grog_nto_gregs): New function. + (elfcore_grog_nto_status): New function. + +2003-02-24 Alan Modra <amodra@bigpond.net.au> + + * elflink.c (_bfd_elf_create_got_section): Check existing .got + section flags before concluding that we've already been called. + Don't use register keyword. + (_bfd_elf_create_dynamic_sections): Don't use register keyword. + (_bfd_elf_create_linker_section): Formatting. + +2003-02-20 jmc <jmc@prioris.mini.pw.edu.pl> + + * coff-h8300.c: Fix typo: intial -> initial. + * coff-ppc.c: Likewise. + +2003-02-20 Alan Modra <amodra@bigpond.net.au> + + * elf32-ppc.c: Formatting. + (allocate_dynrelocs): LD and GD relocs against the same sym need + separate GOT entries. + (ppc_elf_relocate_section): Correct GOT handling for multiple GOT + entries per symbol. + +2003-02-19 Alan Modra <amodra@bigpond.net.au> + + * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc + removal. Localize vars. Remove unnecessary dynobj test. + * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead + of INFO. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. + (elf_i386_relocate_section): Likewise. + (elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars. + * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise. + * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove + local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32 + or PCPLT10 relocs. Don't subtract twice on PLT32 relocs. + Formatting. + + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define. + (ppc64_elf_check_relocs): Use it. Correct comment. Move SEC_ALLOC + test. + (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. Use ELIMINATE_COPY_RELOCS. + (ppc64_elf_relocate_section): Likewise. + + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field. + (ppc_elf_copy_indirect_symbol): Copy pc_count field. + (ELIMINATE_COPY_RELOCS): Define. + (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (MUST_BE_DYN_RELOC): Define. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. Trim dyn_relocs. + (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll + not be used. Do generate dyn_relocs for copy reloc avoidance. Keep + track of pc_rel dyn relocs. + (ppc_elf_relocate_section): Remove "will_become_local". Adjust + WILL_CALL_FINISH_DYNAMIC_SYMBOL use. Trim dyn relocs as per + allocate_dynrelocs. Don't recalculate "sec". + +2003-02-18 Alan Modra <amodra@bigpond.net.au> + + * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test. + * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount + on invalid LD relocs. + (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry. + (ppc64_elf_relocate_section): Unify new handling of LD relocs and + tlsld_got entry. Use IS_PPC64_TLS_RELOC. + + * elf32-ppc.h: New file. + * elf32-ppc.c: Include elf32-ppc.h. + (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define. + (struct ppc_elf_link_hash_entry): Rename "root" to "elf". Adjust uses. + Add "tls_mask" field. + (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define. + (struct ppc_elf_link_hash_table): Rename "root" to "elf". Adjust uses. + Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss, + sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields. + Make use of htab shortcuts throughout file. + (ppc_elf_link_hash_newfunc): Init tls_mask field. + (ppc_elf_link_hash_table_create): Init new fields. + (ppc_elf_copy_indirect_symbol): Copy tls_mask. + (ppc_elf_howto_raw): Add tls relocs. + (ppc_elf_reloc_type_lookup): Handle them. + (ppc_elf_unhandled_reloc): New function. + (ppc_elf_create_got): Stash got section pointer in hash table, + return status. Make .rela.got too. + (ppc_elf_create_dynamic_sections): Stash section pointers in htab. + (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when + NON_GOT_REF set. Don't allocate space in .plt here.. + (allocate_dynrelocs): ..do so here instead, properly ref-counting and + not allocating plt entries unnecessarily. Allocate got entries here. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (ppc_elf_size_dynamic_sections): Allocate local got entries. Pass + "info" during allocate_dynrelocs hash traversal. Use htab section + shortcuts rather than searching for named sections. Get rid of + "plt" and "strip" booleans. + (update_local_sym_info, bad_shared_reloc): New functions. + (ppc_elf_check_relocs): Handle TLS relocs. Move .rela.got creation to + ppc_elf_create_got. Don't mark got or plt reloc syms dynamic, do so + in allocate_dynreloc. Use update_local_sym_info and bad_shared_reloc. + Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16, + R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA + in shared libs. R_PPC_PLTREL32 is a plt reloc too. Refcount all + relocs that might use a plt entry. Set NON_GOT_REF too. + Enumerate all do-nothing relocs. + (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs. Handle + tls relocs and all plt relocs. + (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions. + (ppc_elf_finish_dynamic_symbol): Don't build got entries here. + (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab + shortcuts. + (ppc_elf_relocate_section): Tidy. Handle TLS relocs. Use + bfd_elf_local_sym_name. Simplify unresolved reloc code. Build got + entries and got relocs here. Warn on non-zero got reloc addend. + Split out branch taken/not taken reloc code into a separate switch + and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs. + Split out HA reloc adjustments to separate switch statement. Don't + warn on reloc overflow if we've already warned about undefined. + Don't rebuild sym name when reporting errors. Report all possible + errors from _bfd_final_link_relocate. + (bfd_elf32_bfd_final_link): Don't define. + +2003-02-18 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r". Don't + rebuild sym name when reporting errors. + +2003-02-17 Nick Clifton <nickc@redhat.com> + + * elflink.h (elf_link_output_extsym): Only check + allow_shlib_undefined for shared libraries. + * elf32-i386.c (elf_i386_relocate_section): Remove bogus check + of allow_shlib_undefined. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_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-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_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. + +2003-02-17 Nick Clifton <nickc@redhat.com> + + * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the + address field to use in the comparison. + (SEGMENT_OVERLAPS): Check that LMAs overlap as well. + +2003-02-14 Bob Wilson <bob.wilson@acm.org> + + * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF + backends when checking if the generic ELF target should be used. + + * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs + outside of functions, treat values as absolute addresses. + + * bfd.c: Change embedded documentation to use consistent indentation + and to split up long lines. Change informal style of description + for functions lacking real documentation. + * coffcode.h: Break up long lines in embedded documentation. + * format.c: Likewise. + * targets.c: Likewise. + * libcoff.h: Regenerate. + * bfd-in2.h: Regenerate. + +2003-02-14 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr. + (ppc64_elf_copy_indirect_symbol): Merge tls_mask too. + (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs. + (allocate_dynrelocs): Don't treat undefined and undefweak specially. + (ppc_size_one_stub): Fix warning, and tighten plt entry check. + (group_sections): Don't share a stub section if stubs are for a large + section. Adjust comment. + (ppc64_elf_size_stubs): Roughly double the size left for stubs if + !stubs_always_before_branch. + (ppc64_elf_relocate_section): Initialize tlsld GOT entry once. Don't + treat undefined and undefweak specially when processing dyn relocs. + +2003-02-13 Jakub Jelinek <jakub@redhat.com> + + * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO. + +2003-02-13 Nick Clifton <nickc@redhat.com> + + * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs + in computation of offset to insert into BL instruction. + +2003-02-11 Uwe Stieber <uwe@wwws.de> + + * config.bfd: Add support for kaOS as cross build target system. + +2003-02-11 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned + .__tls_get_addr too. + (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect. + +2003-02-10 Kaz kojima <kkojima@rr.iij4u.or.jp> + + * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field. + (elf_sh_link_hash_entry): Remove tls_tpoff32 field. + (sh_elf_link_hash_newfunc): Remove the initialization of + tls_tpoff32 field. + (allocate_dynrelocs): Keep dyn_relocs if it includes the entry + for which tls_tpoff32 flag is set. + (sh_elf_relocate_section): Covert to LE only if the dyn_relocs + of the symbol includes the entry matched with the input_section + and having tls_tpoff32 flag on. When linking statically, set + symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol + is defined in this executable. + (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately. + +2003-02-10 Jakub Jelinek <jakub@redhat.com> + + * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE + even if there is just non-empty .rela.plt. + +2003-02-10 Nick Clifton <nickc@redhat.com> + + * archures.c (bfd_mach_arm_ep9312): Define. + * bfd-in2.h: Regenerate. + * cpu-arm.c (processors[]): Add ep9312. + (bfd_arm_arch): Add ep9312. + * elf32-arm.h (elf32_arm_merge_private_data): Update error + messages and add test for Maverick floating point support. + (elf32_arm_print_private_bfd_data): Handle + EF_ARM_MAVERICK_FLOAT flag. + (elf32_arm_object_p): New function. + (elf_backend_object_p): Define. + +2003-02-10 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c: Rename assorted occurrences of tls_type and similar + variables, structure fields or function params to tls_mask or + similar to better reflect usage. + (struct got_entry): Comment. + (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*. + (get_tls_mask): Rename from get_tls_type. + +2003-02-09 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (TLS_GD_LD): Don't define.. + (TLS_GD): ..define this instead and update all uses. + (TLS_TPRELGD): Define. + (ppc64_elf_link_hash_table_create): Tweak initialization of + init_refcount and init_offset. + (ppc64_elf_check_relocs): Add one extra element to t_symndx array. + Mark second slot of GD or LD toc entries. + (get_tls_type): Return an int. Distinguish toc GD and LD entries + from other tls types. + (ppc64_elf_tls_setup): New function, split out from.. + (ppc64_elf_tls_optimize): ..here. Don't optimize when symbols are + defined in a dynamic object. Fix LD optimization. Don't set TLS_TPREL + on GD->IE optimization, use TLS_TPRELGD instead. Use get_tls_type + return value to properly decide whether toc GD and LD entries can + optimize away __tls_get_addr call. Check next reloc after DTPMOD64 + to determine GD or LD rather than looking at TLS_LD flag. Don't + attempt to adjust got entry tls_type here.. + (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and + look for possible merges. + (ppc64_elf_size_dynamic_sections): Adjust local got entries for + optimization. + (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge. + (ppc64_elf_relocate_section): Rename some vars to better reflect usage. + Make use of return value from get_tls_type to properly detect GD and + LD optimizations. Split tlsld/gd hi/ha from lo/ds case. Don't + handle tls_get_addr removal when looking at REL24 relocs, do it when + looking at the previous reloc. Check reloc after DTPMOD64 to determine + GD or LD. + * elf64-ppc.h (ppc64_elf_tls_setup): Declare. + +2003-02-08 Alan Modra <amodra@bigpond.net.au> + + * elf32-hppa.c (group_sections): Don't share a stub section if + stubs are for a large section. + + * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for + stubs if !stubs_always_before_branch. + 2003-02-07 Nick Clifton <nickc@redhat.com> * elf.c (swap_out_syms): Generate an error message if an @@ -8,7 +393,6 @@ * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if local_got_entries is NULL. - 2003-02-06 Andreas Schwab <schwab@suse.de> * elf-eh-frame.c (get_DW_EH_PE_signed): Define. @@ -42,7 +426,7 @@ TLS_EXPLICIT): Define. (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got. (link_hash_newfunc): Init new fields. - (ppc64_elf_link_hash_table_create): Likewise. Set init_relcount and + (ppc64_elf_link_hash_table_create): Likewise. Set init_refcount and init_offset to NULL. (ppc64_elf_copy_indirect_symbol): Copy got and plt info. Don't call _bfd_elf_link_hash_copy_indirect, rather insert relevant code from @@ -407,7 +791,7 @@ * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and TPREL also get a reloc if shared. Remove SREL support. (elf64_alpha_emit_dynrel): New. - (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL + (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL and GOTTPREL relocs to local symbols against the tp base. (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel. @@ -419,15 +803,15 @@ 2003-01-20 Svein E. Seldal <Svein.Seldal@solidas.com> * coffcode.h (coff_set_flags): Added get/set arch hooks. - + 2003-01-20 Fabio Alemagna <falemagn@aros.org> * elf32-sh.c: Treat elfNN_bed like other macros defined in elfxx-target.h and #undef it before #define'ing it. * elf32-i386.c: Likewise. - * elf32-sh64.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-sh64.c: Likewise. + * elf32-sh64.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. 2003-01-20 Martin Schwidefsky <schwidefsky@de.ibm.com> @@ -505,7 +889,7 @@ * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c. (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c. * Makefile.in: Regenerate. - + 2003-01-08 Alexandre Oliva <aoliva@redhat.com> * elfn32-mips.c (prev_reloc_section): New. @@ -542,7 +926,7 @@ (bfd_archures_list): Add bfd_iq2000_arch. * configure.in: Handle bfd_elf32_iq2000_vec. * configure: Regenerate. - * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21, + * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21, and BFD_RELOC_IQ2000_UHI16. * targets.c (bfd_elf32_iq2000_vec): Declare. (bfd_target_vector): Add bfd_elf32_iq2000_vec. @@ -632,7 +1016,7 @@ * archures.c (bfd_arch_get_compatible): Add third parameter 'accept_unknowns'. Only accept unknown format BFDs if accept_unknowns is true, or if the format is "binary". - * bfd-in2.h: Regenerate. + * bfd-in2.h: Regenerate. 2002-12-21 Nick Clifton <nickc@redhat.com> @@ -658,7 +1042,7 @@ * bfd-in2.h: Regenerate. * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12. (xstormy16_reloc_map): Add R_XSTORMY16_12. - + 2002-12-19 Kazu Hirata <kazu@cs.umass.edu> * doc/bfdint.texi: Fix typos. diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 6f05319..401568f 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -877,8 +877,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h format.lo: format.c $(INCDIR)/filenames.h init.lo: init.c $(INCDIR)/filenames.h libbfd.lo: libbfd.c $(INCDIR)/filenames.h -opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - $(INCDIR)/objalloc.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \ + $(INCDIR)/libiberty.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ @@ -1250,7 +1250,7 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + elf32-ppc.h elf32-target.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 \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index e6a600f..a05b342 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -799,7 +799,7 @@ configure.in version.h DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES) OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS) @@ -1410,8 +1410,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h format.lo: format.c $(INCDIR)/filenames.h init.lo: init.c $(INCDIR)/filenames.h libbfd.lo: libbfd.c $(INCDIR)/filenames.h -opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - $(INCDIR)/objalloc.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \ + $(INCDIR)/libiberty.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ @@ -1783,7 +1783,7 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + elf32-ppc.h elf32-target.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 \ diff --git a/bfd/archures.c b/bfd/archures.c index 08015f9..62edda1 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -234,6 +234,7 @@ DESCRIPTION .#define bfd_mach_arm_5T 8 .#define bfd_mach_arm_5TE 9 .#define bfd_mach_arm_XScale 10 +.#define bfd_mach_arm_ep9312 11 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 3b1f9ab..917b46f 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -1,7 +1,8 @@ /* 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 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -68,7 +69,7 @@ extern "C" { #endif /* Forward declaration. */ -typedef struct _bfd bfd; +typedef struct bfd bfd; /* Boolean type used in bfd. Too many systems define their own versions of "boolean" for us to safely typedef a "boolean" of diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 1820b23..9540eeb 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6,9 +6,10 @@ Run "make headers" in your build bfd/ to regenerate. */ /* 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 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -75,7 +76,7 @@ extern "C" { #endif /* Forward declaration. */ -typedef struct _bfd bfd; +typedef struct bfd bfd; /* Boolean type used in bfd. Too many systems define their own versions of "boolean" for us to safely typedef a "boolean" of @@ -1689,6 +1690,7 @@ enum bfd_architecture #define bfd_mach_arm_5T 8 #define bfd_mach_arm_5TE 9 #define bfd_mach_arm_XScale 10 +#define bfd_mach_arm_ep9312 11 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -2329,6 +2331,9 @@ to compensate for the borrow when the low bits are added. */ /* Like BFD_RELOC_LO16, but PC relative. */ BFD_RELOC_PCREL_LO16, +/* Like BFD_RELOC_16_PCREL_S2, but for MIPS Embedded PIC. */ + BFD_RELOC_MIPSEMB_16_PCREL_S2, + /* Relocation against a MIPS literal section. */ BFD_RELOC_MIPS_LITERAL, @@ -3443,7 +3448,7 @@ typedef struct symbol_cache_entry 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. */ + 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. */ @@ -3604,7 +3609,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ -struct _bfd +struct bfd { /* A unique identifier of the BFD */ unsigned int id; @@ -3635,7 +3640,7 @@ struct _bfd /* The caching routines use these to maintain a least-recently-used list of BFDs. */ - struct _bfd *lru_prev, *lru_next; + struct bfd *lru_prev, *lru_next; /* When a file is closed by the caching routines, BFD retains state information on the file here... */ @@ -3709,13 +3714,13 @@ struct _bfd /* Stuff only useful for archives. */ PTR 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. */ + 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; + struct bfd *link_next; /* A field used by _bfd_generic_link_add_archive_symbols. This will be used only for archive elements. */ @@ -3871,33 +3876,31 @@ bfd_boolean bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _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)) + 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)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _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)) + BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _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)) + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) #define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _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)) + 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)) @@ -4356,14 +4359,17 @@ const char ** bfd_target_list PARAMS ((void)); const bfd_target * -bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); +bfd_search_for_target PARAMS ((int (* search_func) + (const bfd_target *, void *), + void *)); /* Extracted from format.c. */ bfd_boolean bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); bfd_boolean -bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); +bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, + char ***matching)); bfd_boolean bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); @@ -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 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -34,7 +34,7 @@ SECTION CODE_FRAGMENT . -.struct _bfd +.struct bfd .{ . {* A unique identifier of the BFD *} . unsigned int id; @@ -65,7 +65,7 @@ CODE_FRAGMENT . . {* The caching routines use these to maintain a . least-recently-used list of BFDs. *} -. struct _bfd *lru_prev, *lru_next; +. struct bfd *lru_prev, *lru_next; . . {* When a file is closed by the caching routines, BFD retains . state information on the file here... *} @@ -139,13 +139,13 @@ CODE_FRAGMENT . . {* Stuff only useful for archives. *} . PTR 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. *} +. 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; +. struct bfd *link_next; . . {* A field used by _bfd_generic_link_add_archive_symbols. This will . be used only for archive elements. *} @@ -567,7 +567,7 @@ FUNCTION bfd_get_reloc_upper_bound SYNOPSIS - long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect); + long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); DESCRIPTION Return the number of bytes required to store the @@ -662,7 +662,7 @@ FUNCTION bfd_set_file_flags SYNOPSIS - bfd_boolean bfd_set_file_flags(bfd *abfd, flagword flags); + bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); DESCRIPTION Set the flag word in the BFD @var{abfd} to the value @var{flags}. @@ -813,7 +813,7 @@ FUNCTION bfd_set_start_address SYNOPSIS - bfd_boolean bfd_set_start_address(bfd *abfd, bfd_vma vma); + bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); DESCRIPTION Make @var{vma} the entry point of output BFD @var{abfd}. @@ -836,7 +836,7 @@ FUNCTION bfd_get_gp_size SYNOPSIS - unsigned int bfd_get_gp_size(bfd *abfd); + unsigned int bfd_get_gp_size (bfd *abfd); DESCRIPTION Return the maximum size of objects to be optimized using the GP @@ -863,7 +863,7 @@ FUNCTION bfd_set_gp_size SYNOPSIS - void bfd_set_gp_size(bfd *abfd, unsigned int i); + void bfd_set_gp_size (bfd *abfd, unsigned int i); DESCRIPTION Set the maximum size of objects to be optimized using the GP @@ -926,7 +926,7 @@ FUNCTION bfd_scan_vma SYNOPSIS - bfd_vma bfd_scan_vma(const char *string, const char **end, int base); + bfd_vma bfd_scan_vma (const char *string, const char **end, int base); DESCRIPTION Convert, like <<strtoul>>, a numerical expression @@ -1016,7 +1016,7 @@ FUNCTION bfd_copy_private_bfd_data SYNOPSIS - bfd_boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); + bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); DESCRIPTION Copy private BFD information from the BFD @var{ibfd} to the @@ -1037,7 +1037,7 @@ FUNCTION bfd_merge_private_bfd_data SYNOPSIS - bfd_boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); + bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); DESCRIPTION Merge private BFD information from the BFD @var{ibfd} to the @@ -1058,7 +1058,7 @@ FUNCTION bfd_set_private_flags SYNOPSIS - bfd_boolean bfd_set_private_flags(bfd *abfd, flagword flags); + bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); DESCRIPTION Set private BFD flag information in the BFD @var{abfd}. @@ -1069,43 +1069,41 @@ DESCRIPTION Not enough memory exists to create private data for @var{obfd}. .#define bfd_set_private_flags(abfd, flags) \ -. BFD_SEND (abfd, _bfd_set_private_flags, \ -. (abfd, flags)) +. BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) */ /* FUNCTION - stuff + Other functions DESCRIPTION - Stuff which should be documented: + The following functions exist but have not yet been documented. .#define bfd_sizeof_headers(abfd, reloc) \ -. BFD_SEND (abfd, _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)) +. BFD_SEND (abfd, _bfd_find_nearest_line, \ +. (abfd, sec, syms, off, file, func, line)) . -. {* Do these three do anything useful at all, for any back end? *} .#define bfd_debug_info_start(abfd) \ -. BFD_SEND (abfd, _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)) +. BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) . .#define bfd_debug_info_accumulate(abfd, section) \ -. BFD_SEND (abfd, _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)) +. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) . .#define bfd_update_armap_timestamp(abfd) \ -. BFD_SEND (abfd, _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)) +. 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)) @@ -1265,7 +1263,7 @@ FUNCTION bfd_alt_mach_code SYNOPSIS - bfd_boolean bfd_alt_mach_code(bfd *abfd, int alternative); + bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); DESCRIPTION diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index e21c5b5..2c99af1 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -1,6 +1,6 @@ /* BFD back-end for Hitachi H8/300 COFF binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain, <sac@cygnus.com>. @@ -210,7 +210,7 @@ h8300_coff_link_hash_table_create (abfd) ret->vectors_sec = NULL; ret->funcvec_hash_table = NULL; - /* OK. Everything's intialized, return the base pointer. */ + /* OK. Everything's initialized, return the base pointer. */ return &ret->root.root; } @@ -396,13 +396,9 @@ reloc_processing (relent, reloc, symbols, abfd, section) rtype2howto (relent, reloc); if (((int) reloc->r_symndx) > 0) - { - relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; - } + relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; else - { - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - } + relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; relent->addend = reloc->r_offset; @@ -428,6 +424,7 @@ h8300_symbol_address_p (abfd, input_section, address) while (*s) { asymbol *p = *s; + if (p->section == input_section && (input_section->output_section->vma + input_section->output_offset @@ -472,8 +469,8 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) /* Only examine the relocs which might be relaxable. */ switch (reloc->howto->type) { - /* This is the 16/24 bit absolute branch which could become an 8 bit - pc-relative branch. */ + /* This is the 16/24 bit absolute branch which could become an 8 bit + pc-relative branch. */ case R_JMP1: case R_JMPL1: /* Get the address of the target of this branch. */ @@ -720,7 +717,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, /* Everything looks OK. Apply the relocation and update the src/dst address appropriately. */ - bfd_put_8 (abfd, gap, data + dst_address); dst_address++; src_address++; @@ -752,7 +748,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, /* Everything looks OK. Apply the relocation and update the src/dst address appropriately. */ - bfd_put_16 (abfd, (bfd_vma) gap, data + dst_address); dst_address += 2; src_address += 2; @@ -773,7 +768,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, { /* Everything looks OK. Apply the relocation and update the src/dst address appropriately. */ - bfd_put_8 (abfd, value & 0xff, data + dst_address); dst_address += 1; src_address += 1; diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index f0c82a6..067f2b6 100644 --- a/bfd/coff-ppc.c +++ b/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 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Original version pieced together by Kim Knuttila (krk@cygnus.com) @@ -9,30 +9,29 @@ coff files, in particular, those for the rs/6000, alpha, mips, and intel backends, and the PE work for the arm. -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, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* Current State: - objdump works - relocs generated by gas - ld will link files, but they do not run. - dlltool will not produce correct output in some .reloc cases, and will - not produce the right glue code for dll function calls. -*/ + not produce the right glue code for dll function calls. */ #include "bfd.h" #include "sysdep.h" @@ -58,15 +57,15 @@ extern bfd_boolean ppc_bfd_coff_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void dump_toc PARAMS ((PTR)); -/* The toc is a set of bfd_vma fields. We use the fact that valid */ -/* addresses are even (i.e. the bit representing "1" is off) to allow */ -/* us to encode a little extra information in the field */ -/* - Unallocated addresses are intialized to 1. */ -/* - Allocated addresses are even numbers. */ -/* The first time we actually write a reference to the toc in the bfd, */ -/* we want to record that fact in a fixup file (if it is asked for), so */ -/* we keep track of whether or not an address has been written by marking */ -/* the low order bit with a "1" upon writing */ +/* The toc is a set of bfd_vma fields. We use the fact that valid + addresses are even (i.e. the bit representing "1" is off) to allow + us to encode a little extra information in the field + - Unallocated addresses are initialized to 1. + - Allocated addresses are even numbers. + The first time we actually write a reference to the toc in the bfd, + we want to record that fact in a fixup file (if it is asked for), so + we keep track of whether or not an address has been written by marking + the low order bit with a "1" upon writing. */ #define SET_UNALLOCATED(x) ((x) = 1) #define IS_UNALLOCATED(x) ((x) == 1) @@ -75,10 +74,10 @@ extern void dump_toc PARAMS ((PTR)); #define MARK_AS_WRITTEN(x) ((x) |= 1) #define MAKE_ADDR_AGAIN(x) ((x) &= ~1) -/* Turn on this check if you suspect something amiss in the hash tables */ +/* Turn on this check if you suspect something amiss in the hash tables. */ #ifdef DEBUG_HASH -/* Need a 7 char string for an eye catcher */ +/* Need a 7 char string for an eye catcher. */ #define EYE "krkjunk" #define HASH_CHECK_DCL char eye_catcher[8]; @@ -101,17 +100,17 @@ extern void dump_toc PARAMS ((PTR)); #endif /* In order not to add an int to every hash table item for every coff - linker, we define our own hash table, derived from the coff one */ + linker, we define our own hash table, derived from the coff one. */ /* PE linker hash table entries. */ struct ppc_coff_link_hash_entry { - struct coff_link_hash_entry root; /* First entry, as required */ + struct coff_link_hash_entry root; /* First entry, as required. */ /* As we wonder around the relocs, we'll keep the assigned toc_offset - here */ - bfd_vma toc_offset; /* Our addition, as required */ + here. */ + bfd_vma toc_offset; /* Our addition, as required. */ int symbol_is_glue; unsigned long int glue_insn; @@ -122,7 +121,7 @@ struct ppc_coff_link_hash_entry struct ppc_coff_link_hash_table { - struct coff_link_hash_table root; /* First entry, as required */ + struct coff_link_hash_table root; /* First entry, as required. */ }; static struct bfd_hash_entry *ppc_coff_link_hash_newfunc @@ -172,11 +171,11 @@ ppc_coff_link_hash_newfunc (entry, table, string) if (ret) { /* Initialize the local fields. */ - SET_UNALLOCATED(ret->toc_offset); + SET_UNALLOCATED (ret->toc_offset); ret->symbol_is_glue = 0; ret->glue_insn = 0; - HASH_CHECK_INIT(ret); + HASH_CHECK_INIT (ret); } return (struct bfd_hash_entry *) ret; @@ -216,13 +215,13 @@ ppc_coff_link_hash_table_create (abfd) return &ret->root.root; } -/* Now, tailor coffcode.h to use our hash stuff */ +/* Now, tailor coffcode.h to use our hash stuff. */ #define coff_bfd_link_hash_table_create ppc_coff_link_hash_table_create -/* The nt loader points the toc register to &toc + 32768, in order to */ -/* use the complete range of a 16-bit displacement. We have to adjust */ -/* for this when we fix up loads displaced off the toc reg. */ +/* The nt loader points the toc register to &toc + 32768, in order to + use the complete range of a 16-bit displacement. We have to adjust + for this when we fix up loads displaced off the toc reg. */ #define TOC_LOAD_ADJUSTMENT (-32768) #define TOC_SECTION_NAME ".private.toc" @@ -234,7 +233,7 @@ ppc_coff_link_hash_table_create (abfd) from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) -/* these should definitely go in a header file somewhere... */ +/* These should definitely go in a header file somewhere... */ /* NOP */ #define IMAGE_REL_PPC_ABSOLUTE 0x0000 @@ -284,31 +283,31 @@ ppc_coff_link_hash_table_create (abfd) /* va of containing section (limited to 16 bits) */ #define IMAGE_REL_PPC_SECREL16 0x000F -/* stuff to handle immediate data when the number of bits in the */ -/* data is greater than the number of bits in the immediate field */ -/* We need to do (usually) 32 bit arithmetic on 16 bit chunks */ +/* Stuff to handle immediate data when the number of bits in the + data is greater than the number of bits in the immediate field + We need to do (usually) 32 bit arithmetic on 16 bit chunks. */ #define IMAGE_REL_PPC_REFHI 0x0010 #define IMAGE_REL_PPC_REFLO 0x0011 #define IMAGE_REL_PPC_PAIR 0x0012 -/* This is essentially the same as tocrel16, with TOCDEFN assumed */ +/* This is essentially the same as tocrel16, with TOCDEFN assumed. */ #define IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 -/* Flag bits in IMAGE_RELOCATION.TYPE */ +/* Flag bits in IMAGE_RELOCATION.TYPE. */ -/* subtract reloc value rather than adding it */ +/* Subtract reloc value rather than adding it. */ #define IMAGE_REL_PPC_NEG 0x0100 -/* fix branch prediction bit to predict branch taken */ +/* Fix branch prediction bit to predict branch taken. */ #define IMAGE_REL_PPC_BRTAKEN 0x0200 -/* fix branch prediction bit to predict branch not taken */ +/* Fix branch prediction bit to predict branch not taken. */ #define IMAGE_REL_PPC_BRNTAKEN 0x0400 -/* toc slot defined in file (or, data in toc) */ +/* TOC slot defined in file (or, data in toc). */ #define IMAGE_REL_PPC_TOCDEFN 0x0800 -/* masks to isolate above values in IMAGE_RELOCATION.Type */ +/* Masks to isolate above values in IMAGE_RELOCATION.Type. */ #define IMAGE_REL_PPC_TYPEMASK 0x00FF #define IMAGE_REL_PPC_FLAGMASK 0x0F00 @@ -317,7 +316,7 @@ ppc_coff_link_hash_table_create (abfd) #define EXTRACT_JUNK(x) \ ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK)) -/* static helper functions to make relocation work */ +/* Static helper functions to make relocation work. */ /* (Work In Progress) */ static bfd_reloc_status_type ppc_refhi_reloc PARAMS ((bfd *abfd, @@ -389,41 +388,36 @@ static bfd_boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto)); /* FIXME: It'll take a while to get through all of these. I only need a few to get us started, so those I'll make sure work. Those marked FIXME are either - completely unverified or have a specific unknown marked in the comment */ - -/*---------------------------------------------------------------------------*/ -/* */ -/* Relocation entries for Windows/NT on PowerPC. */ -/* */ -/* From the document "" we find the following listed as used relocs: */ -/* */ -/* ABSOLUTE : The noop */ -/* ADDR[64|32|16] : fields that hold addresses in data fields or the */ -/* 16 bit displacement field on a load/store. */ -/* ADDR[24|14] : fields that hold addresses in branch and cond */ -/* branches. These represent [26|16] bit addresses. */ -/* The low order 2 bits are preserved. */ -/* REL[24|14] : branches relative to the Instruction Address */ -/* register. These represent [26|16] bit addresses, */ -/* as before. The instruction field will be zero, and */ -/* the address of the SYM will be inserted at link time. */ -/* TOCREL16 : 16 bit displacement field referring to a slot in */ -/* toc. */ -/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */ -/* ADDR32NB : 32 bit address relative to the virtual origin. */ -/* (On the alpha, this is always a linker generated thunk)*/ -/* (i.e. 32bit addr relative to the image base) */ -/* SECREL : The value is relative to the start of the section */ -/* containing the symbol. */ -/* SECTION : access to the header containing the item. Supports the */ -/* codeview debugger. */ -/* */ -/* In particular, note that the document does not indicate that the */ -/* relocations listed in the header file are used. */ -/* */ -/* */ -/* */ -/*---------------------------------------------------------------------------*/ + completely unverified or have a specific unknown marked in the comment. */ + +/* Relocation entries for Windows/NT on PowerPC. + + From the document "" we find the following listed as used relocs: + + ABSOLUTE : The noop + ADDR[64|32|16] : fields that hold addresses in data fields or the + 16 bit displacement field on a load/store. + ADDR[24|14] : fields that hold addresses in branch and cond + branches. These represent [26|16] bit addresses. + The low order 2 bits are preserved. + REL[24|14] : branches relative to the Instruction Address + register. These represent [26|16] bit addresses, + as before. The instruction field will be zero, and + the address of the SYM will be inserted at link time. + TOCREL16 : 16 bit displacement field referring to a slot in + toc. + TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. + ADDR32NB : 32 bit address relative to the virtual origin. + (On the alpha, this is always a linker generated thunk) + (i.e. 32bit addr relative to the image base) + SECREL : The value is relative to the start of the section + containing the symbol. + SECTION : access to the header containing the item. Supports the + codeview debugger. + + In particular, note that the document does not indicate that the + relocations listed in the header file are used. */ + static reloc_howto_type ppc_coff_howto_table[] = { @@ -767,7 +761,7 @@ static reloc_howto_type ppc_coff_howto_table[] = }; -/* Some really cheezy macros that can be turned on to test stderr :-) */ +/* Some really cheezy macros that can be turned on to test stderr :-) */ #ifdef DEBUG_RELOC #define UN_IMPL(x) \ @@ -792,16 +786,14 @@ static reloc_howto_type ppc_coff_howto_table[] = #define n_name _n._n_name #define n_zeroes _n._n_n._n_zeroes -#define n_offset _n._n_n._n_offset - -*/ +#define n_offset _n._n_n._n_offset */ -#define DUMP_RELOC2(n,r) \ -{ \ - fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \ - n, r->r_symndx, r->r_vaddr,\ +#define DUMP_RELOC2(n,r) \ +{ \ + fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \ + n, r->r_symndx, r->r_vaddr, \ (((r->r_type) & IMAGE_REL_PPC_TOCDEFN) == 0) \ - ?" ":" TOCDEFN" ); \ + ?" ":" TOCDEFN" ); \ } #else @@ -810,14 +802,13 @@ static reloc_howto_type ppc_coff_howto_table[] = #define DUMP_RELOC2(n,r) #endif -/* toc construction and management routines */ +/* TOC construction and management routines. */ /* This file is compiled twice, and these variables are defined in one of the compilations. FIXME: This is confusing and weird. Also, BFD should not use global variables. */ -extern bfd* bfd_of_toc_owner; +extern bfd * bfd_of_toc_owner; extern long int global_toc_size; - extern long int import_table_size; extern long int first_thunk_address; extern long int thunk_size; @@ -858,7 +849,7 @@ record_toc (toc_section, our_toc_offset, cat, name) enum ref_category cat; const char *name; { - /* add this entry to our toc addr-offset-name list */ + /* Add this entry to our toc addr-offset-name list. */ bfd_size_type amt = sizeof (struct list_ele); struct list_ele *t = (struct list_ele *) bfd_malloc (amt); @@ -889,7 +880,7 @@ static bfd_boolean ppc_record_toc_entry static void ppc_mark_symbol_as_glue PARAMS ((bfd *, int, struct internal_reloc *)); -/* record a toc offset against a symbol */ +/* Record a toc offset against a symbol. */ static bfd_boolean ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) bfd *abfd; @@ -914,16 +905,19 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) if (h == 0) { local_syms = obj_coff_local_toc_table(abfd); + if (local_syms == 0) { unsigned int i; bfd_size_type amt; + /* allocate a table */ amt = (bfd_size_type) obj_raw_syment_count (abfd) * sizeof (int); local_syms = (int *) bfd_zalloc (abfd, amt); if (local_syms == 0) return FALSE; obj_coff_local_toc_table (abfd) = local_syms; + for (i = 0; i < obj_raw_syment_count (abfd); ++i) { SET_UNALLOCATED (local_syms[i]); @@ -935,7 +929,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) local_syms[sym] = global_toc_size; global_toc_size += 4; - /* The size must fit in a 16bit displacment */ + /* The size must fit in a 16bit displacment. */ if (global_toc_size > 65535) { (*_bfd_error_handler) (_("TOC overflow")); @@ -948,14 +942,14 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) { name = h->root.root.root.string; - /* check to see if there's a toc slot allocated. If not, do it - here. It will be used in relocate_section */ + /* Check to see if there's a toc slot allocated. If not, do it + here. It will be used in relocate_section. */ if (IS_UNALLOCATED(h->toc_offset)) { h->toc_offset = global_toc_size; global_toc_size += 4; - /* The size must fit in a 16bit displacment */ + /* The size must fit in a 16bit displacment. */ if (global_toc_size >= 65535) { (*_bfd_error_handler) (_("TOC overflow")); @@ -968,7 +962,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) return TRUE; } -/* record a toc offset against a symbol */ +/* Record a toc offset against a symbol. */ static void ppc_mark_symbol_as_glue(abfd, sym, rel) bfd *abfd; @@ -1013,9 +1007,9 @@ static bfd_boolean in_reloc_p(abfd, howto) #if 0 -/* this function is in charge of performing all the ppc PE relocations */ -/* Don't yet know if we want to do this this particular way ... (krk) */ -/* FIXME: (it is not yet enabled) */ +/* This function is in charge of performing all the ppc PE relocations + Don't yet know if we want to do this this particular way ... (krk). */ +/* FIXME: (it is not yet enabled). */ static bfd_reloc_status_type pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, @@ -1028,8 +1022,8 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, bfd *output_bfd; char **error_message; { - /* the consth relocation comes in two parts, we have to remember - the state between calls, in these variables */ + /* The consth relocation comes in two parts, we have to remember + the state between calls, in these variables. */ static bfd_boolean part1_consth_active = FALSE; static unsigned long part1_consth_value; @@ -1041,7 +1035,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if (output_bfd) { - /* Partial linking - do nothing */ + /* Partial linking - do nothing. */ reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } @@ -1049,7 +1043,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) { - /* Keep the state machine happy in case we're called again */ + /* Keep the state machine happy in case we're called again. */ if (r_type == IMAGE_REL_PPC_REFHI) { part1_consth_active = TRUE; @@ -1151,7 +1145,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, sec = NULL; val = 0; - /* FIXME: PAIR unsupported in the following code */ + /* FIXME: PAIR unsupported in the following code. */ if (h == NULL) { if (symndx == -1) @@ -1189,7 +1183,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, rstat = bfd_reloc_ok; - /* Each case must do its own relocation, setting rstat appropriately */ + /* Each case must do its own relocation, setting rstat appropriately. */ switch (r_type) { default: @@ -1217,16 +1211,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } } - /* - * Amazing bit tricks present. As we may have seen earlier, we - * use the 1 bit to tell us whether or not a toc offset has been - * allocated. Now that they've all been allocated, we will use - * the 1 bit to tell us if we've written this particular toc - * entry out. - */ + /* Amazing bit tricks present. As we may have seen earlier, we + use the 1 bit to tell us whether or not a toc offset has been + allocated. Now that they've all been allocated, we will use + the 1 bit to tell us if we've written this particular toc + entry out. */ fixit = FALSE; if (h == 0) - { /* it is a file local symbol */ + { + /* It is a file local symbol. */ int *local_toc_table; const char *name; @@ -1238,15 +1231,14 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (IS_WRITTEN(our_toc_offset)) { - /* if it has been written out, it is marked with the + /* If it has been written out, it is marked with the 1 bit. Fix up our offset, but do not write it out - again. - */ + again. */ MAKE_ADDR_AGAIN(our_toc_offset); } else { - /* write out the toc entry */ + /* Write out the toc entry. */ record_toc (toc_section, our_toc_offset, priv, strdup (name)); @@ -1277,13 +1269,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, Import Address Table is mapped immediately following the toc, some trippy library code trying for speed on dll linkage, takes advantage of that and considers - the IAT to be part of the toc, thus saving a load. - */ + the IAT to be part of the toc, thus saving a load. */ our_toc_offset = val - (toc_section->output_section->vma + toc_section->output_offset); - /* The size must still fit in a 16bit displacment */ + /* The size must still fit in a 16bit displacment. */ if ((bfd_vma) our_toc_offset >= 65535) { (*_bfd_error_handler) @@ -1297,12 +1288,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, record_toc (toc_section, our_toc_offset, pub, strdup (name)); } - else if (IS_WRITTEN(our_toc_offset)) + else if (IS_WRITTEN (our_toc_offset)) { - /* if it has been written out, it is marked with the + /* If it has been written out, it is marked with the 1 bit. Fix up our offset, but do not write it out - again. - */ + again. */ MAKE_ADDR_AGAIN(our_toc_offset); } else @@ -1310,13 +1300,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, record_toc(toc_section, our_toc_offset, pub, strdup (name)); - /* write out the toc entry */ + /* Write out the toc entry. */ bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); MARK_AS_WRITTEN(h->toc_offset); - /* The tricky part is that this is the address that */ - /* needs a .reloc entry for it */ + /* The tricky part is that this is the address that + needs a .reloc entry for it. */ fixit = TRUE; } } @@ -1324,22 +1314,21 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (fixit && info->base_file) { /* So if this is non pcrelative, and is referenced - to a section or a common symbol, then it needs a reloc */ + to a section or a common symbol, then it needs a reloc. */ - /* relocation to a symbol in a section which + /* Relocation to a symbol in a section which isn't absolute - we output the address here - to a file */ - + to a file. */ bfd_vma addr = (toc_section->output_section->vma + toc_section->output_offset + our_toc_offset); - if (coff_data(output_bfd)->pe) + if (coff_data (output_bfd)->pe) addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; fwrite (&addr, 1,4, (FILE *) info->base_file); } - /* FIXME: this test is conservative */ + /* FIXME: this test is conservative. */ if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN && (bfd_vma) our_toc_offset > toc_section->_raw_size) { @@ -1351,21 +1340,21 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, return FALSE; } - /* Now we know the relocation for this toc reference */ + /* Now we know the relocation for this toc reference. */ relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT; rstat = _bfd_relocate_contents (howto, input_bfd, relocation, loc); } break; case IMAGE_REL_PPC_IFGLUE: { - /* To solve this, we need to know whether or not the symbol */ - /* appearing on the call instruction is a glue function or not. */ - /* A glue function must announce itself via a IMGLUE reloc, and */ - /* the reloc contains the required toc restore instruction */ - + /* To solve this, we need to know whether or not the symbol + appearing on the call instruction is a glue function or not. + A glue function must announce itself via a IMGLUE reloc, and + the reloc contains the required toc restore instruction. */ bfd_vma x; const char *my_name; - DUMP_RELOC2(howto->name, rel); + + DUMP_RELOC2 (howto->name, rel); if (h != 0) { @@ -1379,25 +1368,24 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } break; case IMAGE_REL_PPC_SECREL: - /* Unimplemented: codeview debugging information */ + /* Unimplemented: codeview debugging information. */ /* For fast access to the header of the section containing the item. */ break; case IMAGE_REL_PPC_SECTION: - /* Unimplemented: codeview debugging information */ + /* Unimplemented: codeview debugging information. */ /* Is used to indicate that the value should be relative to the beginning of the section that contains the - symbol */ + symbol. */ break; case IMAGE_REL_PPC_ABSOLUTE: { const char *my_name; + if (h == 0) - my_name = (syms+symndx)->_n._n_name; + my_name = (syms+symndx)->_n._n_name; else - { - my_name = h->root.root.root.string; - } + my_name = h->root.root.root.string; fprintf (stderr, _("Warning: unsupported reloc %s <file %s, section %s>\n"), @@ -1413,8 +1401,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, case IMAGE_REL_PPC_IMGLUE: { /* There is nothing to do now. This reloc was noted in the first - pass over the relocs, and the glue instruction extracted */ + pass over the relocs, and the glue instruction extracted. */ const char *my_name; + if (h->symbol_is_glue == 1) break; my_name = h->root.root.root.string; @@ -1429,13 +1418,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, case IMAGE_REL_PPC_ADDR32NB: { const char *name = 0; - DUMP_RELOC2(howto->name, rel); + + DUMP_RELOC2 (howto->name, rel); if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0) { - /* set magic values */ + /* Set magic values. */ int idata5offset; struct coff_link_hash_entry *myh; + myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", FALSE, FALSE, TRUE); @@ -1457,7 +1448,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } if (h == 0) - { /* it is a file local symbol */ + { + /* It is a file local symbol. */ sym = syms + symndx; name = sym->_n._n_name; } @@ -1466,11 +1458,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, char *target = 0; name = h->root.root.root.string; - if (strcmp(".idata$2", name) == 0) + if (strcmp (".idata$2", name) == 0) target = "__idata2_magic__"; - else if (strcmp(".idata$4", name) == 0) + else if (strcmp (".idata$4", name) == 0) target = "__idata4_magic__"; - else if (strcmp(".idata$5", name) == 0) + else if (strcmp (".idata$5", name) == 0) target = "__idata5_magic__"; if (target != 0) @@ -1514,10 +1506,10 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } rstat = _bfd_relocate_contents (howto, - input_bfd, - val - - pe_data(output_bfd)->pe_opthdr.ImageBase, - loc); + input_bfd, + val - + pe_data (output_bfd)->pe_opthdr.ImageBase, + loc); } break; @@ -1542,24 +1534,23 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if ( info->base_file ) + if (info->base_file) { /* So if this is non pcrelative, and is referenced - to a section or a common symbol, then it needs a reloc */ - if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto)) + to a section or a common symbol, then it needs a reloc. */ + if (sym && pe_data(output_bfd)->in_reloc_p (output_bfd, howto)) { - /* relocation to a symbol in a section which + /* Relocation to a symbol in a section which isn't absolute - we output the address here - to a file */ + to a file. */ bfd_vma addr = rel->r_vaddr - input_section->vma + input_section->output_offset + input_section->output_section->vma; - if (coff_data(output_bfd)->pe) - { - addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; - } + if (coff_data (output_bfd)->pe) + addr -= pe_data (output_bfd)->pe_opthdr.ImageBase; + fwrite (&addr, 1,4, (FILE *) info->base_file); } } @@ -1595,12 +1586,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) - { - return FALSE; - } + return FALSE; } } - } return TRUE; @@ -1686,21 +1674,17 @@ ppc_allocate_toc_section (info) bfd_size_type amt; static char test_char = '1'; - if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */ + if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */ return TRUE; if (bfd_of_toc_owner == 0) - { - /* No toc owner? Something is very wrong. */ - abort (); - } + /* No toc owner? Something is very wrong. */ + abort (); s = bfd_get_section_by_name ( bfd_of_toc_owner , TOC_SECTION_NAME); if (s == NULL) - { - /* No toc section? Something is very wrong. */ - abort (); - } + /* No toc section? Something is very wrong. */ + abort (); amt = global_toc_size; foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt); @@ -1720,58 +1704,55 @@ ppc_process_before_allocation (abfd, info) asection *sec; struct internal_reloc *i, *rel; - /* here we have a bfd that is to be included on the link. We have a hook + /* Here we have a bfd that is to be included on the link. We have a hook to do reloc rummaging, before section sizes are nailed down. */ + _bfd_coff_get_external_symbols (abfd); - _bfd_coff_get_external_symbols(abfd); - - /* rummage around all the relocs and map the toc */ + /* Rummage around all the relocs and map the toc. */ sec = abfd->sections; if (sec == 0) - { - return TRUE; - } + return TRUE; for (; sec != 0; sec = sec->next) - { - if (sec->reloc_count == 0) - continue; + { + if (sec->reloc_count == 0) + continue; - /* load the relocs */ - /* FIXME: there may be a storage leak here */ - i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0); + /* load the relocs */ + /* FIXME: there may be a storage leak here */ + i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0); - if (i == 0) - abort (); + if (i == 0) + abort (); - for (rel=i;rel<i+sec->reloc_count;++rel) - { - unsigned short r_type = EXTRACT_TYPE (rel->r_type); - unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); - bfd_boolean ok = TRUE; + for (rel = i; rel < i + sec->reloc_count; ++rel) + { + unsigned short r_type = EXTRACT_TYPE (rel->r_type); + unsigned short r_flags = EXTRACT_FLAGS (rel->r_type); + bfd_boolean ok = TRUE; - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, rel); - switch(r_type) - { - case IMAGE_REL_PPC_TOCREL16: - /* if TOCDEFN is on, ignore as someone else has allocated the - toc entry */ - if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN ) - ok = ppc_record_toc_entry(abfd, info, sec, - rel->r_symndx, default_toc); - if (!ok) - return FALSE; - break; - case IMAGE_REL_PPC_IMGLUE: - ppc_mark_symbol_as_glue(abfd, rel->r_symndx, rel); - break; - default: - break; - } - } - } + switch(r_type) + { + case IMAGE_REL_PPC_TOCREL16: + /* If TOCDEFN is on, ignore as someone else has allocated the + toc entry. */ + if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN) + ok = ppc_record_toc_entry(abfd, info, sec, + rel->r_symndx, default_toc); + if (!ok) + return FALSE; + break; + case IMAGE_REL_PPC_IMGLUE: + ppc_mark_symbol_as_glue (abfd, rel->r_symndx, rel); + break; + default: + break; + } + } + } return TRUE; } @@ -1779,13 +1760,8 @@ ppc_process_before_allocation (abfd, info) #endif static bfd_reloc_status_type -ppc_refhi_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_refhi_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1806,13 +1782,8 @@ ppc_refhi_reloc (abfd, #if 0 static bfd_reloc_status_type -ppc_reflo_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_reflo_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; @@ -1833,13 +1804,8 @@ ppc_reflo_reloc (abfd, #endif static bfd_reloc_status_type -ppc_pair_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_pair_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1858,13 +1824,8 @@ ppc_pair_reloc (abfd, } static bfd_reloc_status_type -ppc_toc16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_toc16_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1873,33 +1834,24 @@ ppc_toc16_reloc (abfd, bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; { - UN_IMPL("TOCREL16"); - DUMP_RELOC("TOCREL16",reloc_entry); + UN_IMPL ("TOCREL16"); + DUMP_RELOC ("TOCREL16",reloc_entry); if (output_bfd == (bfd *) NULL) - { - return bfd_reloc_continue; - } + return bfd_reloc_continue; return bfd_reloc_ok; } #if 0 -/* ADDR32NB : 32 bit address relative to the virtual origin. */ -/* (On the alpha, this is always a linker generated thunk)*/ -/* (i.e. 32bit addr relative to the image base) */ -/* */ -/* */ +/* ADDR32NB : 32 bit address relative to the virtual origin. + (On the alpha, this is always a linker generated thunk) + (i.e. 32bit addr relative to the image base). */ static bfd_reloc_status_type -ppc_addr32nb_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_addr32nb_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; @@ -1917,13 +1869,8 @@ ppc_addr32nb_reloc (abfd, #endif static bfd_reloc_status_type -ppc_secrel_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_secrel_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1942,13 +1889,8 @@ ppc_secrel_reloc (abfd, } static bfd_reloc_status_type -ppc_section_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_section_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1967,13 +1909,8 @@ ppc_section_reloc (abfd, } static bfd_reloc_status_type -ppc_imglue_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_imglue_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1996,17 +1933,14 @@ ppc_imglue_reloc (abfd, /* FIXME: There is a possiblity that when we read in a reloc from a file, that there are some bits encoded in the upper portion of the - type field. Not yet implemented. -*/ -static void ppc_coff_rtype2howto PARAMS ((arelent *relent, - struct internal_reloc *internal)); + type field. Not yet implemented. */ +static void ppc_coff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); static void ppc_coff_rtype2howto (relent, internal) arelent *relent; struct internal_reloc *internal; { - /* We can encode one of three things in the type field, aside from the type: 1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction @@ -2015,19 +1949,18 @@ ppc_coff_rtype2howto (relent, internal) the branch is expected to be taken or not. 3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file For now, we just strip this stuff to find the type, and ignore it other - than that. - */ + than that. */ reloc_howto_type *howto; unsigned short r_type = EXTRACT_TYPE (internal->r_type); unsigned short r_flags = EXTRACT_FLAGS(internal->r_type); unsigned short junk = EXTRACT_JUNK (internal->r_type); - /* the masking process only slices off the bottom byte for r_type. */ + /* The masking process only slices off the bottom byte for r_type. */ if ( r_type > MAX_RELOC_INDEX ) abort (); - /* check for absolute crap */ - if ( junk != 0 ) + /* Check for absolute crap. */ + if (junk != 0) abort (); switch(r_type) @@ -2040,15 +1973,15 @@ ppc_coff_rtype2howto (relent, internal) case IMAGE_REL_PPC_ADDR32NB: case IMAGE_REL_PPC_SECTION: case IMAGE_REL_PPC_SECREL: - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal); howto = ppc_coff_howto_table + r_type; break; case IMAGE_REL_PPC_IMGLUE: - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal); howto = ppc_coff_howto_table + r_type; break; case IMAGE_REL_PPC_TOCREL16: - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal); if (r_flags & IMAGE_REL_PPC_TOCDEFN) howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16_DEFN; else @@ -2064,7 +1997,6 @@ ppc_coff_rtype2howto (relent, internal) } relent->howto = howto; - } static reloc_howto_type * @@ -2086,19 +2018,18 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) the branch is expected to be taken or not. 3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file For now, we just strip this stuff to find the type, and ignore it other - than that. - */ + than that. */ - unsigned short r_type = EXTRACT_TYPE (rel->r_type); - unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); - unsigned short junk = EXTRACT_JUNK (rel->r_type); + unsigned short r_type = EXTRACT_TYPE (rel->r_type); + unsigned short r_flags = EXTRACT_FLAGS (rel->r_type); + unsigned short junk = EXTRACT_JUNK (rel->r_type); - /* the masking process only slices off the bottom byte for r_type. */ - if ( r_type > MAX_RELOC_INDEX ) + /* The masking process only slices off the bottom byte for r_type. */ + if (r_type > MAX_RELOC_INDEX) abort (); - /* check for absolute crap */ - if ( junk != 0 ) + /* Check for absolute crap. */ + if (junk != 0) abort (); switch(r_type) @@ -2141,7 +2072,7 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return howto; } -/* a cheesy little macro to make the code a little more readable */ +/* A cheesy little macro to make the code a little more readable. */ #define HOW2MAP(bfd_rtype,ppc_rtype) \ case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype] @@ -2167,7 +2098,6 @@ ppc_coff_reloc_type_lookup (abfd, code) default: return NULL; } - /*NOTREACHED*/ } #undef HOW2MAP @@ -2229,8 +2159,7 @@ ppc_coff_reloc_type_lookup (abfd, code) 2. It's not clear to me that being the last bfd read necessarily means that you are the last bfd closed. 3. Doing it on a "swap in" hook depends on when the "swap in" is called, - and how often, etc. It's not clear to me that there isn't a hole here. -*/ + and how often, etc. It's not clear to me that there isn't a hole here. */ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); static void @@ -2239,21 +2168,19 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) PTR ext1 ATTRIBUTE_UNUSED; PTR in1; { - struct internal_syment *in = (struct internal_syment *)in1; + struct internal_syment * in = (struct internal_syment *)in1; - if (bfd_of_toc_owner != 0) /* we already have a toc, so go home */ + if (bfd_of_toc_owner != 0) /* We already have a toc, so go home. */ return; - if (strcmp(in->_n._n_name, ".toc") == 0) + if (strcmp (in->_n._n_name, ".toc") == 0) { flagword flags; register asection *s; - s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME); + s = bfd_get_section_by_name (abfd, TOC_SECTION_NAME); if (s != NULL) - { - return; - } + return; flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY ; @@ -2262,12 +2189,10 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) if (s == NULL || !bfd_set_section_flags (abfd, s, flags) || !bfd_set_section_alignment (abfd, s, 2)) - { - /* FIXME: set appropriate bfd error */ - abort (); - } + /* FIXME: set appropriate bfd error. */ + abort (); - /* save the bfd for later allocation */ + /* Save the bfd for later allocation. */ bfd_of_toc_owner = abfd; } @@ -2297,7 +2222,7 @@ ppc_get_last() return bfd_of_toc_owner; } -/* this piece of machinery exists only to guarantee that the bfd that holds +/* This piece of machinery exists only to guarantee that the bfd that holds the toc section is written last. This does depend on bfd_make_section attaching a new section to the @@ -2306,8 +2231,7 @@ ppc_get_last() This is otherwise intended to be functionally the same as cofflink.c:_bfd_coff_final_link(). It is specifically different only where the POWERPC_LE_PE macro modifies the code. It is left in as a - precise form of comment. krk@cygnus.com -*/ + precise form of comment. krk@cygnus.com */ /* Do the final link step. */ @@ -2382,9 +2306,9 @@ ppc_bfd_coff_final_link (abfd, info) { o->reloc_count = 0; o->lineno_count = 0; + for (p = o->link_order_head; p != NULL; p = p->next) { - if (p->type == bfd_indirect_link_order) { asection *sec; @@ -2437,8 +2361,10 @@ ppc_bfd_coff_final_link (abfd, info) amt = abfd->section_count + 1; amt *= sizeof (struct coff_link_section_info); finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt); + if (finfo.section_info == NULL) goto error_return; + for (i = 0; i <= abfd->section_count; i++) { finfo.section_info[i].relocs = NULL; @@ -2451,6 +2377,7 @@ ppc_bfd_coff_final_link (abfd, info) line_filepos = rel_filepos; linesz = bfd_coff_linesz (abfd); max_output_reloc_count = 0; + for (o = abfd->sections; o != NULL; o = o->next) { if (o->lineno_count == 0) @@ -2605,7 +2532,6 @@ ppc_bfd_coff_final_link (abfd, info) #endif /* Free up the buffers used by _bfd_coff_link_input_bfd. */ - coff_debug_merge_hash_table_free (&finfo.debug_merge); debug_merge_allocated = FALSE; diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 7ce60db..ee50a10 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1,24 +1,24 @@ /* 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 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Most of this hacked by Steve Chamberlain, @@ -225,7 +225,7 @@ SUBSUBSECTION 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 hierachy required by coff. It changes each pointer + structured hierarchy required by coff. It changes each pointer to a symbol into the index into the symbol table of the asymbol. o <<coff_write_symbols>> @@ -558,15 +558,15 @@ sec_to_styp_flags (sec_name, sec_flags) /* For now, the read/write bits are mapped onto SEC_READONLY, even though the semantics don't quite match. The bits from the input - are retained in pei_section_data(abfd, section)->pe_flags */ + are retained in pei_section_data(abfd, section)->pe_flags. */ - styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */ + styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */ if ((sec_flags & SEC_READONLY) == 0) - styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write */ + styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */ if (sec_flags & SEC_CODE) - styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE */ + styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */ if (sec_flags & SEC_SHARED) - styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful */ + styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */ return styp_flags; } @@ -693,12 +693,12 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) else sec_flags |= SEC_ALLOC | SEC_LOAD; -#ifdef STYP_LIT /* A29k readonly text/data section type */ +#ifdef STYP_LIT /* A29k readonly text/data section type. */ if ((styp_flags & STYP_LIT) == STYP_LIT) sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY); #endif /* STYP_LIT */ -#ifdef STYP_OTHER_LOAD /* Other loaded sections */ +#ifdef STYP_OTHER_LOAD /* Other loaded sections. */ if (styp_flags & STYP_OTHER_LOAD) sec_flags = (SEC_LOAD | SEC_ALLOC); #endif /* STYP_SDATA */ @@ -802,7 +802,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) gas-generated, and look for <something> (whatever follows the $) as the comdat symbol. */ - /* All 3 branches use this */ + /* All 3 branches use this. */ symname = _bfd_coff_internal_syment_name (abfd, &isym, buf); if (symname == NULL) @@ -930,7 +930,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) #ifndef TARGET_UNDERSCORE #define TARGET_UNDERSCORE 0 #endif - /* Is this the name we're looking for? */ + /* Is this the name we're looking for ? */ if (strcmp (target_name, symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0) { @@ -1344,7 +1344,8 @@ Special entry points for gdb to swap in coff symbol table parts: .#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)) +. ((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)\ @@ -1369,7 +1370,8 @@ Special entry points for gdb to swap in coff symbol table parts: . ((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)\ +.#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)) . @@ -1397,7 +1399,8 @@ Special entry points for gdb to swap in coff symbol table parts: .#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)\ +.#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)) . @@ -1420,14 +1423,13 @@ coff_bad_format_hook (abfd, filehdr) if (BADMAG (*internal_f)) return FALSE; - /* if the optional header is NULL or not the correct size then + /* If the optional header is NULL or not the correct size then quit; the only difference I can see between m88k dgux headers (MC88DMAGIC) and Intel 960 readwrite headers (I960WRMAGIC) is that the optional header is of a different size. But the mips keeps extra stuff in it's opthdr, so dont check - when doing that - */ + when doing that. */ #if defined(M88) || defined(I960) if (internal_f->f_opthdr != 0 && bfd_coff_aoutsz (abfd) != internal_f->f_opthdr) @@ -1453,6 +1455,7 @@ coff_set_custom_section_alignment (abfd, section, alignment_table, table_size) for (i = 0; i < table_size; ++i) { const char *secname = bfd_get_section_name (abfd, section); + if (alignment_table[i].comparison_length == (unsigned int) -1 ? strcmp (alignment_table[i].name, secname) == 0 : strncmp (alignment_table[i].name, secname, @@ -1566,13 +1569,13 @@ coff_set_alignment_hook (abfd, section, scnhdr) unsigned int i; #ifdef I960 - /* Extract ALIGN from 2**ALIGN stored in section header */ + /* Extract ALIGN from 2**ALIGN stored in section header. */ for (i = 0; i < 32; i++) if ((1 << i) >= hdr->s_align) break; #endif #ifdef TIC80COFF - /* TI tools puts the alignment power in bits 8-11 */ + /* TI tools puts the alignment power in bits 8-11. */ i = (hdr->s_flags >> 8) & 0xF ; #endif #ifdef COFF_DECODE_ALIGNMENT @@ -1588,7 +1591,7 @@ coff_set_alignment_hook (abfd, section, scnhdr) #else /* ! COFF_ALIGN_IN_SECTION_HEADER */ #ifdef COFF_WITH_PE -/* a couple of macros to help setting the alignment power field */ +/* A couple of macros to help setting the alignment power field. */ #define ALIGN_SET(field,x,y) \ if (((field) & IMAGE_SCN_ALIGN_64BYTES) == x )\ {\ @@ -1649,7 +1652,7 @@ coff_set_alignment_hook (abfd, section, scnhdr) section->lma = hdr->s_vaddr; - /* check for extended relocs */ + /* Check for extended relocs. */ if (hdr->s_flags & IMAGE_SCN_LNK_NRELOC_OVFL) { struct external_reloc dst; @@ -1745,6 +1748,7 @@ coff_mkobject (abfd) #endif /* Create the COFF backend specific information. */ + #ifndef coff_mkobject_hook static PTR coff_mkobject_hook (abfd, filehdr, aouthdr) @@ -2125,7 +2129,7 @@ coff_set_arch_mach_hook (abfd, filehdr) #ifdef TICOFF0MAGIC #ifdef TICOFF_TARGET_ARCH - /* this TI COFF section should be used by all new TI COFF v0 targets */ + /* This TI COFF section should be used by all new TI COFF v0 targets. */ case TICOFF0MAGIC: arch = TICOFF_TARGET_ARCH; machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags); @@ -2134,8 +2138,8 @@ coff_set_arch_mach_hook (abfd, filehdr) #endif #ifdef TICOFF1MAGIC - /* this TI COFF section should be used by all new TI COFF v1/2 targets */ - /* TI COFF1 and COFF2 use the target_id field to specify which arch */ + /* This TI COFF section should be used by all new TI COFF v1/2 targets. */ + /* TI COFF1 and COFF2 use the target_id field to specify which arch. */ case TICOFF1MAGIC: case TICOFF2MAGIC: switch (internal_f->f_target_id) @@ -2174,7 +2178,7 @@ coff_set_arch_mach_hook (abfd, filehdr) break; #endif - default: /* Unreadable input file type */ + default: /* Unreadable input file type. */ arch = bfd_arch_obscure; break; } @@ -2215,7 +2219,6 @@ static bfd_boolean coff_pointerize_aux_hook PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); -/*ARGSUSED*/ static bfd_boolean coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) bfd *abfd ATTRIBUTE_UNUSED; @@ -2255,7 +2258,6 @@ static bfd_boolean coff_pointerize_aux_hook PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); -/*ARGSUSED*/ static bfd_boolean coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) bfd *abfd ATTRIBUTE_UNUSED; @@ -2360,7 +2362,7 @@ SUBSUBSECTION static int compare_arelent_ptr PARAMS ((const PTR, const PTR)); -/* AUX's ld wants relocations to be sorted */ +/* AUX's ld wants relocations to be sorted. */ static int compare_arelent_ptr (x, y) const PTR x; @@ -2393,7 +2395,7 @@ coff_write_relocs (abfd, first_undef) p = s->orelocation; #else { - /* sort relocations before we write them out */ + /* Sort relocations before we write them out. */ bfd_size_type amt; amt = s->reloc_count; @@ -2412,10 +2414,11 @@ coff_write_relocs (abfd, first_undef) #ifdef COFF_WITH_PE if (obj_pe (abfd) && s->reloc_count >= 0xffff) { - /* encode real count here as first reloc */ + /* Encode real count here as first reloc. */ struct internal_reloc n; + memset ((PTR) & n, 0, sizeof (n)); - /* add one to count *this* reloc (grr) */ + /* Add one to count *this* reloc (grr). */ n.r_vaddr = s->reloc_count + 1; coff_swap_reloc_out (abfd, &n, &dst); if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd), @@ -2428,6 +2431,7 @@ coff_write_relocs (abfd, first_undef) { struct internal_reloc n; arelent *q = p[i]; + memset ((PTR) & n, 0, sizeof (n)); /* Now we've renumbered the symbols we know where the @@ -2445,11 +2449,13 @@ coff_write_relocs (abfd, first_undef) int j; const char *sname = q->sym_ptr_ptr[0]->name; asymbol **outsyms = abfd->outsymbols; + for (j = first_undef; outsyms[j]; j++) { const char *intable = outsyms[j]->name; + if (strcmp (intable, sname) == 0) { - /* got a hit, so repoint the reloc */ + /* Got a hit, so repoint the reloc. */ q->sym_ptr_ptr = outsyms + j; break; } @@ -2492,12 +2498,13 @@ coff_write_relocs (abfd, first_undef) #endif #ifdef SELECT_RELOC - /* Work out reloc type from what is required */ + /* Work out reloc type from what is required. */ SELECT_RELOC (n, q->howto); #else n.r_type = q->howto->type; #endif coff_swap_reloc_out (abfd, &n, &dst); + if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd), abfd) != bfd_coff_relsz (abfd)) return FALSE; @@ -2593,12 +2600,12 @@ coff_set_flags (abfd, magicp, flagsp) #ifdef TICOFF_DEFAULT_MAGIC case TICOFF_TARGET_ARCH: - /* if there's no indication of which version we want, use the default */ + /* If there's no indication of which version we want, use the default. */ if (!abfd->xvec ) *magicp = TICOFF_DEFAULT_MAGIC; else { - /* we may want to output in a different COFF version */ + /* We may want to output in a different COFF version. */ switch (abfd->xvec->name[4]) { case '0': @@ -3091,8 +3098,8 @@ coff_compute_section_file_positions (abfd) #ifdef ALIGN_SECTIONS_IN_FILE if ((abfd->flags & EXEC_P) != 0) { - /* make sure this section is aligned on the right boundary - by - padding the previous section up if necessary */ + /* Make sure this section is aligned on the right boundary - by + padding the previous section up if necessary. */ old_sofar = sofar; #ifdef RS6000COFF_C @@ -3128,9 +3135,7 @@ coff_compute_section_file_positions (abfd) } #endif if (previous != (asection *) NULL) - { - previous->_raw_size += sofar - old_sofar; - } + previous->_raw_size += sofar - old_sofar; } #endif @@ -3152,7 +3157,7 @@ coff_compute_section_file_positions (abfd) sofar += current->_raw_size; #ifdef ALIGN_SECTIONS_IN_FILE - /* make sure that this section is of the right size too */ + /* Make sure that this section is of the right size too. */ if ((abfd->flags & EXEC_P) == 0) { bfd_size_type old_size; @@ -3241,10 +3246,11 @@ coff_add_missing_symbols (abfd) { coff_symbol_type *csym = coff_symbol_from (abfd, sympp[i]); const char *name; + if (csym) { - /* only do this if there is a coff representation of the input - symbol */ + /* Only do this if there is a coff representation of the input + symbol. */ if (csym->native && csym->native->u.syment.n_sclass == C_FILE) { need_file = 0; @@ -3278,11 +3284,11 @@ coff_add_missing_symbols (abfd) if (!sympp2) return FALSE; memcpy (sympp2, sympp, i * sizeof (asymbol *)); + if (need_file) - { - /* @@ Generate fake .file symbol, in sympp2[i], and increment i. */ - abort (); - } + /* @@ Generate fake .file symbol, in sympp2[i], and increment i. */ + abort (); + if (need_text) sympp2[i++] = coff_section_symbol (abfd, _TEXT); if (need_data) @@ -3419,7 +3425,7 @@ coff_write_object_contents (abfd) bfd_set_error (bfd_error_system_call); /* Make a pass through the symbol table to count line number entries and - put them into the correct asections */ + put them into the correct asections. */ lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd); @@ -3431,13 +3437,13 @@ coff_write_object_contents (abfd) reloc_base = obj_relocbase (abfd); - /* Work out the size of the reloc and linno areas */ + /* Work out the size of the reloc and linno areas. */ for (current = abfd->sections; current != NULL; current = current->next) { #ifdef COFF_WITH_PE - /* we store the actual reloc count in the first reloc's addr */ + /* We store the actual reloc count in the first reloc's addr. */ if (obj_pe (abfd) && current->reloc_count >= 0xffff) reloc_count ++; #endif @@ -3449,7 +3455,7 @@ coff_write_object_contents (abfd) lineno_base = reloc_base + reloc_size; sym_base = lineno_base + lnno_size; - /* Indicate in each section->line_filepos its actual file address */ + /* Indicate in each section->line_filepos its actual file address. */ for (current = abfd->sections; current != NULL; current = current->next) { @@ -3468,7 +3474,7 @@ coff_write_object_contents (abfd) current->rel_filepos = reloc_base; reloc_base += current->reloc_count * bfd_coff_relsz (abfd); #ifdef COFF_WITH_PE - /* extra reloc to hold real count */ + /* Extra reloc to hold real count. */ if (obj_pe (abfd) && current->reloc_count >= 0xffff) reloc_base += bfd_coff_relsz (abfd); #endif @@ -3564,19 +3570,14 @@ coff_write_object_contents (abfd) section.s_paddr = 0; #endif - /* - If this section has no size or is unloadable then the scnptr - will be 0 too - */ + /* If this section has no size or is unloadable then the scnptr + will be 0 too. */ if (current->_raw_size == 0 || (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) - { - section.s_scnptr = 0; - } + section.s_scnptr = 0; else - { - section.s_scnptr = current->filepos; - } + section.s_scnptr = current->filepos; + section.s_relptr = current->rel_filepos; section.s_lnnoptr = current->line_filepos; section.s_nreloc = current->reloc_count; @@ -3606,17 +3607,11 @@ coff_write_object_contents (abfd) section.s_flags = sec_to_styp_flags (current->name, current->flags); if (!strcmp (current->name, _TEXT)) - { - text_sec = current; - } + text_sec = current; else if (!strcmp (current->name, _DATA)) - { - data_sec = current; - } + data_sec = current; else if (!strcmp (current->name, _BSS)) - { - bss_sec = current; - } + bss_sec = current; #ifdef I960 section.s_align = (current->alignment_power @@ -3624,7 +3619,7 @@ coff_write_object_contents (abfd) : 0); #endif #ifdef TIC80COFF - /* TI COFF puts the alignment power in bits 8-11 of the flags */ + /* TI COFF puts the alignment power in bits 8-11 of the flags. */ section.s_flags |= (current->alignment_power & 0xF) << 8; #endif #ifdef COFF_ENCODE_ALIGNMENT @@ -3781,14 +3776,11 @@ coff_write_object_contents (abfd) /* Don't include the internal abs section in the section count */ - /* - We will NOT put a fucking timestamp in the header here. Every time you + /* We will NOT put a fucking timestamp in the header here. Every time you put it back, I will come in and take it out again. I'm sorry. This field does not belong here. We fill it with a 0 so it compares the - same but is not a reasonable time. -- gnu@cygnus.com - */ + same but is not a reasonable time. -- gnu@cygnus.com */ internal_f.f_timdat = 0; - internal_f.f_flags = 0; if (abfd->flags & EXEC_P) @@ -3825,18 +3817,16 @@ coff_write_object_contents (abfd) #endif #ifdef TI_TARGET_ID - /* target id is used in TI COFF v1 and later; COFF0 won't use this field, - but it doesn't hurt to set it internally */ + /* Target id is used in TI COFF v1 and later; COFF0 won't use this field, + but it doesn't hurt to set it internally. */ internal_f.f_target_id = TI_TARGET_ID; #endif #ifdef TIC80_TARGET_ID internal_f.f_target_id = TIC80_TARGET_ID; #endif - /* - FIXME, should do something about the other byte orders and - architectures. - */ + /* FIXME, should do something about the other byte orders and + architectures. */ #ifdef RS6000COFF_C if ((abfd->flags & DYNAMIC) != 0) @@ -3847,11 +3837,11 @@ coff_write_object_contents (abfd) memset (&internal_a, 0, sizeof internal_a); - /* Set up architecture-dependent stuff */ - + /* Set up architecture-dependent stuff. */ { unsigned int magic = 0; unsigned short flags = 0; + coff_set_flags (abfd, &magic, &flags); internal_f.f_magic = magic; internal_f.f_flags |= flags; @@ -3860,14 +3850,13 @@ coff_write_object_contents (abfd) #ifdef A29K #ifdef ULTRA3 /* NYU's machine */ /* FIXME: This is a bogus check. I really want to see if there - * is a .shbss or a .shdata section, if so then set the magic - * number to indicate a shared data executable. - */ + is a .shbss or a .shdata section, if so then set the magic + number to indicate a shared data executable. */ if (internal_f.f_nscns >= 7) - internal_a.magic = SHMAGIC; /* Shared magic */ + internal_a.magic = SHMAGIC; /* Shared magic. */ else #endif /* ULTRA3 */ - internal_a.magic = NMAGIC; /* Assume separate i/d */ + internal_a.magic = NMAGIC; /* Assume separate i/d. */ #define __A_MAGIC_SET__ #endif /* A29K */ #ifdef TICOFF_AOUT_MAGIC @@ -3982,7 +3971,7 @@ coff_write_object_contents (abfd) /* FIXME: Does anybody ever set this to another value? */ internal_a.vstamp = 0; - /* Now should write relocs, strings, syms */ + /* Now should write relocs, strings, syms. */ obj_sym_filepos (abfd) = sym_base; if (bfd_get_symcount (abfd) != 0) @@ -4165,7 +4154,7 @@ coff_write_object_contents (abfd) if (abfd->flags & EXEC_P) { /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. - include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */ + include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)). */ char * buff; bfd_size_type amount = bfd_coff_aoutsz (abfd); @@ -4214,7 +4203,7 @@ coff_set_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (! abfd->output_has_begun) /* set by bfd.c handler */ + if (! abfd->output_has_begun) /* Set by bfd.c handler. */ { if (! coff_compute_section_file_positions (abfd)) return FALSE; @@ -4241,7 +4230,7 @@ coff_set_section_contents (abfd, section, location, offset, count) code has been tested on ISC 4.1 by me, and on SCO by Robert Lipe <robertl@arnet.com> (Thanks!). - Gvran Uddeborg <gvran@uddeborg.pp.se> */ + Gvran Uddeborg <gvran@uddeborg.pp.se>. */ if (strcmp (section->name, _LIB) == 0) { @@ -4365,6 +4354,7 @@ coff_slurp_line_table (abfd, asect) while (counter < asect->lineno_count) { struct internal_lineno dst; + bfd_coff_swap_lineno_in (abfd, src, &dst); cache_ptr->line_number = dst.l_lnno; @@ -4430,19 +4420,16 @@ coff_slurp_symbol_table (abfd) coff_symbol_type *cached_area; unsigned int *table_ptr; bfd_size_type amt; - unsigned int number_of_symbols = 0; if (obj_symbols (abfd)) return TRUE; - /* Read in the symbol table */ + /* Read in the symbol table. */ if ((native_symbols = coff_get_normalized_symtab (abfd)) == NULL) - { - return FALSE; - } /* on error */ + return FALSE; - /* Allocate enough room for all the symbols in cached form */ + /* Allocate enough room for all the symbols in cached form. */ amt = obj_raw_syment_count (abfd); amt *= sizeof (coff_symbol_type); cached_area = (coff_symbol_type *) bfd_alloc (abfd, amt); @@ -4460,6 +4447,7 @@ coff_slurp_symbol_table (abfd) coff_symbol_type *dst = cached_area; unsigned int last_native_index = obj_raw_syment_count (abfd); unsigned int this_index = 0; + while (this_index < last_native_index) { combined_entry_type *src = native_symbols + this_index; @@ -4483,8 +4471,7 @@ coff_slurp_symbol_table (abfd) dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL; dst->symbol.flags |= BSF_NOT_AT_END | BSF_FUNCTION; #endif - /* Fall through to next case */ - + /* Fall through to next case. */ #endif case C_EXT: @@ -4497,10 +4484,10 @@ coff_slurp_symbol_table (abfd) case C_HIDEXT: #endif #ifdef C_SYSTEM - case C_SYSTEM: /* System Wide variable */ + case C_SYSTEM: /* System Wide variable. */ #endif #ifdef COFF_WITH_PE - /* In PE, 0x68 (104) denotes a section symbol */ + /* In PE, 0x68 (104) denotes a section symbol. */ case C_SECTION: /* In PE, 0x69 (105) denotes a weak external symbol. */ case C_NT_WEAK: @@ -4574,16 +4561,16 @@ coff_slurp_symbol_table (abfd) break; - case C_STAT: /* static */ + case C_STAT: /* Static. */ #ifdef I960 - case C_LEAFSTAT: /* static leaf procedure */ + case C_LEAFSTAT: /* Static leaf procedure. */ #endif #if defined ARM - case C_THUMBSTAT: /* Thumb static */ - case C_THUMBLABEL: /* Thumb label */ - case C_THUMBSTATFUNC:/* Thumb static function */ + case C_THUMBSTAT: /* Thumb static. */ + case C_THUMBLABEL: /* Thumb label. */ + case C_THUMBSTATFUNC:/* Thumb static function. */ #endif - case C_LABEL: /* label */ + case C_LABEL: /* Label. */ if (src->u.syment.n_scnum == N_DEBUG) dst->symbol.flags = BSF_DEBUGGING; else @@ -4606,35 +4593,35 @@ coff_slurp_symbol_table (abfd) dst->symbol.value = src->u.syment.n_value; break; - case C_MOS: /* member of structure */ - case C_EOS: /* end of structure */ -#ifdef NOTDEF /* C_AUTOARG has the same value */ + case C_MOS: /* Member of structure. */ + case C_EOS: /* End of structure. */ +#ifdef NOTDEF /* C_AUTOARG has the same value. */ #ifdef C_GLBLREG - case C_GLBLREG: /* A29k-specific storage class */ + case C_GLBLREG: /* A29k-specific storage class. */ #endif #endif - case C_REGPARM: /* register parameter */ - case C_REG: /* register variable */ - /* C_AUTOARG conflictes with TI COFF C_UEXT */ + case C_REGPARM: /* Register parameter. */ + case C_REG: /* register variable. */ + /* C_AUTOARG conflictes with TI COFF C_UEXT. */ #if !defined (TIC80COFF) && !defined (TICOFF) #ifdef C_AUTOARG - case C_AUTOARG: /* 960-specific storage class */ + case C_AUTOARG: /* 960-specific storage class. */ #endif #endif - case C_TPDEF: /* type definition */ + case C_TPDEF: /* Type definition. */ case C_ARG: - case C_AUTO: /* automatic variable */ - case C_FIELD: /* bit field */ - case C_ENTAG: /* enumeration tag */ - case C_MOE: /* member of enumeration */ - case C_MOU: /* member of union */ - case C_UNTAG: /* union tag */ + case C_AUTO: /* Automatic variable. */ + case C_FIELD: /* Bit field. */ + case C_ENTAG: /* Enumeration tag. */ + case C_MOE: /* Member of enumeration. */ + case C_MOU: /* Member of union. */ + case C_UNTAG: /* Union tag. */ dst->symbol.flags = BSF_DEBUGGING; dst->symbol.value = (src->u.syment.n_value); break; - case C_FILE: /* file name */ - case C_STRTAG: /* structure tag */ + case C_FILE: /* File name. */ + case C_STRTAG: /* Structure tag. */ #ifdef RS6000COFF_C case C_GSYM: case C_LSYM: @@ -4654,8 +4641,8 @@ coff_slurp_symbol_table (abfd) break; #ifdef RS6000COFF_C - case C_BINCL: /* beginning of include file */ - case C_EINCL: /* ending of include file */ + case C_BINCL: /* Beginning of include file. */ + case C_EINCL: /* Ending of include file. */ /* The value is actually a pointer into the line numbers of the file. We locate the line number entry, and set the section to the section which contains it, and @@ -4696,9 +4683,9 @@ coff_slurp_symbol_table (abfd) break; #endif - case C_BLOCK: /* ".bb" or ".eb" */ - case C_FCN: /* ".bf" or ".ef" (or PE ".lf") */ - case C_EFCN: /* physical end of function */ + case C_BLOCK: /* ".bb" or ".eb". */ + case C_FCN: /* ".bf" or ".ef" (or PE ".lf"). */ + case C_EFCN: /* Physical end of function. */ #if defined COFF_WITH_PE /* PE sets the symbol to a value relative to the start of the section. */ @@ -4720,7 +4707,7 @@ coff_slurp_symbol_table (abfd) #endif break; - case C_STATLAB: /* Static load time label */ + case C_STATLAB: /* Static load time label. */ dst->symbol.value = src->u.syment.n_value; dst->symbol.flags = BSF_GLOBAL; break; @@ -4733,22 +4720,22 @@ coff_slurp_symbol_table (abfd) && src->u.syment.n_scnum == 0) break; /* Fall through. */ - case C_EXTDEF: /* external definition */ - case C_ULABEL: /* undefined label */ - case C_USTATIC: /* undefined static */ + case C_EXTDEF: /* External definition. */ + case C_ULABEL: /* Undefined label. */ + case C_USTATIC: /* Undefined static. */ #ifndef COFF_WITH_PE /* C_LINE in regular coff is 0x68. NT has taken over this storage - class to represent a section symbol */ - case C_LINE: /* line # reformatted as symbol table entry */ + class to represent a section symbol. */ + case C_LINE: /* line # reformatted as symbol table entry. */ /* NT uses 0x67 for a weak symbol, not C_ALIAS. */ - case C_ALIAS: /* duplicate tag */ + case C_ALIAS: /* Duplicate tag. */ #endif - /* New storage classes for TI COFF */ + /* New storage classes for TI COFF. */ #if defined(TIC80COFF) || defined(TICOFF) - case C_UEXT: /* Tentative external definition */ + case C_UEXT: /* Tentative external definition. */ #endif - case C_EXTLAB: /* External load time label */ - case C_HIDDEN: /* ext symbol in dmert public lib */ + case C_EXTLAB: /* External load time label. */ + case C_HIDDEN: /* Ext symbol in dmert public lib. */ default: (*_bfd_error_handler) (_("%s: Unrecognized storage class %d for %s symbol `%s'"), @@ -4768,17 +4755,18 @@ coff_slurp_symbol_table (abfd) this_index += (src->u.syment.n_numaux) + 1; dst++; number_of_symbols++; - } /* walk the native symtab */ - } /* bfdize the native symtab */ + } + } obj_symbols (abfd) = cached_area; obj_raw_syments (abfd) = native_symbols; bfd_get_symcount (abfd) = number_of_symbols; obj_convert (abfd) = table_ptr; - /* Slurp the line tables for each section too */ + /* Slurp the line tables for each section too. */ { asection *p; + p = abfd->sections; while (p) { @@ -4786,6 +4774,7 @@ coff_slurp_symbol_table (abfd) p = p->next; } } + return TRUE; } /* coff_slurp_symbol_table() */ @@ -5012,15 +5001,15 @@ coff_slurp_reloc_table (abfd, asect, symbols) refering to the symbols in the raw data have not been modified, so we have to have a negative addend to compensate. - Note that symbols which used to be common must be left alone */ + Note that symbols which used to be common must be left alone. */ - /* Calculate any reloc addend by looking at the symbol */ + /* Calculate any reloc addend by looking at the symbol. */ CALC_ADDEND (abfd, ptr, dst, cache_ptr); cache_ptr->address -= asect->vma; /* !! cache_ptr->section = (asection *) NULL;*/ - /* Fill in the cache_ptr->howto field from dst.r_type */ + /* Fill in the cache_ptr->howto field from dst.r_type. */ RTYPE2HOWTO (cache_ptr, &dst); #endif /* RELOC_PROCESSING */ @@ -5088,16 +5077,16 @@ coff_canonicalize_reloc (abfd, section, relptr, symbols) if (section->flags & SEC_CONSTRUCTOR) { - /* this section has relocs made up by us, they are not in the - file, so take them out of their chain and place them into - the data area provided */ + /* This section has relocs made up by us, they are not in the + file, so take them out of their chain and place them into + the data area provided. */ arelent_chain *chain = section->constructor_chain; + for (count = 0; count < section->reloc_count; count++) { *relptr++ = &chain->relent; chain = chain->next; } - } else { diff --git a/bfd/config.bfd b/bfd/config.bfd index 96d4765..c678496 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -189,6 +189,10 @@ case "${targ}" in targ_defvec=bfd_elf32_bigarm_vec targ_selvecs=bfd_elf32_littlearm_vec ;; + arm-*-kaos* | strongarm-*-kaos*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec @@ -370,6 +374,10 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; + i[3456]86-*-kaos*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs=bfd_elf32_i386_vec + ;; i[3456]86-*-nto*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec @@ -901,6 +909,11 @@ case "${targ}" in targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; + powerpc-*-kaos*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="bfd_elf32_powerpcle_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" + ;; powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*) targ_defvec=mach_o_be_vec targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" @@ -1025,7 +1038,7 @@ case "${targ}" in targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" ;; - shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf*) + 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 @@ -1033,7 +1046,7 @@ case "${targ}" in #endif targ_underscore=yes ;; - sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself*) + sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself* | 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 diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index cd4bf14..923c250 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -95,7 +95,8 @@ processors[] = { bfd_mach_arm_4, "strongarm"}, { bfd_mach_arm_4, "strongarm110" }, { bfd_mach_arm_4, "strongarm1100" }, - { bfd_mach_arm_XScale, "xscale" } + { bfd_mach_arm_XScale, "xscale" }, + { bfd_mach_arm_ep9312, "ep9312" } }; static bfd_boolean @@ -140,7 +141,8 @@ static const bfd_arch_info_type arch_info_struct[] = N (bfd_mach_arm_5, "armv5", FALSE, & arch_info_struct[7]), N (bfd_mach_arm_5T, "armv5t", FALSE, & arch_info_struct[8]), N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]), - N (bfd_mach_arm_XScale, "xscale", FALSE, NULL) + N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]), + N (bfd_mach_arm_ep9312, "ep9312", FALSE, NULL) }; const bfd_arch_info_type bfd_arm_arch = diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 2af10b0..b133991 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,10 @@ +2003-02-12 Bob Wilson <bob.wilson@acm.org> + + * bfd.texinfo: Fix quotes for texinfo. Make section title + capitalization more consistent. Use @example instead of @lisp. + Replace FDL appendix with include of fdl.texi. + * fdl.texi: New file. + 2002-11-18 Klee Dienes <kdienes@apple.com> * Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi. @@ -172,43 +179,43 @@ Wed May 24 12:03:25 2000 Hans-Peter Nilsson <hp@axis.com> * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. -Fri Apr 7 17:54:38 2000 Andrew Cagney <cagney@b1.cygnus.com> +2000-04-07 Andrew Cagney <cagney@b1.cygnus.com> * Makefile.in: Rebuild with current autoconf/automake. -Thu Feb 4 23:21:36 1999 Ian Lance Taylor <ian@cygnus.com> +1999-02-04 Ian Lance Taylor <ian@cygnus.com> * Makefile.in: Rebuild with current autoconf/automake. -Thu Jul 23 09:36:44 1998 Nick Clifton <nickc@cygnus.com> +1998-07-23 Nick Clifton <nickc@cygnus.com> * bfdint.texi (BFD ELF processor required): Add paragraph describing the necessity to create "include/elf/CPU.h". -Thu May 7 14:45:43 1998 Ian Lance Taylor <ian@cygnus.com> +1998-05-07 Ian Lance Taylor <ian@cygnus.com> * Makefile.am (chew.o): Add -I options for intl srcdir and objdir. * Makefile.in: Rebuild. -Mon Apr 27 20:19:24 1998 Ian Lance Taylor <ian@cygnus.com> +1998-04-27 Ian Lance Taylor <ian@cygnus.com> * bfdint.texi: New file. * Makefile.am (noinst_TEXINFOS): New variable. * Makefile.in: Rebuild. -Mon Apr 13 16:48:56 1998 Ian Lance Taylor <ian@cygnus.com> +1998-04-13 Ian Lance Taylor <ian@cygnus.com> * Makefile.in: Rebuild. -Mon Apr 6 14:06:55 1998 Ian Lance Taylor <ian@cygnus.com> +1998-04-06 Ian Lance Taylor <ian@cygnus.com> * Makefile.am (STAGESTUFF): Remove variable. (CLEANFILES): Don't remove $(STAGESTUFF). (DISTCLEANFILES, MAINTAINERCLEANFILES): New variables. * Makefile.in: Rebuild. -Fri Mar 27 16:25:25 1998 Ian Lance Taylor <ian@cygnus.com> +1998-03-27 Ian Lance Taylor <ian@cygnus.com> * chew.c (skip_white_and_starts): Remove unused declaration. (skip_white_and_stars): Add casts to avoid warnings. @@ -223,12 +230,12 @@ Fri Mar 27 16:25:25 1998 Ian Lance Taylor <ian@cygnus.com> (print): Change printf format string. (main): Call usage for an unrecognized option. -Fri Feb 13 14:37:14 1998 Ian Lance Taylor <ian@cygnus.com> +1998-02-13 Ian Lance Taylor <ian@cygnus.com> * Makefile.am (AUTOMAKE_OPTIONS): Define. * Makefile.in: Rebuild. -Mon Jan 26 15:38:36 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> +1998-01-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * doc.str (bodytext): Don't output @* at the end. * chew.c (kill_bogus_lines): Make sure that a period at the @@ -238,45 +245,45 @@ Mon Jan 26 15:38:36 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund. * Makefile.am (s-reloc, s-syms): Depend on doc.str. * Makefile.in: Rebuild. -Wed Oct 1 14:41:28 1997 Ian Lance Taylor <ian@cygnus.com> +1997-10-01 Ian Lance Taylor <ian@cygnus.com> * Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or elfcode.h as input files; they don't contribute anything. * Makefile.in: Rebuild. -Fri Aug 15 04:55:15 1997 Doug Evans <dje@canuck.cygnus.com> +1997-08-15 Doug Evans <dje@canuck.cygnus.com> * Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC). * Makefile.in: Rebuild. -Fri Aug 1 12:59:58 1997 Ian Lance Taylor <ian@cygnus.com> +1997-08-01 Ian Lance Taylor <ian@cygnus.com> * Makefile.am (CC_FOR_BUILD): Don't set explicitly. * Makefile.in: Rebuild. -Thu Jul 31 20:00:12 1997 Ian Lance Taylor <ian@cygnus.com> +1997-07-31 Ian Lance Taylor <ian@cygnus.com> * Makefile.am: New file, based on old Makefile.in. * Makefile.in: Now built with automake. -Tue Jul 22 14:44:00 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE> +1997-07-22 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE> * Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi rather than bfd.texi. (DOCFILES): Change bfd.texi to bfdt.texi. * bfd.texinfo: Include bfdt.texi, not bfd.texi. -Mon Jun 16 15:33:15 1997 Ian Lance Taylor <ian@cygnus.com> +1997-06-16 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (CC, CFLAGS): Substitute from configure script. From Jeff Makey <jeff@cts.com>. -Tue Apr 15 12:37:41 1997 Ian Lance Taylor <ian@cygnus.com> +1997-04-15 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (install-info): Use mkinstalldirs to build $(infodir). -Tue Apr 8 12:49:46 1997 Ian Lance Taylor <ian@cygnus.com> +1997-04-08 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (install-info): Permit info files to be in srcdir. (stamp-*): Add a stamp-X target for each X.texi target. @@ -285,61 +292,61 @@ Tue Apr 8 12:49:46 1997 Ian Lance Taylor <ian@cygnus.com> (distclean): Depend upon mostlyclean. Remove stamp-*. Don't remove $(DOCFILES). -Mon Apr 7 15:23:26 1997 Ian Lance Taylor <ian@cygnus.com> +1997-04-07 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (distclean): Don't remove *.info files. -Thu Feb 13 20:50:02 1997 Klaus Kaempf (kkaempf@progis.de) +1997-02-13 Klaus Kaempf (kkaempf@progis.de) * makefile.vms: New file. -Tue Jun 18 18:32:28 1996 Ian Lance Taylor <ian@cygnus.com> +1996-06-18 Ian Lance Taylor <ian@cygnus.com> * chew.c (kill_bogus_lines): Reset sl when not at the start of a line. From Uwe Ohse <uwe@tirka.gun.de>. -Tue Jan 30 14:10:46 1996 Ian Lance Taylor <ian@cygnus.com> +1996-01-30 Ian Lance Taylor <ian@cygnus.com> From Ronald F. Guilmette <rfg@monkeys.com>: * Makefile.in (libbfd.h): Depend upon proto.str. (libcoff.h, bfd.h): Likewise. -Fri Nov 3 14:46:48 1995 Fred Fish <fnf@cygnus.com> +1995-11-03 Fred Fish <fnf@cygnus.com> * Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c, renamed from core.c. -Wed Nov 1 14:28:23 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de> +1995-11-01 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de> * chew.c: Include <ctype.h>. -Fri Oct 6 16:23:34 1995 Ken Raeburn <raeburn@cygnus.com> +1995-10-06 Ken Raeburn <raeburn@cygnus.com> Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile.in (Makefile): Only remake this Makefile. -Wed Oct 4 15:51:05 1995 Ken Raeburn <raeburn@cygnus.com> +1995-10-04 Ken Raeburn <raeburn@cygnus.com> * chew.c: Include <stdio.h>. -Tue Sep 12 18:14:50 1995 Ian Lance Taylor <ian@cygnus.com> +1995-09-12 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (maintainer-clean): New target. -Thu Aug 31 12:18:43 1995 Ian Lance Taylor <ian@cygnus.com> +1995-08-31 Ian Lance Taylor <ian@cygnus.com> * Makefile.in (bfd.h): Add additional #endif at end of bfd.h if __cplusplus is defined. -Tue Nov 29 16:13:34 1994 Doug Evans <dje@canuck.cygnus.com> +1994-11-29 Doug Evans <dje@canuck.cygnus.com> * chew.c (write_buffer): New argument `f', all callers changed. (stdout, stderr, print, drop, idrop): New forth words. * proto.str (COMMENT): New command. * doc.str (COMMENT): Likewise. -Mon Sep 12 11:44:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) +1994-09-12 Ian Lance Taylor (ian@sanguine.cygnus.com) * Makefile.in (DOCFILES): Remove ctor.texi. (IPROTOS): Remove ctor.ip. @@ -349,7 +356,7 @@ Mon Sep 12 11:44:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) $(MKDOC) run on $(srcdir)/../ctor.c. * bfd.texinfo (Constructors): Remove section. -Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com) +1994-09-02 Ken Raeburn (raeburn@cujo.cygnus.com) * chew.c: Include assert.h. Added prototypes for most functions. Changed most uses of int to long. Do bounds checking on the @@ -371,46 +378,46 @@ Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com) * doc.str, proto.str: Handle new commands SENUM, ENUM, ENUMX, ENUMEQ, ENUMEQX, ENUMDOC. -Wed Jan 12 18:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) +1994-01-12 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * bfd.texinfo: Added Linker Functions node. * Makefile.in (DOCFILES): Added linker.texi. (SRCDOC): Added linker.c. (linker.texi): New target. -Tue Jan 4 10:52:56 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) +1994-01-04 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * chew.c: Don't rely on a correct declaration of exit. (chew_exit): New function which just calls exit. (main): Use it. -Mon Jan 3 11:40:40 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) +1994-01-03 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * bfd.texinfo: Added Hash Tables node. * Makefile.in (DOCFILES): Added hash.texi. (SRCDOC): Added hash.c. (hash.texi): New target. -Thu Dec 30 16:57:04 1993 Ken Raeburn (raeburn@cujo.cygnus.com) +1993-12-30 Ken Raeburn (raeburn@cujo.cygnus.com) * Makefile.in: Delete all references to seclet.c, since it's just been deleted. Don't mention hash.c, linker.c, or genlink.h yet, since they don't contain documentation yet (hint, hint!). -Fri Nov 5 10:58:53 1993 David J. Mackenzie (djm@thepub.cygnus.com) +1993-11-05 David J. Mackenzie (djm@thepub.cygnus.com) * bfd.texinfo: Small cleanups. -Fri Nov 19 03:46:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) +1993-11-19 Ken Raeburn (raeburn@cambridge.cygnus.com) * Makefile.in (archures.texi): Depends on $(MKDOC). -Tue Aug 10 14:22:39 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) +1993-08-10 Ken Raeburn (raeburn@cambridge.cygnus.com) * bfd.texinfo (BFD back end): Don't include elfcode.texi, since it's empty now and that triggers a makeinfo bug. -Mon Aug 9 16:27:30 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) +1993-08-09 Ken Raeburn (raeburn@cambridge.cygnus.com) * bfd.texinfo (BFD back end): New section on ELF, includes elf.texi and elfcode.texi. @@ -418,74 +425,74 @@ Mon Aug 9 16:27:30 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) (SRCDOC): Include elfcode.h, elf.c. (elf.texi, elfcode.texi): New intermediate targets. -Thu Jun 24 13:48:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) +1993-06-24 David J. Mackenzie (djm@thepub.cygnus.com) * Makefile.in (.c.o, chew.o): Put CFLAGS last. * bfdsumm.texi: New file, broken out of bfd.texinfo, to share with ld.texinfo. -Mon Jun 14 12:07:07 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) +1993-06-14 david d `zoo' zuhn (zoo at rtl.cygnus.com) * Makefile.in (install-info): remove parentdir cruft, -Wed Jun 9 16:00:32 1993 Jim Kingdon (kingdon@cygnus.com) +1993-06-09 Jim Kingdon (kingdon@cygnus.com) * Makefile.in (mostlyclean): Remove chew.o. -Tue May 25 14:46:58 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) +1993-05-25 Ken Raeburn (raeburn@cambridge.cygnus.com) * Makefile.in (libbfd.h): Use elfcode.h, not elf32.c. -Mon May 24 15:50:07 1993 Ken Raeburn (raeburn@cygnus.com) +1993-05-24 Ken Raeburn (raeburn@cygnus.com) * chew.c (compile): Add a couple of missing casts. -Wed May 12 14:45:14 1993 Ian Lance Taylor (ian@cygnus.com) +1993-05-12 Ian Lance Taylor (ian@cygnus.com) * Makefile.in (CC_FOR_BUILD): New variable, define to be $(CC). (chew.o, $(MKDOC)): Build using CC_FOR_BUILD rather than CC, since it must run on the build machine. -Tue Apr 6 22:38:10 1993 John Gilmore (gnu@cygnus.com) +1993-04-07 John Gilmore (gnu@cygnus.com) * Makefile.in (chew): Don't compile from .c to executable in a single step; it puts a temporary .o filename into the executable, which makes multi-stage comparisons fail. Compile chew.c to chew.o, and link that, which makes identical executables every time. -Wed Mar 24 17:26:29 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com) +1993-03-24 david d `zoo' zuhn (zoo at poseidon.cygnus.com) * Makefile.in: fix typo (bfd.texinfo not bfd.texino) -Fri Mar 19 01:13:00 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) +1993-03-19 Ken Raeburn (raeburn@kr-pc.cygnus.com) * bfd.texinfo: Since BFD version number has been bumped, do same to "version number" on title page, and elsewhere. Should be fixed to extract real version number. -Tue Mar 16 12:15:13 1993 Per Bothner (bothner@rtl.cygnus.com) +1993-03-16 Per Bothner (bothner@rtl.cygnus.com) * Makefile.in: Add *clean rules. -Mon Jan 11 18:43:56 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) +1993-01-11 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * Makefile.in (libbfd.h): Removed duplicate init.c and libbfd.c. Added seclet.c. (bfd.h): Added dependency on bfd.c and seclet.c. Added seclet.c to build. -Thu Dec 17 19:35:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) +1992-12-17 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Makefile.in: added dvi target, define and use $(TEXI2DVI) -Thu Dec 3 17:42:48 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) +1992-12-03 Ken Raeburn (raeburn@cambridge.cygnus.com) * Makefile.in (TEXIDIR): New variable. (bfd.dvi): Look for bfd.texinfo in $(srcdir). Generate index. * bfd.texinfo: Minor doc fixes. -Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com) +1992-11-05 John Gilmore (gnu@cygnus.com) Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. @@ -493,70 +500,70 @@ Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com) (paramstuff): Replace exfunstuff with function to generate PARAMS. * proto.str: Use paramstuff rather than exfunstuff. -Mon Aug 17 12:40:32 1992 Steve Chamberlain (sac@thepub.cygnus.com) +1992-08-17 Steve Chamberlain (sac@thepub.cygnus.com) * chew.c: various patches provided by Howard Chu. -Fri Jun 19 18:59:54 1992 John Gilmore (gnu at cygnus.com) +1992-06-19 John Gilmore (gnu at cygnus.com) * Makefile.in (libbfd.h): Add elf.c as a source of prototypes. -Mon May 11 18:55:59 1992 John Gilmore (gnu at cygnus.com) +1992-05-11 John Gilmore (gnu at cygnus.com) * chew.c: exit() should be declared by config files, not by portable source code. Its type could be int or void function. -Mon May 4 13:45:57 1992 K. Richard Pixley (rich@rtl.cygnus.com) +1992-05-04 K. Richard Pixley (rich@rtl.cygnus.com) * Makefile.in: another CFLAGS correction. -Tue Apr 28 10:21:32 1992 K. Richard Pixley (rich@rtl.cygnus.com) +1992-04-28 K. Richard Pixley (rich@rtl.cygnus.com) * Makefile.in: Do the CFLAGS thing. -Fri Apr 10 22:34:52 1992 Fred Fish (fnf@cygnus.com) +1992-04-11 Fred Fish (fnf@cygnus.com) * Makefile.in (MINUS_G): Add macro and default to -g. -Fri Mar 6 18:53:18 1992 Steve Chamberlain (sac@thepub.cygnus.com) +1992-03-06 Steve Chamberlain (sac@thepub.cygnus.com) * chew.c: now has -w switch turn on warnings -Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) +1992-02-26 K. Richard Pixley (rich@cygnus.com) * Makefile.in, configure.in: removed traces of namesubdir, -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced copyrights to '92, changed some from Cygnus to FSF. -Tue Dec 10 22:11:05 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) * Makefile.in: build chew into the current directory. Complete the MKDOC macro transition. -Tue Dec 10 08:26:28 1991 Steve Chamberlain (sac at rtl.cygnus.com) +1991-12-10 Steve Chamberlain (sac at rtl.cygnus.com) * chew.c: don't core dump when can't open file * Makefile.in: get proto.str from the right place when built in odd directories -Tue Dec 10 04:07:25 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) * Makefile.in: infodir belongs in datadir. -Sat Dec 7 17:01:23 1991 Steve Chamberlain (sac at rtl.cygnus.com) +1991-12-07 Steve Chamberlain (sac at rtl.cygnus.com) * chew.c: Much modified * proto.str, doc.str: New files for extracting to product prototypes and documents respectively. -Fri Dec 6 22:57:12 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com) * Makefile.in: added standards.text support, host/site/target inclusion hooks, install using INSTALL_DATA rather than cp, don't echo on install. -Thu Dec 5 22:46:17 1991 K. Richard Pixley (rich at rtl.cygnus.com) +1991-12-05 K. Richard Pixley (rich at rtl.cygnus.com) * Makefile.in: idestdir and ddestdir go away. Added copyrights and shift gpl to v2. Added ChangeLog if it didn't exist. docdir diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo index f12222e..d6a427f 100644 --- a/bfd/doc/bfd.texinfo +++ b/bfd/doc/bfd.texinfo @@ -1,6 +1,6 @@ \input texinfo.tex @setfilename bfd.info -@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000 +@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, 2003 @c Free Software Foundation, Inc. @c @tex @@ -30,14 +30,14 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the BFD library. -Copyright (C) 1991, 2000, 2001 Free Software Foundation, Inc. +Copyright (C) 1991, 2000, 2001, 2003 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". + section entitled ``GNU Free Documentation License''. @ignore Permission is granted to process this file through Tex and print the @@ -75,14 +75,14 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 2001 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2001, 2003 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". + section entitled ``GNU Free Documentation License''. @end titlepage @end iftex @@ -170,17 +170,17 @@ For example, this sequence does what you would probably expect: return the number of sections in an object file attached to a BFD @code{abfd}. -@lisp +@example @c @cartouche #include "bfd.h" -unsigned int number_of_sections(abfd) +unsigned int number_of_sections (abfd) bfd *abfd; @{ - return bfd_count_sections(abfd); + return bfd_count_sections (abfd); @} @c @end cartouche -@end lisp +@end example The abstraction used within BFD is that an object file has: @@ -205,7 +205,7 @@ IEEE-695. @include bfdsumm.texi @node BFD front end, BFD back ends, Overview, Top -@chapter BFD front end +@chapter BFD Front End @include bfdt.texi @include bfdio.texi @@ -228,7 +228,7 @@ IEEE-695. @end menu @node Memory Usage, Initialization, BFD front end, BFD front end -@section Memory usage +@section Memory Usage BFD keeps all of its internal structures in obstacks. There is one obstack per open BFD file, into which the current state is stored. When a BFD is closed, the obstack is deleted, and so everything which has been @@ -324,370 +324,9 @@ All of BFD lives in one directory. @include mmo.texi @node GNU Free Documentation License, Index, BFD back ends, Top -@chapter GNU Free Documentation License -@cindex GNU Free Documentation License - - GNU Free Documentation License - - Version 1.1, March 2000 - - Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - -0. PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -written document "free" in the sense of freedom: to assure everyone -the effective freedom to copy and redistribute it, with or without -modifying it, either commercially or noncommercially. Secondarily, -this License preserves for the author and publisher a way to get -credit for their work, while not being considered responsible for -modifications made by others. - -This License is a kind of "copyleft", which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - - -1. APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work that contains a -notice placed by the copyright holder saying it can be distributed -under the terms of this License. The "Document", below, refers to any -such manual or work. Any member of the public is a licensee, and is -addressed as "you". - -A "Modified Version" of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A "Secondary Section" is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall subject -(or to related matters) and contains nothing that could fall directly -within that overall subject. (For example, if the Document is in part a -textbook of mathematics, a Secondary Section may not explain any -mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The "Invariant Sections" are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. - -The "Cover Texts" are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. - -A "Transparent" copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, whose contents can be viewed and edited directly and -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup has been designed to thwart or discourage -subsequent modification by readers is not Transparent. A copy that is -not "Transparent" is called "Opaque". - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML designed for human modification. Opaque formats include -PostScript, PDF, proprietary formats that can be read and edited only -by proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML produced by some word processors for output -purposes only. - -The "Title Page" means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, "Title Page" means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - - -2. VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - - -3. COPYING IN QUANTITY - -If you publish printed copies of the Document numbering more than 100, -and the Document's license notice requires Cover Texts, you must enclose -the copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a publicly-accessible computer-network location containing a complete -Transparent copy of the Document, free of added material, which the -general network-using public has access to download anonymously at no -charge using public-standard network protocols. If you use the latter -option, you must take reasonably prudent steps, when you begin -distribution of Opaque copies in quantity, to ensure that this -Transparent copy will remain thus accessible at the stated location -until at least one year after the last time you distribute an Opaque -copy (directly or through your agents or retailers) of that edition to -the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. - - -4. MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -A. Use in the Title Page (and on the covers, if any) a title distinct - from that of the Document, and from those of previous versions - (which should, if there were any, be listed in the History section - of the Document). You may use the same title as a previous version - if the original publisher of that version gives permission. -B. List on the Title Page, as authors, one or more persons or entities - responsible for authorship of the modifications in the Modified - Version, together with at least five of the principal authors of the - Document (all of its principal authors, if it has less than five). -C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. -D. Preserve all the copyright notices of the Document. -E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. -F. Include, immediately after the copyright notices, a license notice - giving the public permission to use the Modified Version under the - terms of this License, in the form shown in the Addendum below. -G. Preserve in that license notice the full lists of Invariant Sections - and required Cover Texts given in the Document's license notice. -H. Include an unaltered copy of this License. -I. Preserve the section entitled "History", and its title, and add to - it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section entitled "History" in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence. -J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions - it was based on. These may be placed in the "History" section. - You may omit a network location for a work that was published at - least four years before the Document itself, or if the original - publisher of the version it refers to gives permission. -K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. -L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. -M. Delete any section entitled "Endorsements". Such a section - may not be included in the Modified Version. -N. Do not retitle any existing section as "Endorsements" - or to conflict in title with any Invariant Section. - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section entitled "Endorsements", provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - - -5. COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections entitled "History" -in the various original documents, forming one section entitled -"History"; likewise combine any sections entitled "Acknowledgements", -and any sections entitled "Dedications". You must delete all sections -entitled "Endorsements." - - -6. COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. - - -7. AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, does not as a whole count as a Modified Version -of the Document, provided no compilation copyright is claimed for the -compilation. Such a compilation is called an "aggregate", and this -License does not apply to the other self-contained works thus compiled -with the Document, on account of their being thus compiled, if they -are not themselves derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one quarter -of the entire aggregate, the Document's Cover Texts may be placed on -covers that surround only the Document within the aggregate. -Otherwise they must appear on covers around the whole aggregate. - - -8. TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License provided that you also include the -original English version of this License. In case of a disagreement -between the translation and the original English version of this -License, the original English version will prevail. - - -9. TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. - - -10. FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. See -http://www.gnu.org/copyleft/. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License "or any later version" applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. - - -ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -@smallexample - Copyright (c) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License". -@end smallexample - -If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no -Front-Cover Texts, write "no Front-Cover Texts" instead of -"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. - -@node Index, , GNU Free Documentation License , Top +@include fdl.texi + +@node Index, , GNU Free Documentation License, Top @unnumbered Index @printindex cp @@ -97,6 +97,12 @@ static bfd_boolean elfcore_grok_netbsd_procinfo PARAMS ((bfd *, Elf_Internal_Note *)); static bfd_boolean elfcore_grok_netbsd_note PARAMS ((bfd *, Elf_Internal_Note *)); +static bfd_boolean elfcore_grok_nto_gregs + PARAMS ((bfd *, Elf_Internal_Note *, pid_t)); +static bfd_boolean elfcore_grok_nto_status + PARAMS ((bfd *, Elf_Internal_Note *, pid_t *)); +static bfd_boolean elfcore_grok_nto_note + PARAMS ((bfd *, Elf_Internal_Note *)); /* Swap version information in and out. The version information is currently size independent. If that ever changes, this code will @@ -3542,7 +3548,7 @@ elf_sort_sections (arg1, arg2) /* Put !SEC_LOAD sections after SEC_LOAD ones. */ -#define TOEND(x) (((x)->flags & (SEC_LOAD|SEC_THREAD_LOCAL)) == 0) +#define TOEND(x) (((x)->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0) if (TOEND (sec1)) { @@ -4656,13 +4662,20 @@ copy_private_bfd_data (ibfd, obfd) && ! section->segment_mark) /* Returns TRUE iff seg1 starts after the end of seg2. */ -#define SEGMENT_AFTER_SEGMENT(seg1, seg2) \ - (seg1->p_vaddr >= SEGMENT_END (seg2, seg2->p_vaddr)) - - /* Returns TRUE iff seg1 and seg2 overlap. */ +#define SEGMENT_AFTER_SEGMENT(seg1, seg2, field) \ + (seg1->field >= SEGMENT_END (seg2, seg2->field)) + + /* Returns TRUE iff seg1 and seg2 overlap. Segments overlap iff both + their VMA address ranges and their LMA address ranges overlap. + It is possible to have overlapping VMA ranges without overlapping LMA + ranges. RedBoot images for example can have both .data and .bss mapped + to the same VMA range, but with the .data section mapped to a different + LMA. */ #define SEGMENT_OVERLAPS(seg1, seg2) \ - (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) \ - || SEGMENT_AFTER_SEGMENT (seg2, seg1))) + ( !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_vaddr) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \ + && !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_paddr) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr))) /* Initialise the segment mark field. */ for (section = ibfd->sections; section != NULL; section = section->next) @@ -4760,13 +4773,14 @@ copy_private_bfd_data (ibfd, obfd) continue; /* Compute how many sections might be placed into this segment. */ - section_count = 0; - for (section = ibfd->sections; section != NULL; section = section->next) + for (section = ibfd->sections, section_count = 0; + section != NULL; + section = section->next) if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed)) ++section_count; - - /* Allocate a segment map big enough to contain all of the - sections we have selected. */ + + /* 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 = (struct elf_segment_map *) bfd_alloc (obfd, amt); @@ -4838,7 +4852,7 @@ copy_private_bfd_data (ibfd, obfd) and possibly its LMA changed, and a new segment or segments will have to be created to contain the other sections. - 4. The sections have been moved, but not be the same amount. + 4. The sections have been moved, but not by the same amount. In this case we can change the segment's LMA to match the LMA of the first section and we will have to create a new segment or segments to contain the other sections. @@ -5082,10 +5096,8 @@ copy_private_bfd_data (ibfd, obfd) if (map->p_paddr != 0) break; if (map == NULL) - { - for (map = map_first; map != NULL; map = map->next) - map->p_paddr_valid = 0; - } + for (map = map_first; map != NULL; map = map->next) + map->p_paddr_valid = 0; elf_tdata (obfd)->segment_map = map_first; @@ -6961,6 +6973,104 @@ elfcore_grok_netbsd_note (abfd, note) /* NOTREACHED */ } +static bfd_boolean +elfcore_grok_nto_status (abfd, note, tid) + bfd *abfd; + Elf_Internal_Note *note; + pid_t *tid; +{ + void *ddata = note->descdata; + char buf[100]; + char *name; + asection *sect; + + /* nto_procfs_status 'pid' field is at offset 0. */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, (bfd_byte *) ddata); + + /* nto_procfs_status 'tid' field is at offset 4. */ + elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4); + + /* nto_procfs_status 'what' field is at offset 14. */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, (bfd_byte *) ddata + 14); + + /* Pass tid back. */ + *tid = elf_tdata (abfd)->core_lwpid; + + /* Make a ".qnx_core_status/%d" section. */ + sprintf (buf, ".qnx_core_status/%d", *tid); + + name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + if (name == NULL) + return FALSE; + strcpy (name, buf); + + sect = bfd_make_section (abfd, name); + if (sect == NULL) + return FALSE; + + sect->_raw_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)); +} + +static bfd_boolean +elfcore_grok_nto_gregs (abfd, note, tid) + bfd *abfd; + Elf_Internal_Note *note; + pid_t tid; +{ + char buf[100]; + char *name; + asection *sect; + + /* Make a ".reg/%d" section. */ + sprintf (buf, ".reg/%d", tid); + + name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + if (name == NULL) + return FALSE; + strcpy (name, buf); + + sect = bfd_make_section (abfd, name); + if (sect == NULL) + return FALSE; + + sect->_raw_size = note->descsz; + sect->filepos = note->descpos; + sect->flags = SEC_HAS_CONTENTS; + sect->alignment_power = 2; + + return elfcore_maybe_make_sect (abfd, ".reg", sect); +} + +#define BFD_QNT_CORE_INFO 7 +#define BFD_QNT_CORE_STATUS 8 +#define BFD_QNT_CORE_GREG 9 +#define BFD_QNT_CORE_FPREG 10 + +static bfd_boolean +elfcore_grok_nto_note (abfd, 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; + + switch (note->type) + { + case BFD_QNT_CORE_INFO: return elfcore_make_note_pseudosection (abfd, ".qnx_core_info", note); + case BFD_QNT_CORE_STATUS: return elfcore_grok_nto_status (abfd, note, &tid); + case BFD_QNT_CORE_GREG: return elfcore_grok_nto_gregs (abfd, note, tid); + case BFD_QNT_CORE_FPREG: return elfcore_grok_prfpreg (abfd, note); + default: return TRUE; + } +} + /* Function: elfcore_write_note Inputs: @@ -7200,6 +7310,11 @@ elfcore_read_notes (abfd, offset, size) if (! elfcore_grok_netbsd_note (abfd, &in)) goto error; } + else if (strncmp (in.namedata, "QNX", 3) == 0) + { + if (! elfcore_grok_nto_note (abfd, &in)) + goto error; + } else { if (! elfcore_grok_note (abfd, &in)) diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 48eb873..509b481 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -86,6 +86,8 @@ static void arm_add_to_rel #endif static enum elf_reloc_type_class elf32_arm_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); +static bfd_boolean elf32_arm_object_p + PARAMS ((bfd *)); #ifndef ELFARM_NABI_C_INCLUDED static void record_arm_to_thumb_glue @@ -927,13 +929,16 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, BFD_ASSERT (my_offset <= globals->thumb_glue_size); - /* Now go back and fix up the original BL insn to point - to here. */ - ret_offset = (s->output_offset - + my_offset - - (input_section->output_offset - + offset + addend) - - 8); + /* Now go back and fix up the original BL insn to point to here. */ + ret_offset = + /* Address of where the stub is located. */ + (s->output_section->vma + s->output_offset + my_offset) + /* Address of where the BL is located. */ + - (input_section->output_section->vma + input_section->output_offset + offset) + /* Addend in the relocation. */ + - addend + /* Biassing for PC-relative addressing. */ + - 8; tmp = bfd_get_32 (input_bfd, hit_data - input_section->vma); @@ -2108,6 +2113,20 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, return TRUE; } +/* Set the right machine number. */ + +static bfd_boolean +elf32_arm_object_p (abfd) + bfd *abfd; +{ + /* XXX - we ought to examine a .note section here. */ + + if (elf_elfheader (abfd)->e_flags & EF_ARM_MAVERICK_FLOAT) + bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_ep9312); + + return TRUE; +} + /* Function to keep ARM specific flags in the ELF header. */ static bfd_boolean elf32_arm_set_private_flags (abfd, flags) @@ -2310,12 +2329,28 @@ ERROR: %s passes floats in integer registers, whereas %s passes them in float re { if (in_flags & EF_ARM_VFP_FLOAT) _bfd_error_handler (_("\ -ERROR: %s uses VFP instructions, whereas %s uses FPA instructions"), +ERROR: %s uses VFP instructions, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + else + _bfd_error_handler (_("\ +ERROR: %s uses FPA instructions, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + + flags_compatible = FALSE; + } + + if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT)) + { + if (in_flags & EF_ARM_MAVERICK_FLOAT) + _bfd_error_handler (_("\ +ERROR: %s uses Maverick instructions, whereas %s does not"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); else _bfd_error_handler (_("\ -ERROR: %s uses FPA instructions, whereas %s uses VFP instructions"), +ERROR: %s uses Maverick instructions, whereas %s does not"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); @@ -2410,6 +2445,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr) if (flags & EF_ARM_VFP_FLOAT) fprintf (file, _(" [VFP float format]")); + else if (flags & EF_ARM_MAVERICK_FLOAT) + fprintf (file, _(" [Maverick float format]")); else fprintf (file, _(" [FPA float format]")); @@ -2430,7 +2467,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr) flags &= ~(EF_ARM_INTERWORK | EF_ARM_APCS_26 | EF_ARM_APCS_FLOAT | EF_ARM_PIC | EF_ARM_NEW_ABI | EF_ARM_OLD_ABI - | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT); + | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT + | EF_ARM_MAVERICK_FLOAT); break; case EF_ARM_EABI_VER1: @@ -3622,7 +3660,6 @@ elf32_arm_reloc_type_class (rela) } } - #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM #define ELF_MAXPAGESIZE 0x8000 @@ -3647,6 +3684,7 @@ elf32_arm_reloc_type_class (rela) #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_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 #define elf_backend_can_gc_sections 1 #define elf_backend_plt_readonly 1 diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 6b6c906..40327b6 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1,24 +1,24 @@ /* CRIS-specific support for 32-bit ELF. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson, based on elf32-fr30.c PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -940,7 +940,6 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 2646f3d..b204c57 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1,6 +1,6 @@ /* BFD back-end for HP PA-RISC ELF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Original code by Center for Software Science @@ -8,21 +8,21 @@ University of Utah Largely rewritten by Alan Modra <alan@linuxcare.com.au> -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -111,7 +111,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ : ldw -24(%sp),%rp ; restore the original rp : ldsid (%rp),%r1 : mtsp %r1,%sr0 - : be,n 0(%sr0,%rp) ; inter-space return */ + : be,n 0(%sr0,%rp) ; inter-space return. */ #define PLT_ENTRY_SIZE 8 #define GOT_ENTRY_SIZE 4 @@ -1685,10 +1685,6 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs) bfd_signed_vma *local_got_refcounts; bfd_signed_vma *local_plt_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - struct elf_link_hash_entry *h; - struct elf32_hppa_link_hash_table *htab; - bfd *dynobj; elf_section_data (sec)->local_dynrel = NULL; @@ -1698,112 +1694,81 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs) local_plt_refcounts = local_got_refcounts; if (local_plt_refcounts != NULL) local_plt_refcounts += symtab_hdr->sh_info; - htab = hppa_link_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) - return TRUE; relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch ((unsigned int) ELF32_R_TYPE (rel->r_info)) - { - case R_PARISC_DLTIND14F: - case R_PARISC_DLTIND14R: - case R_PARISC_DLTIND21L: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->got.refcount > 0) - h->got.refcount -= 1; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; - - case R_PARISC_PCREL12F: - case R_PARISC_PCREL17C: - case R_PARISC_PCREL17F: - case R_PARISC_PCREL22F: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount -= 1; - } - break; - - case R_PARISC_PLABEL14R: - case R_PARISC_PLABEL21L: - case R_PARISC_PLABEL32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf32_hppa_link_hash_entry *eh; - struct elf32_hppa_dyn_reloc_entry **pp; - struct elf32_hppa_dyn_reloc_entry *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - if (h->plt.refcount > 0) - h->plt.refcount -= 1; + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - eh = (struct elf32_hppa_link_hash_entry *) h; + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf32_hppa_link_hash_entry *eh; + struct elf32_hppa_dyn_reloc_entry **pp; + struct elf32_hppa_dyn_reloc_entry *p; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { -#if RELATIVE_DYNRELOCS - if (!IS_ABSOLUTE_RELOC (rtype)) - p->relative_count -= 1; -#endif - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - else if (local_plt_refcounts != NULL) - { - if (local_plt_refcounts[r_symndx] > 0) - local_plt_refcounts[r_symndx] -= 1; - } - break; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf32_hppa_link_hash_entry *) h; - case R_PARISC_DIR32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf32_hppa_link_hash_entry *eh; - struct elf32_hppa_dyn_reloc_entry **pp; - struct elf32_hppa_dyn_reloc_entry *p; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + r_type = ELF32_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PARISC_DLTIND14F: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND21L: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; - eh = (struct elf32_hppa_link_hash_entry *) h; + case R_PARISC_PCREL12F: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { -#if RELATIVE_DYNRELOCS - if (!IS_ABSOLUTE_RELOC (R_PARISC_DIR32)) - p->relative_count -= 1; -#endif - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + case R_PARISC_PLABEL14R: + case R_PARISC_PLABEL21L: + case R_PARISC_PLABEL32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + else if (local_plt_refcounts != NULL) + { + if (local_plt_refcounts[r_symndx] > 0) + local_plt_refcounts[r_symndx] -= 1; + } + break; - default: - break; - } + default: + break; + } + } return TRUE; } @@ -2686,12 +2651,15 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) asection *curr; asection *prev; bfd_size_type total; + bfd_boolean big_sec; curr = tail; if (tail->_cooked_size) total = tail->_cooked_size; else total = tail->_raw_size; + big_sec = total >= stub_group_size; + while ((prev = PREV_SEC (curr)) != NULL && ((total += curr->output_offset - prev->output_offset) < stub_group_size)) @@ -2719,8 +2687,11 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) while (tail != curr && (tail = prev) != NULL); /* But wait, there's more! Input sections up to 240000 - bytes before the stub section can be handled by it too. */ - if (!stubs_always_before_branch) + bytes before the stub section can be handled by it too. + Don't do this if we have a really large section after the + stubs, as adding more stubs increases the chance that + branches may not reach into the stub section. */ + if (!stubs_always_before_branch && !big_sec) { total = 0; while (prev != NULL @@ -2901,11 +2872,22 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, if (stub_group_size == 1) { /* Default values. */ - stub_group_size = 7680000; - if (htab->has_17bit_branch || htab->multi_subspace) - stub_group_size = 240000; - if (htab->has_12bit_branch) - stub_group_size = 7500; + if (stubs_always_before_branch) + { + stub_group_size = 7680000; + if (htab->has_17bit_branch || htab->multi_subspace) + stub_group_size = 240000; + if (htab->has_12bit_branch) + stub_group_size = 7500; + } + else + { + stub_group_size = 6971392; + if (htab->has_17bit_branch || htab->multi_subspace) + stub_group_size = 217856; + if (htab->has_12bit_branch) + stub_group_size = 6808; + } } group_sections (htab, stub_group_size, stubs_always_before_branch); @@ -3688,14 +3670,11 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT && h->elf.type != STT_PARISC_MILLI) { - if (info->symbolic && !info->allow_shlib_undefined) - { - if (!((*info->callbacks->undefined_symbol) - (info, h->elf.root.root.string, input_bfd, - input_section, rel->r_offset, FALSE))) - return FALSE; - warned_undef = TRUE; - } + if (!((*info->callbacks->undefined_symbol) + (info, h->elf.root.root.string, input_bfd, + input_section, rel->r_offset, FALSE))) + return FALSE; + warned_undef = TRUE; } else { diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 69292da..a751d98 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1279,9 +1279,6 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -1291,85 +1288,74 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch ((r_type = elf_i386_tls_transition (info, - ELF32_R_TYPE (rel->r_info), - ELF32_R_SYM (rel->r_info) - >= symtab_hdr->sh_info))) - { - case R_386_TLS_LDM: - if (elf_i386_hash_table (info)->tls_ldm_got.refcount > 0) - elf_i386_hash_table (info)->tls_ldm_got.refcount -= 1; - break; - - case R_386_TLS_GD: - case R_386_TLS_IE_32: - case R_386_TLS_IE: - case R_386_TLS_GOTIE: - case R_386_GOT32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->got.refcount > 0) - h->got.refcount -= 1; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - if (r_type != R_386_TLS_IE) - break; - /* Fall through */ + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - case R_386_TLS_LE_32: - case R_386_TLS_LE: - if (!info->shared) - break; - /* Fall through */ + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_i386_link_hash_entry *eh; + struct elf_i386_dyn_relocs **pp; + struct elf_i386_dyn_relocs *p; - case R_386_32: - case R_386_PC32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_i386_link_hash_entry *eh; - struct elf_i386_dyn_relocs **pp; - struct elf_i386_dyn_relocs *p; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf_i386_link_hash_entry *) h; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; + r_type = ELF32_R_TYPE (rel->r_info); + r_type = elf_i386_tls_transition (info, r_type, h != NULL); + switch (r_type) + { + case R_386_TLS_LDM: + if (elf_i386_hash_table (info)->tls_ldm_got.refcount > 0) + elf_i386_hash_table (info)->tls_ldm_got.refcount -= 1; + break; - eh = (struct elf_i386_link_hash_entry *) h; + case R_386_TLS_GD: + case R_386_TLS_IE_32: + case R_386_TLS_IE: + case R_386_TLS_GOTIE: + case R_386_GOT32: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF32_R_TYPE (rel->r_info) == R_386_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + case R_386_32: + case R_386_PC32: + if (info->shared) + break; + /* Fall through */ - case R_386_PLT32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount -= 1; - } - break; + case R_386_PLT32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; - default: - break; - } + default: + break; + } + } return TRUE; } @@ -1523,9 +1509,9 @@ elf_i386_adjust_dynamic_symbol (info, h) will be called from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol routine, we'll need to do something about initializing any .plt and .got entries in elf_i386_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ ((DYN) \ - && ((INFO)->shared \ + && ((SHARED) \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ && ((H)->dynindx != -1 \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) @@ -1567,7 +1553,8 @@ allocate_dynrelocs (h, inf) return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1653,7 +1640,8 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); } else @@ -2261,7 +2249,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) ; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) ; @@ -2290,7 +2277,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared && (info->symbolic || h->dynindx == -1 @@ -2627,7 +2614,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (rel->r_offset >= 2); type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2); switch (type) - { + { case 0x8b: /* movl */ BFD_ASSERT ((val & 0xc7) == 0x05); @@ -2649,7 +2636,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, default: BFD_FAIL (); break; - } + } } bfd_put_32 (output_bfd, -tpoff (info, relocation), contents + rel->r_offset); @@ -2724,7 +2711,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if ((off & 1) != 0) off &= ~1; - else + else { Elf_Internal_Rela outrel; bfd_byte *loc; diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 81c484b..19a2ce8 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -2,21 +2,21 @@ Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -90,7 +90,7 @@ static reloc_howto_type howto_table[] = { HOWTO(R_68K_GLOB_DAT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_GLOB_DAT", FALSE, 0, 0xffffffff,FALSE), HOWTO(R_68K_JMP_SLOT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_JMP_SLOT", FALSE, 0, 0xffffffff,FALSE), HOWTO(R_68K_RELATIVE, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_RELATIVE", FALSE, 0, 0xffffffff,FALSE), - /* GNU extension to record C++ vtable hierarchy */ + /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_68K_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -104,7 +104,7 @@ static reloc_howto_type howto_table[] = { 0, /* src_mask */ 0, /* dst_mask */ FALSE), - /* GNU extension to record C++ vtable member usage */ + /* GNU extension to record C++ vtable member usage. */ HOWTO (R_68K_GNU_VTENTRY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -181,7 +181,6 @@ reloc_type_lookup (abfd, code) #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup #define ELF_ARCH bfd_arch_m68k -/* end code generated by elf.el */ /* Functions for the m68k ELF linker. */ @@ -342,7 +341,7 @@ elf_m68k_link_hash_table_create (abfd) return &ret->root.root; } -/* Keep m68k-specific flags in the ELF header */ +/* Keep m68k-specific flags in the ELF header. */ static bfd_boolean elf32_m68k_set_private_flags (abfd, flags) bfd *abfd; @@ -379,7 +378,7 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd) return TRUE; } -/* Display the flags field */ +/* Display the flags field. */ static bfd_boolean elf32_m68k_print_private_bfd_data (abfd, ptr) bfd *abfd; @@ -1008,13 +1007,11 @@ elf_m68k_adjust_dynamic_symbol (info, h) /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (s != NULL); s->_raw_size += 4; /* We also need to make an entry in the .rela.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rela.plt"); BFD_ASSERT (s != NULL); s->_raw_size += sizeof (Elf32_External_Rela); @@ -1456,7 +1453,6 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 1399f00..cf705d5 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -261,9 +261,11 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit PC relative reference. */ + /* 16 bit PC relative reference. Note that the ABI document has a typo + and claims R_MIPS_PC16 to be not rightshifted, rendering it useless. + We do the right thing here. */ HOWTO (R_MIPS_PC16, /* type */ - 0, /* rightshift */ + 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ @@ -1401,7 +1403,7 @@ static const struct elf_reloc_map mips_reloc_map[] = { BFD_RELOC_GPREL16, R_MIPS_GPREL16 }, { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL }, { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 }, - { BFD_RELOC_16_PCREL, R_MIPS_PC16 }, + { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 }, { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 }, { BFD_RELOC_GPREL32, R_MIPS_GPREL32 }, { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 }, @@ -1458,7 +1460,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return &elf_mips_gnu_rel_hi16; case BFD_RELOC_PCREL_LO16: return &elf_mips_gnu_rel_lo16; - case BFD_RELOC_16_PCREL_S2: + case BFD_RELOC_MIPSEMB_16_PCREL_S2: return &elf_mips_gnu_rel16_s2; case BFD_RELOC_64_PCREL: return &elf_mips_gnu_pcrel64; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index acd9d84..9947af8 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -3,21 +3,21 @@ Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This file is based on a preliminary PowerPC ELF ABI. The information may not match the final PowerPC ELF ABI. It includes @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/ppc.h" +#include "elf32-ppc.h" /* RELA relocations are used here. */ @@ -53,6 +54,8 @@ static bfd_boolean ppc_elf_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); static bfd_reloc_status_type ppc_elf_addr16_ha_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type ppc_elf_unhandled_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_boolean ppc_elf_object_p PARAMS ((bfd *)); static bfd_boolean ppc_elf_set_private_flags @@ -63,7 +66,7 @@ static int ppc_elf_additional_program_headers PARAMS ((bfd *)); static bfd_boolean ppc_elf_modify_segment_map PARAMS ((bfd *)); -static asection *ppc_elf_create_got +static bfd_boolean ppc_elf_create_got PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean ppc_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -74,10 +77,14 @@ static bfd_boolean ppc_elf_fake_sections static elf_linker_section_t *ppc_elf_create_linker_section PARAMS ((bfd *abfd, struct bfd_link_info *info, enum elf_linker_section_enum)); +static bfd_boolean update_local_sym_info + PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned long, int)); +static void bad_shared_reloc + PARAMS ((bfd *, enum elf_ppc_reloc_type)); static bfd_boolean ppc_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection * ppc_elf_gc_mark_hook +static asection *ppc_elf_gc_mark_hook PARAMS ((asection *sec, struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); static bfd_boolean ppc_elf_gc_sweep_hook @@ -110,13 +117,15 @@ static bfd_boolean ppc_elf_grok_prstatus static bfd_boolean ppc_elf_grok_psinfo PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -#define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */ -#define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */ -#define RA_REGISTER_SHIFT 16 /* value to shift register by to insert RA */ +/* Branch prediction bit for branch taken relocs. */ +#define BRANCH_PREDICT_BIT 0x200000 +/* Mask to set RA in memory instructions. */ +#define RA_REGISTER_MASK 0x001f0000 +/* Value to shift register by to insert RA. */ +#define RA_REGISTER_SHIFT 16 /* The name of the dynamic interpreter. This is put in the .interp section. */ - #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" /* The size in bytes of an entry in the procedure linkage table. */ @@ -128,6 +137,15 @@ static bfd_boolean ppc_elf_grok_psinfo /* The number of single-slot PLT entries (the rest use two slots). */ #define PLT_NUM_SINGLE_ENTRIES 8192 +/* Some nop instructions. */ +#define NOP 0x60000000 +#define CROR_151515 0x4def7b82 +#define CROR_313131 0x4ffffb82 + +/* Offset of tp and dtp pointers from start of TLS block. */ +#define TP_OFFSET 0x7000 +#define DTP_OFFSET 0x8000 + /* Will references to this symbol always reference the symbol in this object? */ #define SYMBOL_REFERENCES_LOCAL(INFO, H) \ @@ -161,16 +179,32 @@ struct ppc_elf_dyn_relocs /* Total number of relocs copied for the input section. */ bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; }; /* PPC ELF linker hash entry. */ struct ppc_elf_link_hash_entry { - struct elf_link_hash_entry root; + struct elf_link_hash_entry elf; /* Track dynamic relocs copied for this symbol. */ struct ppc_elf_dyn_relocs *dyn_relocs; + + /* Contexts in which symbol is used in the GOT (or TOC). + TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the + corresponding relocs are encountered during check_relocs. + tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to + indicate the corresponding GOT entry type is not needed. */ +#define TLS_GD 1 /* GD reloc. */ +#define TLS_LD 2 /* LD reloc. */ +#define TLS_TPREL 4 /* TPREL reloc, => IE. */ +#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */ +#define TLS_TLS 16 /* Any TLS reloc. */ +#define TLS_TPRELGD 32 /* TPREL reloc resulting from GD->IE. */ + char tls_mask; }; #define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent)) @@ -179,7 +213,31 @@ struct ppc_elf_link_hash_entry struct ppc_elf_link_hash_table { - struct elf_link_hash_table root; + struct elf_link_hash_table elf; + + /* Short-cuts to get to dynamic linker sections. */ + asection *got; + asection *relgot; + asection *plt; + asection *relplt; + asection *dynbss; + asection *relbss; + asection *dynsbss; + asection *relsbss; + elf_linker_section_t *sdata; + elf_linker_section_t *sdata2; + + /* Short-cut to first output tls section. */ + asection *tls_sec; + + /* Shortcut to .__tls_get_addr. */ + struct elf_link_hash_entry *tls_get_addr; + + /* TLS local dynamic got entry handling. */ + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tlsld_got; /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; @@ -211,7 +269,10 @@ ppc_elf_link_hash_newfunc (entry, table, string) /* Call the allocation method of the superclass. */ entry = _bfd_elf_link_hash_newfunc (entry, table, string); if (entry != NULL) - ppc_elf_hash_entry (entry)->dyn_relocs = NULL; + { + ppc_elf_hash_entry (entry)->dyn_relocs = NULL; + ppc_elf_hash_entry (entry)->tls_mask = 0; + } return entry; } @@ -229,16 +290,29 @@ ppc_elf_link_hash_table_create (abfd) if (ret == NULL) return NULL; - if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, + if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, ppc_elf_link_hash_newfunc)) { free (ret); return NULL; } + ret->got = NULL; + ret->relgot = NULL; + ret->plt = NULL; + ret->relplt = NULL; + ret->dynbss = NULL; + ret->relbss = NULL; + ret->dynsbss = NULL; + ret->relsbss = NULL; + ret->sdata = NULL; + ret->sdata2 = NULL; + ret->tls_sec = NULL; + ret->tls_get_addr = NULL; + ret->tlsld_got.refcount = 0; ret->sym_sec.abfd = NULL; - return &ret->root.root; + return &ret->elf.root; } /* Copy the extra info we tack onto an elf_link_hash_entry. */ @@ -272,6 +346,7 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind) for (q = edir->dyn_relocs; q != NULL; q = q->next) if (q->sec == p->sec) { + q->pc_count += p->pc_count; q->count += p->count; *pp = p->next; break; @@ -286,6 +361,8 @@ ppc_elf_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } + edir->tls_mask |= eind->tls_mask; + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } @@ -878,10 +955,440 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ + /* Marker reloc for TLS. */ + HOWTO (R_PPC_TLS, + 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_PPC_TLS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Computes the load module index of the load module that contains the + definition of its TLS sym. */ + HOWTO (R_PPC_DTPMOD32, + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPMOD32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Computes a dtv-relative displacement, the difference between the value + of sym+add and the base address of the thread-local storage block that + contains the definition of sym, minus 0x8000. */ + HOWTO (R_PPC_DTPREL32, + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit dtprel reloc. */ + HOWTO (R_PPC_DTPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like DTPREL16, but no overflow. */ + HOWTO (R_PPC_DTPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like DTPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_DTPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like DTPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_DTPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Computes a tp-relative displacement, the difference between the value of + sym+add and the value of the thread pointer (r13). */ + HOWTO (R_PPC_TPREL32, + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit tprel reloc. */ + HOWTO (R_PPC_TPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16, but no overflow. */ + HOWTO (R_PPC_TPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_TPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_TPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates two contiguous entries in the GOT to hold a tls_index structure, + with values (sym+add)@dtpmod and (sym+add)@dtprel, and computes the offset + to the first entry. */ + HOWTO (R_PPC_GOT_TLSGD16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSGD16, but no overflow. */ + HOWTO (R_PPC_GOT_TLSGD16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSGD16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_TLSGD16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSGD16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_TLSGD16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates two contiguous entries in the GOT to hold a tls_index structure, + with values (sym+add)@dtpmod and zero, and computes the offset to the + first entry. */ + HOWTO (R_PPC_GOT_TLSLD16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSLD16, but no overflow. */ + HOWTO (R_PPC_GOT_TLSLD16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSLD16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_TLSLD16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSLD16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_TLSLD16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates an entry in the GOT with value (sym+add)@dtprel, and computes + the offset to the entry. */ + HOWTO (R_PPC_GOT_DTPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_DTPREL16, but no overflow. */ + HOWTO (R_PPC_GOT_DTPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_DTPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_DTPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_DTPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_DTPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates an entry in the GOT with value (sym+add)@tprel, and computes the + offset to the entry. */ + HOWTO (R_PPC_GOT_TPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16, but no overflow. */ + HOWTO (R_PPC_GOT_TPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_TPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_TPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ - /* 32 bit value resulting from the addend minus the symbol */ + /* 32 bit value resulting from the addend minus the symbol. */ HOWTO (R_PPC_EMB_NADDR32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -896,7 +1403,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit value resulting from the addend minus the symbol */ + /* 16 bit value resulting from the addend minus the symbol. */ HOWTO (R_PPC_EMB_NADDR16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -911,7 +1418,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit value resulting from the addend minus the symbol */ + /* 16 bit value resulting from the addend minus the symbol. */ HOWTO (R_PPC_EMB_NADDR16_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -926,7 +1433,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* The high order 16 bits of the addend minus the symbol */ + /* The high order 16 bits of the addend minus the symbol. */ HOWTO (R_PPC_EMB_NADDR16_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -960,7 +1467,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { /* 16 bit value resulting from allocating a 4 byte word to hold an address in the .sdata section, and returning the offset from - _SDA_BASE_ for that relocation */ + _SDA_BASE_ for that relocation. */ HOWTO (R_PPC_EMB_SDAI16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -977,7 +1484,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { /* 16 bit value resulting from allocating a 4 byte word to hold an address in the .sdata2 section, and returning the offset from - _SDA2_BASE_ for that relocation */ + _SDA2_BASE_ for that relocation. */ HOWTO (R_PPC_EMB_SDA2I16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1049,7 +1556,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable hierarchy */ + /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_PPC_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1064,7 +1571,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* dst_mask */ FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable member usage */ + /* GNU extension to record C++ vtable member usage. */ HOWTO (R_PPC_GNU_VTENTRY, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1079,7 +1586,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* dst_mask */ FALSE), /* pcrel_offset */ - /* Phony reloc to handle AIX style TOC entries */ + /* Phony reloc to handle AIX style TOC entries. */ HOWTO (R_PPC_TOC16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1129,8 +1636,7 @@ ppc_elf_howto_init () 3/ Conditional forward branches - Ensure that the "inverse prediction bit" is set (ensure it is predicted taken). 4/ Conditional register branches - Ensure that the "y bit" is set - (ensure it is predicted taken). -*/ + (ensure it is predicted taken). */ /* Sort sections by address. */ @@ -1167,7 +1673,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* If needed, initialize this section's cooked size. */ if (isec->_cooked_size == 0) - isec->_cooked_size = isec->_raw_size; + isec->_cooked_size = isec->_raw_size; /* We're only interested in text sections which overlap the troublesome area at the end of a page. */ @@ -1179,7 +1685,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* Get the section contents. */ /* Get cached copy if it exists. */ if (elf_section_data (isec)->this_hdr.contents != NULL) - contents = elf_section_data (isec)->this_hdr.contents; + contents = elf_section_data (isec)->this_hdr.contents; else { /* Go get them off disk. */ @@ -1197,55 +1703,58 @@ ppc_elf_relax_section (abfd, isec, link_info, again) comb_count = 0; if (isec->reloc_count) { - unsigned n; + unsigned n; bfd_size_type amt; - /* Get a copy of the native relocations. */ - internal_relocs = _bfd_elf32_link_read_relocs ( - abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL, - link_info->keep_memory); - if (internal_relocs == NULL) - goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; + /* Get a copy of the native relocations. */ + internal_relocs + = _bfd_elf32_link_read_relocs (abfd, isec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + link_info->keep_memory); + if (internal_relocs == NULL) + goto error_return; + if (! link_info->keep_memory) + free_relocs = internal_relocs; - /* Setup a faster access method for the reloc info we need. */ + /* Setup a faster access method for the reloc info we need. */ amt = isec->reloc_count; amt *= sizeof (Elf_Internal_Rela*); - rela_comb = (Elf_Internal_Rela**) bfd_malloc (amt); - if (rela_comb == NULL) - goto error_return; - for (n = 0; n < isec->reloc_count; ++n) - { - long r_type; - - r_type = ELF32_R_TYPE (internal_relocs[n].r_info); - if (r_type < 0 || r_type >= (int) R_PPC_max) - goto error_return; - - /* Prologue constants are sometimes present in the ".text" - sections and they can be identified by their associated relocation. - We don't want to process those words and some others which - can also be identified by their relocations. However, not all - conditional branches will have a relocation so we will - only ignore words that 1) have a reloc, and 2) the reloc - is not applicable to a conditional branch. - The array rela_comb is built here for use in the EOP scan loop. */ - switch (r_type) - { - case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */ - case R_PPC_REL14: /* relative cond. br. */ - case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */ - /* We should check the instruction. */ - break; - default: - /* The word is not a conditional branch - ignore it. */ - rela_comb[comb_count++] = &internal_relocs[n]; - break; - } - } - if (comb_count > 1) - qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela); + rela_comb = (Elf_Internal_Rela**) bfd_malloc (amt); + if (rela_comb == NULL) + goto error_return; + for (n = 0; n < isec->reloc_count; ++n) + { + long r_type; + + r_type = ELF32_R_TYPE (internal_relocs[n].r_info); + if (r_type < 0 || r_type >= (int) R_PPC_max) + goto error_return; + + /* Prologue constants are sometimes present in the ".text" + sections and they can be identified by their associated + relocation. We don't want to process those words and + some others which can also be identified by their + relocations. However, not all conditional branches will + have a relocation so we will only ignore words that + 1) have a reloc, and 2) the reloc is not applicable to a + conditional branch. The array rela_comb is built here + for use in the EOP scan loop. */ + switch (r_type) + { + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_REL14: + case R_PPC_REL14_BRNTAKEN: + /* We should check the instruction. */ + break; + default: + /* The word is not a conditional branch - ignore it. */ + rela_comb[comb_count++] = &internal_relocs[n]; + break; + } + } + if (comb_count > 1) + qsort (rela_comb, (size_t) comb_count, sizeof (int), + ppc_elf_sort_rela); } /* Enumerate each EOP region that overlaps this section. */ @@ -1253,99 +1762,104 @@ ppc_elf_relax_section (abfd, isec, link_info, again) dot = end_page = (isec->vma | (PAGESIZE - 1)) + 1; dot -= link_info->mpc860c0; section_modified = FALSE; - if (dot < isec->vma) /* Increment the start position if this section */ - dot = isec->vma; /* begins in the middle of its first EOP region. */ + /* Increment the start position if this section begins in the + middle of its first EOP region. */ + if (dot < isec->vma) + dot = isec->vma; for (; - dot < end_section; - dot += PAGESIZE, end_page += PAGESIZE) - { - - /* Check each word in this EOP region. */ - for (; dot < end_page; dot += 4) - { - bfd_vma isec_offset; - unsigned long insn; - bfd_boolean skip, modified; - - /* Don't process this word if there is a relocation for it and - the relocation indicates the word is not a conditional branch. */ - skip = FALSE; - isec_offset = dot - isec->vma; - for (; comb_curr<comb_count; ++comb_curr) - { - bfd_vma r_offset; - - r_offset = rela_comb[comb_curr]->r_offset; - if (r_offset >= isec_offset) - { - if (r_offset == isec_offset) skip = TRUE; - break; - } - } - if (skip) continue; - - /* Check the current word for a problematic conditional branch. */ + dot < end_section; + dot += PAGESIZE, end_page += PAGESIZE) + { + /* Check each word in this EOP region. */ + for (; dot < end_page; dot += 4) + { + bfd_vma isec_offset; + unsigned long insn; + bfd_boolean skip, modified; + + /* Don't process this word if there is a relocation for it + and the relocation indicates the word is not a + conditional branch. */ + skip = FALSE; + isec_offset = dot - isec->vma; + for (; comb_curr<comb_count; ++comb_curr) + { + bfd_vma r_offset; + + r_offset = rela_comb[comb_curr]->r_offset; + if (r_offset >= isec_offset) + { + if (r_offset == isec_offset) skip = TRUE; + break; + } + } + if (skip) continue; + + /* Check the current word for a problematic conditional + branch. */ #define BO0(insn) ((insn) & 0x02000000) #define BO2(insn) ((insn) & 0x00800000) #define BO4(insn) ((insn) & 0x00200000) - insn = (unsigned long) bfd_get_32 (abfd, contents + isec_offset); - modified = FALSE; - if ((insn & 0xFc000000) == 0x40000000) - { - /* Instruction is BCx */ - if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) - { - bfd_vma target; - /* This branch is predicted as "normal". - If this is a forward branch, it is problematic. */ - - target = insn & 0x0000Fffc; /*extract*/ - target = (target ^ 0x8000) - 0x8000; /*sign extend*/ - if ((insn & 0x00000002) == 0) - target += dot; /*convert to abs*/ - if (target > dot) - { - insn |= 0x00200000; /* set the prediction bit */ - modified = TRUE; - } - } - } - else if ((insn & 0xFc00Fffe) == 0x4c000420) - { - /* Instruction is BCCTRx */ - if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) + insn = (unsigned long) bfd_get_32 (abfd, contents + isec_offset); + modified = FALSE; + if ((insn & 0xFc000000) == 0x40000000) + { + /* Instruction is BCx */ + if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) + { + bfd_vma target; + + /* This branch is predicted as "normal". + If this is a forward branch, it is problematic. */ + target = insn & 0x0000Fffc; + target = (target ^ 0x8000) - 0x8000; + if ((insn & 0x00000002) == 0) + /* Convert to abs. */ + target += dot; + if (target > dot) + { + /* Set the prediction bit. */ + insn |= 0x00200000; + modified = TRUE; + } + } + } + else if ((insn & 0xFc00Fffe) == 0x4c000420) + { + /* Instruction is BCCTRx. */ + if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) { /* This branch is predicted as not-taken. - If this is a forward branch, it is problematic. - Since we can't tell statically if it will branch forward, - always set the prediction bit. */ - insn |= 0x00200000; /* set the prediction bit */ - modified = TRUE; + If this is a forward branch, it is problematic. + Since we can't tell statically if it will branch + forward, always set the prediction bit. */ + insn |= 0x00200000; + modified = TRUE; } - } - else if ((insn & 0xFc00Fffe) == 0x4c000020) - { - /* Instruction is BCLRx */ - if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) + } + else if ((insn & 0xFc00Fffe) == 0x4c000020) + { + /* Instruction is BCLRx */ + if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) { /* This branch is predicted as not-taken. - If this is a forward branch, it is problematic. - Since we can't tell statically if it will branch forward, - always set the prediction bit. */ - insn |= 0x00200000; /* set the prediction bit */ - modified = TRUE; + If this is a forward branch, it is problematic. + Since we can't tell statically if it will branch + forward, always set the prediction bit. */ + insn |= 0x00200000; + modified = TRUE; } - } + } #undef BO0 #undef BO2 #undef BO4 - if (modified) - { - bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset); + if (modified) + { + bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset); section_modified = TRUE; - } - } - } + } + } + } if (section_modified) { elf_section_data (isec)->this_hdr.contents = contents; @@ -1379,7 +1893,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) return TRUE; -error_return: + error_return: if (rela_comb != NULL) free (rela_comb); if (free_relocs != NULL) @@ -1394,7 +1908,7 @@ ppc_elf_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { - enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; + enum elf_ppc_reloc_type r; if (!ppc_elf_howto_table[R_PPC_ADDR32]) /* Initialize howto table if needed. */ @@ -1405,62 +1919,90 @@ ppc_elf_reloc_type_lookup (abfd, code) default: return (reloc_howto_type *) NULL; - case BFD_RELOC_NONE: ppc_reloc = R_PPC_NONE; break; - case BFD_RELOC_32: ppc_reloc = R_PPC_ADDR32; break; - case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC_ADDR24; break; - case BFD_RELOC_16: ppc_reloc = R_PPC_ADDR16; break; - case BFD_RELOC_LO16: ppc_reloc = R_PPC_ADDR16_LO; break; - case BFD_RELOC_HI16: ppc_reloc = R_PPC_ADDR16_HI; break; - case BFD_RELOC_HI16_S: ppc_reloc = R_PPC_ADDR16_HA; break; - case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC_ADDR14; break; - case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC_ADDR14_BRTAKEN; break; - case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC_ADDR14_BRNTAKEN; break; - case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC_REL24; break; - case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC_REL14; break; - case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC_REL14_BRTAKEN; break; - case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC_REL14_BRNTAKEN; break; - case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC_GOT16; break; - case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC_GOT16_LO; break; - case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC_GOT16_HI; break; - case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC_GOT16_HA; break; - case BFD_RELOC_24_PLT_PCREL: ppc_reloc = R_PPC_PLTREL24; break; - case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC_COPY; break; - case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC_GLOB_DAT; break; - case BFD_RELOC_PPC_LOCAL24PC: ppc_reloc = R_PPC_LOCAL24PC; break; - case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC_REL32; break; - case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC_PLT32; break; - case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC_PLTREL32; break; - case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC_PLT16_LO; break; - case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC_PLT16_HI; break; - case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC_PLT16_HA; break; - case BFD_RELOC_GPREL16: ppc_reloc = R_PPC_SDAREL16; break; - case BFD_RELOC_16_BASEREL: ppc_reloc = R_PPC_SECTOFF; break; - case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC_SECTOFF_LO; break; - case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC_SECTOFF_HI; break; - case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC_SECTOFF_HA; break; - case BFD_RELOC_CTOR: ppc_reloc = R_PPC_ADDR32; break; - case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC_TOC16; break; - case BFD_RELOC_PPC_EMB_NADDR32: ppc_reloc = R_PPC_EMB_NADDR32; break; - case BFD_RELOC_PPC_EMB_NADDR16: ppc_reloc = R_PPC_EMB_NADDR16; break; - case BFD_RELOC_PPC_EMB_NADDR16_LO: ppc_reloc = R_PPC_EMB_NADDR16_LO; break; - case BFD_RELOC_PPC_EMB_NADDR16_HI: ppc_reloc = R_PPC_EMB_NADDR16_HI; break; - case BFD_RELOC_PPC_EMB_NADDR16_HA: ppc_reloc = R_PPC_EMB_NADDR16_HA; break; - case BFD_RELOC_PPC_EMB_SDAI16: ppc_reloc = R_PPC_EMB_SDAI16; break; - case BFD_RELOC_PPC_EMB_SDA2I16: ppc_reloc = R_PPC_EMB_SDA2I16; break; - case BFD_RELOC_PPC_EMB_SDA2REL: ppc_reloc = R_PPC_EMB_SDA2REL; break; - case BFD_RELOC_PPC_EMB_SDA21: ppc_reloc = R_PPC_EMB_SDA21; break; - case BFD_RELOC_PPC_EMB_MRKREF: ppc_reloc = R_PPC_EMB_MRKREF; break; - case BFD_RELOC_PPC_EMB_RELSEC16: ppc_reloc = R_PPC_EMB_RELSEC16; break; - case BFD_RELOC_PPC_EMB_RELST_LO: ppc_reloc = R_PPC_EMB_RELST_LO; break; - case BFD_RELOC_PPC_EMB_RELST_HI: ppc_reloc = R_PPC_EMB_RELST_HI; break; - case BFD_RELOC_PPC_EMB_RELST_HA: ppc_reloc = R_PPC_EMB_RELST_HA; break; - case BFD_RELOC_PPC_EMB_BIT_FLD: ppc_reloc = R_PPC_EMB_BIT_FLD; break; - case BFD_RELOC_PPC_EMB_RELSDA: ppc_reloc = R_PPC_EMB_RELSDA; break; - case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC_GNU_VTINHERIT; break; - case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC_GNU_VTENTRY; break; + case BFD_RELOC_NONE: r = R_PPC_NONE; break; + case BFD_RELOC_32: r = R_PPC_ADDR32; break; + case BFD_RELOC_PPC_BA26: r = R_PPC_ADDR24; break; + case BFD_RELOC_16: r = R_PPC_ADDR16; break; + case BFD_RELOC_LO16: r = R_PPC_ADDR16_LO; break; + case BFD_RELOC_HI16: r = R_PPC_ADDR16_HI; break; + case BFD_RELOC_HI16_S: r = R_PPC_ADDR16_HA; break; + case BFD_RELOC_PPC_BA16: r = R_PPC_ADDR14; break; + case BFD_RELOC_PPC_BA16_BRTAKEN: r = R_PPC_ADDR14_BRTAKEN; break; + case BFD_RELOC_PPC_BA16_BRNTAKEN: r = R_PPC_ADDR14_BRNTAKEN; break; + case BFD_RELOC_PPC_B26: r = R_PPC_REL24; break; + case BFD_RELOC_PPC_B16: r = R_PPC_REL14; break; + case BFD_RELOC_PPC_B16_BRTAKEN: r = R_PPC_REL14_BRTAKEN; break; + case BFD_RELOC_PPC_B16_BRNTAKEN: r = R_PPC_REL14_BRNTAKEN; break; + case BFD_RELOC_16_GOTOFF: r = R_PPC_GOT16; break; + case BFD_RELOC_LO16_GOTOFF: r = R_PPC_GOT16_LO; break; + case BFD_RELOC_HI16_GOTOFF: r = R_PPC_GOT16_HI; break; + case BFD_RELOC_HI16_S_GOTOFF: r = R_PPC_GOT16_HA; break; + case BFD_RELOC_24_PLT_PCREL: r = R_PPC_PLTREL24; break; + case BFD_RELOC_PPC_COPY: r = R_PPC_COPY; break; + case BFD_RELOC_PPC_GLOB_DAT: r = R_PPC_GLOB_DAT; break; + case BFD_RELOC_PPC_LOCAL24PC: r = R_PPC_LOCAL24PC; break; + case BFD_RELOC_32_PCREL: r = R_PPC_REL32; break; + case BFD_RELOC_32_PLTOFF: r = R_PPC_PLT32; break; + case BFD_RELOC_32_PLT_PCREL: r = R_PPC_PLTREL32; break; + case BFD_RELOC_LO16_PLTOFF: r = R_PPC_PLT16_LO; break; + case BFD_RELOC_HI16_PLTOFF: r = R_PPC_PLT16_HI; break; + case BFD_RELOC_HI16_S_PLTOFF: r = R_PPC_PLT16_HA; break; + case BFD_RELOC_GPREL16: r = R_PPC_SDAREL16; break; + case BFD_RELOC_16_BASEREL: r = R_PPC_SECTOFF; break; + case BFD_RELOC_LO16_BASEREL: r = R_PPC_SECTOFF_LO; break; + case BFD_RELOC_HI16_BASEREL: r = R_PPC_SECTOFF_HI; break; + case BFD_RELOC_HI16_S_BASEREL: r = R_PPC_SECTOFF_HA; break; + case BFD_RELOC_CTOR: r = R_PPC_ADDR32; break; + case BFD_RELOC_PPC_TOC16: r = R_PPC_TOC16; break; + case BFD_RELOC_PPC_TLS: r = R_PPC_TLS; break; + case BFD_RELOC_PPC_DTPMOD: r = R_PPC_DTPMOD32; break; + case BFD_RELOC_PPC_TPREL16: r = R_PPC_TPREL16; break; + case BFD_RELOC_PPC_TPREL16_LO: r = R_PPC_TPREL16_LO; break; + case BFD_RELOC_PPC_TPREL16_HI: r = R_PPC_TPREL16_HI; break; + case BFD_RELOC_PPC_TPREL16_HA: r = R_PPC_TPREL16_HA; break; + case BFD_RELOC_PPC_TPREL: r = R_PPC_TPREL32; break; + case BFD_RELOC_PPC_DTPREL16: r = R_PPC_DTPREL16; break; + case BFD_RELOC_PPC_DTPREL16_LO: r = R_PPC_DTPREL16_LO; break; + case BFD_RELOC_PPC_DTPREL16_HI: r = R_PPC_DTPREL16_HI; break; + case BFD_RELOC_PPC_DTPREL16_HA: r = R_PPC_DTPREL16_HA; break; + case BFD_RELOC_PPC_DTPREL: r = R_PPC_DTPREL32; break; + case BFD_RELOC_PPC_GOT_TLSGD16: r = R_PPC_GOT_TLSGD16; break; + case BFD_RELOC_PPC_GOT_TLSGD16_LO: r = R_PPC_GOT_TLSGD16_LO; break; + case BFD_RELOC_PPC_GOT_TLSGD16_HI: r = R_PPC_GOT_TLSGD16_HI; break; + case BFD_RELOC_PPC_GOT_TLSGD16_HA: r = R_PPC_GOT_TLSGD16_HA; break; + case BFD_RELOC_PPC_GOT_TLSLD16: r = R_PPC_GOT_TLSLD16; break; + case BFD_RELOC_PPC_GOT_TLSLD16_LO: r = R_PPC_GOT_TLSLD16_LO; break; + case BFD_RELOC_PPC_GOT_TLSLD16_HI: r = R_PPC_GOT_TLSLD16_HI; break; + case BFD_RELOC_PPC_GOT_TLSLD16_HA: r = R_PPC_GOT_TLSLD16_HA; break; + case BFD_RELOC_PPC_GOT_TPREL16: r = R_PPC_GOT_TPREL16; break; + case BFD_RELOC_PPC_GOT_TPREL16_LO: r = R_PPC_GOT_TPREL16_LO; break; + case BFD_RELOC_PPC_GOT_TPREL16_HI: r = R_PPC_GOT_TPREL16_HI; break; + case BFD_RELOC_PPC_GOT_TPREL16_HA: r = R_PPC_GOT_TPREL16_HA; break; + case BFD_RELOC_PPC_GOT_DTPREL16: r = R_PPC_GOT_DTPREL16; break; + case BFD_RELOC_PPC_GOT_DTPREL16_LO: r = R_PPC_GOT_DTPREL16_LO; break; + case BFD_RELOC_PPC_GOT_DTPREL16_HI: r = R_PPC_GOT_DTPREL16_HI; break; + case BFD_RELOC_PPC_GOT_DTPREL16_HA: r = R_PPC_GOT_DTPREL16_HA; break; + case BFD_RELOC_PPC_EMB_NADDR32: r = R_PPC_EMB_NADDR32; break; + case BFD_RELOC_PPC_EMB_NADDR16: r = R_PPC_EMB_NADDR16; break; + case BFD_RELOC_PPC_EMB_NADDR16_LO: r = R_PPC_EMB_NADDR16_LO; break; + case BFD_RELOC_PPC_EMB_NADDR16_HI: r = R_PPC_EMB_NADDR16_HI; break; + case BFD_RELOC_PPC_EMB_NADDR16_HA: r = R_PPC_EMB_NADDR16_HA; break; + case BFD_RELOC_PPC_EMB_SDAI16: r = R_PPC_EMB_SDAI16; break; + case BFD_RELOC_PPC_EMB_SDA2I16: r = R_PPC_EMB_SDA2I16; break; + case BFD_RELOC_PPC_EMB_SDA2REL: r = R_PPC_EMB_SDA2REL; break; + case BFD_RELOC_PPC_EMB_SDA21: r = R_PPC_EMB_SDA21; break; + case BFD_RELOC_PPC_EMB_MRKREF: r = R_PPC_EMB_MRKREF; break; + case BFD_RELOC_PPC_EMB_RELSEC16: r = R_PPC_EMB_RELSEC16; break; + case BFD_RELOC_PPC_EMB_RELST_LO: r = R_PPC_EMB_RELST_LO; break; + case BFD_RELOC_PPC_EMB_RELST_HI: r = R_PPC_EMB_RELST_HI; break; + case BFD_RELOC_PPC_EMB_RELST_HA: r = R_PPC_EMB_RELST_HA; break; + case BFD_RELOC_PPC_EMB_BIT_FLD: r = R_PPC_EMB_BIT_FLD; break; + case BFD_RELOC_PPC_EMB_RELSDA: r = R_PPC_EMB_RELSDA; break; + case BFD_RELOC_VTABLE_INHERIT: r = R_PPC_GNU_VTINHERIT; break; + case BFD_RELOC_VTABLE_ENTRY: r = R_PPC_GNU_VTENTRY; break; } - return ppc_elf_howto_table[(int) ppc_reloc]; + return ppc_elf_howto_table[(int) r]; }; /* Set the howto pointer for a PowerPC ELF reloc. */ @@ -1517,6 +2059,34 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } +static bfd_reloc_status_type +ppc_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + /* 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 (error_message != NULL) + { + static char buf[60]; + sprintf (buf, "generic linker can't handle %s", + reloc_entry->howto->name); + *error_message = buf; + } + return bfd_reloc_dangerous; +} + /* Fix bad default arch selected for a 32 bit input bfd when the default is 64 bit. */ @@ -1554,7 +2124,8 @@ ppc_elf_set_private_flags (abfd, flags) } /* Merge backend specific data from an object file to the output - object file when linking */ + object file when linking. */ + static bfd_boolean ppc_elf_merge_private_bfd_data (ibfd, obfd) bfd *ibfd; @@ -1564,7 +2135,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) flagword new_flags; bfd_boolean error; - /* Check if we have the same endianess */ + /* Check if we have the same endianess. */ if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return FALSE; @@ -1574,19 +2145,22 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) new_flags = elf_elfheader (ibfd)->e_flags; old_flags = elf_elfheader (obfd)->e_flags; - if (!elf_flags_init (obfd)) /* First call, no flags set */ + if (!elf_flags_init (obfd)) { + /* First call, no flags set. */ elf_flags_init (obfd) = TRUE; elf_elfheader (obfd)->e_flags = new_flags; } - else if (new_flags == old_flags) /* Compatible flags are ok */ + /* Compatible flags are ok. */ + else if (new_flags == old_flags) ; - else /* Incompatible flags */ + /* Incompatible flags. */ + else { - /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib to be linked - with either. */ + /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib + to be linked with either. */ error = FALSE; if ((new_flags & EF_PPC_RELOCATABLE) != 0 && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0) @@ -1610,19 +2184,20 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB; /* The output is -mrelocatable iff it can't be -mrelocatable-lib, - but each input file is either -mrelocatable or -mrelocatable-lib. */ + but each input file is either -mrelocatable or -mrelocatable-lib. */ if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB) && (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)) && (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))) elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE; - /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it */ + /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if + any module uses it. */ elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB); - new_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); - old_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + new_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + old_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); - /* Warn about any other mismatches */ + /* Warn about any other mismatches. */ if (new_flags != old_flags) { error = TRUE; @@ -1695,11 +2270,11 @@ ppc_elf_create_linker_section (abfd, info, which) bfd *dynobj = elf_hash_table (info)->dynobj; elf_linker_section_t *lsect; - /* Record the first bfd section that needs the special section */ + /* Record the first bfd section that needs the special section. */ if (!dynobj) dynobj = elf_hash_table (info)->dynobj = abfd; - /* If this is the first time, create the section */ + /* If this is the first time, create the section. */ lsect = elf_linker_section (dynobj, which); if (!lsect) { @@ -1794,26 +2369,38 @@ ppc_elf_modify_segment_map (abfd) /* The powerpc .got has a blrl instruction in it. Mark it executable. */ -static asection * +static bfd_boolean ppc_elf_create_got (abfd, info) bfd *abfd; struct bfd_link_info *info; { - register asection *s; + struct ppc_elf_link_hash_table *htab; + asection *s; flagword flags; if (!_bfd_elf_create_got_section (abfd, info)) - return NULL; + return FALSE; - s = bfd_get_section_by_name (abfd, ".got"); + htab = ppc_elf_hash_table (info); + htab->got = s = bfd_get_section_by_name (abfd, ".got"); if (s == NULL) abort (); flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); if (!bfd_set_section_flags (abfd, s, flags)) - return NULL; - return s; + return FALSE; + + htab->relgot = bfd_make_section (abfd, ".rela.got"); + if (!htab->relgot + || ! bfd_set_section_flags (abfd, htab->relgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (abfd, htab->relgot, 2)) + return FALSE; + + return TRUE; } /* We have to create .dynsbss and .rela.sbss here so that they get mapped @@ -1825,7 +2412,8 @@ ppc_elf_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; { - register asection *s; + struct ppc_elf_link_hash_table *htab; + asection *s; flagword flags; if (!ppc_elf_create_got (abfd, info)) @@ -1837,21 +2425,25 @@ ppc_elf_create_dynamic_sections (abfd, info) flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - s = bfd_make_section (abfd, ".dynsbss"); + htab = ppc_elf_hash_table (info); + htab->dynbss = bfd_get_section_by_name (abfd, ".dynbss"); + htab->dynsbss = s = bfd_make_section (abfd, ".dynsbss"); if (s == NULL || ! bfd_set_section_flags (abfd, s, SEC_ALLOC)) return FALSE; if (! info->shared) { - s = bfd_make_section (abfd, ".rela.sbss"); + htab->relbss = bfd_get_section_by_name (abfd, ".rela.bss"); + htab->relsbss = s = bfd_make_section (abfd, ".rela.sbss"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return FALSE; } - s = bfd_get_section_by_name (abfd, ".plt"); + htab->relplt = bfd_get_section_by_name (abfd, ".rela.plt"); + htab->plt = s = bfd_get_section_by_name (abfd, ".plt"); if (s == NULL) abort (); @@ -1859,6 +2451,12 @@ ppc_elf_create_dynamic_sections (abfd, info) return bfd_set_section_flags (abfd, s, flags); } +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* 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 @@ -1870,17 +2468,18 @@ ppc_elf_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { - bfd *dynobj = elf_hash_table (info)->dynobj; + struct ppc_elf_link_hash_table *htab; asection *s; unsigned int power_of_two; - bfd_vma plt_offset; #ifdef DEBUG - fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", h->root.root.string); + fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", + h->root.root.string); #endif /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL + htab = ppc_elf_hash_table (info); + BFD_ASSERT (htab->elf.dynobj != NULL && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) || h->weakdef != NULL || ((h->elf_link_hash_flags @@ -1890,85 +2489,28 @@ ppc_elf_adjust_dynamic_symbol (info, h) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))); - /* If this is a function, put it in the procedure linkage table. We - will fill in the contents of the procedure linkage table later, - when we know the address of the .got section. */ + /* Deal with function syms. */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - if (! elf_hash_table (info)->dynamic_sections_created + /* Clear procedure linkage table information for any symbol that + won't need a .plt entry. */ + if (! htab->elf.dynamic_sections_created || SYMBOL_CALLS_LOCAL (info, h) - || (info->shared && h->plt.refcount <= 0)) + || h->plt.refcount <= 0) { /* A PLT entry is not required/allowed when: - 1. We are not using ld.so; because then the PLT entry - can't be set up, so we can't use one. + 1. We are not using ld.so; because then the PLT entry + can't be set up, so we can't use one. - 2. We know for certain that a call to this symbol - will go to this object. + 2. We know for certain that a call to this symbol + will go to this object. - 3. GC has rendered the entry unused. - Note, however, that in an executable all references to the - symbol go to the PLT, so we can't turn it off in that case. - ??? The correct thing to do here is to reference count - all uses of the symbol, not just those to the GOT or PLT. */ + 3. GC has rendered the entry unused. */ h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - return TRUE; } - - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return FALSE; - } - BFD_ASSERT (h->dynindx != -1); - - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->_raw_size == 0) - s->_raw_size += PLT_INITIAL_ENTRY_SIZE; - - /* The PowerPC PLT is actually composed of two parts, the first part - is 2 words (for a load and a jump), and then there is a remaining - word available at the end. */ - plt_offset = (PLT_INITIAL_ENTRY_SIZE - + (PLT_SLOT_SIZE - * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) - / PLT_ENTRY_SIZE))); - - /* If this symbol is not defined in a regular file, and we are - not generating a shared library, then set the symbol to this - location in the .plt. This is required to make function - pointers compare as equal between the normal executable and - the shared library. */ - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - { - h->root.u.def.section = s; - h->root.u.def.value = plt_offset; - } - - h->plt.offset = plt_offset; - - /* Make room for this entry. After the 8192nd entry, room - for two entries is allocated. */ - if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE - >= PLT_NUM_SINGLE_ENTRIES) - s->_raw_size += 2 * PLT_ENTRY_SIZE; - else - s->_raw_size += PLT_ENTRY_SIZE; - - /* We also need to make an entry in the .rela.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rela.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += sizeof (Elf32_External_Rela); - return TRUE; } else @@ -1996,6 +2538,30 @@ ppc_elf_adjust_dynamic_symbol (info, h) if (info->shared) return TRUE; + /* If there are no references to this symbol that do not use the + GOT, we don't need to generate a copy reloc. */ + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) + return TRUE; + + if (ELIMINATE_COPY_RELOCS) + { + struct ppc_elf_dyn_relocs *p; + for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } + } + /* We must allocate the symbol in our .dynbss section, which will become part of the .bss section of the executable. There will be an entry for this symbol in the .dynsym section. The dynamic @@ -2010,10 +2576,10 @@ ppc_elf_adjust_dynamic_symbol (info, h) allocate it in .sbss. FIXME: It would be better to do this if and only if there were actually SDAREL relocs for that symbol. */ - if (h->size <= elf_gp_size (dynobj)) - s = bfd_get_section_by_name (dynobj, ".dynsbss"); + if (h->size <= elf_gp_size (htab->elf.dynobj)) + s = htab->dynsbss; else - s = bfd_get_section_by_name (dynobj, ".dynbss"); + s = htab->dynbss; BFD_ASSERT (s != NULL); /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to @@ -2024,10 +2590,10 @@ ppc_elf_adjust_dynamic_symbol (info, h) { asection *srel; - if (h->size <= elf_gp_size (dynobj)) - srel = bfd_get_section_by_name (dynobj, ".rela.sbss"); + if (h->size <= elf_gp_size (htab->elf.dynobj)) + srel = htab->relsbss; else - srel = bfd_get_section_by_name (dynobj, ".rela.bss"); + srel = htab->relbss; BFD_ASSERT (srel != NULL); srel->_raw_size += sizeof (Elf32_External_Rela); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; @@ -2042,9 +2608,9 @@ ppc_elf_adjust_dynamic_symbol (info, h) /* Apply the required alignment. */ s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) + if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) + if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) return FALSE; } @@ -2058,13 +2624,38 @@ ppc_elf_adjust_dynamic_symbol (info, h) return TRUE; } +/* This is the condition under which finish_dynamic_symbol will be + called from elflink.h. If elflink.h doesn't call our + finish_dynamic_symbol routine, we'll need to do something about + initializing any .plt and .got entries in relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ + ((DYN) \ + && ((SHARED) \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + +/* Of those relocs that might be copied as dynamic relocs, this macro + selects those that must be copied when linking a shared library, + even when the symbol is local. */ + +#define MUST_BE_DYN_RELOC(RTYPE) \ + ((RTYPE) != R_PPC_REL24 \ + && (RTYPE) != R_PPC_REL14 \ + && (RTYPE) != R_PPC_REL14_BRTAKEN \ + && (RTYPE) != R_PPC_REL14_BRNTAKEN \ + && (RTYPE) != R_PPC_REL32) + /* Allocate space in associated reloc sections for dynamic relocs. */ static bfd_boolean -allocate_dynrelocs (h, info) +allocate_dynrelocs (h, inf) struct elf_link_hash_entry *h; - PTR info ATTRIBUTE_UNUSED; + PTR inf; { + struct bfd_link_info *info = (struct bfd_link_info *) inf; + struct ppc_elf_link_hash_entry *eh; + struct ppc_elf_link_hash_table *htab; struct ppc_elf_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) @@ -2076,7 +2667,178 @@ allocate_dynrelocs (h, info) symbol in a hash traversal. So look at it now. */ h = (struct elf_link_hash_entry *) h->root.u.i.link; - for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) + htab = ppc_elf_hash_table (info); + if (htab->elf.dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) + { + asection *s = htab->plt; + + /* If this is the first .plt entry, make room for the special + first entry. */ + if (s->_raw_size == 0) + s->_raw_size += PLT_INITIAL_ENTRY_SIZE; + + /* The PowerPC PLT is actually composed of two parts, the + first part is 2 words (for a load and a jump), and then + there is a remaining word available at the end. */ + h->plt.offset = (PLT_INITIAL_ENTRY_SIZE + + (PLT_SLOT_SIZE + * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) + / PLT_ENTRY_SIZE))); + + /* If this symbol is not defined in a regular file, and we + are not generating a shared library, then set the symbol + to this location in the .plt. This is required to make + function pointers compare as equal between the normal + executable and the shared library. */ + if (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + h->root.u.def.section = s; + h->root.u.def.value = h->plt.offset; + } + + /* Make room for this entry. After the 8192nd entry, room + for two entries is allocated. */ + s->_raw_size += PLT_ENTRY_SIZE; + if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE + >= PLT_NUM_SINGLE_ENTRIES) + s->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ + htab->relplt->_raw_size += sizeof (Elf32_External_Rela); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + eh = (struct ppc_elf_link_hash_entry *) h; + if (eh->elf.got.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. */ + if (eh->elf.dynindx == -1 + && (eh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (!bfd_elf32_link_record_dynamic_symbol (info, &eh->elf)) + return FALSE; + } + + if (eh->tls_mask == (TLS_TLS | TLS_LD) + && !(eh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) + /* If just an LD reloc, we'll just use htab->tlsld_got.offset. */ + eh->elf.got.offset = (bfd_vma) -1; + else + { + bfd_boolean dyn; + eh->elf.got.offset = htab->got->_raw_size; + if ((eh->tls_mask & TLS_TLS) != 0) + { + if ((eh->tls_mask & TLS_LD) != 0) + htab->got->_raw_size += 8; + if ((eh->tls_mask & TLS_GD) != 0) + htab->got->_raw_size += 8; + if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0) + htab->got->_raw_size += 4; + if ((eh->tls_mask & TLS_DTPREL) != 0) + htab->got->_raw_size += 4; + } + else + htab->got->_raw_size += 4; + dyn = htab->elf.dynamic_sections_created; + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf)) + { + /* All the entries we allocated need relocs. */ + htab->relgot->_raw_size + += ((htab->got->_raw_size - eh->elf.got.offset) / 4 + * sizeof (Elf32_External_Rela)); + /* Except LD only needs one. */ + if ((eh->tls_mask & TLS_LD) != 0) + htab->relgot->_raw_size -= sizeof (Elf32_External_Rela); + } + } + } + else + eh->elf.got.offset = (bfd_vma) -1; + + if (eh->dyn_relocs == NULL) + return TRUE; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for relocs that have become local due to symbol visibility + changes. */ + if (info->shared) + { + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || info->symbolic)) + { + struct ppc_elf_dyn_relocs **pp; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { + p->count -= p->pc_count; + p->pc_count = 0; + if (p->count == 0) + *pp = p->next; + else + pp = &p->next; + } + } + } + else if (ELIMINATE_COPY_RELOCS) + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf64_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->dyn_relocs = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->dyn_relocs; p != NULL; p = p->next) { asection *sreloc = elf_section_data (p->sec)->sreloc; sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); @@ -2124,9 +2886,8 @@ ppc_elf_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { - bfd *dynobj; + struct ppc_elf_link_hash_table *htab; asection *s; - bfd_boolean plt; bfd_boolean relocs; bfd *ibfd; @@ -2134,43 +2895,42 @@ ppc_elf_size_dynamic_sections (output_bfd, info) fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); #endif - dynobj = elf_hash_table (info)->dynobj; - BFD_ASSERT (dynobj != NULL); + htab = ppc_elf_hash_table (info); + BFD_ASSERT (htab->elf.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"); + s = bfd_get_section_by_name (htab->elf.dynobj, ".interp"); BFD_ASSERT (s != NULL); s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } } - else + + if (htab->tlsld_got.refcount > 0) { - /* We may have created entries in the .rela.got, .rela.sdata, and - .rela.sdata2 sections. However, if we are not creating the - dynamic sections, we will not actually use these entries. Reset - the size of .rela.got, et al, which will cause it to get - stripped from the output file below. */ - static char *rela_sections[] = { ".rela.got", ".rela.sdata", - ".rela.sdata2", ".rela.sbss", - (char *) 0 }; - char **p; - - for (p = rela_sections; *p != (char *) 0; p++) - { - s = bfd_get_section_by_name (dynobj, *p); - if (s != NULL) - s->_raw_size = 0; - } + htab->tlsld_got.offset = htab->got->_raw_size; + htab->got->_raw_size += 8; + if (info->shared) + htab->relgot->_raw_size += sizeof (Elf32_External_Rela); } + else + htab->tlsld_got.offset = (bfd_vma) -1; - /* Allocate space for local sym dynamic relocs. */ + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + char *lgot_masks; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) continue; @@ -2179,9 +2939,9 @@ ppc_elf_size_dynamic_sections (output_bfd, info) struct ppc_elf_dyn_relocs *p; for (p = ((struct ppc_elf_dyn_relocs *) - elf_section_data (s)->local_dynrel); - p != NULL; - p = p->next) + elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) { if (!bfd_is_abs_section (p->sec) && bfd_is_abs_section (p->sec->output_section)) @@ -2202,45 +2962,76 @@ ppc_elf_size_dynamic_sections (output_bfd, info) } } } + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + lgot_masks = (char *) end_local_got; + s = htab->got; + srel = htab->relgot; + for (; local_got < end_local_got; ++local_got, ++lgot_masks) + if (*local_got > 0) + { + if (*lgot_masks == (TLS_TLS | TLS_LD)) + { + /* If just an LD reloc, we'll just use + htab->tlsld_got.offset. */ + if (htab->tlsld_got.offset == (bfd_vma) -1) + { + htab->tlsld_got.offset = s->_raw_size; + s->_raw_size += 8; + if (info->shared) + srel->_raw_size += sizeof (Elf32_External_Rela); + } + *local_got = (bfd_vma) -1; + } + else + { + *local_got = s->_raw_size; + if ((*lgot_masks & TLS_TLS) != 0) + { + if ((*lgot_masks & TLS_GD) != 0) + s->_raw_size += 8; + if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0) + s->_raw_size += 4; + if ((*lgot_masks & TLS_DTPREL) != 0) + s->_raw_size += 4; + } + else + s->_raw_size += 4; + if (info->shared) + srel->_raw_size += ((s->_raw_size - *local_got) / 4 + * sizeof (Elf32_External_Rela)); + } + } + else + *local_got = (bfd_vma) -1; } /* Allocate space for global sym dynamic relocs. */ - elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, NULL); + elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, info); - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - plt = FALSE; + /* We've now determined the sizes of the various dynamic sections. + Allocate memory for them. */ relocs = FALSE; - for (s = dynobj->sections; s != NULL; s = s->next) + for (s = htab->elf.dynobj->sections; s != NULL; s = s->next) { - const char *name; - bfd_boolean strip; - 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); - - strip = FALSE; - - if (strcmp (name, ".plt") == 0) + if (s == htab->plt + || s == htab->got + || (htab->sdata != NULL && s == htab->sdata->section) + || (htab->sdata2 != NULL && s == htab->sdata2->section)) { - if (s->_raw_size == 0) - { - /* Strip this section if we don't need it; see the - comment below. */ - strip = TRUE; - } - else - { - /* Remember whether there is a PLT. */ - plt = TRUE; - } + /* Strip this section if we don't need it; see the + comment below. */ } - else if (strncmp (name, ".rela", 5) == 0) + else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { if (s->_raw_size == 0) { @@ -2253,7 +3044,6 @@ ppc_elf_size_dynamic_sections (output_bfd, info) adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ - strip = TRUE; } else { @@ -2265,27 +3055,25 @@ ppc_elf_size_dynamic_sections (output_bfd, info) s->reloc_count = 0; } } - else if (strcmp (name, ".got") != 0 - && strcmp (name, ".sdata") != 0 - && strcmp (name, ".sdata2") != 0) + else { /* It's not one of our sections, so don't allocate space. */ continue; } - if (strip) + if (s->_raw_size == 0) { _bfd_strip_section_from_output (info, s); continue; } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL && s->_raw_size != 0) + s->contents = (bfd_byte *) bfd_zalloc (htab->elf.dynobj, s->_raw_size); + if (s->contents == NULL) return FALSE; } - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created) { /* Add some entries to the .dynamic section. We fill in the values later, in ppc_elf_finish_dynamic_sections, but we @@ -2301,7 +3089,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) return FALSE; } - if (plt) + if (htab->plt != NULL && htab->plt->_raw_size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) @@ -2335,6 +3123,45 @@ ppc_elf_size_dynamic_sections (output_bfd, info) return TRUE; } +static bfd_boolean +update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type) + bfd *abfd; + Elf_Internal_Shdr *symtab_hdr; + unsigned long r_symndx; + int tls_type; +{ + bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (abfd); + char *local_got_tls_masks; + + if (local_got_refcounts == NULL) + { + bfd_size_type size = symtab_hdr->sh_info; + + size *= sizeof (*local_got_refcounts) + sizeof (*local_got_tls_masks); + local_got_refcounts = (bfd_signed_vma *) bfd_zalloc (abfd, size); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + } + + local_got_refcounts[r_symndx] += 1; + local_got_tls_masks = (char *) (local_got_refcounts + symtab_hdr->sh_info); + local_got_tls_masks[r_symndx] |= tls_type; + return TRUE; +} + +static void +bad_shared_reloc (abfd, r_type) + bfd *abfd; + enum elf_ppc_reloc_type r_type; +{ + (*_bfd_error_handler) + (_("%s: relocation %s cannot be used when making a shared object"), + bfd_archive_filename (abfd), + ppc_elf_howto_table[(int) r_type]->name); + bfd_set_error (bfd_error_bad_value); +} + /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ @@ -2346,17 +3173,12 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) asection *sec; const Elf_Internal_Rela *relocs; { - bfd *dynobj; + struct ppc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + struct elf_link_hash_entry **sym_hashes; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - bfd_signed_vma *local_got_refcounts; - elf_linker_section_t *sdata; - elf_linker_section_t *sdata2; asection *sreloc; - asection *sgot = NULL; - asection *srelgot = NULL; if (info->relocateable) return TRUE; @@ -2370,36 +3192,38 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) /* Create the linker generated sections all the time so that the special symbols are created. */ - if ((sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA)) == NULL) + htab = ppc_elf_hash_table (info); + if (htab->sdata == NULL) { - sdata = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA); - if (!sdata) + htab->sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA); + if (htab->sdata == NULL) + htab->sdata = ppc_elf_create_linker_section (abfd, info, + LINKER_SECTION_SDATA); + if (htab->sdata == NULL) return FALSE; } - if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL) + if (htab->sdata2 == NULL) { - sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2); - if (!sdata2) + htab->sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2); + if (htab->sdata2 == NULL) + htab->sdata2 = ppc_elf_create_linker_section (abfd, info, + LINKER_SECTION_SDATA2); + if (htab->sdata2 == NULL) return FALSE; } - dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - local_got_refcounts = elf_local_got_refcounts (abfd); - 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; - sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { unsigned long r_symndx; + enum elf_ppc_reloc_type r_type; struct elf_link_hash_entry *h; + int tls_type = 0; r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -2412,182 +3236,118 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) startup code. */ if (h && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) { - if (sgot == NULL) + if (htab->got == NULL) { - if (dynobj == NULL) - elf_hash_table (info)->dynobj = dynobj = abfd; - sgot = ppc_elf_create_got (dynobj, info); - if (sgot == NULL) + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!ppc_elf_create_got (htab->elf.dynobj, info)) return FALSE; } } - switch (ELF32_R_TYPE (rel->r_info)) + r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info); + switch (r_type) { - /* GOT16 relocations */ + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + htab->tlsld_got.refcount += 1; + tls_type = TLS_TLS | TLS_LD; + goto dogottls; + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogottls; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + if (info->shared) + info->flags |= DF_STATIC_TLS; + tls_type = TLS_TLS | TLS_TPREL; + goto dogottls; + + case R_PPC_GOT_DTPREL16: + case R_PPC_GOT_DTPREL16_LO: + case R_PPC_GOT_DTPREL16_HI: + case R_PPC_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + dogottls: + sec->has_tls_reloc = 1; + /* Fall thru */ + + /* GOT16 relocations */ case R_PPC_GOT16: case R_PPC_GOT16_LO: case R_PPC_GOT16_HI: case R_PPC_GOT16_HA: /* This symbol requires a global offset table entry. */ - - if (sgot == NULL) + if (htab->got == NULL) { - if (dynobj == NULL) - elf_hash_table (info)->dynobj = dynobj = abfd; - sgot = ppc_elf_create_got (dynobj, info); - if (sgot == NULL) + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!ppc_elf_create_got (htab->elf.dynobj, info)) return FALSE; } - - if (srelgot == NULL - && (h != NULL || info->shared)) - { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - if (srelgot == NULL) - { - srelgot = bfd_make_section (dynobj, ".rela.got"); - if (srelgot == NULL - || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, srelgot, 2)) - return FALSE; - } - } - if (h != NULL) { - if (h->got.refcount == 0) - { - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - if (!bfd_elf32_link_record_dynamic_symbol (info, h)) - return FALSE; - - /* Allocate space in the .got. */ - sgot->_raw_size += 4; - /* Allocate relocation space. */ - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - h->got.refcount++; + h->got.refcount += 1; + ppc_elf_hash_entry (h)->tls_mask |= tls_type; } else - { - /* This is a global offset table entry for a local symbol. */ - if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts - = (bfd_signed_vma *) bfd_zalloc (abfd, size); - if (local_got_refcounts == NULL) - return FALSE; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - if (local_got_refcounts[r_symndx] == 0) - { - sgot->_raw_size += 4; - - /* If we are generating a shared object, we need to - output a R_PPC_RELATIVE reloc so that the - dynamic linker can adjust this GOT entry. */ - if (info->shared) - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - local_got_refcounts[r_symndx]++; - } + /* This is a global offset table entry for a local symbol. */ + if (!update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type)) + return FALSE; break; - /* Indirect .sdata relocation */ + /* Indirect .sdata relocation. */ case R_PPC_EMB_SDAI16: if (info->shared) { - ((*_bfd_error_handler) - (_("%s: relocation %s cannot be used when making a shared object"), - bfd_archive_filename (abfd), "R_PPC_EMB_SDAI16")); + bad_shared_reloc (abfd, r_type); return FALSE; } - - if (srelgot == NULL && (h != NULL || info->shared)) - { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - if (srelgot == NULL) - { - srelgot = bfd_make_section (dynobj, ".rela.got"); - if (srelgot == NULL - || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, srelgot, 2)) - return FALSE; - } - } - - if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata, h, rel)) + if (!bfd_elf32_create_pointer_linker_section (abfd, info, + htab->sdata, h, rel)) return FALSE; - break; - /* Indirect .sdata2 relocation */ + /* Indirect .sdata2 relocation. */ case R_PPC_EMB_SDA2I16: if (info->shared) { - ((*_bfd_error_handler) - (_("%s: relocation %s cannot be used when making a shared object"), - bfd_archive_filename (abfd), "R_PPC_EMB_SDA2I16")); + bad_shared_reloc (abfd, r_type); return FALSE; } - - if (srelgot == NULL && (h != NULL || info->shared)) - { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - if (srelgot == NULL) - { - srelgot = bfd_make_section (dynobj, ".rela.got"); - if (srelgot == NULL - || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, srelgot, 2)) - return FALSE; - } - } - - if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata2, h, rel)) + if (!bfd_elf32_create_pointer_linker_section (abfd, info, + htab->sdata2, h, rel)) return FALSE; - break; case R_PPC_SDAREL16: case R_PPC_EMB_SDA2REL: case R_PPC_EMB_SDA21: + case R_PPC_EMB_RELSDA: + case R_PPC_EMB_NADDR32: + case R_PPC_EMB_NADDR16: + case R_PPC_EMB_NADDR16_LO: + case R_PPC_EMB_NADDR16_HI: + case R_PPC_EMB_NADDR16_HA: if (info->shared) { - ((*_bfd_error_handler) - (_("%s: relocation %s cannot be used when making a shared object"), - bfd_archive_filename (abfd), - ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name)); + bad_shared_reloc (abfd, r_type); return FALSE; } break; case R_PPC_PLT32: case R_PPC_PLTREL24: + case R_PPC_PLTREL32: case R_PPC_PLT16_LO: case R_PPC_PLT16_HI: case R_PPC_PLT16_HA: @@ -2595,25 +3355,19 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) fprintf (stderr, "Reloc requires a PLT entry\n"); #endif /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code without - linking in any dynamic objects, in which case we don't - need to generate a procedure linkage table after all. */ + actually build the entry in finish_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ if (h == NULL) { /* It does not make sense to have a procedure linkage - table entry for a local symbol. */ + table entry for a local symbol. */ bfd_set_error (bfd_error_bad_value); return FALSE; } - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return FALSE; - } h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; h->plt.refcount++; break; @@ -2625,9 +3379,37 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) case R_PPC_SECTOFF_LO: case R_PPC_SECTOFF_HI: case R_PPC_SECTOFF_HA: + case R_PPC_DTPREL16: + case R_PPC_DTPREL16_LO: + case R_PPC_DTPREL16_HI: + case R_PPC_DTPREL16_HA: + case R_PPC_TOC16: + break; + + /* This are just markers. */ + case R_PPC_TLS: + case R_PPC_EMB_MRKREF: + case R_PPC_NONE: + case R_PPC_max: break; - /* This refers only to functions defined in the shared library */ + /* These should only appear in dynamic objects. */ + case R_PPC_COPY: + case R_PPC_GLOB_DAT: + case R_PPC_JMP_SLOT: + case R_PPC_RELATIVE: + break; + + /* These aren't handled yet. We'll report an error later. */ + case R_PPC_ADDR30: + case R_PPC_EMB_RELSEC16: + case R_PPC_EMB_RELST_LO: + case R_PPC_EMB_RELST_HI: + case R_PPC_EMB_RELST_HA: + case R_PPC_EMB_BIT_FLD: + break; + + /* This refers only to functions defined in the shared library. */ case R_PPC_LOCAL24PC: break; @@ -2645,6 +3427,25 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) return FALSE; break; + /* We shouldn't really be seeing these. */ + case R_PPC_TPREL32: + if (info->shared) + info->flags |= DF_STATIC_TLS; + goto dodyn; + + /* Nor these. */ + case R_PPC_DTPMOD32: + case R_PPC_DTPREL32: + goto dodyn; + + case R_PPC_TPREL16: + case R_PPC_TPREL16_LO: + case R_PPC_TPREL16_HI: + case R_PPC_TPREL16_HA: + if (info->shared) + info->flags |= DF_STATIC_TLS; + goto dodyn; + /* When creating a shared object, we must copy these relocs into the output file. We create a reloc section in dynobj and make room for the reloc. */ @@ -2659,15 +3460,71 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) break; /* fall through */ - default: - if (info->shared) + case R_PPC_ADDR32: + case R_PPC_ADDR24: + case R_PPC_ADDR16: + case R_PPC_ADDR16_LO: + case R_PPC_ADDR16_HI: + case R_PPC_ADDR16_HA: + case R_PPC_ADDR14: + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_UADDR32: + case R_PPC_UADDR16: + if (h != NULL && !info->shared) + { + /* We may need a plt entry if the symbol turns out to be + a function defined in a dynamic object. */ + h->plt.refcount++; + + /* We may need a copy reloc too. */ + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + } + + dodyn: + /* If we are creating a shared library, and this is a reloc + against a global symbol, or a non PC relative reloc + against a local symbol, then we need to copy the reloc + into the shared library. However, if we are linking with + -Bsymbolic, we do not need to copy a reloc against a + global symbol which is defined in an object we are + including in the link (i.e., DEF_REGULAR is set). At + this point we have not seen all the input files, so it is + possible that DEF_REGULAR is not set now but will be set + later (it is never cleared). In case of a weak definition, + DEF_REGULAR may be cleared later by a strong definition in + a shared library. We account for that possibility below by + storing information in the dyn_relocs field of the hash + table entry. A similar situation occurs when creating + shared libraries and symbol visibility changes render the + symbol local. + + If on the other hand, we are creating an executable, we + may need to keep relocations for symbols satisfied by a + dynamic library if we manage to avoid copy relocs for the + symbol. */ + if ((info->shared + && (MUST_BE_DYN_RELOC (r_type) + || (h != NULL + && (! info->symbolic + || h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (ELIMINATE_COPY_RELOCS + && !info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) { struct ppc_elf_dyn_relocs *p; struct ppc_elf_dyn_relocs **head; #ifdef DEBUG fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n", - (h && h->root.root.string) ? h->root.root.string : "<unknown>"); + (h && h->root.root.string + ? h->root.root.string : "<unknown>")); #endif if (sreloc == NULL) { @@ -2684,19 +3541,21 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); - sreloc = bfd_get_section_by_name (dynobj, name); + sreloc = bfd_get_section_by_name (htab->elf.dynobj, name); if (sreloc == NULL) { flagword flags; - sreloc = bfd_make_section (dynobj, name); + sreloc = bfd_make_section (htab->elf.dynobj, name); flags = (SEC_HAS_CONTENTS | SEC_READONLY | SEC_IN_MEMORY | SEC_LINKER_CREATED); if ((sec->flags & SEC_ALLOC) != 0) flags |= SEC_ALLOC | SEC_LOAD; if (sreloc == NULL - || ! bfd_set_section_flags (dynobj, sreloc, flags) - || ! bfd_set_section_alignment (dynobj, sreloc, 2)) + || ! bfd_set_section_flags (htab->elf.dynobj, + sreloc, flags) + || ! bfd_set_section_alignment (htab->elf.dynobj, + sreloc, 2)) return FALSE; } elf_section_data (sec)->sreloc = sreloc; @@ -2715,9 +3574,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) easily. Oh well. */ asection *s; - s = (bfd_section_from_r_symndx - (abfd, &ppc_elf_hash_table (info)->sym_sec, - sec, r_symndx)); + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); if (s == NULL) return FALSE; @@ -2729,16 +3587,19 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) if (p == NULL || p->sec != sec) { p = ((struct ppc_elf_dyn_relocs *) - bfd_alloc (elf_hash_table (info)->dynobj, sizeof *p)); + bfd_alloc (htab->elf.dynobj, sizeof *p)); if (p == NULL) return FALSE; p->next = *head; *head = p; p->sec = sec; p->count = 0; + p->pc_count = 0; } - p->count++; + p->count += 1; + if (!MUST_BE_DYN_RELOC (r_type)) + p->pc_count += 1; } break; @@ -2788,85 +3649,348 @@ ppc_elf_gc_mark_hook (sec, info, rel, h, sym) return NULL; } -/* Update the got entry reference counts for the section being removed. */ +/* Update the got, plt and dynamic reloc reference counts for the + section being removed. */ static bfd_boolean ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct bfd_link_info *info; asection *sec; const Elf_Internal_Rela *relocs; { + struct ppc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; + htab = ppc_elf_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_PPC_GOT16: - case R_PPC_GOT16_LO: - case R_PPC_GOT16_HI: - case R_PPC_GOT16_HA: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->got.refcount > 0) - h->got.refcount--; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx]--; - } - break; - - case R_PPC_PLT32: - case R_PPC_PLTREL24: - case R_PPC_PLT16_LO: - case R_PPC_PLT16_HI: - case R_PPC_PLT16_HA: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount--; - } - /* Fall through */ + { + unsigned long r_symndx; + enum elf_ppc_reloc_type r_type; + struct elf_link_hash_entry *h = NULL; - default: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_elf_dyn_relocs **pp, *p; + struct ppc_elf_link_hash_entry *eh; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct ppc_elf_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + htab->tlsld_got.refcount -= 1; + /* Fall thru */ + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + case R_PPC_GOT_DTPREL16: + case R_PPC_GOT_DTPREL16_LO: + case R_PPC_GOT_DTPREL16_HI: + case R_PPC_GOT_DTPREL16_HA: + case R_PPC_GOT16: + case R_PPC_GOT16_LO: + case R_PPC_GOT16_HI: + case R_PPC_GOT16_HA: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount--; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; + + case R_PPC_REL24: + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: + case R_PPC_REL32: + if (h == NULL + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || SYMBOL_REFERENCES_LOCAL (info, h)) + break; + /* Fall thru */ + + case R_PPC_ADDR32: + case R_PPC_ADDR24: + case R_PPC_ADDR16: + case R_PPC_ADDR16_LO: + case R_PPC_ADDR16_HI: + case R_PPC_ADDR16_HA: + case R_PPC_ADDR14: + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_UADDR32: + case R_PPC_UADDR16: + case R_PPC_PLT32: + case R_PPC_PLTREL24: + case R_PPC_PLT16_LO: + case R_PPC_PLT16_HI: + case R_PPC_PLT16_HA: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; + + default: + break; + } + } + return TRUE; +} + +/* Set htab->tls_sec and htab->tls_get_addr. */ + +bfd_boolean +ppc_elf_tls_setup (obfd, info) + bfd *obfd; + struct bfd_link_info *info; +{ + asection *tls; + struct ppc_elf_link_hash_table *htab; + + htab = ppc_elf_hash_table (info); + htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr", + FALSE, FALSE, TRUE); + + for (tls = obfd->sections; tls != NULL; tls = tls->next) + if ((tls->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) + == (SEC_THREAD_LOCAL | SEC_LOAD)) + break; + htab->tls_sec = tls; + + return tls != NULL; +} + +/* Run through all the TLS relocs looking for optimization + opportunities. */ + +bfd_boolean +ppc_elf_tls_optimize (obfd, info) + bfd *obfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; +{ + bfd *ibfd; + asection *sec; + struct ppc_elf_link_hash_table *htab; + + if (info->relocateable || info->shared) + return TRUE; + + htab = ppc_elf_hash_table (info); + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + Elf_Internal_Sym *locsyms = NULL; + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section)) { - struct ppc_elf_dyn_relocs **pp, *p; + Elf_Internal_Rela *relstart, *rel, *relend; + int expecting_tls_get_addr; + + /* Read the relocations. */ + relstart = _bfd_elf32_link_read_relocs (ibfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); + if (relstart == NULL) + return FALSE; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + expecting_tls_get_addr = 0; + relend = relstart + sec->reloc_count; + for (rel = relstart; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + unsigned long r_symndx; + struct elf_link_hash_entry *h = NULL; + char *tls_mask; + char tls_set, tls_clear; + bfd_boolean is_local; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_link_hash_entry **sym_hashes; - for (pp = &ppc_elf_hash_entry (h)->dyn_relocs; - (p = *pp) != NULL; - pp = &p->next) - if (p->sec == sec) - { - if (--p->count == 0) - *pp = p->next; - break; - } + sym_hashes = elf_sym_hashes (ibfd); + 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; + } + + is_local = FALSE; + if (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) + is_local = TRUE; + + r_type = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + /* These relocs should never be against a symbol + defined in a shared lib. Leave them alone if + that turns out to be the case. */ + expecting_tls_get_addr = 0; + htab->tlsld_got.refcount -= 1; + if (!is_local) + continue; + + /* LD -> LE */ + tls_set = 0; + tls_clear = TLS_LD; + expecting_tls_get_addr = 1; + break; + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + if (is_local) + /* GD -> LE */ + tls_set = 0; + else + /* GD -> IE */ + tls_set = TLS_TLS | TLS_TPRELGD; + tls_clear = TLS_GD; + expecting_tls_get_addr = 1; + break; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + expecting_tls_get_addr = 0; + if (is_local) + { + /* IE -> LE */ + tls_set = 0; + tls_clear = TLS_TPREL; + break; + } + else + continue; + + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: + case R_PPC_REL24: + if (expecting_tls_get_addr + && h != NULL + && h == htab->tls_get_addr) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + expecting_tls_get_addr = 0; + continue; + + default: + expecting_tls_get_addr = 0; + continue; + } + + if (h != NULL) + { + if (tls_set == 0) + { + /* We managed to get rid of a got entry. */ + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + tls_mask = &ppc_elf_hash_entry (h)->tls_mask; + } + else + { + Elf_Internal_Sym *sym; + bfd_signed_vma *lgot_refs; + char *lgot_masks; + + if (locsyms == NULL) + { + locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (locsyms == NULL) + locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, + symtab_hdr->sh_info, + 0, NULL, NULL, NULL); + if (locsyms == NULL) + { + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + return FALSE; + } + } + sym = locsyms + r_symndx; + lgot_refs = elf_local_got_refcounts (ibfd); + if (lgot_refs == NULL) + abort (); + if (tls_set == 0) + { + /* We managed to get rid of a got entry. */ + if (lgot_refs[r_symndx] > 0) + lgot_refs[r_symndx] -= 1; + } + lgot_masks = (char *) (lgot_refs + symtab_hdr->sh_info); + tls_mask = &lgot_masks[r_symndx]; + } + + *tls_mask |= tls_set; + *tls_mask &= ~tls_clear; + } + + if (elf_section_data (sec)->relocs != relstart) + free (relstart); } - break; - } + if (locsyms != NULL + && (symtab_hdr->contents != (unsigned char *) locsyms)) + { + if (!info->keep_memory) + free (locsyms); + else + symtab_hdr->contents = (unsigned char *) locsyms; + } + } return TRUE; } @@ -2898,9 +4022,9 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_size_type amt; /* We don't go through bfd_make_section, because we don't - want to attach this common section to DYNOBJ. The linker - will move the symbols to the appropriate output section - when it defines common symbols. */ + want to attach this common section to DYNOBJ. The linker + will move the symbols to the appropriate output section + when it defines common symbols. */ amt = sizeof (asection); sdata->bss_section = (asection *) bfd_zalloc (abfd, amt); if (sdata->bss_section == NULL) @@ -2939,20 +4063,18 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; { - bfd *dynobj; + struct ppc_elf_link_hash_table *htab; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_symbol called for %s", h->root.root.string); #endif - dynobj = elf_hash_table (info)->dynobj; - BFD_ASSERT (dynobj != NULL); + htab = ppc_elf_hash_table (info); + BFD_ASSERT (htab->elf.dynobj != NULL); if (h->plt.offset != (bfd_vma) -1) { - asection *splt; - asection *srela; Elf_Internal_Rela rela; bfd_byte *loc; bfd_vma reloc_index; @@ -2962,20 +4084,17 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) #endif /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ BFD_ASSERT (h->dynindx != -1); - - splt = bfd_get_section_by_name (dynobj, ".plt"); - srela = bfd_get_section_by_name (dynobj, ".rela.plt"); - BFD_ASSERT (splt != NULL && srela != NULL); + BFD_ASSERT (htab->plt != NULL && htab->relplt != NULL); /* We don't need to fill in the .plt. The ppc dynamic linker will fill it in. */ /* Fill in the entry in the .rela.plt section. */ - rela.r_offset = (splt->output_section->vma - + splt->output_offset + rela.r_offset = (htab->plt->output_section->vma + + htab->plt->output_offset + h->plt.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT); rela.r_addend = 0; @@ -2983,7 +4102,8 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE; if (reloc_index > PLT_NUM_SINGLE_ENTRIES) reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2; - loc = srela->contents + reloc_index * sizeof (Elf32_External_Rela); + loc = (htab->relplt->contents + + reloc_index * sizeof (Elf32_External_Rela)); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) @@ -3001,49 +4121,6 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) - { - asection *sgot; - asection *srela; - Elf_Internal_Rela rela; - bfd_byte *loc; - - /* This symbol has an entry in the global offset table. Set it - up. */ - - sgot = bfd_get_section_by_name (dynobj, ".got"); - srela = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (sgot != NULL && srela != NULL); - - rela.r_offset = (sgot->output_section->vma - + sgot->output_offset - + (h->got.offset &~ (bfd_vma) 1)); - - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. The entry in - the global offset table will already have been initialized in - the relocate_section function. */ - if (info->shared - && SYMBOL_REFERENCES_LOCAL (info, h)) - { - rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); - rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - } - else - { - BFD_ASSERT ((h->got.offset & 1) == 0); - rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT); - rela.r_addend = 0; - } - - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); - loc = srela->contents; - loc += srela->reloc_count++ * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - } - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { asection *s; @@ -3058,12 +4135,10 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1); - if (h->size <= elf_gp_size (dynobj)) - s = bfd_get_section_by_name (h->root.u.def.section->owner, - ".rela.sbss"); + if (h->size <= elf_gp_size (htab->elf.dynobj)) + s = htab->relsbss; else - s = bfd_get_section_by_name (h->root.u.def.section->owner, - ".rela.bss"); + s = htab->relbss; BFD_ASSERT (s != NULL); rela.r_offset = (h->root.u.def.value @@ -3096,80 +4171,69 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) struct bfd_link_info *info; { asection *sdyn; - bfd *dynobj = elf_hash_table (info)->dynobj; - asection *sgot = bfd_get_section_by_name (dynobj, ".got"); + struct ppc_elf_link_hash_table *htab; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n"); #endif - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + htab = ppc_elf_hash_table (info); + sdyn = bfd_get_section_by_name (htab->elf.dynobj, ".dynamic"); - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created) { - asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL && sdyn != NULL); + BFD_ASSERT (htab->plt != NULL && sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; - const char *name; - bfd_boolean size; + asection *s; - bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); + bfd_elf32_swap_dyn_in (htab->elf.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; - default: name = NULL; size = FALSE; break; - } + case DT_PLTGOT: + s = htab->plt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; - if (name != NULL) - { - asection *s; + case DT_PLTRELSZ: + dyn.d_un.d_val = htab->relplt->_raw_size; + break; - 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 - { - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size; - else - dyn.d_un.d_val = s->_raw_size; - } - } - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + case DT_JMPREL: + s = htab->relplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + + default: + continue; } + + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); } } /* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can easily find the address of the _GLOBAL_OFFSET_TABLE_. */ - if (sgot) + if (htab->got) { - unsigned char *contents = sgot->contents; + unsigned char *contents = htab->got->contents; bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents); if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4); + bfd_put_32 (output_bfd, (bfd_vma) 0, contents + 4); else bfd_put_32 (output_bfd, sdyn->output_section->vma + sdyn->output_offset, - contents+4); + contents + 4); - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 4; } return TRUE; @@ -3216,25 +4280,16 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *local_syms; asection **local_sections; { - Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); - bfd *dynobj = elf_hash_table (info)->dynobj; - elf_linker_section_t *sdata = NULL; - elf_linker_section_t *sdata2 = NULL; - Elf_Internal_Rela *rel = relocs; - Elf_Internal_Rela *relend = relocs + input_section->reloc_count; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + struct ppc_elf_link_hash_table *htab; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + Elf_Internal_Rela outrel; + bfd_byte *loc; asection *sreloc = NULL; - asection *splt; - asection *sgot; bfd_vma *local_got_offsets; bfd_boolean ret = TRUE; - long insn; - - if (dynobj) - { - sdata = elf_linker_section (dynobj, LINKER_SECTION_SDATA); - sdata2 = elf_linker_section (dynobj, LINKER_SECTION_SDATA2); - } #ifdef DEBUG fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n", @@ -3251,56 +4306,43 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Initialize howto table if needed. */ ppc_elf_howto_init (); + htab = ppc_elf_hash_table (info); local_got_offsets = elf_local_got_offsets (input_bfd); - - splt = sgot = NULL; - if (dynobj != NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - sgot = bfd_get_section_by_name (dynobj, ".got"); - } - + 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++) { - enum elf_ppc_reloc_type r_type = (enum elf_ppc_reloc_type)ELF32_R_TYPE (rel->r_info); - bfd_vma offset = rel->r_offset; - bfd_vma addend = rel->r_addend; - bfd_reloc_status_type r = bfd_reloc_other; - Elf_Internal_Sym *sym = (Elf_Internal_Sym *) 0; - asection *sec = (asection *) 0; - struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) 0; - const char *sym_name = (const char *) 0; + enum elf_ppc_reloc_type r_type; + bfd_vma addend; + bfd_reloc_status_type r; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + const char *sym_name; reloc_howto_type *howto; unsigned long r_symndx; bfd_vma relocation; - int will_become_local; - - /* Unknown relocation handling */ - if ((unsigned) r_type >= (unsigned) R_PPC_max - || !ppc_elf_howto_table[(int) r_type]) - { - (*_bfd_error_handler) (_("%s: unknown relocation type %d"), - bfd_archive_filename (input_bfd), - (int) r_type); - - bfd_set_error (bfd_error_bad_value); - ret = FALSE; - continue; - } - - howto = ppc_elf_howto_table[(int) r_type]; + bfd_vma branch_bit, insn, from; + bfd_boolean unresolved_reloc; + bfd_boolean warned; + unsigned int tls_type, tls_mask, tls_gd; + + r_type = (enum elf_ppc_reloc_type)ELF32_R_TYPE (rel->r_info); + sym = (Elf_Internal_Sym *) 0; + sec = (asection *) 0; + h = (struct elf_link_hash_entry *) 0; + unresolved_reloc = FALSE; + warned = FALSE; r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - sym_name = "<local symbol>"; + sym_name = bfd_elf_local_sym_name (input_bfd, sym); relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); - addend = rel->r_addend; - /* Relocs to local symbols are always resolved. */ - will_become_local = 1; } else { @@ -3310,127 +4352,551 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, h = (struct elf_link_hash_entry *) h->root.u.i.link; sym_name = h->root.root.string; - /* Can this relocation be resolved immediately? */ - will_become_local = SYMBOL_REFERENCES_LOCAL (info, h); - + relocation = 0; if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if (((r_type == R_PPC_PLT32 - || r_type == R_PPC_PLTREL24) - && splt != NULL - && h->plt.offset != (bfd_vma) -1) - || (r_type == R_PPC_LOCAL24PC - && sec->output_section == NULL) - || ((r_type == R_PPC_GOT16 - || r_type == R_PPC_GOT16_LO - || r_type == R_PPC_GOT16_HI - || r_type == R_PPC_GOT16_HA) - && elf_hash_table (info)->dynamic_sections_created - && (! info->shared || ! will_become_local)) - || (info->shared - && ! will_become_local - && ((input_section->flags & SEC_ALLOC) != 0 - /* Testing SEC_DEBUGGING here may be wrong. - It's here to avoid a crash when - generating a shared library with DWARF - debugging information. */ - || ((input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) - && (r_type == R_PPC_ADDR32 - || r_type == R_PPC_ADDR24 - || r_type == R_PPC_ADDR16 - || r_type == R_PPC_ADDR16_LO - || r_type == R_PPC_ADDR16_HI - || r_type == R_PPC_ADDR16_HA - || r_type == R_PPC_ADDR14 - || r_type == R_PPC_ADDR14_BRTAKEN - || r_type == R_PPC_ADDR14_BRNTAKEN - || r_type == R_PPC_COPY - || r_type == R_PPC_GLOB_DAT - || r_type == R_PPC_JMP_SLOT - || r_type == R_PPC_UADDR32 - || r_type == R_PPC_UADDR16 - || r_type == R_PPC_SDAREL16 - || r_type == R_PPC_EMB_NADDR32 - || r_type == R_PPC_EMB_NADDR16 - || r_type == R_PPC_EMB_NADDR16_LO - || r_type == R_PPC_EMB_NADDR16_HI - || r_type == R_PPC_EMB_NADDR16_HA - || r_type == R_PPC_EMB_SDAI16 - || r_type == R_PPC_EMB_SDA2I16 - || r_type == R_PPC_EMB_SDA2REL - || r_type == R_PPC_EMB_SDA21 - || r_type == R_PPC_EMB_MRKREF - || r_type == R_PPC_EMB_BIT_FLD - || r_type == R_PPC_EMB_RELSDA - || ((r_type == R_PPC_REL24 - || r_type == R_PPC_REL32 - || r_type == R_PPC_REL14 - || r_type == R_PPC_REL14_BRTAKEN - || r_type == R_PPC_REL14_BRNTAKEN - || r_type == R_PPC_RELATIVE) - && strcmp (h->root.root.string, - "_GLOBAL_OFFSET_TABLE_") != 0)))) - { - /* In these cases, we don't need the relocation - value. We check specially because in some - obscure cases sec->output_section will be NULL. */ - relocation = 0; - } - else if (sec->output_section == NULL) - { - (*_bfd_error_handler) - (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), - bfd_archive_filename (input_bfd), h->root.root.string, - bfd_get_section_name (input_bfd, input_section)); - relocation = 0; - } + /* Set a flag that will be cleared later if we find a + relocation value for this symbol. output_section + is typically NULL for symbols satisfied by a shared + library. */ + if (sec->output_section == NULL) + unresolved_reloc = TRUE; else relocation = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); } else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; + ; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; + ; else { - if (! (*info->callbacks->undefined_symbol) (info, - h->root.root.string, - input_bfd, - input_section, - rel->r_offset, - (!info->shared - || info->no_undefined - || ELF_ST_VISIBILITY (h->other)))) + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, input_section, + rel->r_offset, (!info->shared + || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return FALSE; - relocation = 0; + warned = TRUE; + } + } + + /* 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 + for the final instruction stream. */ + tls_mask = 0; + tls_gd = 0; + if (IS_PPC_TLS_RELOC (r_type)) + { + if (h != NULL) + tls_mask = ((struct ppc_elf_link_hash_entry *) h)->tls_mask; + else if (local_got_offsets != NULL) + { + char *lgot_masks; + lgot_masks = (char *) (local_got_offsets + symtab_hdr->sh_info); + tls_mask = lgot_masks[r_symndx]; } } - switch ((int) r_type) + /* Ensure reloc mapping code below stays sane. */ + if ((R_PPC_GOT_TLSLD16 & 3) != (R_PPC_GOT_TLSGD16 & 3) + || (R_PPC_GOT_TLSLD16_LO & 3) != (R_PPC_GOT_TLSGD16_LO & 3) + || (R_PPC_GOT_TLSLD16_HI & 3) != (R_PPC_GOT_TLSGD16_HI & 3) + || (R_PPC_GOT_TLSLD16_HA & 3) != (R_PPC_GOT_TLSGD16_HA & 3) + || (R_PPC_GOT_TLSLD16 & 3) != (R_PPC_GOT_TPREL16 & 3) + || (R_PPC_GOT_TLSLD16_LO & 3) != (R_PPC_GOT_TPREL16_LO & 3) + || (R_PPC_GOT_TLSLD16_HI & 3) != (R_PPC_GOT_TPREL16_HI & 3) + || (R_PPC_GOT_TLSLD16_HA & 3) != (R_PPC_GOT_TPREL16_HA & 3)) + abort (); + switch (r_type) { default: - (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"), - bfd_archive_filename (input_bfd), - (int) r_type, sym_name); + break; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) + { + bfd_vma insn; + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn &= 31 << 21; + insn |= 0x3c020000; /* addis 0,2,0 */ + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + r_type = R_PPC_TPREL16_HA; + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + } + break; + + case R_PPC_TLS: + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) + { + bfd_vma insn, rtra; + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); + if ((insn & ((31 << 26) | (31 << 11))) + == ((31 << 26) | (2 << 11))) + rtra = insn & ((1 << 26) - (1 << 16)); + else if ((insn & ((31 << 26) | (31 << 16))) + == ((31 << 26) | (2 << 16))) + rtra = (insn & (31 << 21)) | ((insn & (31 << 11)) << 5); + else + abort (); + if ((insn & ((1 << 11) - (1 << 1))) == 266 << 1) + /* add -> addi. */ + insn = 14 << 26; + else if ((insn & (31 << 1)) == 23 << 1 + && ((insn & (31 << 6)) < 14 << 6 + || ((insn & (31 << 6)) >= 16 << 6 + && (insn & (31 << 6)) < 24 << 6))) + /* load and store indexed -> dform. */ + insn = (32 | ((insn >> 6) & 31)) << 26; + else if ((insn & (31 << 1)) == 21 << 1 + && (insn & (0x1a << 6)) == 0) + /* ldx, ldux, stdx, stdux -> ld, ldu, std, stdu. */ + insn = (((58 | ((insn >> 6) & 4)) << 26) + | ((insn >> 6) & 1)); + else if ((insn & (31 << 1)) == 21 << 1 + && (insn & ((1 << 11) - (1 << 1))) == 341 << 1) + /* lwax -> lwa. */ + insn = (58 << 26) | 2; + else + abort (); + insn |= rtra; + 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; + } + break; + + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_gdld_hi; + break; + + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + { + tls_gdld_hi: + if ((tls_mask & tls_gd) != 0) + r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3) + + R_PPC_GOT_TPREL16); + else + { + bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); + rel->r_offset -= 2; + r_type = R_PPC_NONE; + } + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + } + break; + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_get_addr_check; + break; + + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + { + tls_get_addr_check: + if (rel + 1 < relend) + { + enum elf_ppc_reloc_type r_type2; + unsigned long r_symndx2; + struct elf_link_hash_entry *h2; + bfd_vma insn1, insn2, insn3; + bfd_vma offset; + + /* The next instruction should be a call to + __tls_get_addr. Peek at the reloc to be sure. */ + r_type2 + = (enum elf_ppc_reloc_type) ELF32_R_TYPE (rel[1].r_info); + r_symndx2 = ELF32_R_SYM (rel[1].r_info); + if (r_symndx2 < symtab_hdr->sh_info + || (r_type2 != R_PPC_REL14 + && r_type2 != R_PPC_REL14_BRTAKEN + && r_type2 != R_PPC_REL14_BRNTAKEN + && r_type2 != R_PPC_REL24 + && r_type2 != R_PPC_PLTREL24)) + break; + + h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info]; + while (h2->root.type == bfd_link_hash_indirect + || h2->root.type == bfd_link_hash_warning) + h2 = (struct elf_link_hash_entry *) h2->root.u.i.link; + if (h2 == NULL || h2 != htab->tls_get_addr) + break; + + /* OK, it checks out. Replace the call. */ + offset = rel[1].r_offset; + insn1 = bfd_get_32 (output_bfd, + contents + rel->r_offset - 2); + insn3 = bfd_get_32 (output_bfd, + contents + offset + 4); + if ((tls_mask & tls_gd) != 0) + { + /* IE */ + insn1 &= (1 << 26) - 1; + insn1 |= 32 << 26; /* lwz */ + insn2 = 0x7c631214; /* add 3,3,2 */ + rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE); + r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3) + + R_PPC_GOT_TPREL16); + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + } + else + { + /* LE */ + insn1 = 0x3c620000; /* addis 3,2,0 */ + insn2 = 0x38630000; /* addi 3,3,0 */ + if (tls_gd == 0) + { + /* Was an LD reloc. */ + r_symndx = 0; + rel->r_addend = htab->tls_sec->vma + DTP_OFFSET; + rel[1].r_addend = htab->tls_sec->vma + DTP_OFFSET; + } + r_type = R_PPC_TPREL16_HA; + 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; + } + if (insn3 == NOP + || insn3 == CROR_151515 || insn3 == CROR_313131) + { + insn3 = insn2; + insn2 = NOP; + rel[1].r_offset += 4; + } + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn2, contents + offset); + bfd_put_32 (output_bfd, insn3, contents + offset + 4); + if (tls_gd == 0) + { + /* We changed the symbol on an LD reloc. Start over + in order to get h, sym, sec etc. right. */ + rel--; + continue; + } + } + } + break; + } + + /* Handle other relocations that tweak non-addend part of insn. */ + branch_bit = 0; + switch (r_type) + { + default: + break; + + /* Branch taken prediction relocations. */ + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_REL14_BRTAKEN: + branch_bit = BRANCH_PREDICT_BIT; + /* Fall thru */ + + /* Branch not taken predicition relocations. */ + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_REL14_BRNTAKEN: + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); + insn &= ~BRANCH_PREDICT_BIT; + insn |= branch_bit; + + from = (rel->r_offset + + input_section->output_offset + + input_section->output_section->vma); + + /* Invert 'y' bit if not the default. */ + if ((bfd_signed_vma) (relocation + rel->r_addend - from) < 0) + insn ^= BRANCH_PREDICT_BIT; + + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + break; + } + + addend = rel->r_addend; + tls_type = 0; + howto = NULL; + if ((unsigned) r_type < (unsigned) R_PPC_max) + howto = ppc_elf_howto_table[(int) r_type]; + switch (r_type) + { + default: + (*_bfd_error_handler) + (_("%s: unknown relocation type %d for symbol %s"), + bfd_archive_filename (input_bfd), (int) r_type, sym_name); bfd_set_error (bfd_error_bad_value); ret = FALSE; continue; - case (int) R_PPC_NONE: + case R_PPC_NONE: + case R_PPC_TLS: + case R_PPC_EMB_MRKREF: + case R_PPC_GNU_VTINHERIT: + case R_PPC_GNU_VTENTRY: continue; + /* GOT16 relocations. Like an ADDR16 using the symbol's + address in the GOT as relocation value instead of the + symbol's value itself. Also, create a GOT entry for the + symbol and put the symbol value there. */ + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogot; + + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + tls_type = TLS_TLS | TLS_LD; + goto dogot; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + tls_type = TLS_TLS | TLS_TPREL; + goto dogot; + + case R_PPC_GOT_DTPREL16: + case R_PPC_GOT_DTPREL16_LO: + case R_PPC_GOT_DTPREL16_HI: + case R_PPC_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + goto dogot; + + case R_PPC_GOT16: + case R_PPC_GOT16_LO: + case R_PPC_GOT16_HI: + case R_PPC_GOT16_HA: + dogot: + { + /* Relocation is to the entry for this symbol in the global + offset table. */ + bfd_vma off; + bfd_vma *offp; + unsigned long indx; + + if (htab->got == NULL) + abort (); + + indx = 0; + if (tls_type == (TLS_TLS | TLS_LD) + && (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))) + offp = &htab->tlsld_got.offset; + else if (h != NULL) + { + bfd_boolean dyn; + dyn = htab->elf.dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && SYMBOL_REFERENCES_LOCAL (info, h))) + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. */ + ; + else + { + indx = h->dynindx; + unresolved_reloc = FALSE; + } + offp = &h->got.offset; + } + else + { + if (local_got_offsets == NULL) + abort (); + offp = &local_got_offsets[r_symndx]; + } + + /* The offset must always be a multiple of 4. We use the + least significant bit to record whether we have already + processed this entry. */ + off = *offp; + if ((off & 1) != 0) + off &= ~1; + else + { + unsigned int tls_m = (tls_mask + & (TLS_LD | TLS_GD | TLS_DTPREL + | TLS_TPREL | TLS_TPRELGD)); + + if (offp == &htab->tlsld_got.offset) + tls_m = TLS_LD; + else if (h == NULL + || !(h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC)) + tls_m &= ~TLS_LD; + + /* We might have multiple got entries for this sym. + Initialize them all. */ + do + { + int tls_ty = 0; + + if ((tls_m & TLS_LD) != 0) + { + tls_ty = TLS_TLS | TLS_LD; + tls_m &= ~TLS_LD; + } + else if ((tls_m & TLS_GD) != 0) + { + tls_ty = TLS_TLS | TLS_GD; + tls_m &= ~TLS_GD; + } + else if ((tls_m & TLS_DTPREL) != 0) + { + tls_ty = TLS_TLS | TLS_DTPREL; + tls_m &= ~TLS_DTPREL; + } + else if ((tls_m & (TLS_TPREL | TLS_TPRELGD)) != 0) + { + tls_ty = TLS_TLS | TLS_TPREL; + tls_m = 0; + } + + /* Generate relocs for the dynamic linker. */ + if (info->shared || indx != 0) + { + outrel.r_offset = (htab->got->output_section->vma + + htab->got->output_offset + + off); + if (tls_ty & (TLS_LD | TLS_GD)) + { + outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPMOD32); + outrel.r_addend = 0; + if (tls_ty == (TLS_TLS | TLS_GD)) + { + loc = htab->relgot->contents; + loc += (htab->relgot->reloc_count++ + * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, + &outrel, loc); + outrel.r_info + = ELF32_R_INFO (indx, R_PPC_DTPREL32); + outrel.r_offset += 4; + } + } + else if (tls_ty == (TLS_TLS | TLS_DTPREL)) + outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPREL32); + else if (tls_ty == (TLS_TLS | TLS_TPREL)) + outrel.r_info = ELF32_R_INFO (indx, R_PPC_TPREL32); + else if (indx == 0) + outrel.r_info = ELF32_R_INFO (indx, R_PPC_RELATIVE); + else + outrel.r_info = ELF32_R_INFO (indx, R_PPC_GLOB_DAT); + outrel.r_addend = 0; + if (indx == 0) + outrel.r_addend += relocation; + loc = htab->relgot->contents; + loc += (htab->relgot->reloc_count++ + * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + + /* Init the .got section contents if we're not + emitting a reloc. */ + else + { + bfd_vma value = relocation; + + if ((tls_ty & (TLS_GD | TLS_TPREL | TLS_DTPREL + | TLS_TPRELGD)) != 0) + { + value -= htab->tls_sec->vma + DTP_OFFSET; + if ((tls_ty & TLS_TPREL) != 0) + value += DTP_OFFSET - TP_OFFSET; + } + + if (tls_ty == (TLS_TLS | TLS_GD)) + { + bfd_put_32 (output_bfd, value, + htab->got->contents + off + 4); + value = 1; + } + else if (tls_ty == (TLS_TLS | TLS_LD)) + value = 1; + bfd_put_32 (output_bfd, value, + htab->got->contents + off); + } + + off += 4; + if (tls_ty & (TLS_LD | TLS_GD)) + off += 4; + } + while (tls_m != 0); + + off = *offp; + *offp = off | 1; + } + + if (off >= (bfd_vma) -2) + abort (); + + if ((tls_type & TLS_TLS) != 0) + { + if (tls_type != (TLS_TLS | TLS_LD)) + { + if ((tls_mask & TLS_LD) != 0 + && !(h == NULL + || !(h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC))) + off += 8; + if (tls_type != (TLS_TLS | TLS_GD)) + { + if ((tls_mask & TLS_GD) != 0) + off += 8; + if (tls_type != (TLS_TLS | TLS_DTPREL)) + { + if ((tls_mask & TLS_DTPREL) != 0) + off += 4; + } + } + } + } + + relocation = htab->got->output_offset + off - 4; + + /* Addends on got relocations don't make much sense. + x+off@got is actually x@got+off, and since the got is + generated by a hash table traversal, the value in the + got at entry m+n bears little relation to the entry m. */ + if (addend != 0) + (*_bfd_error_handler) + (_("%s(%s+0x%lx): non-zero addend on got reloc against `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + sym_name); + } + break; + /* Relocations that need no special processing. */ - case (int) R_PPC_LOCAL24PC: + case R_PPC_LOCAL24PC: /* It makes no sense to point a local relocation at a symbol not in this object. */ if (h != NULL @@ -3449,45 +4915,95 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; - /* Relocations that may need to be propagated if this is a shared - object. */ - case (int) R_PPC_REL24: - case (int) R_PPC_REL32: - case (int) R_PPC_REL14: + case R_PPC_DTPREL16: + case R_PPC_DTPREL16_LO: + case R_PPC_DTPREL16_HI: + case R_PPC_DTPREL16_HA: + addend -= htab->tls_sec->vma + DTP_OFFSET; + break; + + /* Relocations that may need to be propagated if this is a shared + object. */ + case R_PPC_TPREL16: + case R_PPC_TPREL16_LO: + case R_PPC_TPREL16_HI: + case R_PPC_TPREL16_HA: + addend -= htab->tls_sec->vma + TP_OFFSET; + /* The TPREL16 relocs shouldn't really be used in shared + libs as they will result in DT_TEXTREL being set, but + support them anyway. */ + goto dodyn; + + case R_PPC_TPREL32: + addend -= htab->tls_sec->vma + TP_OFFSET; + goto dodyn; + + case R_PPC_DTPREL32: + addend -= htab->tls_sec->vma + DTP_OFFSET; + goto dodyn; + + case R_PPC_REL24: + case R_PPC_REL32: + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: /* If these relocations are not to a named symbol, they can be handled right here, no need to bother the dynamic linker. */ if (h == NULL || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 || SYMBOL_REFERENCES_LOCAL (info, h)) break; - /* fall through */ - - /* Relocations that always need to be propagated if this is a shared - object. */ - case (int) R_PPC_ADDR32: - case (int) R_PPC_ADDR24: - case (int) R_PPC_ADDR16: - case (int) R_PPC_ADDR16_LO: - case (int) R_PPC_ADDR16_HI: - case (int) R_PPC_ADDR16_HA: - case (int) R_PPC_ADDR14: - case (int) R_PPC_UADDR32: - case (int) R_PPC_UADDR16: - if (info->shared && r_symndx != 0) + /* fall through */ + + /* Relocations that always need to be propagated if this is a shared + object. */ + case R_PPC_ADDR32: + case R_PPC_ADDR24: + case R_PPC_ADDR16: + case R_PPC_ADDR16_LO: + case R_PPC_ADDR16_HI: + case R_PPC_ADDR16_HA: + case R_PPC_ADDR14: + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_UADDR32: + case R_PPC_UADDR16: + case R_PPC_DTPMOD32: + /* 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 ((info->shared + && (MUST_BE_DYN_RELOC (r_type) + || (h != NULL + && h->dynindx != -1 + && (!info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (ELIMINATE_COPY_RELOCS + && !info->shared + && (input_section->flags & SEC_ALLOC) != 0 + && h != NULL + && h->dynindx != -1 + && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) { - Elf_Internal_Rela outrel; - bfd_byte *loc; int skip; #ifdef DEBUG fprintf (stderr, "ppc_elf_relocate_section need to create relocation for %s\n", - (h && h->root.root.string) ? h->root.root.string : "<unknown>"); + (h && h->root.root.string + ? h->root.root.string : "<unknown>")); #endif /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ - + are copied into the output file to be resolved at run + time. */ if (sreloc == NULL) { const char *name; @@ -3504,7 +5020,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, input_section), name + 5) == 0); - sreloc = bfd_get_section_by_name (dynobj, name); + sreloc = bfd_get_section_by_name (htab->elf.dynobj, name); BFD_ASSERT (sreloc != NULL); } @@ -3522,9 +5038,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (skip) memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if this symbol was marked to - become local. */ - else if (! will_become_local) + become local. */ + else if (h != NULL + && !SYMBOL_REFERENCES_LOCAL (info, h)) { + unresolved_reloc = FALSE; outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; } @@ -3538,16 +5056,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, { long indx; - if (h == NULL) - sec = local_sections[r_symndx]; - else - { - BFD_ASSERT (h->root.type == bfd_link_hash_defined - || (h->root.type - == bfd_link_hash_defweak)); - sec = h->root.u.def.section; - } - if (bfd_is_abs_section (sec)) indx = 0; else if (sec == NULL || sec->owner == NULL) @@ -3571,8 +5079,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (indx <= 0) { printf ("indx=%d section=%s flags=%08x name=%s\n", - indx, osec->name, osec->flags, - h->root.root.string); + indx, osec->name, osec->flags, + h->root.root.string); } #endif } @@ -3599,186 +5107,66 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; } } - - /* Arithmetic adjust relocations that aren't going into a - shared object. */ - if (r_type == R_PPC_ADDR16_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). */ - && sec != NULL) - { - addend += ((relocation + addend) & 0x8000) << 1; - } - break; - - /* branch taken prediction relocations */ - case (int) R_PPC_ADDR14_BRTAKEN: - case (int) R_PPC_REL14_BRTAKEN: - insn = bfd_get_32 (output_bfd, contents + offset); - if ((relocation - offset) & 0x8000) - insn &= ~BRANCH_PREDICT_BIT; - else - insn |= BRANCH_PREDICT_BIT; - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); - break; - - /* branch not taken predicition relocations */ - case (int) R_PPC_ADDR14_BRNTAKEN: - case (int) R_PPC_REL14_BRNTAKEN: - insn = bfd_get_32 (output_bfd, contents + offset); - if ((relocation - offset) & 0x8000) - insn |= BRANCH_PREDICT_BIT; - else - insn &= ~BRANCH_PREDICT_BIT; - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); - break; - - /* GOT16 relocations */ - case (int) R_PPC_GOT16: - case (int) R_PPC_GOT16_LO: - case (int) R_PPC_GOT16_HI: - case (int) R_PPC_GOT16_HA: - /* Relocation is to the entry for this symbol in the global - offset table. */ - BFD_ASSERT (sgot != NULL); - - if (h != NULL) - { - bfd_vma off; - - off = h->got.offset; - BFD_ASSERT (off != (bfd_vma) -1); - - if (! elf_hash_table (info)->dynamic_sections_created - || (info->shared - && SYMBOL_REFERENCES_LOCAL (info, h))) - { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally. We must initialize this entry in the - global offset table. Since the offset must - always be a multiple of 4, we use the least - significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rela.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; - else - { - bfd_put_32 (output_bfd, relocation, - sgot->contents + off); - h->got.offset |= 1; - } - } - - relocation = sgot->output_offset + off - 4; - } - else - { - bfd_vma off; - - BFD_ASSERT (local_got_offsets != NULL - && local_got_offsets[r_symndx] != (bfd_vma) -1); - - off = local_got_offsets[r_symndx]; - - /* The offset must always be a multiple of 4. We use - the least significant bit to record whether we have - already processed this entry. */ - if ((off & 1) != 0) - off &= ~1; - else - { - - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - bfd_byte *loc; - - /* We need to generate a R_PPC_RELATIVE reloc - for the dynamic linker. */ - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (srelgot != NULL); - - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + off); - outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); - outrel.r_addend = relocation; - loc = srelgot->contents; - loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - relocation = 0; - } - - bfd_put_32 (output_bfd, relocation, sgot->contents + off); - local_got_offsets[r_symndx] |= 1; - } - - relocation = sgot->output_offset + off - 4; - } - if (r_type == R_PPC_GOT16_HA) - addend += ((relocation + addend) & 0x8000) << 1; break; - /* Indirect .sdata relocation */ - case (int) R_PPC_EMB_SDAI16: - BFD_ASSERT (sdata != NULL); - relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info, - sdata, h, relocation, rel, - R_PPC_RELATIVE); + /* Indirect .sdata relocation. */ + case R_PPC_EMB_SDAI16: + BFD_ASSERT (htab->sdata != NULL); + relocation + = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, + info, htab->sdata, h, + relocation, rel, + R_PPC_RELATIVE); break; - /* Indirect .sdata2 relocation */ - case (int) R_PPC_EMB_SDA2I16: - BFD_ASSERT (sdata2 != NULL); - relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info, - sdata2, h, relocation, rel, - R_PPC_RELATIVE); + /* Indirect .sdata2 relocation. */ + case R_PPC_EMB_SDA2I16: + BFD_ASSERT (htab->sdata2 != NULL); + relocation + = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, + info, htab->sdata2, h, + relocation, rel, + R_PPC_RELATIVE); break; - /* Handle the TOC16 reloc. We want to use the offset within the .got - section, not the actual VMA. This is appropriate when generating - an embedded ELF object, for which the .got section acts like the - AIX .toc section. */ - case (int) R_PPC_TOC16: /* phony GOT16 relocations */ + /* Handle the TOC16 reloc. We want to use the offset within the .got + section, not the actual VMA. This is appropriate when generating + an embedded ELF object, for which the .got section acts like the + AIX .toc section. */ + case R_PPC_TOC16: /* phony GOT16 relocations */ BFD_ASSERT (sec != (asection *) 0); BFD_ASSERT (bfd_is_und_section (sec) || strcmp (bfd_get_section_name (abfd, sec), ".got") == 0 || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0) - addend -= sec->output_section->vma + sec->output_offset + 0x8000; + addend -= sec->output_section->vma + sec->output_offset + 0x8000; break; - case (int) R_PPC_PLTREL24: + case R_PPC_PLTREL24: /* Relocation is to the entry for this symbol in the - procedure linkage table. */ + procedure linkage table. */ BFD_ASSERT (h != NULL); if (h->plt.offset == (bfd_vma) -1 - || splt == NULL) + || htab->plt == NULL) { /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ + happens when statically linking PIC code, or when + using -Bsymbolic. */ break; } - relocation = (splt->output_section->vma - + splt->output_offset + unresolved_reloc = FALSE; + relocation = (htab->plt->output_section->vma + + htab->plt->output_offset + h->plt.offset); break; - /* relocate against _SDA_BASE_ */ - case (int) R_PPC_SDAREL16: + /* Relocate against _SDA_BASE_. */ + case R_PPC_SDAREL16: { const char *name; + const struct elf_link_hash_entry *sh; BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); @@ -3790,19 +5178,21 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_archive_filename (input_bfd), sym_name, - ppc_elf_howto_table[(int) r_type]->name, + howto->name, name); } - addend -= (sdata->sym_hash->root.u.def.value - + sdata->sym_hash->root.u.def.section->output_section->vma - + sdata->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } break; - /* relocate against _SDA2_BASE_ */ - case (int) R_PPC_EMB_SDA2REL: + /* Relocate against _SDA2_BASE_. */ + case R_PPC_EMB_SDA2REL: { const char *name; + const struct elf_link_hash_entry *sh; BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); @@ -3812,24 +5202,26 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_archive_filename (input_bfd), sym_name, - ppc_elf_howto_table[(int) r_type]->name, + howto->name, name); bfd_set_error (bfd_error_bad_value); ret = FALSE; continue; } - addend -= (sdata2->sym_hash->root.u.def.value - + sdata2->sym_hash->root.u.def.section->output_section->vma - + sdata2->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata2->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } break; - /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */ - case (int) R_PPC_EMB_SDA21: - case (int) R_PPC_EMB_RELSDA: + /* Relocate against either _SDA_BASE_, _SDA2_BASE_, or 0. */ + case R_PPC_EMB_SDA21: + case R_PPC_EMB_RELSDA: { const char *name; + const struct elf_link_hash_entry *sh; int reg; BFD_ASSERT (sec != (asection *) 0); @@ -3840,18 +5232,20 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, && (name[5] == 0 || name[5] == '.')))) { reg = 13; - addend -= (sdata->sym_hash->root.u.def.value - + sdata->sym_hash->root.u.def.section->output_section->vma - + sdata->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } else if (strncmp (name, ".sdata2", 7) == 0 || strncmp (name, ".sbss2", 6) == 0) { reg = 2; - addend -= (sdata2->sym_hash->root.u.def.value - + sdata2->sym_hash->root.u.def.section->output_section->vma - + sdata2->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata2->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } else if (strcmp (name, ".PPC.EMB.sdata0") == 0 @@ -3865,7 +5259,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_archive_filename (input_bfd), sym_name, - ppc_elf_howto_table[(int) r_type]->name, + howto->name, name); bfd_set_error (bfd_error_bad_value); @@ -3875,72 +5269,83 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (r_type == R_PPC_EMB_SDA21) { /* fill in register field */ - insn = bfd_get_32 (output_bfd, contents + offset); + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT); - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); } } break; - /* Relocate against the beginning of the section */ - case (int) R_PPC_SECTOFF: - case (int) R_PPC_SECTOFF_LO: - case (int) R_PPC_SECTOFF_HI: - BFD_ASSERT (sec != (asection *) 0); - addend -= sec->output_section->vma; - break; - - case (int) R_PPC_SECTOFF_HA: + /* Relocate against the beginning of the section. */ + case R_PPC_SECTOFF: + case R_PPC_SECTOFF_LO: + case R_PPC_SECTOFF_HI: + case R_PPC_SECTOFF_HA: BFD_ASSERT (sec != (asection *) 0); addend -= sec->output_section->vma; - addend += ((relocation + addend) & 0x8000) << 1; break; - /* Negative relocations */ - case (int) R_PPC_EMB_NADDR32: - case (int) R_PPC_EMB_NADDR16: - case (int) R_PPC_EMB_NADDR16_LO: - case (int) R_PPC_EMB_NADDR16_HI: + /* Negative relocations. */ + case R_PPC_EMB_NADDR32: + case R_PPC_EMB_NADDR16: + case R_PPC_EMB_NADDR16_LO: + case R_PPC_EMB_NADDR16_HI: + case R_PPC_EMB_NADDR16_HA: addend -= 2 * relocation; break; - case (int) R_PPC_EMB_NADDR16_HA: - addend -= 2 * relocation; - addend += ((relocation + addend) & 0x8000) << 1; - break; - - /* NOP relocation that prevents garbage collecting linkers from omitting a - reference. */ - case (int) R_PPC_EMB_MRKREF: - continue; - - case (int) R_PPC_COPY: - case (int) R_PPC_GLOB_DAT: - case (int) R_PPC_JMP_SLOT: - case (int) R_PPC_RELATIVE: - case (int) R_PPC_PLT32: - case (int) R_PPC_PLTREL32: - case (int) R_PPC_PLT16_LO: - case (int) R_PPC_PLT16_HI: - case (int) R_PPC_PLT16_HA: - case (int) R_PPC_EMB_RELSEC16: - case (int) R_PPC_EMB_RELST_LO: - case (int) R_PPC_EMB_RELST_HI: - case (int) R_PPC_EMB_RELST_HA: - case (int) R_PPC_EMB_BIT_FLD: - (*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."), - bfd_archive_filename (input_bfd), - ppc_elf_howto_table[(int) r_type]->name, - sym_name); + case R_PPC_COPY: + case R_PPC_GLOB_DAT: + case R_PPC_JMP_SLOT: + case R_PPC_RELATIVE: + case R_PPC_PLT32: + case R_PPC_PLTREL32: + case R_PPC_PLT16_LO: + case R_PPC_PLT16_HI: + case R_PPC_PLT16_HA: + case R_PPC_ADDR30: + case R_PPC_EMB_RELSEC16: + case R_PPC_EMB_RELST_LO: + case R_PPC_EMB_RELST_HI: + case R_PPC_EMB_RELST_HA: + case R_PPC_EMB_BIT_FLD: + (*_bfd_error_handler) + (_("%s: Relocation %s is not yet supported for symbol %s."), + bfd_archive_filename (input_bfd), + howto->name, + sym_name); bfd_set_error (bfd_error_invalid_operation); ret = FALSE; continue; + } - case (int) R_PPC_GNU_VTINHERIT: - case (int) R_PPC_GNU_VTENTRY: - /* These are no-ops in the end. */ - continue; + /* Do any further special processing. */ + switch (r_type) + { + default: + break; + + case R_PPC_ADDR16_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. */ + addend += ((relocation + addend) & 0x8000) << 1; + break; } #ifdef DEBUG @@ -3949,27 +5354,41 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (int) r_type, sym_name, r_symndx, - (long) offset, + (long) rel->r_offset, (long) addend); #endif + if (unresolved_reloc + && !((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + sym_name); + ret = FALSE; + } + r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, - offset, + rel->r_offset, relocation, addend); - if (r == bfd_reloc_ok) - ; - else if (r == bfd_reloc_overflow) + if (r != bfd_reloc_ok) { - const char *name; - - if (h != NULL) + if (sym_name == NULL) + sym_name = "(null)"; + if (r == bfd_reloc_overflow) { - if (h->root.type == bfd_link_hash_undefweak + if (warned) + continue; + if (h != NULL + && h->root.type == bfd_link_hash_undefweak && howto->pc_relative) { /* Assume this is a call protected by other code that @@ -3981,30 +5400,25 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - name = h->root.root.string; + if (! (*info->callbacks->reloc_overflow) (info, + sym_name, + howto->name, + rel->r_addend, + input_bfd, + input_section, + rel->r_offset)) + return FALSE; } else { - name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (name == NULL) - continue; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); + (*_bfd_error_handler) + (_("%s(%s+0x%lx): reloc against `%s': error %d"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, sym_name, (int) r); + ret = FALSE; } - - if (! (*info->callbacks->reloc_overflow) (info, - name, - howto->name, - (bfd_vma) 0, - input_bfd, - input_section, - offset)) - return FALSE; } - else - ret = FALSE; } #ifdef DEBUG @@ -4033,7 +5447,8 @@ ppc_elf_reloc_type_class (rela) } } -/* Support for core dump NOTE sections */ +/* Support for core dump NOTE sections. */ + static bfd_boolean ppc_elf_grok_prstatus (abfd, note) bfd *abfd; @@ -4044,21 +5459,21 @@ ppc_elf_grok_prstatus (abfd, note) switch (note->descsz) { - default: - return FALSE; + default: + return FALSE; - case 268: /* Linux/PPC */ - /* pr_cursig */ - elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + case 268: /* Linux/PPC. */ + /* 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_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); - /* pr_reg */ - offset = 72; - raw_size = 192; + /* pr_reg */ + offset = 72; + raw_size = 192; - break; + break; } /* Make a ".reg/999" section. */ @@ -4073,14 +5488,14 @@ ppc_elf_grok_psinfo (abfd, note) { switch (note->descsz) { - default: - return FALSE; + default: + return FALSE; - case 128: /* Linux/PPC elf_prpsinfo */ - elf_tdata (abfd)->core_program - = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); - elf_tdata (abfd)->core_command - = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); + case 128: /* Linux/PPC elf_prpsinfo. */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); } /* Note that for some reason, a spurious space is tacked @@ -4101,28 +5516,27 @@ ppc_elf_grok_psinfo (abfd, note) /* Very simple linked list structure for recording apuinfo values. */ typedef struct apuinfo_list { - struct apuinfo_list * next; - unsigned long value; + struct apuinfo_list *next; + unsigned long value; } apuinfo_list; static apuinfo_list * head; -static void apuinfo_list_init PARAMS ((void)); -static void apuinfo_list_add PARAMS ((unsigned long)); -static unsigned apuinfo_list_length PARAMS ((void)); +static void apuinfo_list_init PARAMS ((void)); +static void apuinfo_list_add PARAMS ((unsigned long)); +static unsigned apuinfo_list_length PARAMS ((void)); static unsigned long apuinfo_list_element PARAMS ((unsigned long)); -static void apuinfo_list_finish PARAMS ((void)); +static void apuinfo_list_finish PARAMS ((void)); -extern void ppc_elf_begin_write_processing +extern void ppc_elf_begin_write_processing PARAMS ((bfd *, struct bfd_link_info *)); -extern void ppc_elf_final_write_processing +extern void ppc_elf_final_write_processing PARAMS ((bfd *, bfd_boolean)); -extern bfd_boolean ppc_elf_write_section +extern bfd_boolean ppc_elf_write_section PARAMS ((bfd *, asection *, bfd_byte *)); - static void apuinfo_list_init PARAMS ((void)) { @@ -4133,7 +5547,7 @@ static void apuinfo_list_add (value) unsigned long value; { - apuinfo_list * entry = head; + apuinfo_list *entry = head; while (entry != NULL) { @@ -4154,7 +5568,7 @@ apuinfo_list_add (value) static unsigned apuinfo_list_length PARAMS ((void)) { - apuinfo_list * entry; + apuinfo_list *entry; unsigned long count; for (entry = head, count = 0; @@ -4182,11 +5596,11 @@ apuinfo_list_element (number) static void apuinfo_list_finish PARAMS ((void)) { - apuinfo_list * entry; + apuinfo_list *entry; for (entry = head; entry;) { - apuinfo_list * next = entry->next; + apuinfo_list *next = entry->next; free (entry); entry = next; } @@ -4194,8 +5608,8 @@ apuinfo_list_finish PARAMS ((void)) head = NULL; } -#define APUINFO_SECTION_NAME ".PPC.EMB.apuinfo" -#define APUINFO_LABEL "APUinfo" +#define APUINFO_SECTION_NAME ".PPC.EMB.apuinfo" +#define APUINFO_LABEL "APUinfo" /* Scan the input BFDs and create a linked list of the APUinfo values that will need to be emitted. */ @@ -4205,16 +5619,16 @@ ppc_elf_begin_write_processing (abfd, link_info) bfd *abfd; struct bfd_link_info *link_info; { - bfd * ibfd; - asection * asec; - char * buffer; - unsigned num_input_sections; + bfd *ibfd; + asection *asec; + char *buffer; + unsigned num_input_sections; bfd_size_type output_section_size; - unsigned i; - unsigned num_entries; + unsigned i; + unsigned num_entries; unsigned long offset; unsigned long length; - const char * error_message = NULL; + const char *error_message = NULL; if (link_info == NULL) return; @@ -4254,9 +5668,8 @@ ppc_elf_begin_write_processing (abfd, link_info) /* Read in the input sections contents. */ for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link_next) { - unsigned long datum; - char * ptr; - + unsigned long datum; + char *ptr; asec = bfd_get_section_by_name (ibfd, APUINFO_SECTION_NAME); if (asec == NULL) @@ -4319,7 +5732,7 @@ ppc_elf_begin_write_processing (abfd, link_info) asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME); - if (! bfd_set_section_size (abfd, asec, output_section_size)) + if (! bfd_set_section_size (abfd, asec, output_section_size)) ibfd = abfd, error_message = _("warning: unable to set size of %s section in %s"); @@ -4327,8 +5740,8 @@ ppc_elf_begin_write_processing (abfd, link_info) free (buffer); if (error_message) - _bfd_error_handler (error_message, APUINFO_SECTION_NAME, - bfd_archive_filename (ibfd)); + (*_bfd_error_handler) (error_message, APUINFO_SECTION_NAME, + bfd_archive_filename (ibfd)); } @@ -4337,11 +5750,12 @@ ppc_elf_begin_write_processing (abfd, link_info) bfd_boolean ppc_elf_write_section (abfd, asec, contents) - bfd * abfd ATTRIBUTE_UNUSED; - asection * asec; - bfd_byte * contents ATTRIBUTE_UNUSED; + bfd *abfd ATTRIBUTE_UNUSED; + asection *asec; + bfd_byte *contents ATTRIBUTE_UNUSED; { - return apuinfo_list_length () && strcmp (asec->name, APUINFO_SECTION_NAME) == 0; + return (apuinfo_list_length () + && strcmp (asec->name, APUINFO_SECTION_NAME) == 0); } @@ -4349,13 +5763,13 @@ ppc_elf_write_section (abfd, asec, contents) void ppc_elf_final_write_processing (abfd, linker) - bfd * abfd; + bfd *abfd; bfd_boolean linker ATTRIBUTE_UNUSED; { - bfd_byte * buffer; - asection * asec; - unsigned i; - unsigned num_entries; + bfd_byte *buffer; + asection *asec; + unsigned i; + unsigned num_entries; bfd_size_type length; asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME); @@ -4372,7 +5786,8 @@ ppc_elf_final_write_processing (abfd, linker) buffer = bfd_malloc (length); if (buffer == NULL) { - _bfd_error_handler (_("failed to allocate space for new APUinfo section.")); + (*_bfd_error_handler) + (_("failed to allocate space for new APUinfo section.")); return; } @@ -4391,10 +5806,10 @@ ppc_elf_final_write_processing (abfd, linker) } if (length != asec->_raw_size) - _bfd_error_handler (_("failed to compute new APUinfo section.")); + (*_bfd_error_handler) (_("failed to compute new APUinfo section.")); if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length)) - _bfd_error_handler (_("failed to install new APUinfo section.")); + (*_bfd_error_handler) (_("failed to install new APUinfo section.")); free (buffer); @@ -4427,11 +5842,10 @@ ppc_elf_final_write_processing (abfd, linker) #define elf_backend_rela_normal 1 #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_relax_section ppc_elf_relax_section #define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags -#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link -#define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create +#define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create #define elf_backend_object_p ppc_elf_object_p #define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook @@ -4452,8 +5866,8 @@ ppc_elf_final_write_processing (abfd, linker) #define elf_backend_grok_prstatus ppc_elf_grok_prstatus #define elf_backend_grok_psinfo ppc_elf_grok_psinfo #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 -#define elf_backend_write_section ppc_elf_write_section +#define elf_backend_begin_write_processing ppc_elf_begin_write_processing +#define elf_backend_final_write_processing ppc_elf_final_write_processing +#define elf_backend_write_section ppc_elf_write_section #include "elf32-target.h" diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index e8d94af..857b7a0 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. @@ -351,7 +351,7 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst) /* A relocation function which doesn't do anything. */ static bfd_reloc_status_type s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) + output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry; asymbol *symbol ATTRIBUTE_UNUSED; @@ -935,7 +935,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) && local_got_refcounts == NULL) { bfd_size_type size; - + size = symtab_hdr->sh_info; size *= (sizeof (bfd_signed_vma) + sizeof(char)); local_got_refcounts = ((bfd_signed_vma *) @@ -969,20 +969,20 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* Got is created, nothing to be done. */ break; - case R_390_PLT16DBL: - case R_390_PLT32DBL: + case R_390_PLT16DBL: + case R_390_PLT32DBL: case R_390_PLT32: case R_390_PLTOFF16: case R_390_PLTOFF32: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code which is - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code which is + never referenced by a dynamic object, in which case we + don't need to generate a procedure linkage table entry + after all. */ /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ + creating a procedure linkage table entry. */ if (h != NULL) { h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; @@ -1022,10 +1022,10 @@ elf_s390_check_relocs (abfd, info, sec, relocs) case R_390_TLS_IEENT: if (info->shared) info->flags |= DF_STATIC_TLS; - /* Fall through */ + /* Fall through. */ case R_390_GOT12: - case R_390_GOT16: + case R_390_GOT16: case R_390_GOT32: case R_390_GOTENT: case R_390_TLS_GD32: @@ -1087,19 +1087,19 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (r_type != R_390_TLS_IE32) break; - /* Fall through */ + /* Fall through. */ case R_390_TLS_LE32: if (!info->shared) break; info->flags |= DF_STATIC_TLS; - /* Fall through */ + /* Fall through. */ - case R_390_8: - case R_390_16: + case R_390_8: + case R_390_16: case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: + case R_390_PC16: + case R_390_PC16DBL: case R_390_PC32DBL: case R_390_PC32: if (h != NULL && !info->shared) @@ -1216,8 +1216,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* Track dynamic relocs needed for local syms too. We really need local syms available to do this easily. Oh well. */ - asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) @@ -1231,6 +1231,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (p == NULL || p->sec != sec) { bfd_size_type amt = sizeof *p; + p = ((struct elf_s390_dyn_relocs *) bfd_alloc (htab->elf.dynobj, amt)); if (p == NULL) @@ -1253,17 +1254,17 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ - case R_390_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return FALSE; - break; + case R_390_GNU_VTINHERIT: + if (!_bfd_elf32_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_390_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return FALSE; - break; + case R_390_GNU_VTENTRY: + if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; default: break; @@ -1326,9 +1327,6 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -1339,16 +1337,31 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_s390_link_hash_entry *eh; + struct elf_s390_dyn_relocs **pp; + struct elf_s390_dyn_relocs *p; - if (r_symndx < symtab_hdr->sh_info) - h = NULL; - else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf_s390_link_hash_entry *) h; - r_type = elf_s390_tls_transition (info, - ELF32_R_TYPE (rel->r_info), - r_symndx >= symtab_hdr->sh_info); + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = ELF32_R_TYPE (rel->r_info); + r_type = elf_s390_tls_transition (info, r_type, h != NULL); switch (r_type) { case R_390_TLS_LDM32: @@ -1379,14 +1392,7 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) if (local_got_refcounts[r_symndx] > 0) local_got_refcounts[r_symndx] -= 1; } - if (r_type != R_390_TLS_IE32) - break; - /* Fall through */ - - case R_390_TLS_LE32: - if (!info->shared) - break; - /* Fall through */ + break; case R_390_8: case R_390_12: @@ -1396,33 +1402,10 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) case R_390_PC16DBL: case R_390_PC32DBL: case R_390_PC32: - if (h != NULL) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - eh = (struct elf_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF32_R_TYPE (rel->r_info) == R_390_PC16 - || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; - + if (info->shared) + break; + /* Fall through. */ + case R_390_PLT16DBL: case R_390_PLT32DBL: case R_390_PLT32: @@ -1516,8 +1499,8 @@ elf_s390_adjust_dynamic_symbol (info, h) && h->root.type != bfd_link_hash_undefined)) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object, or if all references were garbage collected. In + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In such a case, we don't actually need to build a procedure linkage table, and we can just do a PC32 reloc instead. */ h->plt.offset = (bfd_vma) -1; @@ -1847,6 +1830,7 @@ allocate_dynrelocs (h, inf) for (p = eh->dyn_relocs; p != NULL; p = p->next) { asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); } @@ -2014,7 +1998,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) } else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { - if (s->_raw_size != 0 && s != htab->srelplt) + if (s->_raw_size != 0) relocs = TRUE; /* We use the reloc_count field as a counter if we need @@ -2079,10 +2063,10 @@ elf_s390_size_dynamic_sections (output_bfd, info) } if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) + { + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) return FALSE; /* If any dynamic relocs apply to a read-only section, @@ -2202,8 +2186,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, r_type = ELF32_R_TYPE (rel->r_info); if (r_type == (int) R_390_GNU_VTINHERIT - || r_type == (int) R_390_GNU_VTENTRY) - continue; + || r_type == (int) R_390_GNU_VTENTRY) + continue; if (r_type >= (int) R_390_max) { bfd_set_error (bfd_error_bad_value); @@ -2252,7 +2236,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -2260,7 +2243,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, + input_section, rel->r_offset, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return FALSE; @@ -2291,7 +2274,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; - + /* Offset in GOT is PLT index plus GOT headers(3) times 4, addr & GOT addr. */ relocation = (plt_index + 3) * GOT_ENTRY_SIZE; @@ -2303,164 +2286,162 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, } /* Fall through. */ - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT32: case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ + /* Relocation is to the entry for this symbol in the global + offset table. */ if (htab->sgot == NULL) abort (); - if (h != NULL) - { + if (h != NULL) + { bfd_boolean dyn; - off = h->got.offset; + off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + || (info->shared + && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) - { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 2, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; - else - { + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + { + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. We must initialize + this entry in the global offset table. Since the + offset must always be a multiple of 2, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rel.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { bfd_put_32 (output_bfd, relocation, htab->sgot->contents + off); - h->got.offset |= 1; - } - } + h->got.offset |= 1; + } + } else unresolved_reloc = FALSE; - } - else - { + } + else + { if (local_got_offsets == NULL) abort (); - off = local_got_offsets[r_symndx]; + off = local_got_offsets[r_symndx]; - /* The offset must always be a multiple of 4. We use - the least significant bit to record whether we have - already generated the necessary reloc. */ - if ((off & 1) != 0) - off &= ~1; - else - { - bfd_put_32 (output_bfd, relocation, + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already generated the necessary reloc. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, htab->sgot->contents + off); - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; bfd_byte *loc; - srelgot = htab->srelgot; + srelgot = htab->srelgot; if (srelgot == NULL) abort (); - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + off); + outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation; loc = srelgot->contents; loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - } + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } - local_got_offsets[r_symndx] |= 1; - } - } + local_got_offsets[r_symndx] |= 1; + } + } if (off >= (bfd_vma) -2) abort (); relocation = htab->sgot->output_offset + off; - /* - * For @GOTENT the relocation is against the offset between - * the instruction and the symbols entry in the GOT and not - * between the start of the GOT and the symbols entry. We - * add the vma of the GOT to get the correct value. - */ + /* For @GOTENT the relocation is against the offset between + the instruction and the symbols entry in the GOT and not + between the start of the GOT and the symbols entry. We + add the vma of the GOT to get the correct value. */ if ( r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT) relocation += htab->sgot->output_section->vma; - break; + break; case R_390_GOTOFF16: - case R_390_GOTOFF32: - /* Relocation is relative to the start of the global offset - table. */ - - /* Note that sgot->output_offset is not involved in this - calculation. We always want the start of .got. If we - defined _GLOBAL_OFFSET_TABLE in a different way, as is - permitted by the ABI, we might have to change this - calculation. */ - relocation -= htab->sgot->output_section->vma; - break; - - case R_390_GOTPC: + case R_390_GOTOFF32: + /* Relocation is relative to the start of the global offset + table. */ + + /* Note that sgot->output_offset is not involved in this + calculation. We always want the start of .got. If we + defined _GLOBAL_OFFSET_TABLE in a different way, as is + permitted by the ABI, we might have to change this + calculation. */ + relocation -= htab->sgot->output_section->vma; + break; + + case R_390_GOTPC: case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ - relocation = htab->sgot->output_section->vma; + /* Use global offset table as symbol value. */ + relocation = htab->sgot->output_section->vma; unresolved_reloc = FALSE; - break; + break; - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_PLT32: - /* Relocation is to the entry for this symbol in the - procedure linkage table. */ + case R_390_PLT16DBL: + case R_390_PLT32DBL: + case R_390_PLT32: + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ - /* Resolve a PLT32 reloc against a local symbol directly, - without using the procedure linkage table. */ - if (h == NULL) - break; + /* Resolve a PLT32 reloc against a local symbol directly, + without using the procedure linkage table. */ + if (h == NULL) + break; - if (h->plt.offset == (bfd_vma) -1 + if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset); unresolved_reloc = FALSE; - break; + break; case R_390_PLTOFF16: case R_390_PLTOFF32: - /* Relocation is to the entry for this symbol in the - procedure linkage table relative to the start of the GOT. */ + /* Relocation is to the entry for this symbol in the + procedure linkage table relative to the start of the GOT. */ /* For local symbols or if we didn't make a PLT entry for this symbol resolve the symbol directly. */ - if ( h == NULL + if ( h == NULL || h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) { @@ -2468,28 +2449,28 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; } - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset - htab->sgot->output_section->vma); unresolved_reloc = FALSE; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: + break; + + case R_390_8: + case R_390_16: + case R_390_32: + case R_390_PC16: + 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 (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) break; - if ((info->shared + if ((info->shared && ((r_type != R_390_PC16 && r_type != R_390_PC16DBL && r_type != R_390_PC32DBL @@ -2509,9 +2490,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, & ELF_LINK_HASH_DEF_REGULAR) == 0) || h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined))) - { - Elf_Internal_Rela outrel; - bfd_boolean skip, relocate; + { + Elf_Internal_Rela outrel; + bfd_boolean skip, relocate; asection *sreloc; bfd_byte *loc; @@ -2519,8 +2500,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, are copied into the output file to be resolved at run time. */ - skip = FALSE; - relocate = FALSE; + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, @@ -2529,12 +2510,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) skip = TRUE, relocate = TRUE; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); - if (skip) + if (skip) memset (&outrel, 0, sizeof outrel); - else if (h != NULL + else if (h != NULL && h->dynindx != -1 && (r_type == R_390_PC16 || r_type == R_390_PC16DBL @@ -2544,17 +2525,17 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, || !info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); + { + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; - } - else - { + } + else + { /* This symbol is local, or marked to become local. */ relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation + rel->r_addend; - } + } sreloc = elf_section_data (input_section)->sreloc; if (sreloc == NULL) @@ -2564,13 +2545,13 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - /* If this reloc is against an external symbol, we do - not want to fiddle with the addend. Otherwise, we - need to include the symbol value so that it becomes - an addend for the dynamic reloc. */ - if (! relocate) - continue; - } + /* If this reloc is against an external symbol, we do + not want to fiddle with the addend. Otherwise, we + need to include the symbol value so that it becomes + an addend for the dynamic reloc. */ + if (! relocate) + continue; + } break; /* Relocations for tls literal pool entries. */ @@ -2592,7 +2573,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } - /* Fall through */ + /* Fall through. */ case R_390_TLS_GD32: case R_390_TLS_GOTIE32: @@ -2636,7 +2617,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, if ((off & 1) != 0) off &= ~1; - else + else { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -2667,7 +2648,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, { if (indx == 0) { - BFD_ASSERT (! unresolved_reloc); + BFD_ASSERT (! unresolved_reloc); bfd_put_32 (output_bfd, relocation - dtpoff_base (info), htab->sgot->contents + off + GOT_ENTRY_SIZE); @@ -2771,7 +2752,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, htab->tls_ldm_got.offset |= 1; } relocation = htab->sgot->output_offset + off; - unresolved_reloc = FALSE; + unresolved_reloc = FALSE; break; case R_390_TLS_LE32: @@ -2981,8 +2962,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma relative_offset; /* This symbol has an entry in the procedure linkage table. Set - it up. */ - + it up. */ if (h->dynindx == -1 || htab->splt == NULL || htab->sgotplt == NULL @@ -2990,26 +2970,26 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) abort (); /* Calc. index no. - Current offset - size first entry / entry size. */ + Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; /* Offset in GOT is PLT index plus GOT headers(3) times 4, - addr & GOT addr. */ + addr & GOT addr. */ got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; /* S390 uses halfwords for relative branch calc! */ relative_offset = - ((PLT_FIRST_ENTRY_SIZE + - (PLT_ENTRY_SIZE * plt_index) + 18) / 2); + (PLT_ENTRY_SIZE * plt_index) + 18) / 2); /* If offset is > 32768, branch to a previous branch - 390 can only handle +-64 K jumps. */ + 390 can only handle +-64 K jumps. */ if ( -32768 > (int) relative_offset ) - relative_offset = - -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2); + relative_offset + = -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2); /* Fill in the entry in the procedure linkage table. */ if (!info->shared) { - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0, + bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0, htab->splt->contents + h->plt.offset); bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD1, htab->splt->contents + h->plt.offset + 4); @@ -3080,10 +3060,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) } /* Insert offset into reloc. table here. */ bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela), - htab->splt->contents + h->plt.offset + 28); + htab->splt->contents + h->plt.offset + 28); /* Fill in the entry in the global offset table. - Points to instruction after GOT offset. */ + Points to instruction after GOT offset. */ bfd_put_32 (output_bfd, (htab->splt->output_section->vma + htab->splt->output_offset @@ -3120,7 +3100,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ + up. */ if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -3143,16 +3123,16 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - } + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } else { BFD_ASSERT((h->got.offset & 1) == 0); bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_390_GLOB_DAT); - rela.r_addend = 0; - } + rela.r_addend = 0; + } loc = htab->srelgot->contents; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela); @@ -3270,39 +3250,39 @@ elf_s390_finish_dynamic_sections (output_bfd, info) /* Fill in the special first entry in the procedure linkage table. */ if (htab->splt && htab->splt->_raw_size > 0) { - memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE); - if (info->shared) + memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE); + if (info->shared) { bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD0, - htab->splt->contents ); + htab->splt->contents ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); + htab->splt->contents +4 ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD2, - htab->splt->contents +8 ); + htab->splt->contents +8 ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); + htab->splt->contents +12 ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - } - else - { - bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0, - htab->splt->contents ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2, - htab->splt->contents +8 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5, - htab->splt->contents +20 ); - bfd_put_32 (output_bfd, - htab->sgotplt->output_section->vma + htab->splt->contents +16 ); + } + else + { + bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0, + htab->splt->contents ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1, + htab->splt->contents +4 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2, + htab->splt->contents +8 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3, + htab->splt->contents +12 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4, + htab->splt->contents +16 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5, + htab->splt->contents +20 ); + bfd_put_32 (output_bfd, + htab->sgotplt->output_section->vma + htab->sgotplt->output_offset, - htab->splt->contents + 24); - } + htab->splt->contents + 24); + } elf_section_data (htab->splt->output_section) ->this_hdr.sh_entsize = 4; } @@ -3377,27 +3357,27 @@ elf_s390_grok_prstatus (abfd, note) #define elf_backend_plt_header_size PLT_ENTRY_SIZE #define elf_backend_rela_normal 1 -#define elf_info_to_howto elf_s390_info_to_howto +#define elf_info_to_howto elf_s390_info_to_howto #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 elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol -#define elf_backend_check_relocs elf_s390_check_relocs +#define elf_backend_check_relocs elf_s390_check_relocs #define elf_backend_copy_indirect_symbol elf_s390_copy_indirect_symbol #define elf_backend_create_dynamic_sections elf_s390_create_dynamic_sections #define elf_backend_finish_dynamic_sections elf_s390_finish_dynamic_sections #define elf_backend_finish_dynamic_symbol elf_s390_finish_dynamic_symbol -#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook -#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook +#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook +#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook #define elf_backend_reloc_type_class elf_s390_reloc_type_class -#define elf_backend_relocate_section elf_s390_relocate_section +#define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_grok_prstatus elf_s390_grok_prstatus #define bfd_elf32_mkobject elf_s390_mkobject -#define elf_backend_object_p elf_s390_object_p +#define elf_backend_object_p elf_s390_object_p #include "elf32-target.h" diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index f0e0177..c9167bc 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -179,6 +179,8 @@ static reloc_howto_type sh_elf_howto_table[] = 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) */ @@ -186,10 +188,10 @@ static reloc_howto_type sh_elf_howto_table[] = TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - sh_elf_reloc, /* special_function */ + NULL, /* special_function */ "R_SH_IND12W", /* name */ - TRUE, /* partial_inplace */ - 0xfff, /* src_mask */ + FALSE, /* partial_inplace */ + 0x0, /* src_mask */ 0xfff, /* dst_mask */ TRUE), /* pcrel_offset */ @@ -2232,6 +2234,12 @@ sh_elf_relax_section (abfd, sec, link_info, again) /* Change the R_SH_USES reloc into an R_SH_IND12W reloc, and replace the jsr with a bsr. */ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_SH_IND12W); + /* We used to test (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info) + here, but that only checks if the symbol is an external symbol, + not if the symbol is in a different section. Besides, we need + a consistent meaning for the relocation, so we just assume here that + the value of the symbol is not available. */ +#if 0 if (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info) { /* If this needs to be changed because of future relaxing, @@ -2242,12 +2250,14 @@ sh_elf_relax_section (abfd, sec, link_info, again) contents + irel->r_offset); } else +#endif { /* We can't fully resolve this yet, because the external symbol value may be changed by future relaxing. We let the final link phase handle it. */ bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset); } + irel->r_addend = -4; /* See if there is another R_SH_USES reloc referring to the same register load. */ @@ -2316,7 +2326,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) /* Look for load and store instructions that we can align on four byte boundaries. */ - if (have_code) + if ((elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK) != EF_SH4 + && have_code) { bfd_boolean swapped; @@ -2542,14 +2553,28 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) break; case R_SH_IND12W: - if (ELF32_R_SYM (irel->r_info) >= symtab_hdr->sh_info) - start = stop = addr; + off = insn & 0xfff; + if (! off) + { + /* This has been made by previous relaxation. Since the + relocation will be against an external symbol, the + final relocation will just do the right thing. */ + start = stop = addr; + } else { - off = insn & 0xfff; if (off & 0x800) off -= 0x1000; stop = (bfd_vma) ((bfd_signed_vma) start + 4 + off * 2); + + /* The addend will be against the section symbol, thus + for adjusting the addend, the relevant start is the + start of the section. + N.B. If we want to abandom in-place changes here and + test directly using symbol + addend, we have to take into + account that the addend has already been adjusted by -4. */ + if (stop > addr && stop < toaddr) + irel->r_addend -= count; } break; @@ -3500,6 +3525,9 @@ struct elf_sh_dyn_relocs /* Number of pc-relative relocs copied for the input section. */ bfd_size_type pc_count; + + /* If TRUE, R_SH_TLS_TPOFF32 relocation is generated. */ + bfd_boolean tls_tpoff32; }; /* sh ELF linker hash entry. */ @@ -3524,9 +3552,6 @@ struct elf_sh_link_hash_entry enum { GOT_UNKNOWN = 0, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE } tls_type; - - /* If TRUE, R_SH_TLS_TPOFF32 relocation is generated. */ - bfd_boolean tls_tpoff32; }; #define sh_elf_hash_entry(ent) ((struct elf_sh_link_hash_entry *)(ent)) @@ -3630,7 +3655,6 @@ sh_elf_link_hash_newfunc (entry, table, string) ret->datalabel_got.refcount = ret->root.got.refcount; #endif ret->tls_type = GOT_UNKNOWN; - ret->tls_tpoff32 = FALSE; } return (struct bfd_hash_entry *) ret; @@ -4053,7 +4077,7 @@ allocate_dynrelocs (h, inf) && eh->gotplt_refcount > 0) { /* The symbol has been forced local, or we have some direct got refs, - so treat all the gotplt refs as got refs. */ + so treat all the gotplt refs as got refs. */ h->got.refcount += eh->gotplt_refcount; if (h->plt.refcount >= eh->gotplt_refcount) h->plt.refcount -= eh->gotplt_refcount; @@ -4207,8 +4231,9 @@ allocate_dynrelocs (h, inf) } else { - if (sh_elf_hash_entry (h)->tls_tpoff32) - goto keep; + for (p = eh->dyn_relocs; p; p = p->next) + if (p->tls_tpoff32) + goto keep; /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -4785,7 +4810,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (! info->symbolic || info->allow_shlib_undefined) && ! info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -4812,7 +4836,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; case R_SH_IND12W: - relocation -= 4; goto final_link_relocate; case R_SH_DIR8WPN: @@ -5256,10 +5279,18 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, tls_type = sh_elf_hash_entry (h)->tls_type; if (! info->shared && (h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - && (tls_type == GOT_TLS_IE - || sh_elf_hash_entry (h)->tls_tpoff32)) - r_type = R_SH_TLS_LE_32; + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + { + struct elf_sh_dyn_relocs *p; + + /* If TPOFF32 relocation can be created, convert it. */ + for (p = sh_elf_hash_entry (h)->dyn_relocs; p; p = p->next) + if (p->sec == input_section && p->tls_tpoff32) + { + r_type = R_SH_TLS_LE_32; + break; + } + } } if (r_type == R_SH_TLS_GD_32 && tls_type == GOT_TLS_IE) @@ -5368,7 +5399,13 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (sreloc != NULL); } - indx = (h && h->dynindx != -1) ? h->dynindx : 0; + if (h == NULL + || h->dynindx == -1 + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + indx = 0; + else + indx = h->dynindx; outrel.r_offset = (input_section->output_section->vma + input_section->output_offset + rel->r_offset); @@ -5400,7 +5437,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, if ((off & 1) != 0) off &= ~1; - else + else { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -5415,7 +5452,13 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section, outrel.r_offset = (sgot->output_section->vma + sgot->output_offset + off); - indx = (h && h->dynindx != -1) ? h->dynindx : 0; + if (h == NULL + || h->dynindx == -1 + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + indx = 0; + else + indx = h->dynindx; dr_type = (r_type == R_SH_TLS_GD_32 ? R_SH_TLS_DTPMOD32 : R_SH_TLS_TPOFF32); if (dr_type == R_SH_TLS_TPOFF32 && indx == 0) @@ -5900,9 +5943,6 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - struct elf_link_hash_entry *h; - struct elf_sh_link_hash_entry *eh; elf_section_data (sec)->local_dynrel = NULL; @@ -5913,15 +5953,20 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; #ifdef INCLUDE_SHMEDIA int seen_stt_datalabel = 0; #endif r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx < symtab_hdr->sh_info) - h = NULL; - else + if (r_symndx >= symtab_hdr->sh_info) { + struct elf_sh_link_hash_entry *eh; + struct elf_sh_dyn_relocs **pp; + struct elf_sh_dyn_relocs *p; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; #ifdef INCLUDE_SHMEDIA while (h->root.type == bfd_link_hash_indirect @@ -5931,12 +5976,18 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs) h = (struct elf_link_hash_entry *) h->root.u.i.link; } #endif + eh = (struct elf_sh_link_hash_entry *) h; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } } - eh = (struct elf_sh_link_hash_entry *) h; - switch (sh_elf_optimized_tls_reloc (info, ELF32_R_TYPE (rel->r_info), - ELF32_R_SYM (rel->r_info) - >= symtab_hdr->sh_info)) + r_type = ELF32_R_TYPE (rel->r_info); + switch (sh_elf_optimized_tls_reloc (info, r_type, h != NULL)) { case R_SH_TLS_LD_32: if (sh_elf_hash_table (info)->tls_ldm_got.refcount > 0) @@ -5969,6 +6020,8 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs) #ifdef INCLUDE_SHMEDIA if (seen_stt_datalabel) { + struct elf_sh_link_hash_entry *eh; + eh = (struct elf_sh_link_hash_entry *) h; if (eh->datalabel_got.refcount > 0) eh->datalabel_got.refcount -= 1; } @@ -5994,27 +6047,9 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs) case R_SH_DIR32: case R_SH_REL32: - if (h != NULL) - { - struct elf_sh_dyn_relocs **pp; - struct elf_sh_dyn_relocs *p; - - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + if (info->shared) + break; + /* Fall thru */ case R_SH_PLT32: #ifdef INCLUDE_SHMEDIA @@ -6041,6 +6076,8 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs) #endif if (h != NULL) { + struct elf_sh_link_hash_entry *eh; + eh = (struct elf_sh_link_hash_entry *) h; if (eh->gotplt_refcount > 0) { eh->gotplt_refcount -= 1; @@ -6596,6 +6633,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs) p->sec = sec; p->count = 0; p->pc_count = 0; + p->tls_tpoff32 = FALSE; } p->count += 1; @@ -6693,11 +6731,11 @@ sh_elf_check_relocs (abfd, info, sec, relocs) p->sec = sec; p->count = 0; p->pc_count = 0; + p->tls_tpoff32 = FALSE; } p->count += 1; - if (h) - sh_elf_hash_entry (h)->tls_tpoff32 = TRUE; + p->tls_tpoff32 = TRUE; } break; diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 1c22100..e2c6544 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -2,21 +2,21 @@ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -63,8 +63,8 @@ static struct bfd_hash_entry *link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table *elf32_sparc_link_hash_table_create PARAMS ((bfd *)); -static bfd_boolean create_got_section PARAMS ((bfd *, - struct bfd_link_info *)); +static bfd_boolean create_got_section + PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean elf32_sparc_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static void elf32_sparc_copy_indirect_symbol @@ -291,11 +291,14 @@ elf32_sparc_reloc_type_lookup (abfd, code) return &elf32_sparc_rev32_howto; default: - for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); i++) - { - if (sparc_reloc_map[i].bfd_reloc_val == code) - return &_bfd_sparc_elf_howto_table[(int) sparc_reloc_map[i].elf_reloc_val]; - } + for (i = 0; + i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); + i++) + { + if (sparc_reloc_map[i].bfd_reloc_val == code) + return (_bfd_sparc_elf_howto_table + + (int) sparc_reloc_map[i].elf_reloc_val); + } } bfd_set_error (bfd_error_bad_value); return NULL; @@ -633,9 +636,9 @@ link_hash_newfunc (entry, table, string) if (entry == NULL) { entry = bfd_hash_allocate (table, - sizeof (struct elf32_sparc_link_hash_entry)); + sizeof (struct elf32_sparc_link_hash_entry)); if (entry == NULL) - return entry; + return entry; } /* Call the allocation method of the superclass. */ @@ -758,32 +761,32 @@ elf32_sparc_copy_indirect_symbol (bed, dir, ind) if (eind->dyn_relocs != NULL) { if (edir->dyn_relocs != NULL) - { - struct elf32_sparc_dyn_relocs **pp; - struct elf32_sparc_dyn_relocs *p; - - if (ind->root.type == bfd_link_hash_indirect) - abort (); - - /* Add reloc counts against the weak sym to the strong sym - list. Merge any entries against the same section. */ - for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) - { - struct elf32_sparc_dyn_relocs *q; - - for (q = edir->dyn_relocs; q != NULL; q = q->next) - if (q->sec == p->sec) - { - q->pc_count += p->pc_count; - q->count += p->count; - *pp = p->next; - break; - } - if (q == NULL) - pp = &p->next; - } - *pp = edir->dyn_relocs; - } + { + struct elf32_sparc_dyn_relocs **pp; + struct elf32_sparc_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + { + struct elf32_sparc_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + q->pc_count += p->pc_count; + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } edir->dyn_relocs = eind->dyn_relocs; eind->dyn_relocs = NULL; @@ -820,15 +823,15 @@ elf32_sparc_tls_transition (info, abfd, r_type, is_local) return R_SPARC_TLS_IE_HI22; case R_SPARC_TLS_GD_LO10: if (is_local) - return R_SPARC_TLS_LE_LOX10; + return R_SPARC_TLS_LE_LOX10; return R_SPARC_TLS_IE_LO10; case R_SPARC_TLS_IE_HI22: if (is_local) - return R_SPARC_TLS_LE_HIX22; + return R_SPARC_TLS_LE_HIX22; return r_type; case R_SPARC_TLS_IE_LO10: if (is_local) - return R_SPARC_TLS_LE_LOX10; + return R_SPARC_TLS_LE_LOX10; return r_type; case R_SPARC_TLS_LDM_HI22: return R_SPARC_TLS_LE_HIX22; @@ -880,12 +883,12 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) r_type = ELF32_R_TYPE (rel->r_info); if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) - { - (*_bfd_error_handler) (_("%s: bad symbol index: %d"), - bfd_archive_filename (abfd), - r_symndx); - return FALSE; - } + { + (*_bfd_error_handler) (_("%s: bad symbol index: %d"), + bfd_archive_filename (abfd), + r_symndx); + return FALSE; + } if (r_symndx < symtab_hdr->sh_info) h = NULL; @@ -1049,17 +1052,17 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) case R_SPARC_PLT32: case R_SPARC_WPLT30: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code without - linking in any dynamic objects, in which case we don't - need to generate a procedure linkage table after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ if (h == NULL) { /* The Solaris native assembler will generate a WPLT30 - reloc for a local symbol if you assemble a call from - one section to another when using -K pic. We treat - it as WDISP30. */ + reloc for a local symbol if you assemble a call from + one section to another when using -K pic. We treat + it as WDISP30. */ if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) goto r_sparc_plt32; break; @@ -1149,8 +1152,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) struct elf32_sparc_dyn_relocs **head; /* When creating a shared object, we must copy these - relocs into the output file. We create a reloc - section in dynobj and make room for the reloc. */ + relocs into the output file. We create a reloc + section in dynobj and make room for the reloc. */ if (sreloc == NULL) { const char *name; @@ -1231,15 +1234,15 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) break; - case R_SPARC_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return FALSE; - break; + case R_SPARC_GNU_VTINHERIT: + if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return FALSE; + break; - case R_SPARC_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return FALSE; - break; + case R_SPARC_GNU_VTENTRY: + if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; default: break; @@ -1263,21 +1266,21 @@ elf32_sparc_gc_mark_hook (sec, info, rel, h, sym) { case R_SPARC_GNU_VTINHERIT: case R_SPARC_GNU_VTENTRY: - break; + break; default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; + 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; + case bfd_link_hash_common: + return h->root.u.c.p->section; default: break; - } + } } } else @@ -1294,14 +1297,12 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) asection *sec; const Elf_Internal_Rela *relocs; { - Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; + + elf_section_data (sec)->local_dynrel = NULL; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -1309,116 +1310,98 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch ((r_type = elf32_sparc_tls_transition (info, abfd, - ELF32_R_TYPE (rel->r_info), - ELF32_R_SYM (rel->r_info) - >= symtab_hdr->sh_info))) - { - case R_SPARC_TLS_LDM_HI22: - case R_SPARC_TLS_LDM_LO10: - if (elf32_sparc_hash_table (info)->tls_ldm_got.refcount > 0) - elf32_sparc_hash_table (info)->tls_ldm_got.refcount -= 1; - break; - - case R_SPARC_TLS_LE_HIX22: - case R_SPARC_TLS_LE_LOX10: - if (info->shared) - goto r_sparc_plt32; - break; + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - case R_SPARC_PC10: - case R_SPARC_PC22: - if ((r_symndx = ELF32_R_SYM (rel->r_info)) >= symtab_hdr->sh_info - && strcmp (sym_hashes[r_symndx - - symtab_hdr->sh_info]->root.root.string, - "_GLOBAL_OFFSET_TABLE_") == 0) - break; - /* Fall through. */ + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_dyn_relocs **pp; + struct elf32_sparc_dyn_relocs *p; - case R_SPARC_DISP8: - case R_SPARC_DISP16: - case R_SPARC_DISP32: - case R_SPARC_WDISP30: - case R_SPARC_WDISP22: - case R_SPARC_WDISP19: - case R_SPARC_WDISP16: - case R_SPARC_8: - case R_SPARC_16: - case R_SPARC_32: - case R_SPARC_HI22: - case R_SPARC_22: - case R_SPARC_13: - case R_SPARC_LO10: - case R_SPARC_UA16: - case R_SPARC_UA32: - r_sparc_plt32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf32_sparc_link_hash_entry *eh; - struct elf32_sparc_dyn_relocs **pp; - struct elf32_sparc_dyn_relocs *p; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf32_sparc_link_hash_entry *) h; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + r_type = ELF32_R_TYPE (rel->r_info); + r_type = elf32_sparc_tls_transition (info, abfd, r_type, h != NULL); + switch (r_type) + { + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + if (elf32_sparc_hash_table (info)->tls_ldm_got.refcount > 0) + elf32_sparc_hash_table (info)->tls_ldm_got.refcount -= 1; + break; - if (! info->shared) - --h->plt.refcount; + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + case R_SPARC_GOT10: + case R_SPARC_GOT13: + case R_SPARC_GOT22: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount--; + } + else + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; - eh = (struct elf32_sparc_link_hash_entry *) h; + case R_SPARC_PC10: + case R_SPARC_PC22: + if (h != NULL + && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + break; + /* Fall through. */ - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (_bfd_sparc_elf_howto_table[r_type].pc_relative) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + case R_SPARC_DISP8: + case R_SPARC_DISP16: + case R_SPARC_DISP32: + case R_SPARC_WDISP30: + case R_SPARC_WDISP22: + case R_SPARC_WDISP19: + case R_SPARC_WDISP16: + case R_SPARC_8: + case R_SPARC_16: + case R_SPARC_32: + case R_SPARC_HI22: + case R_SPARC_22: + case R_SPARC_13: + case R_SPARC_LO10: + case R_SPARC_UA16: + case R_SPARC_UA32: + case R_SPARC_PLT32: + if (info->shared) + break; + /* Fall through. */ - case R_SPARC_TLS_GD_HI22: - case R_SPARC_TLS_GD_LO10: - case R_SPARC_TLS_IE_HI22: - case R_SPARC_TLS_IE_LO10: - case R_SPARC_GOT10: - case R_SPARC_GOT13: - case R_SPARC_GOT22: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->got.refcount > 0) - h->got.refcount--; - } - else - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx]--; - } - break; - - case R_SPARC_PLT32: - case R_SPARC_HIPLT22: - case R_SPARC_LOPLT10: - case R_SPARC_PCPLT32: - case R_SPARC_PCPLT10: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount--; - } - if (r_type == R_SPARC_PLT32) - goto r_sparc_plt32; - break; + case R_SPARC_WPLT30: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; - default: - break; - } + default: + break; + } + } return TRUE; } @@ -1632,7 +1615,7 @@ allocate_dynrelocs (h, inf) /* The first four entries in .plt are reserved. */ if (s->_raw_size == 0) s->_raw_size = 4 * PLT_ENTRY_SIZE; - + /* The procedure linkage table has a maximum size. */ if (s->_raw_size >= 0x400000) { @@ -2176,8 +2159,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, r_type = ELF32_R_TYPE (rel->r_info); if (r_type == R_SPARC_GNU_VTINHERIT - || r_type == R_SPARC_GNU_VTENTRY) - continue; + || r_type == R_SPARC_GNU_VTENTRY) + continue; if (r_type < 0 || r_type >= (int) R_SPARC_max_std) { @@ -2224,7 +2207,6 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) ; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) ; @@ -2245,7 +2227,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_GOT13: case R_SPARC_GOT22: /* Relocation is to the entry for this symbol in the global - offset table. */ + offset table. */ if (htab->sgot == NULL) abort (); @@ -2265,13 +2247,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) { /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 4, we use the - least significant bit to record whether we have - initialized it already. + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. We must initialize + this entry in the global offset table. Since the + offset must always be a multiple of 4, we use the + least significant bit to record whether we have + initialized it already. When doing a dynamic link, we create a .rela.got relocation entry to initialize the value. This @@ -2343,7 +2325,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_WPLT30: r_sparc_wplt30: /* Relocation is to the entry for this symbol in the - procedure linkage table. */ + procedure linkage table. */ /* The Solaris native assembler will generate a WPLT30 reloc for a local symbol if you assemble a call from one @@ -2355,8 +2337,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, if (h->plt.offset == (bfd_vma) -1) { /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ + happens when statically linking PIC code, or when + using -Bsymbolic. */ break; } @@ -2428,8 +2410,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_boolean skip, relocate = FALSE; /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ + are copied into the output file to be resolved at run + time. */ BFD_ASSERT (sreloc != NULL); @@ -2481,7 +2463,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, if (skip) memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if the symbol was marked to - become local. */ + become local. */ else if (h != NULL && ! is_plt && ((! info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags @@ -2550,7 +2532,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); /* This reloc will be computed at runtime, so there's no - need to do anything now. */ + need to do anything now. */ if (! relocate) continue; } @@ -2615,7 +2597,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if (h != NULL) + if (h != NULL) { off = h->got.offset; h->got.offset |= 1; @@ -2626,14 +2608,14 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, off = local_got_offsets[r_symndx]; local_got_offsets[r_symndx] |= 1; } - + r_sparc_tlsldm: if (htab->sgot == NULL) abort (); if ((off & 1) != 0) off &= ~1; - else + else { Elf_Internal_Rela outrel; Elf32_External_Rela *loc; @@ -3099,7 +3081,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) { bfd *dynobj; struct elf32_sparc_link_hash_table *htab; - + htab = elf32_sparc_hash_table (info); dynobj = htab->elf.dynobj; @@ -3111,7 +3093,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_byte *loc; /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ BFD_ASSERT (h->dynindx != -1); @@ -3165,7 +3147,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ + up. */ sgot = htab->sgot; srela = htab->srelgot; @@ -3245,7 +3227,7 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) bfd *dynobj; asection *sdyn; struct elf32_sparc_link_hash_table *htab; - + htab = elf32_sparc_hash_table (info); dynobj = htab->elf.dynobj; @@ -3513,7 +3495,7 @@ elf32_sparc_reloc_type_class (rela) #define elf_backend_object_p elf32_sparc_object_p #define elf_backend_final_write_processing \ elf32_sparc_final_write_processing -#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook +#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_sparc_gc_sweep_hook #define elf_backend_reloc_type_class elf32_sparc_reloc_type_class diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index a9e8b0b..1aca042 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1,23 +1,23 @@ /* VAX series support for 32-bit ELF - Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Matt Thomas <matt@3am-software.com>. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -1539,7 +1539,6 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -1699,7 +1698,6 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - if (sreloc == NULL) { const char *name; @@ -1908,7 +1906,6 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the procedure linkage table. Set it up. */ - BFD_ASSERT (h->dynindx != -1); splt = bfd_get_section_by_name (dynobj, ".plt"); @@ -1975,7 +1972,6 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the global offset table. Set it up. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); srela = bfd_get_section_by_name (dynobj, ".rela.got"); BFD_ASSERT (sgot != NULL && srela != NULL); @@ -2014,7 +2010,6 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_byte *loc; /* This symbol needs a copy reloc. Set it up. */ - BFD_ASSERT (h->dynindx != -1 && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)); diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index aa592fa..9f564ca 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -4503,7 +4503,6 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.root.type == bfd_link_hash_undefweak) undef_weak_ref = TRUE; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) ; @@ -5176,7 +5175,7 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info) bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); } - /* Initialize the PLT0 entry */ + /* Initialize the PLT0 entry. */ if (splt->_raw_size > 0) { bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents); diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 98f46dc..4d3b8d4 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -1,21 +1,21 @@ /* Support for HPPA 64-bit ELF - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "alloca-conf.h" #include "bfd.h" diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index d29f286..807ddf5 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -300,9 +300,11 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit PC relative reference. */ + /* 16 bit PC relative reference. Note that the ABI document has a typo + and claims R_MIPS_PC16 to be not rightshifted, rendering it useless. + We do the right thing here. */ HOWTO (R_MIPS_PC16, /* type */ - 0, /* rightshift */ + 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ @@ -795,9 +797,11 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit PC relative reference. */ + /* 16 bit PC relative reference. Note that the ABI document has a typo + and claims R_MIPS_PC16 to be not rightshifted, rendering it useless. + We do the right thing here. */ HOWTO (R_MIPS_PC16, /* type */ - 0, /* rightshift */ + 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ @@ -1894,7 +1898,7 @@ static const struct elf_reloc_map mips_reloc_map[] = /* There is no BFD reloc for R_MIPS_REL32. */ { BFD_RELOC_64, R_MIPS_64 }, { BFD_RELOC_CTOR, R_MIPS_64 }, - { BFD_RELOC_16_PCREL, R_MIPS_PC16 }, + { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 }, { BFD_RELOC_HI16_S, R_MIPS_HI16 }, { BFD_RELOC_LO16, R_MIPS_LO16 }, { BFD_RELOC_GPREL16, R_MIPS_GPREL16 }, diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index b86bb85..23d95d5 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3,21 +3,21 @@ Written by Linus Nordberg, Swox AB <info@swox.com>, based on elf32-ppc.c by Ian Lance Taylor. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This file is based on the 64-bit PowerPC ELF ABI. It is also based on the file elf32-ppc.c. */ @@ -2503,14 +2503,18 @@ struct got_entry { struct got_entry *next; + /* The symbol addend that we'll be placing in the GOT. */ bfd_vma addend; + /* Reference count until size_dynamic_sections, GOT offset thereafter. */ union { bfd_signed_vma refcount; bfd_vma offset; } got; + /* Zero for non-tls entries, or TLS_TLS and one of TLS_GD, TLS_LD, + TLS_TPREL or TLS_DTPREL for tls entries. */ char tls_type; }; @@ -2529,13 +2533,20 @@ struct plt_entry }; /* Of those relocs that might be copied as dynamic relocs, this macro - selects those that must be copied when linking a shared library. */ + selects those that must be copied when linking a shared library, + even when the symbol is local. */ #define MUST_BE_DYN_RELOC(RTYPE) \ ((RTYPE) != R_PPC64_REL32 \ && (RTYPE) != R_PPC64_REL64 \ && (RTYPE) != R_PPC64_REL30) +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* Section name for stubs is the associated section name plus this string. */ #define STUB_SUFFIX ".stub" @@ -2633,14 +2644,21 @@ struct ppc_link_hash_entry unsigned int is_entry:1; /* Contexts in which symbol is used in the GOT (or TOC). - Linker optimization will result in various transformations. */ -#define TLS_TLS 1 /* Any TLS reloc. */ -#define TLS_GD_LD 2 /* GD or LD reloc requiring 2 got slots. */ -#define TLS_LD 4 /* LD reloc. */ -#define TLS_TPREL 8 /* TPREL reloc, => IE. */ -#define TLS_DTPREL 16 /* DTPREL reloc, => LD. */ -#define TLS_EXPLICIT 32 /* Marks TOC section relocs. */ - char tls_type; + TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the + corresponding relocs are encountered during check_relocs. + tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to + indicate the corresponding GOT entry type is not needed. + tls_optimize may also set TLS_TPRELGD when a GD reloc turns into + a TPREL one. We use a separate flag rather than setting TPREL + just for convenience in distinguishing the two cases. */ +#define TLS_GD 1 /* GD reloc. */ +#define TLS_LD 2 /* LD reloc. */ +#define TLS_TPREL 4 /* TPREL reloc, => IE. */ +#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */ +#define TLS_TLS 16 /* Any TLS reloc. */ +#define TLS_EXPLICIT 32 /* Marks TOC section TLS relocs. */ +#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */ + char tls_mask; }; /* ppc64 ELF linker hash table. */ @@ -2767,7 +2785,7 @@ static void ppc64_elf_hide_symbol static bfd_boolean get_sym_h PARAMS ((struct elf_link_hash_entry **, Elf_Internal_Sym **, asection **, char **, Elf_Internal_Sym **, unsigned long, bfd *)); -static bfd_boolean get_tls_type +static int get_tls_mask PARAMS ((char **, Elf_Internal_Sym **, const Elf_Internal_Rela *, bfd *)); static bfd_boolean allocate_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); @@ -2909,7 +2927,7 @@ link_hash_newfunc (entry, table, string) eh->is_func = 0; eh->is_func_descriptor = 0; eh->is_entry = 0; - eh->tls_type = 0; + eh->tls_mask = 0; } return entry; @@ -2957,13 +2975,20 @@ ppc64_elf_link_hash_table_create (abfd) htab->sbrlt = NULL; htab->srelbrlt = NULL; htab->tls_sec = NULL; + htab->tls_get_addr = NULL; htab->tlsld_got.refcount = 0; htab->stub_error = 0; htab->has_14bit_branch = 0; htab->have_undefweak = 0; htab->stub_iteration = 0; htab->sym_sec.abfd = NULL; + /* Initializing two fields of the union is just cosmetic. We really + only care about glist, but when compiled on a 32-bit host the + bfd_vma fields are larger. Setting the bfd_vma to zero makes + debugger inspection of these fields look nicer. */ + htab->elf.init_refcount.refcount = 0; htab->elf.init_refcount.glist = NULL; + htab->elf.init_offset.offset = 0; htab->elf.init_offset.glist = NULL; return &htab->elf.root; @@ -3289,6 +3314,7 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) edir->is_func |= eind->is_func; edir->is_func_descriptor |= eind->is_func_descriptor; edir->is_entry |= eind->is_entry; + edir->tls_mask |= eind->tls_mask; /* Copy down any references that we may have already seen to the symbol which just became indirect. */ @@ -3404,13 +3430,13 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type) int tls_type; { struct got_entry **local_got_ents = elf_local_got_ents (abfd); - char *local_got_tls_types; + char *local_got_tls_masks; if (local_got_ents == NULL) { bfd_size_type size = symtab_hdr->sh_info; - size *= sizeof (*local_got_ents) + sizeof (char); + size *= sizeof (*local_got_ents) + sizeof (*local_got_tls_masks); local_got_ents = (struct got_entry **) bfd_zalloc (abfd, size); if (local_got_ents == NULL) return FALSE; @@ -3439,8 +3465,8 @@ update_local_sym_info (abfd, symtab_hdr, r_symndx, r_addend, tls_type) ent->got.refcount += 1; } - local_got_tls_types = (char *) (local_got_ents + symtab_hdr->sh_info); - local_got_tls_types[r_symndx] |= tls_type; + local_got_tls_masks = (char *) (local_got_ents + symtab_hdr->sh_info); + local_got_tls_masks[r_symndx] |= tls_type; return TRUE; } @@ -3556,14 +3582,14 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_GOT_TLSLD16_HI: case R_PPC64_GOT_TLSLD16_HA: htab->tlsld_got.refcount += 1; - tls_type = TLS_TLS | TLS_GD_LD | TLS_LD; + tls_type = TLS_TLS | TLS_LD; goto dogottls; case R_PPC64_GOT_TLSGD16: case R_PPC64_GOT_TLSGD16_LO: case R_PPC64_GOT_TLSGD16_HI: case R_PPC64_GOT_TLSGD16_HA: - tls_type = TLS_TLS | TLS_GD_LD; + tls_type = TLS_TLS | TLS_GD; goto dogottls; case R_PPC64_GOT_TPREL16_DS: @@ -3618,7 +3644,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) eh->elf.got.glist = ent; } ent->got.refcount += 1; - eh->tls_type |= tls_type; + eh->tls_mask |= tls_type; } else /* This is a global offset table entry for a local symbol. */ @@ -3709,7 +3735,10 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) return FALSE; if (h == htab->tls_get_addr) sec->has_tls_reloc = 1; - else if (strcmp (h->root.root.string, ".__tls_get_addr") == 0) + else if ((strncmp (h->root.root.string, ".__tls_get_addr", 15) + == 0) + && (h->root.root.string[15] == 0 + || h->root.root.string[15] == '@')) { htab->tls_get_addr = h; sec->has_tls_reloc = 1; @@ -3727,9 +3756,9 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (rel + 1 < rel_end && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64) && rel[1].r_offset == rel->r_offset + 8) - tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD_LD; + tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD; else - tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD_LD | TLS_LD; + tls_type = TLS_EXPLICIT | TLS_TLS | TLS_LD; goto dotlstoc; case R_PPC64_DTPREL64: @@ -3747,7 +3776,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) { struct ppc_link_hash_entry *eh; eh = (struct ppc_link_hash_entry *) h; - eh->tls_type |= tls_type; + eh->tls_mask |= tls_type; } else if (!update_local_sym_info (abfd, symtab_hdr, r_symndx, @@ -3756,7 +3785,8 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (ppc64_elf_section_data (sec)->t_symndx == NULL) { - bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8; + /* One extra to simplify get_tls_mask. */ + bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8 + 1; ppc64_elf_section_data (sec)->t_symndx = (unsigned *) bfd_zalloc (abfd, amt); if (ppc64_elf_section_data (sec)->t_symndx == NULL) @@ -3764,6 +3794,13 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) } BFD_ASSERT (rel->r_offset % 8 == 0); ppc64_elf_section_data (sec)->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; + else if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_LD)) + ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -2; goto dodyn; case R_PPC64_TPREL16: @@ -3844,6 +3881,10 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (NO_OPD_RELOCS && opd_sym_map != NULL) break; + /* Don't propagate relocs that the dynamic linker won't relocate. */ + if ((sec->flags & SEC_ALLOC) == 0) + break; + /* If we are creating a shared library, and this is a reloc against a global symbol, or a non PC relative reloc against a local symbol, then we need to copy the reloc @@ -3856,7 +3897,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) later (it is never cleared). In case of a weak definition, DEF_REGULAR may be cleared later by a strong definition in a shared library. We account for that possibility below by - storing information in the relocs_copied field of the hash + storing information in the dyn_relocs field of the hash table entry. A similar situation occurs when creating shared libraries and symbol visibility changes render the symbol local. @@ -3867,15 +3908,14 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) symbol. */ dodyn: if ((info->shared - && (sec->flags & SEC_ALLOC) != 0 && (MUST_BE_DYN_RELOC (r_type) || (h != NULL && (! info->symbolic || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared - && (sec->flags & SEC_ALLOC) != 0 + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && (h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags @@ -4078,11 +4118,29 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) { unsigned long r_symndx; enum elf_ppc64_reloc_type r_type; - struct elf_link_hash_entry *h; + struct elf_link_hash_entry *h = NULL; char tls_type = 0; r_symndx = ELF64_R_SYM (rel->r_info); r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_link_hash_entry *eh; + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct ppc_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + switch (r_type) { case R_PPC64_GOT_TLSLD16: @@ -4090,14 +4148,14 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) case R_PPC64_GOT_TLSLD16_HI: case R_PPC64_GOT_TLSLD16_HA: htab->tlsld_got.refcount -= 1; - tls_type = TLS_TLS | TLS_GD_LD | TLS_LD; + tls_type = TLS_TLS | TLS_LD; goto dogot; case R_PPC64_GOT_TLSGD16: case R_PPC64_GOT_TLSGD16_LO: case R_PPC64_GOT_TLSGD16_HI: case R_PPC64_GOT_TLSGD16_HA: - tls_type = TLS_TLS | TLS_GD_LD; + tls_type = TLS_TLS | TLS_GD; goto dogot; case R_PPC64_GOT_TPREL16_DS: @@ -4124,11 +4182,8 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) { struct got_entry *ent; - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - ent = h->got.glist; - } + if (h != NULL) + ent = h->got.glist; else ent = local_got_ents[r_symndx]; @@ -4152,11 +4207,10 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) case R_PPC64_REL14_BRNTAKEN: case R_PPC64_REL14_BRTAKEN: case R_PPC64_REL24: - if (r_symndx >= symtab_hdr->sh_info) + if (h != NULL) { struct plt_entry *ent; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; for (ent = h->plt.plist; ent != NULL; ent = ent->next) if (ent->addend == rel->r_addend) break; @@ -4167,73 +4221,6 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) } break; - case R_PPC64_REL30: - case R_PPC64_REL32: - case R_PPC64_REL64: - if (r_symndx >= symtab_hdr->sh_info) - { - struct ppc_link_hash_entry *eh; - struct ppc_dyn_relocs **pp; - struct ppc_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - eh = (struct ppc_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; - - case R_PPC64_DTPMOD64: - case R_PPC64_DTPREL64: - case R_PPC64_TPREL64: - case R_PPC64_ADDR14: - case R_PPC64_ADDR14_BRNTAKEN: - case R_PPC64_ADDR14_BRTAKEN: - case R_PPC64_ADDR16: - case R_PPC64_ADDR16_DS: - case R_PPC64_ADDR16_HA: - case R_PPC64_ADDR16_HI: - case R_PPC64_ADDR16_HIGHER: - case R_PPC64_ADDR16_HIGHERA: - case R_PPC64_ADDR16_HIGHEST: - case R_PPC64_ADDR16_HIGHESTA: - case R_PPC64_ADDR16_LO: - case R_PPC64_ADDR16_LO_DS: - case R_PPC64_ADDR24: - case R_PPC64_ADDR32: - case R_PPC64_ADDR64: - case R_PPC64_UADDR16: - case R_PPC64_UADDR32: - case R_PPC64_UADDR64: - case R_PPC64_TOC: - if (r_symndx >= symtab_hdr->sh_info) - { - struct ppc_link_hash_entry *eh; - struct ppc_dyn_relocs **pp; - struct ppc_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - eh = (struct ppc_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; - default: break; } @@ -4492,8 +4479,6 @@ ppc64_elf_adjust_dynamic_symbol (info, h) struct elf_link_hash_entry *h; { struct ppc_link_hash_table *htab; - struct ppc_link_hash_entry * eh; - struct ppc_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -4551,20 +4536,26 @@ ppc64_elf_adjust_dynamic_symbol (info, h) if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0) return TRUE; - eh = (struct ppc_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct ppc_link_hash_entry * eh; + struct ppc_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return TRUE; + eh = (struct ppc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -4672,11 +4663,11 @@ ppc64_elf_hide_symbol (info, h, force_local) } static bfd_boolean -get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd) +get_sym_h (hp, symp, symsecp, tls_maskp, locsymsp, r_symndx, ibfd) struct elf_link_hash_entry **hp; Elf_Internal_Sym **symp; asection **symsecp; - char **tlstypep; + char **tls_maskp; Elf_Internal_Sym **locsymsp; unsigned long r_symndx; bfd *ibfd; @@ -4708,12 +4699,12 @@ get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd) *symsecp = symsec; } - if (tlstypep != NULL) + if (tls_maskp != NULL) { struct ppc_link_hash_entry *eh; eh = (struct ppc_link_hash_entry *) h; - *tlstypep = &eh->tls_type; + *tls_maskp = &eh->tls_mask; } } else @@ -4750,45 +4741,50 @@ get_sym_h (hp, symp, symsecp, tlstypep, locsymsp, r_symndx, ibfd) *symsecp = symsec; } - if (tlstypep != NULL) + if (tls_maskp != NULL) { struct got_entry **lgot_ents; - char *tlstype; + char *tls_mask; - tlstype = NULL; + tls_mask = NULL; lgot_ents = elf_local_got_ents (ibfd); if (lgot_ents != NULL) { - char *lgot_types = (char *) (lgot_ents + symtab_hdr->sh_info); - tlstype = &lgot_types[r_symndx]; + char *lgot_masks = (char *) (lgot_ents + symtab_hdr->sh_info); + tls_mask = &lgot_masks[r_symndx]; } - *tlstypep = tlstype; + *tls_maskp = tls_mask; } } return TRUE; } -static bfd_boolean -get_tls_type (tls_type, locsymsp, rel, ibfd) - char **tls_type; +/* Returns TLS_MASKP for the given REL symbol. Function return is 0 on + error, 2 on a toc GD type suitable for optimization, 3 on a toc LD + type suitable for optimization, and 1 otherwise. */ + +static int +get_tls_mask (tls_maskp, locsymsp, rel, ibfd) + char **tls_maskp; Elf_Internal_Sym **locsymsp; const Elf_Internal_Rela *rel; bfd *ibfd; { unsigned long r_symndx; + unsigned int next_r; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; asection *sec; bfd_vma off; r_symndx = ELF64_R_SYM (rel->r_info); - if (!get_sym_h (&h, &sym, &sec, tls_type, locsymsp, r_symndx, ibfd)) - return FALSE; + if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd)) + return 0; - if ((*tls_type != NULL && **tls_type != 0) + if ((*tls_maskp != NULL && **tls_maskp != 0) || sec == NULL || ppc64_elf_section_data (sec)->t_symndx == NULL) - return TRUE; + return 1; /* Look inside a TOC section too. */ if (h != NULL) @@ -4801,7 +4797,21 @@ get_tls_type (tls_type, locsymsp, rel, ibfd) off += rel->r_addend; BFD_ASSERT (off % 8 == 0); r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8]; - return get_sym_h (&h, &sym, NULL, tls_type, locsymsp, r_symndx, ibfd); + next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1]; + if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd)) + return 0; + if (h == NULL + || h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + if (next_r == (unsigned) -1) + return 2; + if (next_r == (unsigned) -2 + && (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))) + return 3; + } + return 1; } bfd_boolean @@ -5110,39 +5120,58 @@ ppc64_elf_edit_opd (obfd, info) return TRUE; } -/* Run through all the TLS relocs looking for optimization - opportunities. The linker has been hacked (see ppc64elf.em) to do - a preliminary section layout so that we know the TLS segment - offsets. We can't optimize earlier because some optimizations need - to know the tp offset, and we need to optimize before allocating - dynamic relocations. */ +/* Set htab->tls_sec. */ bfd_boolean -ppc64_elf_tls_optimize (obfd, info) +ppc64_elf_tls_setup (obfd, info) bfd *obfd; struct bfd_link_info *info; { asection *tls; - bfd *ibfd; - asection *sec; struct ppc_link_hash_table *htab; - if (info->relocateable) - return TRUE; - for (tls = obfd->sections; tls != NULL; tls = tls->next) if ((tls->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) == (SEC_THREAD_LOCAL | SEC_LOAD)) break; - if (tls == NULL) - return TRUE; htab = ppc_hash_table (info); htab->tls_sec = tls; - if (info->shared) + if (htab->tls_get_addr != NULL) + { + struct elf_link_hash_entry *h = htab->tls_get_addr; + + 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; + + htab->tls_get_addr = h; + } + + return tls != NULL; +} + +/* Run through all the TLS relocs looking for optimization + opportunities. The linker has been hacked (see ppc64elf.em) to do + a preliminary section layout so that we know the TLS segment + offsets. We can't optimize earlier because some optimizations need + to know the tp offset, and we need to optimize before allocating + dynamic relocations. */ + +bfd_boolean +ppc64_elf_tls_optimize (obfd, info) + bfd *obfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; +{ + bfd *ibfd; + asection *sec; + struct ppc_link_hash_table *htab; + + if (info->relocateable || info->shared) return TRUE; + htab = ppc_hash_table (info); for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { Elf_Internal_Sym *locsyms = NULL; @@ -5169,13 +5198,13 @@ ppc64_elf_tls_optimize (obfd, info) struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; asection *sym_sec; - char *tls_type; - char tls_set, tls_clear, got_tls_type = 0; + char *tls_mask; + char tls_set, tls_clear, tls_type = 0; bfd_vma value; - bfd_boolean ok_tprel; + bfd_boolean ok_tprel, is_local; r_symndx = ELF64_R_SYM (rel->r_info); - if (!get_sym_h (&h, &sym, &sym_sec, &tls_type, &locsyms, + if (!get_sym_h (&h, &sym, &sym_sec, &tls_mask, &locsyms, r_symndx, ibfd)) { err_free_rel: @@ -5197,9 +5226,13 @@ ppc64_elf_tls_optimize (obfd, info) } else value = sym->st_value; + ok_tprel = FALSE; - if (sym_sec != NULL && sym_sec->output_section != NULL) + is_local = FALSE; + if (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) { + is_local = TRUE; value += sym_sec->output_offset; value += sym_sec->output_section->vma; value -= htab->tls_sec->vma; @@ -5215,16 +5248,17 @@ ppc64_elf_tls_optimize (obfd, info) case R_PPC64_GOT_TLSLD16_LO: case R_PPC64_GOT_TLSLD16_HI: case R_PPC64_GOT_TLSLD16_HA: + /* These relocs should never be against a symbol + defined in a shared lib. Leave them alone if + that turns out to be the case. */ htab->tlsld_got.refcount -= 1; - if (ok_tprel) - /* LD -> LE */ - tls_set = 0; - else - /* We still need a GOT entry as the offset is - too big. ie. LD -> IE. */ - tls_set = TLS_TLS | TLS_TPREL; - tls_clear = TLS_GD_LD; - got_tls_type = TLS_TLS | TLS_GD_LD | TLS_LD; + if (!is_local) + continue; + + /* LD -> LE */ + tls_set = 0; + tls_clear = TLS_LD; + tls_type = TLS_TLS | TLS_LD; expecting_tls_get_addr = 1; break; @@ -5232,21 +5266,14 @@ ppc64_elf_tls_optimize (obfd, info) case R_PPC64_GOT_TLSGD16_LO: case R_PPC64_GOT_TLSGD16_HI: case R_PPC64_GOT_TLSGD16_HA: - if (ok_tprel - && (h == NULL - || ((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL) != 0 - || !info->shared - || info->symbolic)))) + if (ok_tprel) /* GD -> LE */ tls_set = 0; else /* GD -> IE */ - tls_set = TLS_TLS | TLS_TPREL; - tls_clear = TLS_GD_LD; - got_tls_type = TLS_TLS | TLS_GD_LD; + tls_set = TLS_TLS | TLS_TPRELGD; + tls_clear = TLS_GD; + tls_type = TLS_TLS | TLS_GD; expecting_tls_get_addr = 1; break; @@ -5260,7 +5287,7 @@ ppc64_elf_tls_optimize (obfd, info) /* IE -> LE */ tls_set = 0; tls_clear = TLS_TPREL; - got_tls_type = TLS_TLS | TLS_TPREL; + tls_type = TLS_TLS | TLS_TPREL; break; } else @@ -5282,12 +5309,14 @@ ppc64_elf_tls_optimize (obfd, info) { /* Check for toc tls entries. */ char *toc_tls; + int retval; - if (!get_tls_type (&toc_tls, &locsyms, - rel - 1, ibfd)) + retval = get_tls_mask (&toc_tls, &locsyms, + rel - 1, ibfd); + if (retval == 0) goto err_free_rel; if (toc_tls != NULL) - expecting_tls_get_addr = *toc_tls != 0; + expecting_tls_get_addr = retval > 1; } if (expecting_tls_get_addr) @@ -5319,32 +5348,27 @@ ppc64_elf_tls_optimize (obfd, info) case R_PPC64_DTPMOD64: expecting_tls_get_addr = 0; - if ((*tls_type & TLS_LD) == 0) + if (rel + 1 < relend + && (rel[1].r_info + == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)) + && rel[1].r_offset == rel->r_offset + 8) { - if ((h == NULL - || ((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL) != 0 - || !info->shared - || info->symbolic))) - && ok_tprel) + if (ok_tprel) /* GD -> LE */ - tls_set = TLS_EXPLICIT; + tls_set = TLS_EXPLICIT | TLS_GD; else /* GD -> IE */ - tls_set = TLS_EXPLICIT | TLS_TPREL; - tls_clear = TLS_GD_LD; + tls_set = TLS_EXPLICIT | TLS_GD | TLS_TPRELGD; + tls_clear = TLS_GD; } else { - if (ok_tprel) - /* LD -> LE */ - tls_set = TLS_EXPLICIT; - else - /* LD -> IE */ - tls_set = TLS_EXPLICIT | TLS_TPREL; - tls_clear = TLS_GD_LD; + if (!is_local) + continue; + + /* LD -> LE */ + tls_set = TLS_EXPLICIT; + tls_clear = TLS_LD; } break; @@ -5365,7 +5389,7 @@ ppc64_elf_tls_optimize (obfd, info) for (; ent != NULL; ent = ent->next) if (ent->addend == rel->r_addend - && ent->tls_type == got_tls_type) + && ent->tls_type == tls_type) break; if (ent == NULL) abort (); @@ -5376,8 +5400,6 @@ ppc64_elf_tls_optimize (obfd, info) if (ent->got.refcount > 0) ent->got.refcount -= 1; } - else - ent->tls_type = tls_set; } else if (h != NULL) { @@ -5395,22 +5417,17 @@ ppc64_elf_tls_optimize (obfd, info) /* If we got rid of a DTPMOD/DTPREL reloc pair then we'll lose one or two dyn relocs. */ - if (tls_clear == TLS_GD_LD - && rel + 1 < relend - && (rel[1].r_info - == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)) - && rel[1].r_offset == rel->r_offset + 8) - p->count -= 1; - if (tls_set == TLS_EXPLICIT) + if (tls_set == (TLS_EXPLICIT | TLS_GD)) p->count -= 1; + p->count -= 1; if (p->count == 0) *pp = p->next; break; } } - *tls_type |= tls_set; - *tls_type &= ~tls_clear; + *tls_mask |= tls_set; + *tls_mask &= ~tls_clear; } if (elf_section_data (sec)->relocs != relstart) @@ -5434,9 +5451,9 @@ ppc64_elf_tls_optimize (obfd, info) will be called from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol routine, we'll need to do something about initializing any .plt and .got entries in ppc64_elf_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ ((DYN) \ - && ((INFO)->shared \ + && ((SHARED) \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ && ((H)->dynindx != -1 \ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) @@ -5467,7 +5484,7 @@ allocate_dynrelocs (h, inf) if (htab->elf.dynamic_sections_created && h->dynindx != -1 - && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) { struct plt_entry *pent; bfd_boolean doneone = FALSE; @@ -5515,11 +5532,39 @@ allocate_dynrelocs (h, inf) h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } + eh = (struct ppc_link_hash_entry *) h; + /* Run through the TLS GD got entries first if we're changing them + to TPREL. */ + if ((eh->tls_mask & TLS_TPRELGD) != 0) + for (gent = h->got.glist; gent != NULL; gent = gent->next) + if (gent->got.refcount > 0 + && (gent->tls_type & TLS_GD) != 0) + { + /* This was a GD entry that has been converted to TPREL. If + there happens to be a TPREL entry we can use that one. */ + struct got_entry *ent; + for (ent = h->got.glist; ent != NULL; ent = ent->next) + if (ent->got.refcount > 0 + && (ent->tls_type & TLS_TPREL) != 0 + && ent->addend == gent->addend) + { + gent->got.refcount = 0; + break; + } + + /* If not, then we'll be using our own TPREL entry. */ + if (gent->got.refcount != 0) + gent->tls_type = TLS_TLS | TLS_TPREL; + } + for (gent = h->got.glist; gent != NULL; gent = gent->next) if (gent->got.refcount > 0) { + bfd_boolean dyn; + /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ + Undefined weak syms won't yet be marked as dynamic, + nor will all TLS symbols. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { @@ -5527,27 +5572,28 @@ allocate_dynrelocs (h, inf) return FALSE; } - if ((gent->tls_type & TLS_LD) != 0) - gent->got.offset = htab->tlsld_got.offset; - else + if ((gent->tls_type & TLS_LD) != 0 + && !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) { - bfd_boolean dyn; - - s = htab->sgot; - gent->got.offset = s->_raw_size; - s->_raw_size += (gent->tls_type & TLS_GD_LD) != 0 ? 16 : 8; - dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) - htab->srelgot->_raw_size - += ((gent->tls_type & TLS_GD_LD) != 0 - ? 2 * sizeof (Elf64_External_Rela) - : sizeof (Elf64_External_Rela)); + gent->got.offset = htab->tlsld_got.offset; + continue; } + + s = htab->sgot; + gent->got.offset = s->_raw_size; + s->_raw_size + += (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8; + dyn = htab->elf.dynamic_sections_created; + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) + htab->srelgot->_raw_size + += (gent->tls_type & eh->tls_mask & TLS_GD + ? 2 * sizeof (Elf64_External_Rela) + : sizeof (Elf64_External_Rela)); } else gent->got.offset = (bfd_vma) -1; - eh = (struct ppc_link_hash_entry *) h; if (eh->dyn_relocs == NULL) return TRUE; @@ -5576,18 +5622,15 @@ allocate_dynrelocs (h, inf) } } } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not dynamic. */ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - || (htab->elf.dynamic_sections_created - && (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -5697,6 +5740,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) { struct got_entry **lgot_ents; struct got_entry **end_lgot_ents; + char *lgot_masks; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srel; @@ -5738,16 +5782,17 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_lgot_ents = lgot_ents + locsymcount; + lgot_masks = (char *) end_lgot_ents; s = htab->sgot; srel = htab->srelgot; - for (; lgot_ents < end_lgot_ents; ++lgot_ents) + for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_masks) { struct got_entry *ent; for (ent = *lgot_ents; ent != NULL; ent = ent->next) if (ent->got.refcount > 0) { - if ((ent->tls_type & TLS_LD) != 0) + if ((ent->tls_type & *lgot_masks & TLS_LD) != 0) { if (htab->tlsld_got.offset == (bfd_vma) -1) { @@ -5761,7 +5806,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) else { ent->got.offset = s->_raw_size; - if ((ent->tls_type & TLS_GD_LD) != 0) + if ((ent->tls_type & *lgot_masks & TLS_GD) != 0) { s->_raw_size += 16; if (info->shared) @@ -6190,13 +6235,14 @@ ppc_size_one_stub (gen_entry, in_arg) if (stub_entry->stub_type == ppc_stub_plt_call) { struct plt_entry *ent; + off = (bfd_vma) -1; for (ent = stub_entry->h->elf.plt.plist; ent != NULL; ent = ent->next) if (ent->addend == stub_entry->addend) { off = ent->plt.offset & ~(bfd_vma) 1; break; } - if (ent == NULL) + if (off >= (bfd_vma) -2) abort (); off += (htab->splt->output_offset + htab->splt->output_section->vma @@ -6376,12 +6422,15 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) asection *curr; asection *prev; bfd_size_type total; + bfd_boolean big_sec; curr = tail; if (tail->_cooked_size) total = tail->_cooked_size; else total = tail->_raw_size; + big_sec = total >= stub_group_size; + while ((prev = PREV_SEC (curr)) != NULL && ((total += curr->output_offset - prev->output_offset) < stub_group_size)) @@ -6396,7 +6445,7 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) section size. That's a little tricky, and this way will only break if stubs added make the total size more than 2^25, ie. for the default stub_group_size, if stubs total - more than 2834432 bytes, or over 100000 plt call stubs. */ + more than 2097152 bytes, or nearly 75000 plt call stubs. */ do { prev = PREV_SEC (tail); @@ -6406,8 +6455,11 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) while (tail != curr && (tail = prev) != NULL); /* But wait, there's more! Input sections up to stub_group_size - bytes before the stub section can be handled by it too. */ - if (!stubs_always_before_branch) + bytes before the stub section can be handled by it too. + Don't do this if we have a really large section after the + stubs, as adding more stubs increases the chance that + branches may not reach into the stub section. */ + if (!stubs_always_before_branch && !big_sec) { total = 0; while (prev != NULL @@ -6459,9 +6511,18 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, if (stub_group_size == 1) { /* Default values. */ - stub_group_size = 30720000; - if (htab->has_14bit_branch) - stub_group_size = 30000; + 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); @@ -6603,13 +6664,12 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, && irela != internal_relocs) { /* Get tls info. */ - char *tls_type; + char *tls_mask; - if (!get_tls_type (&tls_type, &local_syms, + if (!get_tls_mask (&tls_mask, &local_syms, irela - 1, input_bfd)) goto error_ret_free_internal; - if (tls_type != NULL - && (*tls_type & (TLS_TLS | TLS_GD_LD)) == TLS_TLS) + if (*tls_mask != 0) continue; } @@ -6902,7 +6962,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *relend; Elf_Internal_Rela outrel; bfd_byte *loc; - unsigned int tls_get_addr_type; struct got_entry **local_got_ents; bfd_vma TOCstart; bfd_boolean ret = TRUE; @@ -6918,27 +6977,12 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, ppc_howto_init (); htab = ppc_hash_table (info); - if (info->shared && (htab->tlsld_got.offset & 1) == 0) - { - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + htab->tlsld_got.offset); - outrel.r_info = ELF64_R_INFO (0, R_PPC64_DTPMOD64); - outrel.r_addend = 0; - - loc = htab->srelgot->contents; - loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - htab->tlsld_got.offset |= 1; - } - local_got_ents = elf_local_got_ents (input_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; - tls_get_addr_type = 0; rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) @@ -6952,7 +6996,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry *fdh; const char *sym_name; unsigned long r_symndx; - char tls_type; + char tls_mask, tls_gd, tls_type; bfd_vma relocation; bfd_boolean unresolved_reloc; bfd_boolean warned; @@ -6963,7 +7007,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info); r_symndx = ELF64_R_SYM (rel->r_info); - r = bfd_reloc_other; sym = (Elf_Internal_Sym *) 0; sec = (asection *) 0; h = (struct elf_link_hash_entry *) 0; @@ -7019,7 +7062,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) ; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) ; @@ -7035,17 +7077,21 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } - /* TLS optimizations. */ - tls_type = 0; - if (IS_TLS_RELOC (r_type)) + /* 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 + for the final instruction stream. */ + tls_mask = 0; + tls_gd = 0; + if (IS_PPC64_TLS_RELOC (r_type)) { if (h != NULL) - tls_type = ((struct ppc_link_hash_entry *) h)->tls_type; + tls_mask = ((struct ppc_link_hash_entry *) h)->tls_mask; else if (local_got_ents != NULL) { - char *lgot_types; - lgot_types = (char *) (local_got_ents + symtab_hdr->sh_info); - tls_type = lgot_types[r_symndx]; + char *lgot_masks; + lgot_masks = (char *) (local_got_ents + symtab_hdr->sh_info); + tls_mask = lgot_masks[r_symndx]; } } @@ -7064,39 +7110,52 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, switch (r_type) { default: - tls_get_addr_type = 0; break; case R_PPC64_TOC16: case R_PPC64_TOC16_LO: case R_PPC64_TOC16_DS: case R_PPC64_TOC16_LO_DS: - tls_get_addr_type = 0; { /* Check for toc tls entries. */ char *toc_tls; + int retval; - if (!get_tls_type (&toc_tls, &local_syms, rel, input_bfd)) + retval = get_tls_mask (&toc_tls, &local_syms, rel, input_bfd); + if (retval == 0) return FALSE; if (toc_tls) { - tls_type = *toc_tls; + tls_mask = *toc_tls; if (r_type == R_PPC64_TOC16_DS || r_type == R_PPC64_TOC16_LO_DS) goto toctprel; else - tls_get_addr_type = tls_type; + { + /* If we found a GD reloc pair, then we might be + doing a GD->IE transition. */ + if (retval == 2) + { + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_get_addr_check; + } + else if (retval == 3) + { + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + goto tls_get_addr_check; + } + } } } break; case R_PPC64_GOT_TPREL16_DS: case R_PPC64_GOT_TPREL16_LO_DS: - tls_get_addr_type = 0; toctprel: - if (tls_type != 0 - && (tls_type & TLS_TPREL) == 0) + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) { bfd_vma insn; insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); @@ -7109,20 +7168,19 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; case R_PPC64_TLS: - tls_get_addr_type = 0; - if (tls_type == 0) + if (tls_mask == 0) { /* Check for toc tls entries. */ char *toc_tls; - if (!get_tls_type (&toc_tls, &local_syms, rel, input_bfd)) + if (!get_tls_mask (&toc_tls, &local_syms, rel, input_bfd)) return FALSE; if (toc_tls) - tls_type = *toc_tls; + tls_mask = *toc_tls; } - if (tls_type != 0 - && (tls_type & TLS_TPREL) == 0) + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) { bfd_vma insn, rtra; insn = bfd_get_32 (output_bfd, contents + rel->r_offset); @@ -7164,130 +7222,162 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; - case R_PPC64_GOT_TLSGD16: - case R_PPC64_GOT_TLSGD16_LO: case R_PPC64_GOT_TLSGD16_HI: case R_PPC64_GOT_TLSGD16_HA: - case R_PPC64_GOT_TLSLD16: - case R_PPC64_GOT_TLSLD16_LO: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_gdld_hi; + break; + case R_PPC64_GOT_TLSLD16_HI: case R_PPC64_GOT_TLSLD16_HA: - tls_get_addr_type = 0; - if (tls_type != 0 && (tls_type & TLS_GD_LD) == 0) + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) { - if (r_type == R_PPC64_GOT_TLSGD16_HI - || r_type == R_PPC64_GOT_TLSGD16_HA - || r_type == R_PPC64_GOT_TLSLD16_HI - || r_type == R_PPC64_GOT_TLSLD16_HA) + tls_gdld_hi: + if ((tls_mask & tls_gd) != 0) + r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3) + + R_PPC64_GOT_TPREL16_DS); + else { - if ((tls_type & TLS_LD) != 0) - { - bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); - r_type = R_PPC64_NONE; - rel->r_offset -= 2; - } - else - r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3) - + R_PPC64_GOT_TPREL16_DS); - rel->r_info = ELF64_R_INFO (r_symndx, r_type); - break; + bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); + rel->r_offset -= 2; + r_type = R_PPC64_NONE; } - - /* This reloc and its instruction will be replaced so there's - not much point in doing anything more here. We know the - next reloc will be a REL24 to __tls_get_addr, and will - be handled below. */ - tls_get_addr_type = tls_type; - continue; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); } break; - case R_PPC64_REL14: - case R_PPC64_REL14_BRTAKEN: - case R_PPC64_REL14_BRNTAKEN: - case R_PPC64_REL24: - if (h != NULL - && h == htab->tls_get_addr - && tls_get_addr_type != 0 - && (tls_get_addr_type & TLS_GD_LD) == 0) - { - /* Replace the call. */ - bfd_vma insn1, insn2, insn3; - bfd_vma offset = rel->r_offset; + case R_PPC64_GOT_TLSGD16: + case R_PPC64_GOT_TLSGD16_LO: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_get_addr_check; + break; - insn1 = bfd_get_32 (output_bfd, contents + rel[-1].r_offset - 2); - insn3 = bfd_get_32 (output_bfd, contents + offset + 4); - if (tls_get_addr_type & TLS_TPREL) - { - /* IE */ - insn1 &= (1 << 26) - (1 << 2); - insn1 |= 58 << 26; /* ld */ - insn2 = 0x7c636a14; /* add 3,3,13 */ - /* Fix the relocs for --emit-relocs. */ - r_type = ELF64_R_TYPE (rel[-1].r_info); - if (tls_get_addr_type & TLS_EXPLICIT) - r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16; - else - r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3) - + R_PPC64_GOT_TPREL16_DS); - rel[-1].r_info - = ELF64_R_INFO (ELF64_R_SYM (rel[-1].r_info), r_type); - rel->r_info = 0; - } - else + case R_PPC64_GOT_TLSLD16: + case R_PPC64_GOT_TLSLD16_LO: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + { + tls_get_addr_check: + if (rel + 1 < relend) { - /* LE */ - insn1 = 0x3c6d0000; /* addis 3,13,0 */ - insn2 = 0x38630000; /* addi 3,3,0 */ - if (tls_get_addr_type & TLS_LD) + enum elf_ppc64_reloc_type r_type2; + unsigned long r_symndx2; + struct elf_link_hash_entry *h2; + bfd_vma insn1, insn2, insn3; + bfd_vma offset; + + /* The next instruction should be a call to + __tls_get_addr. Peek at the reloc to be sure. */ + r_type2 + = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel[1].r_info); + r_symndx2 = ELF64_R_SYM (rel[1].r_info); + if (r_symndx2 < symtab_hdr->sh_info + || (r_type2 != R_PPC64_REL14 + && r_type2 != R_PPC64_REL14_BRTAKEN + && r_type2 != R_PPC64_REL14_BRNTAKEN + && r_type2 != R_PPC64_REL24)) + break; + + h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info]; + while (h2->root.type == bfd_link_hash_indirect + || h2->root.type == bfd_link_hash_warning) + h2 = (struct elf_link_hash_entry *) h2->root.u.i.link; + if (h2 == NULL || h2 != htab->tls_get_addr) + break; + + /* OK, it checks out. Replace the call. */ + offset = rel[1].r_offset; + insn1 = bfd_get_32 (output_bfd, + contents + rel->r_offset - 2); + insn3 = bfd_get_32 (output_bfd, + contents + offset + 4); + if ((tls_mask & tls_gd) != 0) { - r_symndx = 0; - rel[-1].r_addend = htab->tls_sec->vma + DTP_OFFSET; - rel->r_addend = htab->tls_sec->vma + DTP_OFFSET; + /* IE */ + insn1 &= (1 << 26) - (1 << 2); + insn1 |= 58 << 26; /* ld */ + insn2 = 0x7c636a14; /* add 3,3,13 */ + rel[1].r_info = ELF64_R_INFO (r_symndx2, R_PPC64_NONE); + if ((tls_mask & TLS_EXPLICIT) == 0) + r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3) + + R_PPC64_GOT_TPREL16_DS); + else + r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); } else - r_symndx = ELF64_R_SYM (rel[-1].r_info); - rel[-1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_HA); - rel->r_info = ELF64_R_INFO (r_symndx, R_PPC64_TPREL16_LO); - rel->r_offset += 2; - } - if (insn3 == NOP - || insn3 == CROR_151515 || insn3 == CROR_313131) - { - insn3 = insn2; - insn2 = NOP; - rel->r_offset += 4; + { + /* LE */ + insn1 = 0x3c6d0000; /* addis 3,13,0 */ + insn2 = 0x38630000; /* addi 3,3,0 */ + if (tls_gd == 0) + { + /* Was an LD reloc. */ + r_symndx = 0; + rel->r_addend = htab->tls_sec->vma + DTP_OFFSET; + rel[1].r_addend = htab->tls_sec->vma + DTP_OFFSET; + } + r_type = R_PPC64_TPREL16_HA; + 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; + } + if (insn3 == NOP + || insn3 == CROR_151515 || insn3 == CROR_313131) + { + insn3 = insn2; + insn2 = NOP; + rel[1].r_offset += 4; + } + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn2, contents + offset); + bfd_put_32 (output_bfd, insn3, contents + offset + 4); + if (tls_gd == 0) + { + /* We changed the symbol on an LD reloc. Start over + in order to get h, sym, sec etc. right. */ + rel--; + continue; + } } - bfd_put_32 (output_bfd, insn1, contents + rel[-1].r_offset - 2); - bfd_put_32 (output_bfd, insn2, contents + offset); - bfd_put_32 (output_bfd, insn3, contents + offset + 4); - /* Do the relocs again. */ - rel -= 2; - tls_get_addr_type = 0; - continue; } - tls_get_addr_type = 0; break; case R_PPC64_DTPMOD64: - if ((tls_type & TLS_GD_LD) == 0) + if (rel + 1 < relend + && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64) + && rel[1].r_offset == rel->r_offset + 8) { - if ((tls_type & TLS_TPREL) != 0) - r_type = R_PPC64_TPREL64; - else + if ((tls_mask & TLS_GD) == 0) + { + rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_NONE); + if ((tls_mask & TLS_TPRELGD) != 0) + r_type = R_PPC64_TPREL64; + else + { + bfd_put_64 (output_bfd, (bfd_vma) 1, + contents + rel->r_offset); + r_type = R_PPC64_NONE; + } + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } + } + else + { + if ((tls_mask & TLS_LD) == 0) { bfd_put_64 (output_bfd, (bfd_vma) 1, contents + rel->r_offset); r_type = R_PPC64_NONE; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); } - rel->r_info = ELF64_R_INFO (r_symndx, r_type); - if ((tls_type & TLS_LD) == 0) - rel[1].r_info = 0; } break; case R_PPC64_TPREL64: - if ((tls_type & TLS_TPREL) == 0) + if ((tls_mask & TLS_TPREL) == 0) { r_type = R_PPC64_NONE; rel->r_info = ELF64_R_INFO (r_symndx, r_type); @@ -7437,14 +7527,14 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_GOT_TLSGD16_LO: case R_PPC64_GOT_TLSGD16_HI: case R_PPC64_GOT_TLSGD16_HA: - tls_type = TLS_TLS | TLS_GD_LD; + tls_type = TLS_TLS | TLS_GD; goto dogot; case R_PPC64_GOT_TLSLD16: case R_PPC64_GOT_TLSLD16_LO: case R_PPC64_GOT_TLSLD16_HI: case R_PPC64_GOT_TLSLD16_HA: - tls_type = TLS_TLS | TLS_GD_LD | TLS_LD; + tls_type = TLS_TLS | TLS_LD; goto dogot; case R_PPC64_GOT_TPREL16_DS: @@ -7471,57 +7561,64 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { /* Relocation is to the entry for this symbol in the global offset table. */ - struct got_entry *ent; + bfd_vma *offp; bfd_vma off; - unsigned long indx; + unsigned long indx = 0; if (htab->sgot == NULL) abort (); - if (h != NULL) - ent = h->got.glist; + if (tls_type == (TLS_TLS | TLS_LD) + && (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))) + offp = &htab->tlsld_got.offset; else { - if (local_got_ents == NULL) - abort (); - ent = local_got_ents[r_symndx]; - } + struct got_entry *ent; - for (; ent != NULL; ent = ent->next) - if (ent->addend == rel->r_addend - && ent->tls_type == tls_type) - break; - if (ent == NULL) - abort (); - - off = ent->got.offset; - indx = 0; - if (h != NULL) - { - bfd_boolean dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR))) - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. */ - ; + if (h != NULL) + { + bfd_boolean dyn = htab->elf.dynamic_sections_created; + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && (info->symbolic + || h->dynindx == -1 + || (h->elf_link_hash_flags + & ELF_LINK_FORCED_LOCAL)) + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR))) + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. */ + ; + else + { + indx = h->dynindx; + unresolved_reloc = FALSE; + } + ent = h->got.glist; + } else { - indx = h->dynindx; - unresolved_reloc = FALSE; + if (local_got_ents == NULL) + abort (); + ent = local_got_ents[r_symndx]; } + + for (; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->tls_type == tls_type) + break; + if (ent == NULL) + abort (); + offp = &ent->got.offset; } /* The offset must always be a multiple of 8. We use the least significant bit to record whether we have already processed this entry. */ + off = *offp; if ((off & 1) != 0) off &= ~1; else @@ -7529,32 +7626,37 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Generate relocs for the dynamic linker, except in the case of TLSLD where we'll use one entry per module. */ - if ((info->shared || indx != 0) - && ent->tls_type != (TLS_TLS | TLS_GD_LD | TLS_LD)) + *offp = off | 1; + if (info->shared || indx != 0) { outrel.r_offset = (htab->sgot->output_section->vma + htab->sgot->output_offset + off); - if (ent->tls_type == (TLS_TLS | TLS_GD_LD)) + if (tls_type & (TLS_LD | TLS_GD)) { outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64); outrel.r_addend = 0; - loc = htab->srelgot->contents; - loc += (htab->srelgot->reloc_count++ - * sizeof (Elf64_External_Rela)); - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64); - outrel.r_offset += 8; + if (tls_type == (TLS_TLS | TLS_GD)) + { + loc = htab->srelgot->contents; + loc += (htab->srelgot->reloc_count++ + * sizeof (Elf64_External_Rela)); + bfd_elf64_swap_reloca_out (output_bfd, + &outrel, loc); + outrel.r_info + = ELF64_R_INFO (indx, R_PPC64_DTPREL64); + outrel.r_offset += 8; + } } - else if (ent->tls_type == (TLS_TLS | TLS_DTPREL)) + else if (tls_type == (TLS_TLS | TLS_DTPREL)) outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64); - else if (ent->tls_type == (TLS_TLS | TLS_TPREL)) + else if (tls_type == (TLS_TLS | TLS_TPREL)) outrel.r_info = ELF64_R_INFO (indx, R_PPC64_TPREL64); else if (indx == 0) outrel.r_info = ELF64_R_INFO (indx, R_PPC64_RELATIVE); else outrel.r_info = ELF64_R_INFO (indx, R_PPC64_GLOB_DAT); - outrel.r_addend = ent->addend; + outrel.r_addend = rel->r_addend; if (indx == 0) outrel.r_addend += relocation; loc = htab->srelgot->contents; @@ -7565,29 +7667,27 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Init the .got section contents if we're not emitting a reloc. */ - if (!(info->shared || indx != 0)) + else { - - relocation += ent->addend; - if ((tls_type & TLS_TLS) != 0) + relocation += rel->r_addend; + if (tls_type != 0) { relocation -= htab->tls_sec->vma + DTP_OFFSET; if ((tls_type & TLS_TPREL) != 0) relocation += DTP_OFFSET - TP_OFFSET; } - if ((tls_type & TLS_GD_LD) != 0) + if ((tls_type & TLS_GD) != 0) { - if ((tls_type & TLS_LD) != 0) - relocation = - DTP_OFFSET; bfd_put_64 (output_bfd, relocation, htab->sgot->contents + off + 8); relocation = 1; } + else if (tls_type == (TLS_TLS | TLS_LD)) + relocation = 1; bfd_put_64 (output_bfd, relocation, htab->sgot->contents + off); } - ent->got.offset |= 1; } if (off >= (bfd_vma) -2) @@ -7748,16 +7848,13 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, && (! info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) { Elf_Internal_Rela outrel; bfd_boolean skip, relocate; @@ -7871,7 +7968,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_RELATIVE: /* We shouldn't ever see these dynamic relocs in relocatable files. */ - /* Fall thru */ + /* Fall through. */ case R_PPC64_PLTGOT16: case R_PPC64_PLTGOT16_DS: @@ -8016,11 +8113,14 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (r != bfd_reloc_ok) { - const char *name; - - if (h != NULL) + if (sym_name == NULL) + sym_name = "(null)"; + if (r == bfd_reloc_overflow) { - if (h->root.type == bfd_link_hash_undefweak + if (warned) + continue; + if (h != NULL + && h->root.type == bfd_link_hash_undefweak && ppc64_elf_howto_table[(int) r_type]->pc_relative) { /* Assume this is a call protected by other code that @@ -8032,21 +8132,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - name = h->root.root.string; - } - else - { - name = bfd_elf_local_sym_name (input_bfd, sym); - if (name == NULL) - continue; - } - - if (r == bfd_reloc_overflow) - { - if (warned) - continue; if (!((*info->callbacks->reloc_overflow) - (info, name, ppc64_elf_howto_table[(int) r_type]->name, + (info, sym_name, ppc64_elf_howto_table[(int) r_type]->name, rel->r_addend, input_bfd, input_section, rel->r_offset))) return FALSE; } @@ -8056,7 +8143,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s(%s+0x%lx): reloc against `%s': error %d"), bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), - (long) rel->r_offset, name, (int) r); + (long) rel->r_offset, sym_name, (int) r); ret = FALSE; } } @@ -8100,7 +8187,6 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* Create a JMP_SLOT reloc to inform the dynamic linker to fill in the PLT entry. */ - rela.r_offset = (htab->splt->output_section->vma + htab->splt->output_offset + ent->plt.offset); diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index 707ee63..4b80cc5 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -21,6 +21,8 @@ bfd_boolean ppc64_elf_mark_entry_syms PARAMS ((struct bfd_link_info *)); bfd_boolean ppc64_elf_edit_opd PARAMS ((bfd *, struct bfd_link_info *)); +bfd_boolean ppc64_elf_tls_setup + PARAMS ((bfd *, struct bfd_link_info *)); bfd_boolean ppc64_elf_tls_optimize PARAMS ((bfd *, struct bfd_link_info *)); bfd_vma ppc64_elf_toc diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 1c81edf..e3c7f22 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 64-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of BFD, the Binary File Descriptor library. @@ -373,7 +373,7 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst) /* A relocation function which doesn't do anything. */ static bfd_reloc_status_type s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) + output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry; asymbol *symbol ATTRIBUTE_UNUSED; @@ -986,7 +986,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* Fall through */ case R_390_GOT12: - case R_390_GOT16: + case R_390_GOT16: case R_390_GOT32: case R_390_GOT64: case R_390_GOTENT: @@ -1292,9 +1292,6 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -1305,16 +1302,31 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_s390_link_hash_entry *eh; + struct elf_s390_dyn_relocs **pp; + struct elf_s390_dyn_relocs *p; - if (r_symndx < symtab_hdr->sh_info) - h = NULL; - else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf_s390_link_hash_entry *) h; - r_type = elf_s390_tls_transition (info, - ELF64_R_TYPE (rel->r_info), - r_symndx >= symtab_hdr->sh_info); + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = ELF64_R_TYPE (rel->r_info); + r_type = elf_s390_tls_transition (info, r_type, h != NULL); switch (r_type) { case R_390_TLS_LDM64: @@ -1347,14 +1359,7 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) if (local_got_refcounts[r_symndx] > 0) local_got_refcounts[r_symndx] -= 1; } - if (r_type != R_390_TLS_IE64) - break; - /* Fall through */ - - case R_390_TLS_LE64: - if (!info->shared) - break; - /* Fall through */ + break; case R_390_8: case R_390_12: @@ -1366,33 +1371,9 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: - if (h != NULL) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - eh = (struct elf_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 - || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC32 - || ELF64_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC64) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + if (info->shared) + break; + /* Fall through */ case R_390_PLT16DBL: case R_390_PLT32: @@ -2226,7 +2207,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -2266,14 +2246,14 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; - + /* Offset in GOT is PLT index plus GOT headers(3) times 4, addr & GOT addr. */ relocation = (plt_index + 3) * GOT_ENTRY_SIZE; unresolved_reloc = FALSE; if (r_type == R_390_GOTPLTENT) - relocation += htab->sgot->output_section->vma; + relocation += htab->sgot->output_section->vma; break; } /* Fall through. */ @@ -2371,12 +2351,10 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, relocation = htab->sgot->output_offset + off; - /* - * For @GOTENT the relocation is against the offset between - * the instruction and the symbols entry in the GOT and not - * between the start of the GOT and the symbols entry. We - * add the vma of the GOT to get the correct value. - */ + /* For @GOTENT the relocation is against the offset between + the instruction and the symbols entry in the GOT and not + between the start of the GOT and the symbols entry. We + add the vma of the GOT to get the correct value. */ if ( r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT) relocation += htab->sgot->output_section->vma; @@ -2429,17 +2407,17 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, + htab->splt->output_offset + h->plt.offset); unresolved_reloc = FALSE; - break; + break; case R_390_PLTOFF16: case R_390_PLTOFF32: case R_390_PLTOFF64: - /* Relocation is to the entry for this symbol in the - procedure linkage table relative to the start of the GOT. */ + /* Relocation is to the entry for this symbol in the + procedure linkage table relative to the start of the GOT. */ /* For local symbols or if we didn't make a PLT entry for this symbol resolve the symbol directly. */ - if ( h == NULL + if ( h == NULL || h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) { @@ -2447,9 +2425,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; } - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset - htab->sgot->output_section->vma); unresolved_reloc = FALSE; break; @@ -2500,7 +2478,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - skip = FALSE; relocate = FALSE; @@ -2577,7 +2554,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloc_out (output_bfd, &outrel, loc); } - /* Fall through */ + /* Fall through. */ case R_390_TLS_GD64: case R_390_TLS_GOTIE64: @@ -2621,7 +2598,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, if ((off & 1) != 0) off &= ~1; - else + else { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -2756,7 +2733,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, htab->tls_ldm_got.offset |= 1; } relocation = htab->sgot->output_offset + off; - unresolved_reloc = FALSE; + unresolved_reloc = FALSE; break; case R_390_TLS_LE64: @@ -3067,7 +3044,6 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the global offset table. Set it up. */ - if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -3278,11 +3254,9 @@ elf_s390_finish_dynamic_sections (output_bfd, info) return TRUE; } -/* - * Why was the hash table entry size definition changed from - * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and - * this is the only reason for the s390_elf64_size_info structure. - */ +/* Why was the hash table entry size definition changed from + ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and + this is the only reason for the s390_elf64_size_info structure. */ const struct elf_size_info s390_elf64_size_info = { @@ -3294,10 +3268,10 @@ const struct elf_size_info s390_elf64_size_info = sizeof (Elf64_External_Sym), sizeof (Elf64_External_Dyn), sizeof (Elf_External_Note), - 8, /* hash-table entry size */ - 1, /* internal relocations per external relocations */ - 64, /* arch_size */ - 8, /* file_align */ + 8, /* hash-table entry size. */ + 1, /* internal relocations per external relocations. */ + 64, /* arch_size. */ + 8, /* file_align. */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index c9d248e..e4f04b5 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -2,21 +2,21 @@ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -2067,7 +2067,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) ; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) ; @@ -2083,7 +2082,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* To avoid generating warning messages about truncated relocations, set the relocation's address to be the same as the start of this section. */ - if (input_section->output_section != NULL) relocation = input_section->output_section->vma; else @@ -2615,7 +2613,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } } - /* FALLTHROUGH */ + /* Fall through. */ default: do_default: @@ -2820,7 +2818,6 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ - BFD_ASSERT (h->dynindx != -1); s = bfd_get_section_by_name (h->root.u.def.section->owner, @@ -2923,10 +2920,8 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) /* Initialize the contents of the .plt section. */ if (splt->_raw_size > 0) - { - sparc64_elf_build_plt (output_bfd, splt->contents, - (int) (splt->_raw_size / PLT_ENTRY_SIZE)); - } + sparc64_elf_build_plt (output_bfd, splt->contents, + (int) (splt->_raw_size / PLT_ENTRY_SIZE)); elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; @@ -3137,14 +3132,14 @@ const struct elf_size_info sparc64_elf_size_info = sizeof (Elf64_External_Sym), sizeof (Elf64_External_Dyn), sizeof (Elf_External_Note), - 4, /* hash-table entry size */ - /* internal relocations per external relocations. + 4, /* hash-table entry size. */ + /* Internal relocations per external relocations. For link purposes we use just 1 internal per 1 external, for assembly and slurp symbol table we use 2. */ 1, - 64, /* arch_size */ - 8, /* file_align */ + 64, /* arch_size. */ + 8, /* file_align. */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index a3c36ff..f13b4d2 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1,22 +1,22 @@ /* X86-64 specific support for 64-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Jan Hubicka <jh@suse.cz>. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -1091,9 +1091,6 @@ elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -1103,85 +1100,79 @@ elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch ((r_type = elf64_x86_64_tls_transition (info, - ELF64_R_TYPE (rel->r_info), - ELF64_R_SYM (rel->r_info) - >= symtab_hdr->sh_info))) - { - case R_X86_64_TLSLD: - if (elf64_x86_64_hash_table (info)->tls_ld_got.refcount > 0) - elf64_x86_64_hash_table (info)->tls_ld_got.refcount -= 1; - break; - - case R_X86_64_TLSGD: - case R_X86_64_GOTTPOFF: - case R_X86_64_GOT32: - case R_X86_64_GOTPCREL: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->got.refcount > 0) - h->got.refcount -= 1; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - case R_X86_64_8: - case R_X86_64_16: - case R_X86_64_32: - case R_X86_64_64: - case R_X86_64_32S: - case R_X86_64_PC8: - case R_X86_64_PC16: - case R_X86_64_PC32: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf64_x86_64_link_hash_entry *eh; - struct elf64_x86_64_dyn_relocs **pp; - struct elf64_x86_64_dyn_relocs *p; + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf64_x86_64_link_hash_entry *eh; + struct elf64_x86_64_dyn_relocs **pp; + struct elf64_x86_64_dyn_relocs *p; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf64_x86_64_link_hash_entry *) h; - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } - eh = (struct elf64_x86_64_link_hash_entry *) h; + r_type = ELF64_R_TYPE (rel->r_info); + r_type = elf64_x86_64_tls_transition (info, r_type, h != NULL); + switch (r_type) + { + case R_X86_64_TLSLD: + if (elf64_x86_64_hash_table (info)->tls_ld_got.refcount > 0) + elf64_x86_64_hash_table (info)->tls_ld_got.refcount -= 1; + break; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF64_R_TYPE (rel->r_info) == R_X86_64_PC8 - || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC16 - || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + case R_X86_64_TLSGD: + case R_X86_64_GOTTPOFF: + case R_X86_64_GOT32: + case R_X86_64_GOTPCREL: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + case R_X86_64_8: + case R_X86_64_16: + case R_X86_64_32: + case R_X86_64_64: + case R_X86_64_32S: + case R_X86_64_PC8: + case R_X86_64_PC16: + case R_X86_64_PC32: + if (info->shared) + break; + /* Fall thru */ - case R_X86_64_PLT32: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount -= 1; - } - break; + case R_X86_64_PLT32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; - default: - break; - } + default: + break; + } + } return TRUE; } @@ -1921,7 +1912,6 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; @@ -2106,7 +2096,6 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - skip = FALSE; relocate = FALSE; @@ -2330,7 +2319,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, if ((off & 1) != 0) off &= ~1; - else + else { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -2408,12 +2397,12 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, addq foo@gottpoff(%rip), %rax */ BFD_ASSERT (rel->r_offset >= 4); for (i = 0; i < 4; i++) - BFD_ASSERT (bfd_get_8 (input_bfd, + BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset - 4 + i) == tlsgd[i]); BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size); for (i = 0; i < 4; i++) - BFD_ASSERT (bfd_get_8 (input_bfd, + BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset + 4 + i) == tlsgd[i+4]); BFD_ASSERT (rel + 1 < relend); @@ -2592,7 +2581,6 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the procedure linkage table. Set it up. */ - if (h->dynindx == -1 || htab->splt == NULL || htab->sgotplt == NULL @@ -2671,7 +2659,6 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the global offset table. Set it up. */ - if (htab->sgot == NULL || htab->srelgot == NULL) abort (); diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 4f9fcf7..724d607 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -1,22 +1,22 @@ /* ELF core file support for BFD. - Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ char* elf_core_file_failing_command (abfd) @@ -48,11 +48,11 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) } /* See if the name in the corefile matches the executable name. */ - corename = elf_tdata (core_bfd)->core_program; if (corename != NULL) { const char* execname = strrchr (exec_bfd->filename, '/'); + execname = execname ? execname + 1 : exec_bfd->filename; if (strcmp(execname, corename) != 0) @@ -71,17 +71,15 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) register set) and the floating point register set are stored in a segment of type PT_NOTE. We handcraft a couple of extra bfd sections that allow standard bfd access to the general registers (.reg) and the - floating point registers (.reg2). - - */ + floating point registers (.reg2). */ const bfd_target * elf_core_file_p (abfd) bfd *abfd; { - Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ - Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ - Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form */ + Elf_External_Ehdr x_ehdr; /* Elf file header, external form. */ + Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form. */ + Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form. */ unsigned int phindex; struct elf_backend_data *ebd; struct bfd_preserve preserve; @@ -103,7 +101,7 @@ elf_core_file_p (abfd) if (! elf_file_p (&x_ehdr)) goto wrong; - /* FIXME: Check EI_VERSION here ! */ + /* FIXME: Check EI_VERSION here ! */ /* Check the address size ("class"). */ if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS) @@ -112,11 +110,11 @@ elf_core_file_p (abfd) /* Check the byteorder. */ switch (x_ehdr.e_ident[EI_DATA]) { - case ELFDATA2MSB: /* Big-endian */ + case ELFDATA2MSB: /* Big-endian. */ if (! bfd_big_endian (abfd)) goto wrong; break; - case ELFDATA2LSB: /* Little-endian */ + case ELFDATA2LSB: /* Little-endian. */ if (! bfd_little_endian (abfd)) goto wrong; break; @@ -168,7 +166,11 @@ elf_core_file_p (abfd) if ((*target_ptr)->flavour != bfd_target_elf_flavour) continue; back = (struct elf_backend_data *) (*target_ptr)->backend_data; - if (back->elf_machine_code == i_ehdrp->e_machine) + if (back->elf_machine_code == i_ehdrp->e_machine + || (back->elf_machine_alt1 != 0 + && i_ehdrp->e_machine == back->elf_machine_alt1) + || (back->elf_machine_alt2 != 0 + && i_ehdrp->e_machine == back->elf_machine_alt2)) { /* target_ptr is an ELF backend which matches this object file, so reject the generic ELF target. */ @@ -203,6 +205,7 @@ elf_core_file_p (abfd) for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { Elf_External_Phdr x_phdr; + if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof (x_phdr), abfd) != sizeof (x_phdr)) goto fail; @@ -222,21 +225,17 @@ elf_core_file_p (abfd) /* Process each program header. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) - { - if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex)) - goto fail; - } + if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex)) + goto fail; /* Save the entry point from the ELF header. */ bfd_get_start_address (abfd) = i_ehdrp->e_entry; /* Let the backend double check the format and override global information. */ - if (ebd->elf_backend_object_p) - { - if (! (*ebd->elf_backend_object_p) (abfd)) - goto wrong; - } + if (ebd->elf_backend_object_p + && (! (*ebd->elf_backend_object_p) (abfd))) + goto wrong; bfd_preserve_finish (abfd, &preserve); return abfd->xvec; diff --git a/bfd/elflink.c b/bfd/elflink.c index 3170035..962c104 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1,5 +1,5 @@ /* ELF linking support for BFD. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -31,14 +31,15 @@ _bfd_elf_create_got_section (abfd, info) struct bfd_link_info *info; { flagword flags; - register asection *s; + asection *s; struct elf_link_hash_entry *h; struct bfd_link_hash_entry *bh; struct elf_backend_data *bed = get_elf_backend_data (abfd); int ptralign; /* This function may be called more than once. */ - if (bfd_get_section_by_name (abfd, ".got") != NULL) + s = bfd_get_section_by_name (abfd, ".got"); + if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0) return TRUE; switch (bed->s->arch_size) @@ -111,7 +112,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) struct bfd_link_info *info; { flagword flags, pltflags; - register asection *s; + asection *s; struct elf_backend_data *bed = get_elf_backend_data (abfd); int ptralign; @@ -272,7 +273,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h) } /* We don't put any version information in the dynamic string - table. */ + table. */ name = h->root.root.string; p = strchr (name, ELF_VER_CHR); if (p == NULL) @@ -525,18 +526,19 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) s->_raw_size = align_power (s->_raw_size, lsect->alignment); - /* Is there a hole we have to provide? If so check whether the segment is - too big already */ + /* Is there a hole we have to provide? If so check whether the + segment is too big already */ if (lsect->hole_size) { lsect->hole_offset = s->_raw_size; s->_raw_size += lsect->hole_size; if (lsect->hole_offset > lsect->max_hole_offset) { - (*_bfd_error_handler) (_("%s: Section %s is too large to add hole of %ld bytes"), - bfd_get_filename (abfd), - lsect->name, - (long) lsect->hole_size); + (*_bfd_error_handler) + (_("%s: Section %s is too large to add hole of %ld bytes"), + bfd_get_filename (abfd), + lsect->name, + (long) lsect->hole_size); bfd_set_error (bfd_error_bad_value); return (elf_linker_section_t *)0; diff --git a/bfd/elflink.h b/bfd/elflink.h index a70f873..7d2d2e2 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2,21 +2,21 @@ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* ELF linker code. */ @@ -1168,6 +1168,8 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Versym *extversym = NULL; Elf_External_Versym *ever; struct elf_link_hash_entry *weaks; + struct elf_link_hash_entry **nondeflt_vers = NULL; + bfd_size_type nondeflt_vers_cnt = 0; Elf_Internal_Sym *isymbuf = NULL; Elf_Internal_Sym *isym; Elf_Internal_Sym *isymend; @@ -1997,6 +1999,23 @@ elf_link_add_object_symbols (abfd, info) override, dt_needed)) goto error_free_vers; + if (definition && (abfd->flags & DYNAMIC) == 0) + { + char *p = strchr (name, ELF_VER_CHR); + if (p != NULL && p[1] != ELF_VER_CHR) + { + /* Queue non-default versions so that .symver x, x@FOO + aliases can be checked. */ + if (! nondeflt_vers) + { + amt = (isymend - isym + 1) + * sizeof (struct elf_link_hash_entry *); + nondeflt_vers = bfd_malloc (amt); + } + nondeflt_vers [nondeflt_vers_cnt++] = h; + } + } + if (dynsym && h->dynindx == -1) { if (! _bfd_elf_link_record_dynamic_symbol (info, h)) @@ -2071,6 +2090,55 @@ elf_link_add_object_symbols (abfd, info) } } + /* Now that all the symbols from this input file are created, handle + .symver foo, foo@BAR such that any relocs against foo become foo@BAR. */ + if (nondeflt_vers != NULL) + { + bfd_size_type cnt, symidx; + + for (cnt = 0; cnt < nondeflt_vers_cnt; ++cnt) + { + struct elf_link_hash_entry *h = nondeflt_vers[cnt], *hi; + char *shortname, *p; + + p = strchr (h->root.root.string, ELF_VER_CHR); + if (p == NULL + || (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak)) + continue; + + amt = p - h->root.root.string; + shortname = bfd_malloc (amt + 1); + memcpy (shortname, h->root.root.string, amt); + shortname[amt] = '\0'; + + hi = (struct elf_link_hash_entry *) + bfd_link_hash_lookup (info->hash, shortname, + FALSE, FALSE, FALSE); + if (hi != NULL + && hi->root.type == h->root.type + && hi->root.u.def.value == h->root.u.def.value + && hi->root.u.def.section == h->root.u.def.section) + { + (*bed->elf_backend_hide_symbol) (info, hi, TRUE); + hi->root.type = bfd_link_hash_indirect; + hi->root.u.i.link = (struct bfd_link_hash_entry *) h; + (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); + sym_hash = elf_sym_hashes (abfd); + if (sym_hash) + for (symidx = 0; symidx < extsymcount; ++symidx) + if (sym_hash[symidx] == hi) + { + sym_hash[symidx] = h; + break; + } + } + free (shortname); + } + free (nondeflt_vers); + nondeflt_vers = NULL; + } + if (extversym != NULL) { free (extversym); @@ -2277,6 +2345,8 @@ elf_link_add_object_symbols (abfd, info) return TRUE; error_free_vers: + if (nondeflt_vers != NULL) + free (nondeflt_vers); if (extversym != NULL) free (extversym); error_free_sym: @@ -2509,7 +2579,10 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs, else if (shdr->sh_entsize == sizeof (Elf_External_Rela)) swap_in = bed->s->swap_reloca_in; else - abort (); + { + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } erela = external_relocs; erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize; @@ -4878,18 +4951,24 @@ elf_bfd_final_link (abfd, info) merged = FALSE; for (o = abfd->sections; o != (asection *) NULL; o = o->next) { + struct bfd_elf_section_data *esdo = elf_section_data (o); o->reloc_count = 0; for (p = o->link_order_head; p != NULL; p = p->next) { + unsigned int reloc_count = 0; + struct bfd_elf_section_data *esdi = NULL; + unsigned int *rel_count1; + if (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order) - ++o->reloc_count; + reloc_count = 1; else if (p->type == bfd_indirect_link_order) { asection *sec; sec = p->u.indirect.section; + esdi = elf_section_data (sec); /* Mark all sections which are to be included in the link. This will normally be every section. We need @@ -4901,7 +4980,7 @@ elf_bfd_final_link (abfd, info) merged = TRUE; if (info->relocateable || info->emitrelocations) - o->reloc_count += sec->reloc_count; + reloc_count = sec->reloc_count; else if (bed->elf_backend_count_relocs) { Elf_Internal_Rela * relocs; @@ -4910,8 +4989,7 @@ elf_bfd_final_link (abfd, info) (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->keep_memory)); - o->reloc_count - += (*bed->elf_backend_count_relocs) (sec, relocs); + reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs); if (elf_section_data (o)->relocs != relocs) free (relocs); @@ -4954,6 +5032,56 @@ elf_bfd_final_link (abfd, info) } } } + + if (reloc_count == 0) + continue; + + o->reloc_count += reloc_count; + + /* MIPS may have a mix of REL and RELA relocs on sections. + To support this curious ABI we keep reloc counts in + elf_section_data too. We must be careful to add the + relocations from the input section to the right output + count. FIXME: Get rid of one count. We have + o->reloc_count == esdo->rel_count + esdo->rel_count2. */ + rel_count1 = &esdo->rel_count; + if (esdi != NULL) + { + bfd_boolean same_size; + bfd_size_type entsize1; + + entsize1 = esdi->rel_hdr.sh_entsize; + BFD_ASSERT (entsize1 == sizeof (Elf_External_Rel) + || entsize1 == sizeof (Elf_External_Rela)); + same_size = (!o->use_rela_p + == (entsize1 == sizeof (Elf_External_Rel))); + + if (!same_size) + rel_count1 = &esdo->rel_count2; + + if (esdi->rel_hdr2 != NULL) + { + bfd_size_type entsize2 = esdi->rel_hdr2->sh_entsize; + unsigned int alt_count; + unsigned int *rel_count2; + + BFD_ASSERT (entsize2 != entsize1 + && (entsize2 == sizeof (Elf_External_Rel) + || entsize2 == sizeof (Elf_External_Rela))); + + rel_count2 = &esdo->rel_count2; + if (!same_size) + rel_count2 = &esdo->rel_count; + + /* The following is probably too simplistic if the + backend counts output relocs unusually. */ + BFD_ASSERT (bed->elf_backend_count_relocs == NULL); + alt_count = NUM_SHDR_ENTRIES (esdi->rel_hdr2); + *rel_count2 += alt_count; + reloc_count -= alt_count; + } + } + *rel_count1 += reloc_count; } if (o->reloc_count > 0) @@ -4987,63 +5115,6 @@ elf_bfd_final_link (abfd, info) if (! _bfd_elf_compute_section_file_positions (abfd, info)) goto error_return; - /* Figure out how many relocations we will have in each section. - Just using RELOC_COUNT isn't good enough since that doesn't - maintain a separate value for REL vs. RELA relocations. */ - if (emit_relocs) - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) - for (o = sub->sections; o != NULL; o = o->next) - { - asection *output_section; - - if (! o->linker_mark) - { - /* This section was omitted from the link. */ - continue; - } - - output_section = o->output_section; - - if (output_section != NULL - && (o->flags & SEC_RELOC) != 0) - { - struct bfd_elf_section_data *esdi - = elf_section_data (o); - struct bfd_elf_section_data *esdo - = elf_section_data (output_section); - unsigned int *rel_count; - unsigned int *rel_count2; - bfd_size_type entsize; - bfd_size_type entsize2; - - /* We must be careful to add the relocations from the - input section to the right output count. */ - entsize = esdi->rel_hdr.sh_entsize; - entsize2 = esdi->rel_hdr2 ? esdi->rel_hdr2->sh_entsize : 0; - BFD_ASSERT ((entsize == sizeof (Elf_External_Rel) - || entsize == sizeof (Elf_External_Rela)) - && entsize2 != entsize - && (entsize2 == 0 - || entsize2 == sizeof (Elf_External_Rel) - || entsize2 == sizeof (Elf_External_Rela))); - if (entsize == esdo->rel_hdr.sh_entsize) - { - rel_count = &esdo->rel_count; - rel_count2 = &esdo->rel_count2; - } - else - { - rel_count = &esdo->rel_count2; - rel_count2 = &esdo->rel_count; - } - - *rel_count += NUM_SHDR_ENTRIES (& esdi->rel_hdr); - if (esdi->rel_hdr2) - *rel_count2 += NUM_SHDR_ENTRIES (esdi->rel_hdr2); - output_section->flags |= SEC_RELOC; - } - } - /* That created the reloc sections. Set their sizes, and assign them file positions, and allocate some buffers. */ for (o = abfd->sections; o != NULL; o = o->next) @@ -6096,8 +6167,7 @@ elf_link_output_extsym (h, data) referenced by regular files, because we will already have issued warnings for them. */ if (! finfo->info->relocateable - && ! finfo->info->allow_shlib_undefined - && ! finfo->info->shared + && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined) && h->root.type == bfd_link_hash_undefined && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 00a0e88..b2d745b 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -275,9 +275,11 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit PC relative reference. */ + /* 16 bit PC relative reference. Note that the ABI document has a typo + and claims R_MIPS_PC16 to be not rightshifted, rendering it useless. + We do the right thing here. */ HOWTO (R_MIPS_PC16, /* type */ - 0, /* rightshift */ + 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ @@ -772,9 +774,11 @@ static reloc_howto_type elf_mips_howto_table_rela[] = 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ - /* 16 bit PC relative reference. */ + /* 16 bit PC relative reference. Note that the ABI document has a typo + and claims R_MIPS_PC16 to be not rightshifted, rendering it useless. + We do the right thing here. */ HOWTO (R_MIPS_PC16, /* type */ - 0, /* rightshift */ + 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ @@ -1837,7 +1841,7 @@ static const struct elf_reloc_map mips_reloc_map[] = /* There is no BFD reloc for R_MIPS_REL32. */ { BFD_RELOC_CTOR, R_MIPS_32 }, { BFD_RELOC_64, R_MIPS_64 }, - { BFD_RELOC_16_PCREL, R_MIPS_PC16 }, + { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 }, { BFD_RELOC_HI16_S, R_MIPS_HI16 }, { BFD_RELOC_LO16, R_MIPS_LO16 }, { BFD_RELOC_GPREL16, R_MIPS_GPREL16 }, diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index df48866..d1a78ab 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -102,6 +102,7 @@ struct elfNN_ia64_dyn_sym_info /* TRUE for the different kinds of linker data we want created. */ unsigned want_got : 1; + unsigned want_gotx : 1; unsigned want_fptr : 1; unsigned want_ltoff_fptr : 1; unsigned want_plt : 1; @@ -154,6 +155,12 @@ struct elfNN_ia64_link_hash_table struct elfNN_ia64_local_hash_table loc_hash_table; }; +struct elfNN_ia64_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; +}; + #define elfNN_ia64_hash_table(p) \ ((struct elfNN_ia64_link_hash_table *) ((p)->hash)) @@ -169,6 +176,8 @@ static void elfNN_ia64_info_to_howto static bfd_boolean elfNN_ia64_relax_section PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, bfd_boolean *again)); +static void elfNN_ia64_relax_ldxmov + PARAMS((bfd *abfd, bfd_byte *contents, bfd_vma off)); static bfd_boolean is_unwind_section_name PARAMS ((bfd *abfd, const char *)); static bfd_boolean elfNN_ia64_section_from_shdr @@ -299,6 +308,8 @@ static bfd_vma elfNN_ia64_dtprel_base PARAMS ((struct bfd_link_info *info)); static int elfNN_ia64_unwind_entry_compare PARAMS ((const PTR, const PTR)); +static bfd_boolean elfNN_ia64_choose_gp + PARAMS ((bfd *abfd, struct bfd_link_info *info)); static bfd_boolean elfNN_ia64_final_link PARAMS ((bfd *abfd, struct bfd_link_info *info)); static bfd_boolean elfNN_ia64_relocate_section @@ -645,37 +656,14 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] = #define DYNAMIC_INTERPRETER(abfd) \ (elfNN_ia64_aix_vec (abfd->xvec) ? AIX_DYNAMIC_INTERPRETER : ELF_DYNAMIC_INTERPRETER) -/* Select out of range branch fixup type. Note that Itanium does - not support brl, and so it gets emulated by the kernel. */ -#undef USE_BRL - -#ifdef USE_BRL static const bfd_byte oor_brl[16] = { 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */ 0x00, 0x00, 0x00, 0xc0 }; -#else -static const bfd_byte oor_ip[48] = -{ - 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */ - 0x01, 0x00, 0x00, 0x60, - 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */ - 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */ - 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */ - 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */ - 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ - 0x60, 0x00, 0x80, 0x00 /* br b6;; */ -}; -#endif -/* These functions do relaxation for IA-64 ELF. - - This is primarily to support branches to targets out of range; - relaxation of R_IA64_LTOFF22X and R_IA64_LDXMOV is handled in - relocate_section directly. */ +/* These functions do relaxation for IA-64 ELF. */ static bfd_boolean elfNN_ia64_relax_section (abfd, sec, link_info, again) @@ -701,6 +689,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) struct one_fixup *fixups = NULL; bfd_boolean changed_contents = FALSE; bfd_boolean changed_relocs = FALSE; + bfd_boolean changed_got = FALSE; + bfd_vma gp = 0; /* Assume we're not going to change any sizes, and we'll only need one pass. */ @@ -728,24 +718,6 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) ia64_info = elfNN_ia64_hash_table (link_info); irelend = internal_relocs + sec->reloc_count; - for (irel = internal_relocs; irel < irelend; irel++) - { - unsigned long r_type = ELFNN_R_TYPE (irel->r_info); - if (r_type == R_IA64_PCREL21B - || r_type == R_IA64_PCREL21BI - || r_type == R_IA64_PCREL21M - || r_type == R_IA64_PCREL21F) - break; - } - - /* No branch-type relocations. */ - if (irel == irelend) - { - if (elf_section_data (sec)->relocs != internal_relocs) - free (internal_relocs); - return TRUE; - } - /* Get the section contents. */ if (elf_section_data (sec)->this_hdr.contents != NULL) contents = elf_section_data (sec)->this_hdr.contents; @@ -760,19 +732,33 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) goto error_return; } - for (; irel < irelend; irel++) + for (irel = internal_relocs; irel < irelend; irel++) { unsigned long r_type = ELFNN_R_TYPE (irel->r_info); bfd_vma symaddr, reladdr, trampoff, toff, roff; asection *tsec; struct one_fixup *f; bfd_size_type amt; + bfd_boolean is_branch; + struct elfNN_ia64_dyn_sym_info *dyn_i; - if (r_type != R_IA64_PCREL21B - && r_type != R_IA64_PCREL21BI - && r_type != R_IA64_PCREL21M - && r_type != R_IA64_PCREL21F) - continue; + switch (r_type) + { + case R_IA64_PCREL21B: + case R_IA64_PCREL21BI: + case R_IA64_PCREL21M: + case R_IA64_PCREL21F: + is_branch = TRUE; + break; + + case R_IA64_LTOFF22X: + case R_IA64_LDXMOV: + is_branch = FALSE; + break; + + default: + continue; + } /* Get the value of the symbol referred to by the reloc. */ if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info) @@ -805,12 +791,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); toff = isym->st_value; + dyn_i = get_dyn_sym_info (ia64_info, NULL, abfd, irel, FALSE); } else { unsigned long indx; struct elf_link_hash_entry *h; - struct elfNN_ia64_dyn_sym_info *dyn_i; indx = ELFNN_R_SYM (irel->r_info) - symtab_hdr->sh_info; h = elf_sym_hashes (abfd)[indx]; @@ -824,7 +810,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) /* For branches to dynamic symbols, we're interested instead in a branch to the PLT entry. */ - if (dyn_i && dyn_i->want_plt2) + if (is_branch && dyn_i && dyn_i->want_plt2) { /* Internal branches shouldn't be sent to the PLT. Leave this for now and we'll give an error later. */ @@ -834,6 +820,11 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) tsec = ia64_info->plt_sec; toff = dyn_i->plt2_offset; } + + /* Can't do anything else with dynamic symbols. */ + else if (elfNN_ia64_dynamic_symbol_p (h, link_info)) + continue; + else { /* We can't do anthing with undefined symbols. */ @@ -852,103 +843,140 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) + irel->r_addend); roff = irel->r_offset; - reladdr = (sec->output_section->vma - + sec->output_offset - + roff) & (bfd_vma) -4; - /* If the branch is in range, no need to do anything. */ - if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 - && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0) - continue; + if (is_branch) + { + reladdr = (sec->output_section->vma + + sec->output_offset + + roff) & (bfd_vma) -4; - /* If the branch and target are in the same section, you've - got one honking big section and we can't help you. You'll - get an error message later. */ - if (tsec == sec) - continue; + /* If the branch is in range, no need to do anything. */ + if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 + && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0) + continue; - /* Look for an existing fixup to this address. */ - for (f = fixups; f ; f = f->next) - if (f->tsec == tsec && f->toff == toff) - break; + /* If the branch and target are in the same section, you've + got one honking big section and we can't help you. You'll + get an error message later. */ + if (tsec == sec) + continue; - if (f == NULL) - { - /* Two alternatives: If it's a branch to a PLT entry, we can - make a copy of the FULL_PLT entry. Otherwise, we'll have - to use a `brl' insn to get where we're going. */ + /* Look for an existing fixup to this address. */ + for (f = fixups; f ; f = f->next) + if (f->tsec == tsec && f->toff == toff) + break; + + if (f == NULL) + { + /* Two alternatives: If it's a branch to a PLT entry, we can + make a copy of the FULL_PLT entry. Otherwise, we'll have + to use a `brl' insn to get where we're going. */ + + size_t size; + + if (tsec == ia64_info->plt_sec) + size = sizeof (plt_full_entry); + else + { + size = sizeof (oor_brl); + } + + /* Resize the current section to make room for the new branch. */ + trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16; + amt = trampoff + size; + contents = (bfd_byte *) bfd_realloc (contents, amt); + if (contents == NULL) + goto error_return; + sec->_cooked_size = amt; - size_t size; + if (tsec == ia64_info->plt_sec) + { + memcpy (contents + trampoff, plt_full_entry, size); + + /* Hijack the old relocation for use as the PLTOFF reloc. */ + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PLTOFF22); + irel->r_offset = trampoff; + } + else + { + memcpy (contents + trampoff, oor_brl, size); + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PCREL60B); + irel->r_offset = trampoff + 2; + } - if (tsec == ia64_info->plt_sec) - size = sizeof (plt_full_entry); + /* Record the fixup so we don't do it again this section. */ + f = (struct one_fixup *) + bfd_malloc ((bfd_size_type) sizeof (*f)); + f->next = fixups; + f->tsec = tsec; + f->toff = toff; + f->trampoff = trampoff; + fixups = f; + } else { -#ifdef USE_BRL - size = sizeof (oor_brl); -#else - size = sizeof (oor_ip); -#endif + /* Nop out the reloc, since we're finalizing things here. */ + irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); } - /* Resize the current section to make room for the new branch. */ - trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16; - amt = trampoff + size; - contents = (bfd_byte *) bfd_realloc (contents, amt); - if (contents == NULL) + /* Fix up the existing branch to hit the trampoline. Hope like + hell this doesn't overflow too. */ + if (elfNN_ia64_install_value (abfd, contents + roff, + f->trampoff - (roff & (bfd_vma) -4), + r_type) != bfd_reloc_ok) goto error_return; - sec->_cooked_size = amt; - if (tsec == ia64_info->plt_sec) + changed_contents = TRUE; + changed_relocs = TRUE; + } + else + { + /* Fetch the gp. */ + if (gp == 0) { - memcpy (contents + trampoff, plt_full_entry, size); + bfd *obfd = sec->output_section->owner; + gp = _bfd_get_gp_value (obfd); + if (gp == 0) + { + if (!elfNN_ia64_choose_gp (obfd, link_info)) + goto error_return; + gp = _bfd_get_gp_value (obfd); + } + } - /* Hijack the old relocation for use as the PLTOFF reloc. */ + /* If the data is out of range, do nothing. */ + if ((bfd_signed_vma) (symaddr - gp) >= 0x200000 + ||(bfd_signed_vma) (symaddr - gp) < -0x200000) + continue; + + if (r_type == R_IA64_LTOFF22X) + { irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), - R_IA64_PLTOFF22); - irel->r_offset = trampoff; + R_IA64_GPREL22); + changed_relocs = TRUE; + if (dyn_i->want_gotx) + { + dyn_i->want_gotx = 0; + changed_got |= !dyn_i->want_got; + } } else { -#ifdef USE_BRL - memcpy (contents + trampoff, oor_brl, size); - irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), - R_IA64_PCREL60B); - irel->r_offset = trampoff + 2; -#else - memcpy (contents + trampoff, oor_ip, size); - irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), - R_IA64_PCREL64I); - irel->r_addend -= 16; - irel->r_offset = trampoff + 2; -#endif + elfNN_ia64_relax_ldxmov (abfd, contents, roff); + irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); + changed_contents = TRUE; + changed_relocs = TRUE; } - - /* Record the fixup so we don't do it again this section. */ - f = (struct one_fixup *) bfd_malloc ((bfd_size_type) sizeof (*f)); - f->next = fixups; - f->tsec = tsec; - f->toff = toff; - f->trampoff = trampoff; - fixups = f; - } - else - { - /* Nop out the reloc, since we're finalizing things here. */ - irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); } - - /* Fix up the existing branch to hit the trampoline. Hope like - hell this doesn't overflow too. */ - if (elfNN_ia64_install_value (abfd, contents + roff, - f->trampoff - (roff & (bfd_vma) -4), - r_type) != bfd_reloc_ok) - goto error_return; - - changed_contents = TRUE; - changed_relocs = TRUE; } + /* ??? If we created fixups, this may push the code segment large + enough that the data segment moves, which will change the GP. + Reset the GP so that we re-calculate next round. We need to + do this at the _beginning_ of the next round; now will not do. */ + /* Clean up and go home. */ while (fixups) { @@ -989,6 +1017,21 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) elf_section_data (sec)->relocs = internal_relocs; } + if (changed_got) + { + struct elfNN_ia64_allocate_data data; + data.info = link_info; + data.ofs = 0; + + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data); + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data); + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data); + ia64_info->got_sec->_raw_size = data.ofs; + ia64_info->got_sec->_cooked_size = data.ofs; + + /* ??? Resize .rela.got too. */ + } + *again = changed_contents || changed_relocs; return TRUE; @@ -1003,6 +1046,39 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) free (internal_relocs); return FALSE; } + +static void +elfNN_ia64_relax_ldxmov (abfd, contents, off) + bfd *abfd; + bfd_byte *contents; + bfd_vma off; +{ + int shift, r1, r3; + bfd_vma dword, insn; + + switch ((int)off & 0x3) + { + case 0: shift = 5; break; + case 1: shift = 14; off += 3; break; + case 2: shift = 23; off += 6; break; + case 3: + abort (); + } + + dword = bfd_get_64 (abfd, contents + off); + insn = (dword >> shift) & 0x1ffffffffffLL; + + r1 = (insn >> 6) & 127; + r3 = (insn >> 20) & 127; + if (r1 == r3) + insn = 0x8000000; /* nop */ + else + insn = (insn & 0x7f01fff) | 0x10800000000LL; /* (qp) mov r1 = r3 */ + + dword &= ~(0x1ffffffffffLL << shift); + dword |= (insn << shift); + bfd_put_64 (abfd, dword, contents + off); +} /* Return TRUE if NAME is an unwind table section name. */ @@ -2125,15 +2201,16 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) { enum { NEED_GOT = 1, - NEED_FPTR = 2, - NEED_PLTOFF = 4, - NEED_MIN_PLT = 8, - NEED_FULL_PLT = 16, - NEED_DYNREL = 32, - NEED_LTOFF_FPTR = 64, - NEED_TPREL = 128, - NEED_DTPMOD = 256, - NEED_DTPREL = 512 + NEED_GOTX = 2, + NEED_FPTR = 4, + NEED_PLTOFF = 8, + NEED_MIN_PLT = 16, + NEED_FULL_PLT = 32, + NEED_DYNREL = 64, + NEED_LTOFF_FPTR = 128, + NEED_TPREL = 256, + NEED_DTPMOD = 512, + NEED_DTPREL = 1024 }; struct elf_link_hash_entry *h = NULL; @@ -2230,11 +2307,14 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) break; case R_IA64_LTOFF22: - case R_IA64_LTOFF22X: case R_IA64_LTOFF64I: need_entry = NEED_GOT; break; + case R_IA64_LTOFF22X: + need_entry = NEED_GOTX; + break; + case R_IA64_PLTOFF22: case R_IA64_PLTOFF64I: case R_IA64_PLTOFF64MSB: @@ -2316,7 +2396,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) dyn_i->h = h; /* Create what's needed. */ - if (need_entry & (NEED_GOT | NEED_TPREL | NEED_DTPMOD | NEED_DTPREL)) + if (need_entry & (NEED_GOT | NEED_GOTX | NEED_TPREL + | NEED_DTPMOD | NEED_DTPREL)) { if (!got) { @@ -2326,6 +2407,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) } if (need_entry & NEED_GOT) dyn_i->want_got = 1; + if (need_entry & NEED_GOTX) + dyn_i->want_gotx = 1; if (need_entry & NEED_TPREL) dyn_i->want_tprel = 1; if (need_entry & NEED_DTPMOD) @@ -2385,12 +2468,6 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) return TRUE; } -struct elfNN_ia64_allocate_data -{ - struct bfd_link_info *info; - bfd_size_type ofs; -}; - /* For cleanliness, and potentially faster dynamic loading, allocate external GOT entries first. */ @@ -2401,7 +2478,7 @@ allocate_global_data_got (dyn_i, data) { struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; - if (dyn_i->want_got + if ((dyn_i->want_got || dyn_i->want_gotx) && ! dyn_i->want_fptr && (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) || (elfNN_ia64_aix_vec (x->info->hash->creator) @@ -2473,7 +2550,7 @@ allocate_local_got (dyn_i, data) { struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; - if (dyn_i->want_got + if ((dyn_i->want_got || dyn_i->want_gotx) && ! (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) || elfNN_ia64_aix_vec (x->info->hash->creator))) { @@ -2699,7 +2776,7 @@ allocate_dynrel_entries (dyn_i, data) /* Take care of the GOT and PLT relocations. */ - if (((dynamic_symbol || shared) && dyn_i->want_got) + if (((dynamic_symbol || shared) && (dyn_i->want_got || dyn_i->want_gotx)) || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1)) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); if ((dynamic_symbol || shared) && dyn_i->want_tprel) @@ -3516,125 +3593,148 @@ elfNN_ia64_unwind_entry_compare (a, b) return (av < bv ? -1 : av > bv ? 1 : 0); } +/* Make sure we've got ourselves a nice fat __gp value. */ static bfd_boolean -elfNN_ia64_final_link (abfd, info) +elfNN_ia64_choose_gp (abfd, info) bfd *abfd; struct bfd_link_info *info; { + bfd_vma min_vma = (bfd_vma) -1, max_vma = 0; + bfd_vma min_short_vma = min_vma, max_short_vma = 0; + struct elf_link_hash_entry *gp; + bfd_vma gp_val; + asection *os; struct elfNN_ia64_link_hash_table *ia64_info; - asection *unwind_output_sec; ia64_info = elfNN_ia64_hash_table (info); - /* Make sure we've got ourselves a nice fat __gp value. */ - if (!info->relocateable) + /* Find the min and max vma of all sections marked short. Also collect + min and max vma of any type, for use in selecting a nice gp. */ + for (os = abfd->sections; os ; os = os->next) { - bfd_vma min_vma = (bfd_vma) -1, max_vma = 0; - bfd_vma min_short_vma = min_vma, max_short_vma = 0; - struct elf_link_hash_entry *gp; - bfd_vma gp_val; - asection *os; + bfd_vma lo, hi; + + if ((os->flags & SEC_ALLOC) == 0) + continue; - /* Find the min and max vma of all sections marked short. Also - collect min and max vma of any type, for use in selecting a - nice gp. */ - for (os = abfd->sections; os ; os = os->next) + lo = os->vma; + hi = os->vma + os->_raw_size; + if (hi < lo) + hi = (bfd_vma) -1; + + if (min_vma > lo) + min_vma = lo; + if (max_vma < hi) + max_vma = hi; + if (os->flags & SEC_SMALL_DATA) { - bfd_vma lo, hi; + if (min_short_vma > lo) + min_short_vma = lo; + if (max_short_vma < hi) + max_short_vma = hi; + } + } - if ((os->flags & SEC_ALLOC) == 0) - continue; + /* See if the user wants to force a value. */ + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE, + FALSE, FALSE); + + if (gp + && (gp->root.type == bfd_link_hash_defined + || gp->root.type == bfd_link_hash_defweak)) + { + asection *gp_sec = gp->root.u.def.section; + gp_val = (gp->root.u.def.value + + gp_sec->output_section->vma + + gp_sec->output_offset); + } + else + { + /* Pick a sensible value. */ - lo = os->vma; - hi = os->vma + os->_raw_size; - if (hi < lo) - hi = (bfd_vma) -1; + asection *got_sec = ia64_info->got_sec; - if (min_vma > lo) - min_vma = lo; - if (max_vma < hi) - max_vma = hi; - if (os->flags & SEC_SMALL_DATA) - { - if (min_short_vma > lo) - min_short_vma = lo; - if (max_short_vma < hi) - max_short_vma = hi; - } + /* Start with just the address of the .got. */ + if (got_sec) + gp_val = got_sec->output_section->vma; + else if (max_short_vma != 0) + gp_val = min_short_vma; + else + gp_val = min_vma; + + /* If it is possible to address the entire image, but we + don't with the choice above, adjust. */ + if (max_vma - min_vma < 0x400000 + && max_vma - gp_val <= 0x200000 + && gp_val - min_vma > 0x200000) + gp_val = min_vma + 0x200000; + else if (max_short_vma != 0) + { + /* If we don't cover all the short data, adjust. */ + if (max_short_vma - gp_val >= 0x200000) + gp_val = min_short_vma + 0x200000; + + /* If we're addressing stuff past the end, adjust back. */ + if (gp_val > max_vma) + gp_val = max_vma - 0x200000 + 8; } + } - /* See if the user wants to force a value. */ - gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE, - FALSE, FALSE); + /* Validate whether all SHF_IA_64_SHORT sections are within + range of the chosen GP. */ - if (gp - && (gp->root.type == bfd_link_hash_defined - || gp->root.type == bfd_link_hash_defweak)) + if (max_short_vma != 0) + { + if (max_short_vma - min_short_vma >= 0x400000) { - asection *gp_sec = gp->root.u.def.section; - gp_val = (gp->root.u.def.value - + gp_sec->output_section->vma - + gp_sec->output_offset); + (*_bfd_error_handler) + (_("%s: short data segment overflowed (0x%lx >= 0x400000)"), + bfd_get_filename (abfd), + (unsigned long) (max_short_vma - min_short_vma)); + return FALSE; } - else + else if ((gp_val > min_short_vma + && gp_val - min_short_vma > 0x200000) + || (gp_val < max_short_vma + && max_short_vma - gp_val >= 0x200000)) { - /* Pick a sensible value. */ + (*_bfd_error_handler) + (_("%s: __gp does not cover short data segment"), + bfd_get_filename (abfd)); + return FALSE; + } + } - asection *got_sec = ia64_info->got_sec; + _bfd_set_gp_value (abfd, gp_val); - /* Start with just the address of the .got. */ - if (got_sec) - gp_val = got_sec->output_section->vma; - else if (max_short_vma != 0) - gp_val = min_short_vma; - else - gp_val = min_vma; - - /* If it is possible to address the entire image, but we - don't with the choice above, adjust. */ - if (max_vma - min_vma < 0x400000 - && max_vma - gp_val <= 0x200000 - && gp_val - min_vma > 0x200000) - gp_val = min_vma + 0x200000; - else if (max_short_vma != 0) - { - /* If we don't cover all the short data, adjust. */ - if (max_short_vma - gp_val >= 0x200000) - gp_val = min_short_vma + 0x200000; + return TRUE; +} - /* If we're addressing stuff past the end, adjust back. */ - if (gp_val > max_vma) - gp_val = max_vma - 0x200000 + 8; - } - } +static bfd_boolean +elfNN_ia64_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *unwind_output_sec; + + ia64_info = elfNN_ia64_hash_table (info); - /* Validate whether all SHF_IA_64_SHORT sections are within - range of the chosen GP. */ + /* Make sure we've got ourselves a nice fat __gp value. */ + if (!info->relocateable) + { + bfd_vma gp_val = _bfd_get_gp_value (abfd); + struct elf_link_hash_entry *gp; - if (max_short_vma != 0) + if (gp_val == 0) { - if (max_short_vma - min_short_vma >= 0x400000) - { - (*_bfd_error_handler) - (_("%s: short data segment overflowed (0x%lx >= 0x400000)"), - bfd_get_filename (abfd), - (unsigned long) (max_short_vma - min_short_vma)); - return FALSE; - } - else if ((gp_val > min_short_vma - && gp_val - min_short_vma > 0x200000) - || (gp_val < max_short_vma - && max_short_vma - gp_val >= 0x200000)) - { - (*_bfd_error_handler) - (_("%s: __gp does not cover short data segment"), - bfd_get_filename (abfd)); - return FALSE; - } + if (! elfNN_ia64_choose_gp (abfd, info)) + return FALSE; + gp_val = _bfd_get_gp_value (abfd); } - _bfd_set_gp_value (abfd, gp_val); - + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE, + FALSE, FALSE); if (gp) { gp->root.type = bfd_link_hash_defined; @@ -3828,7 +3928,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, else if (h->root.type == bfd_link_hash_undefweak) undef_weak_ref = TRUE; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) ; @@ -3926,7 +4025,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, srel, rel->r_offset, dyn_r_type, dynindx, addend); } - /* FALLTHRU */ + /* Fall through. */ case R_IA64_LTV32MSB: case R_IA64_LTV32LSB: @@ -4536,7 +4635,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info) bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon); } - /* Initialize the PLT0 entry */ + /* Initialize the PLT0 entry. */ if (ia64_info->plt_sec) { bfd_byte *loc = ia64_info->plt_sec->contents; @@ -4555,7 +4654,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info) return TRUE; } -/* ELF file flag handling: */ +/* ELF file flag handling: */ /* Function to keep IA-64 specific file flags. */ static bfd_boolean diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 1410519..6ca4f06 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -9,21 +9,21 @@ Traditional MIPS targets support added by Koundinya.K, Dansk Data Elektronik & Operations Research Group. <kk@ddeorg.soft.net> -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This file handles functionality common to the different MIPS ABI's. */ @@ -359,17 +359,17 @@ typedef struct loader for use by the static exception system. */ typedef struct runtime_pdr { - bfd_vma adr; /* memory address of start of procedure */ - long regmask; /* save register mask */ - long regoffset; /* save register offset */ - long fregmask; /* save floating point register mask */ - long fregoffset; /* save floating point register offset */ - long frameoffset; /* frame size */ - short framereg; /* frame pointer register */ - short pcreg; /* offset or reg of return pc */ - long irpss; /* index into the runtime string table */ + bfd_vma adr; /* Memory address of start of procedure. */ + long regmask; /* Save register mask. */ + long regoffset; /* Save register offset. */ + long fregmask; /* Save floating point register mask. */ + long fregoffset; /* Save floating point register offset. */ + long frameoffset; /* Frame size. */ + short framereg; /* Frame pointer register. */ + short pcreg; /* Offset or reg of return pc. */ + long irpss; /* Index into the runtime string table. */ long reserved; - struct exception_info *exception_info;/* pointer to exception array */ + struct exception_info *exception_info;/* Pointer to exception array. */ } RPDR, *pRPDR; #define cbRPDR sizeof (RPDR) #define rpdNil ((pRPDR) 0) @@ -496,7 +496,6 @@ static struct mips_got_info *mips_elf_got_for_ibfd static bfd *reldyn_sorting_bfd; /* Nonzero if ABFD is using the N32 ABI. */ - #define ABI_N32_P(abfd) \ ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0) @@ -2130,7 +2129,7 @@ mips_elf_bfd2got_entry_eq (entry1, entry2) return e1->bfd == e2->bfd; } -/* In a multi-got link, determine the GOT to be used for IBDF. G must +/* In a multi-got link, determine the GOT to be used for IBFD. G must be the master GOT data. */ static struct mips_got_info * @@ -3095,7 +3094,6 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, addresses. */ symbol = 0; else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) symbol = 0; @@ -3317,12 +3315,6 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, value &= howto->dst_mask; break; - case R_MIPS_GNU_REL16_S2: - value = symbol + mips_elf_sign_extend (addend << 2, 18) - p; - overflowed_p = mips_elf_overflow_p (value, 18); - value = (value >> 2) & howto->dst_mask; - break; - case R_MIPS_GNU_REL_HI16: /* Instead of subtracting 'p' here, we should be subtracting the equivalent value for the LO part of the reloc, since the value @@ -3451,8 +3443,10 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, break; case R_MIPS_PC16: - value = mips_elf_sign_extend (addend, 16) + symbol - p; - overflowed_p = mips_elf_overflow_p (value, 16); + case R_MIPS_GNU_REL16_S2: + value = mips_elf_sign_extend (addend << 2, 18) + symbol - p; + overflowed_p = mips_elf_overflow_p (value, 18); + value = (value >> 2) & howto->dst_mask; break; case R_MIPS_GOT_HI16: diff --git a/bfd/format.c b/bfd/format.c index 8cc7b7a..9af6efc 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -1,23 +1,23 @@ /* Generic BFD support for file formats. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION @@ -52,7 +52,7 @@ FUNCTION bfd_check_format SYNOPSIS - bfd_boolean bfd_check_format(bfd *abfd, bfd_format format); + bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); DESCRIPTION Verify if the file attached to the BFD @var{abfd} is compatible @@ -98,7 +98,8 @@ FUNCTION bfd_check_format_matches SYNOPSIS - bfd_boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching); + bfd_boolean bfd_check_format_matches (bfd *abfd, bfd_format format, + char ***matching); DESCRIPTION Like <<bfd_check_format>>, except when it returns FALSE with @@ -210,7 +211,7 @@ bfd_check_format_matches (abfd, format, matching) if (*target == &binary_vec) continue; - abfd->xvec = *target; /* Change BFD's target temporarily */ + abfd->xvec = *target; /* Change BFD's target temporarily. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return FALSE; @@ -224,7 +225,8 @@ bfd_check_format_matches (abfd, format, matching) temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); if (temp) - { /* This format checks out as ok! */ + { + /* This format checks out as ok! */ right_targ = temp; /* If this is the default target, accept it, even if other @@ -279,6 +281,7 @@ bfd_check_format_matches (abfd, format, matching) { /* Try partial matches. */ right_targ = ar_right_targ; + if (right_targ == bfd_default_vector[0]) { match_count = 1; @@ -286,12 +289,11 @@ bfd_check_format_matches (abfd, format, matching) else { match_count = ar_match_index - _bfd_target_vector_entries; + if (matching && match_count > 1) - { - memcpy (matching_vector, - matching_vector + _bfd_target_vector_entries, - sizeof (*matching_vector) * match_count); - } + memcpy (matching_vector, + matching_vector + _bfd_target_vector_entries, + sizeof (*matching_vector) * match_count); } } @@ -361,7 +363,7 @@ FUNCTION bfd_set_format SYNOPSIS - bfd_boolean bfd_set_format(bfd *abfd, bfd_format format); + bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); DESCRIPTION This function sets the file format of the BFD @var{abfd} to the @@ -402,7 +404,7 @@ FUNCTION bfd_format_string SYNOPSIS - const char *bfd_format_string(bfd_format format); + const char *bfd_format_string (bfd_format format); DESCRIPTION Return a pointer to a const string diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 222b23d..14978ba 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -850,6 +850,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_LO16", "BFD_RELOC_PCREL_HI16_S", "BFD_RELOC_PCREL_LO16", + "BFD_RELOC_MIPSEMB_16_PCREL_S2", "BFD_RELOC_MIPS_LITERAL", "BFD_RELOC_MIPS_GOT16", "BFD_RELOC_MIPS_CALL16", diff --git a/bfd/libcoff.h b/bfd/libcoff.h index c0279e5..1beec22 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -866,7 +866,8 @@ typedef struct #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)) + ((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)\ @@ -891,7 +892,8 @@ typedef struct ((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)\ +#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)) @@ -919,7 +921,8 @@ typedef struct #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)\ +#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)) diff --git a/bfd/po/da.po b/bfd/po/da.po index 89ed7d0..cf0121a 100644 --- a/bfd/po/da.po +++ b/bfd/po/da.po @@ -1,12 +1,12 @@ # Danish messages for bfd. # Copyright (C) 2001, 2002 Free Software Foundation, Inc. -# Keld Simonsen <keld@dkuug.dk>, 2002 +# Keld Simonsen <keld@dkuug.dk>, 2002-2003 # msgid "" msgstr "" "Project-Id-Version: bfd 2.12.91\n" "POT-Creation-Date: 2002-07-23 15:55-0400\n" -"PO-Revision-Date: 2002-11-09 23:25+0100\n" +"PO-Revision-Date: 2003-03-01 23:25+0100\n" "Last-Translator: Keld Simonsen <keld@dkuug.dk>\n" "Language-Team: Danish <dansk@klid.dk>\n" "MIME-Version: 1.0\n" @@ -1179,14 +1179,14 @@ msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" msgstr "%s: fejl: ujusteret relokeringstype %d på %08x relokering %08x\n" #: elf32-sh64.c:677 -#, fuzzy, c-format +#, c-format msgid "%s: could not write out added .cranges entries" -msgstr "%s: kunne ikke udskrive tilføjede .crangives-poster" +msgstr "%s: kunne ikke udskrive tilføjede .cranges-poster" #: elf32-sh64.c:739 -#, fuzzy, c-format +#, c-format msgid "%s: could not write out sorted .cranges entries" -msgstr "%s: kunne ikke udskrive sorterede crangives-poster" +msgstr "%s: kunne ikke udskrive sorterede cranges-poster" #: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format @@ -1204,22 +1204,22 @@ msgid "%s: linking little endian files with big endian files" msgstr "%s: lænker little endian-filer med big endian-filer" #: elf32-v850.c:682 -#, fuzzy, c-format +#, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "Variabel \"%s\" kan ikke befinde sig i flere små dataområder" #: elf32-v850.c:685 -#, fuzzy, c-format +#, c-format msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions" -msgstr "Variabel \"%s\" kan kun være i et af de små, tomme og bittesmå dataområder" +msgstr "Variabel \"%s\" kan kun være i ét af de små, tomme og bittesmå dataområder" #: elf32-v850.c:688 -#, fuzzy, c-format +#, c-format msgid "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "Variabel \"%s\" kan ikke være i både små og tomme dataområder samtidigt" #: elf32-v850.c:691 -#, fuzzy, c-format +#, c-format msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "Variabel \"%s\" kan ikke være i både små og bittesmå dataområder samtidigt" diff --git a/bfd/reloc.c b/bfd/reloc.c index 9f8a952..45660c8 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2080,7 +2080,10 @@ ENUM BFD_RELOC_PCREL_LO16 ENUMDOC Like BFD_RELOC_LO16, but PC relative. - +ENUM + BFD_RELOC_MIPSEMB_16_PCREL_S2 +ENUMDOC + Like BFD_RELOC_16_PCREL_S2, but for MIPS Embedded PIC. ENUM BFD_RELOC_MIPS_LITERAL ENUMDOC @@ -2150,7 +2153,6 @@ ENUMX ENUMDOC Fujitsu Frv Relocations. COMMENT -COMMENT ENUMDOC MIPS ELF relocations. @@ -1,24 +1,24 @@ /* Generic symbol-table support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION @@ -74,9 +74,9 @@ SUBSECTION | if (storage_needed < 0) | FAIL | -| if (storage_needed == 0) { -| return ; -| } +| if (storage_needed == 0) +| return; +| | symbol_table = (asymbol **) xmalloc (storage_needed); | ... | number_of_symbols = @@ -85,9 +85,8 @@ SUBSECTION | if (number_of_symbols < 0) | FAIL | -| for (i = 0; i < number_of_symbols; i++) { -| process_symbol (symbol_table[i]); -| } +| for (i = 0; i < number_of_symbols; i++) +| process_symbol (symbol_table[i]); All storage for the symbols themselves is in an objalloc connected to the BFD; it is freed when the BFD is closed. @@ -108,25 +107,26 @@ SUBSECTION example showing the creation of a symbol table with only one element: | #include "bfd.h" -| main() +| 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); +| 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->section = bfd_make_section_old_way (abfd, ".text"); | new->flags = BSF_GLOBAL; | new->value = 0x12345; | | ptrs[0] = new; | ptrs[1] = (asymbol *)0; | -| bfd_set_symtab(abfd, ptrs, 1); -| bfd_close(abfd); +| bfd_set_symtab (abfd, ptrs, 1); +| bfd_close (abfd); +| return 0; | } | | ./makesym @@ -192,7 +192,7 @@ CODE_FRAGMENT . 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. *} +. 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. *} @@ -346,7 +346,7 @@ FUNCTION bfd_is_local_label SYNOPSIS - bfd_boolean bfd_is_local_label(bfd *abfd, asymbol *sym); + bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); DESCRIPTION Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is @@ -438,7 +438,7 @@ FUNCTION bfd_print_symbol_vandf SYNOPSIS - void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol); + void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol); DESCRIPTION Print the value and flags of the @var{symbol} supplied to the @@ -451,16 +451,14 @@ bfd_print_symbol_vandf (abfd, arg, symbol) asymbol *symbol; { FILE *file = (FILE *) arg; + flagword type = symbol->flags; + if (symbol->section != (asection *) NULL) - { - bfd_fprintf_vma (abfd, file, - symbol->value + symbol->section->vma); - } + bfd_fprintf_vma (abfd, file, + symbol->value + symbol->section->vma); else - { - bfd_fprintf_vma (abfd, file, symbol->value); - } + bfd_fprintf_vma (abfd, file, symbol->value); /* This presumes that a symbol can not be both BSF_DEBUGGING and BSF_DYNAMIC, nor more than one of BSF_FUNCTION, BSF_FILE, and @@ -504,7 +502,7 @@ FUNCTION _bfd_generic_make_empty_symbol SYNOPSIS - asymbol *_bfd_generic_make_empty_symbol (bfd *); + asymbol * _bfd_generic_make_empty_symbol (bfd *); DESCRIPTION Create a new <<asymbol>> structure for the BFD @var{abfd} @@ -634,7 +632,7 @@ DESCRIPTION class of @var{symbol}, or '?' for an unknown class. SYNOPSIS - int bfd_decode_symclass(asymbol *symbol); + int bfd_decode_symclass (asymbol *symbol); */ int bfd_decode_symclass (symbol) @@ -726,7 +724,7 @@ DESCRIPTION calling this function. SYNOPSIS - void bfd_symbol_info(asymbol *symbol, symbol_info *ret); + void bfd_symbol_info (asymbol *symbol, symbol_info *ret); */ void @@ -749,7 +747,7 @@ FUNCTION bfd_copy_private_symbol_data SYNOPSIS - bfd_boolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); + bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); DESCRIPTION Copy private symbol information from @var{isym} in the BFD @@ -816,7 +814,6 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) an asymbol. We don't worry about the sym argument we are passed; we just return the asymbol the minisymbol points to. */ -/*ARGSUSED*/ asymbol * _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym) bfd *abfd ATTRIBUTE_UNUSED; @@ -1245,12 +1242,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, else #endif { - /* Cache non-existant or invalid. Do binary search on - indextable. */ - long low, high; long mid = -1; + /* Cache non-existant or invalid. Do binary search on + indextable. */ indexentry = NULL; low = 0; @@ -1305,9 +1301,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, case N_SLINE: case N_DSLINE: case N_BSLINE: - /* A line number. The value is relative to the start of the - current function. */ - val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF); + /* A line number. If the function was specified, then the value + is relative to the start of the function. Otherwise, the + value is an absolute address. */ + val = ((indexentry->function_name ? indexentry->val : 0) + + bfd_get_32 (abfd, stab + VALOFF)); /* If this line starts before our desired offset, or if it's the first line we've been able to find, use it. The !saw_line check works around a bug in GCC 2.95.3, which emits @@ -1376,7 +1374,6 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, /* This will typically be something like main:F(0,1), so we want to clobber the colon. It's OK to change the name, since the string is in our own local storage anyhow. */ - s = strchr (indexentry->function_name, ':'); if (s != NULL) *s = '\0'; diff --git a/bfd/targets.c b/bfd/targets.c index c541c11..2211e12 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -763,7 +763,7 @@ static const bfd_target * const _bfd_target_vector[] = { #endif &aout0_big_vec, #if 0 - /* We have no way of distinguishing these from other a.out variants */ + /* We have no way of distinguishing these from other a.out variants. */ &aout_arm_big_vec, &aout_arm_little_vec, /* No one seems to use this. */ @@ -909,7 +909,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_powerpcle_pei_vec, &cris_aout_vec, #ifdef BFD64 - &demo_64_vec, /* Only compiled if host has long-long support */ + &demo_64_vec, /* Only compiled if host has long-long support. */ #endif &ecoff_big_vec, &ecoff_biglittle_vec, @@ -1011,7 +1011,7 @@ static const bfd_target * const _bfd_target_vector[] = { #endif &ppcboot_vec, #if 0 - /* We have no way of distinguishing these from other a.out variants */ + /* We have no way of distinguishing these from other a.out variants. */ &riscix_vec, #endif #ifdef BFD64 @@ -1221,7 +1221,7 @@ FUNCTION bfd_find_target SYNOPSIS - const bfd_target *bfd_find_target(const char *target_name, bfd *abfd); + const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); DESCRIPTION Return a pointer to the transfer vector for the object target @@ -1274,7 +1274,7 @@ FUNCTION bfd_target_list SYNOPSIS - const char **bfd_target_list(void); + const char ** bfd_target_list (void); DESCRIPTION Return a freshly malloced NULL-terminated @@ -1319,7 +1319,9 @@ FUNCTION bfd_seach_for_target SYNOPSIS - const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); + const bfd_target * bfd_search_for_target (int (* search_func) + (const bfd_target *, void *), + void *); DESCRIPTION Return a pointer to the first transfer vector in the list of diff --git a/bfd/version.h b/bfd/version.h index 32e8805..d251770 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20030207 +#define BFD_VERSION_DATE 20030305 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff --git a/config.guess b/config.guess index ca12b79..4fc21ec 100755 --- a/config.guess +++ b/config.guess @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-01-03' +timestamp='2003-01-30' # 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 @@ -242,65 +242,47 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - eval $set_cc_for_build - cat <<EOF >$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null - if test "$?" = 0 ; then - case `$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - 3-1307) - UNAME_MACHINE="alphaev7" - ;; - esac - fi echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) @@ -1152,7 +1134,11 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2003-01-03' +timestamp='2003-02-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -257,7 +257,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ @@ -296,7 +296,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -329,11 +329,13 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -925,6 +927,14 @@ case $basic_machine in basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -1027,7 +1037,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) @@ -1227,6 +1237,12 @@ case $os in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; -none) ;; *) diff --git a/config/ChangeLog b/config/ChangeLog index 15c7c3e..091f6fd 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org> + + * mh-dgux: Delete. + 2002-12-28 Alexandre Oliva <aoliva@redhat.com> * acx.m4: Name cache variables properly. diff --git a/config/mh-dgux b/config/mh-dgux deleted file mode 100644 index b55fb2f..0000000 --- a/config/mh-dgux +++ /dev/null @@ -1,2 +0,0 @@ -RANLIB=true - @@ -16,6 +16,9 @@ ac_help="$ac_help Don't force sequential configuration of sub-packages for the host, target or build machine, or of any sub-packages at all" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -33,7 +36,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -148,7 +150,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -319,11 +320,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -489,16 +485,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -585,7 +577,7 @@ 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:589: checking host system type" >&5 +echo "configure:581: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -606,7 +598,7 @@ 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:610: checking target system type" >&5 +echo "configure:602: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -624,7 +616,7 @@ 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:628: checking build system type" >&5 +echo "configure:620: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -693,15 +685,6 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," -# clear some things potentially inherited from environment. - -enable_threads=no -enable_shared=no -enable_libstdcxx_v3=yes -floating_point=default -gas=default -x11=default - ### we might need to use some other shell than /bin/sh for running subshells ### If we are on Windows, search for the shell. This will permit people ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure @@ -736,15 +719,6 @@ esac config_shell=${CONFIG_SHELL-/bin/sh} -## this is a little touchy and won't always work, but... -## -## if the argv[[0]] starts with a slash then it is an absolute name that can (and -## must) be used as is. -## -## otherwise, if argv[[0]] has no slash in it, we can assume that it is on the -## path. Since PATH might include "." we also add `pwd` to the end of PATH. -## - progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi @@ -805,8 +779,6 @@ fi # host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib" -libstdcxx_version="target-libstdc++-v3" - # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to # know that we are building the simulator. @@ -827,7 +799,7 @@ libgcj="target-libffi \ target_libs="target-libiberty \ target-libgloss \ target-newlib \ - ${libstdcxx_version} \ + target-libstdc++-v3 \ target-libf2c \ ${libgcj} \ target-libobjc" @@ -971,22 +943,22 @@ case "${host}" in ;; i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*) noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi" - ;; + ;; i[3456]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv" - noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" - ;; + noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + ;; i[3456]86-*-beos*) - noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" - ;; + noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" + ;; *-*-cygwin*) - noconfigdirs="autoconf automake send-pr rcs guile perl" + noconfigdirs="autoconf automake send-pr rcs guile perl" ;; *-*-netbsd*) noconfigdirs="rcs" ;; ppc*-*-pe) - noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv" + noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv" ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline" @@ -1016,9 +988,20 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + *-*-darwin*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" + noconfigdirs="$noconfigdirs target-libobjc ${libgcj}" + ;; *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + *-*-kaos*) + # Remove unsupported stuff on all kaOS configurations. + skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx" + skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf" + skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib" + noconfigdirs="$noconfigdirs target-libgloss" + ;; *-*-netbsd*) # Skip some stuff on all NetBSD configurations. noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss" @@ -1032,7 +1015,7 @@ case "${target}" in esac ;; *-*-netware) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}" ;; *-*-rtems*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -1076,11 +1059,11 @@ case "${target}" in noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim" noconfigdirs="$noconfigdirs expect dejagnu" # the C++ libraries don't build on top of CE's C libraries - noconfigdirs="$noconfigdirs ${libstdcxx_version}" + noconfigdirs="$noconfigdirs target-libstdc++-v3" noconfigdirs="$noconfigdirs target-newlib" case "${host}" in *-*-cygwin*) ;; # keep gdb and readline - *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}" + *) noconfigdirs="$noconfigdirs gdb readline" ;; esac ;; @@ -1115,19 +1098,19 @@ case "${target}" in noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; avr-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; c4x-*-* | tic4x-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; c54x*-*-* | tic54x-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; d10v-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; d30v-*-*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -1142,7 +1125,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libgloss" ;; h8500-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c" ;; hppa*64*-*-linux* | parisc*64*-*-linux*) # In this case, it's because the hppa64-linux target is for @@ -1188,7 +1171,7 @@ case "${target}" in # This section makes it possible to build newlib natively on linux. # If we are using a cross compiler then don't configure newlib. if test x${is_cross_compiler} != xno ; then - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib" fi noconfigdirs="$noconfigdirs target-libgloss" # If we are not using a cross compiler, do configure newlib. @@ -1221,7 +1204,7 @@ case "${target}" in esac ;; i[3456]86-*-pe) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; i[3456]86-*-sco3.2v5*) # The linker does not yet know about weak symbols in COFF, @@ -1238,10 +1221,10 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; i[3456]86-*-beos*) - noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" - ;; + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; m68k-*-elf*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -1280,9 +1263,6 @@ case "${target}" in powerpc-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}" - ;; powerpc-*-eabi) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -1322,7 +1302,7 @@ case "${target}" in ;; mipstx39-*-*) noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; + ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; @@ -1364,7 +1344,7 @@ case "${target}" in sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; v810-*-*) - noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; v850-*-*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -1382,7 +1362,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; ip2k-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; *-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" @@ -1408,19 +1388,19 @@ esac # go away some day. # NB: embedded tabs in this IF block -- do not untabify if test x"${enable_languages+set}" != xset; then - if test x"${LANGUAGES+set}" = xset; then - enable_languages="${LANGUAGES}" - echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 - else - enable_languages=all - fi + if test x"${LANGUAGES+set}" = xset; then + enable_languages="${LANGUAGES}" + echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 + else + enable_languages=all + fi else - if test x"${enable_languages}" = x || - test x"${enable_languages}" = xyes; - then - echo configure.in: --enable-languages needs at least one language argument 1>&2 - exit 1 - fi + if test x"${enable_languages}" = x || + test x"${enable_languages}" = xyes; + then + echo configure.in: --enable-languages needs at least one language argument 1>&2 + exit 1 + fi fi enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'` @@ -1429,64 +1409,60 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/ # front ends it requires, even if some are required indirectly. for lang in ${srcdir}/gcc/*/config-lang.in .. do - case $lang in - ..) - ;; + case $lang in + ..) ;; # The odd quoting in the next line works around # an apparent bug in bash 1.12 on linux. - ${srcdir}/gcc/[*]/config-lang.in) - ;; + ${srcdir}/gcc/[*]/config-lang.in) ;; *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang` - for other in $this_lang_requires - do - case ,${enable_languages}, in - *,$other,*) - ;; - *,all,*) - ;; - *,$lang_alias,*) - echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2 - enable_languages="$enable_languages,$other" - ;; - esac - done - ;; - esac + lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` + this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang` + for other in $this_lang_requires + do + case ,${enable_languages}, in + *,$other,*) ;; + *,all,*) ;; + *,$lang_alias,*) + echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2 + enable_languages="$enable_languages,$other" + ;; + esac + done + ;; + esac done subdirs= for lang in ${srcdir}/gcc/*/config-lang.in .. do - case $lang in - ..) ;; - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. - ${srcdir}/gcc/[*]/config-lang.in) ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang` - this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang` - build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang` - if test "x$lang_alias" = x - then - echo "$lang doesn't set \$language." 1>&2 - exit 1 - fi - case ${build_by_default},${enable_languages}, in - *,$lang_alias,*) add_this_lang=yes ;; - no,*) add_this_lang=no ;; - *,all,*) add_this_lang=yes ;; - *) add_this_lang=no ;; - esac - if test x"${add_this_lang}" = xyes; then - eval target_libs='"$target_libs "'\"$this_lang_libs\" - else - eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\" - fi - ;; - esac + case $lang in + ..) ;; + # The odd quoting in the next line works around + # an apparent bug in bash 1.12 on linux. + ${srcdir}/gcc/[*]/config-lang.in) ;; + *) + lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` + this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang` + this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang` + build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang` + if test "x$lang_alias" = x + then + echo "$lang doesn't set \$language." 1>&2 + exit 1 + fi + case ${build_by_default},${enable_languages}, in + *,$lang_alias,*) add_this_lang=yes ;; + no,*) add_this_lang=no ;; + *,all,*) add_this_lang=yes ;; + *) add_this_lang=no ;; + esac + if test x"${add_this_lang}" = xyes; then + eval target_libs='"$target_libs "'\"$this_lang_libs\" + else + eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\" + fi + ;; + esac done # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and @@ -1691,7 +1667,6 @@ case "${host}" in ;; m88k-dg-dgux*) tentative_cc="gcc -Wall -ansi -D__using_DGUX" - host_makefile_frag="config/mh-dgux" ;; m88k-harris-cxux*) # Under CX/UX, we want to tell the compiler to use ANSI mode. @@ -1909,24 +1884,6 @@ if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target- extra_host_args="$extra_host_args --with-newlib" fi -# We default to --with-shared on platforms where -fpic is meaningless. -# Well, we don't yet, but we will. -if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then - case "${target}" in - alpha*-dec-osf*) enable_shared=yes ;; - alpha*-*-linux*) enable_shared=yes ;; - mips-sgi-irix5*) enable_shared=yes ;; - *) enable_shared=no ;; - esac -fi - -case "${enable_shared}" in - yes) shared=yes ;; - no) shared=no ;; - "") shared=no ;; - *) shared=yes ;; -esac - # Default to using --with-stabs for certain targets. if test x${with_stabs} = x ; then @@ -2302,12 +2259,10 @@ esac # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the # binutils tools will find libbfd.so. -if test "${shared}" = "yes" ; then - SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" -else - SET_LIB_PATH= -fi - +case "${enable_shared}" in + no | "") SET_LIB_PATH= ;; + *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;; +esac case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; @@ -2604,7 +2559,7 @@ esac # being built; programs in there won't even run. if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then # Search for pre-installed headers if nothing else fits. - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include' + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include' fi if test "x${use_gnu_ld}" = x && @@ -2704,8 +2659,6 @@ ospace_frag=${srcdir}/${ospace_frag} - - # Build module lists & subconfigure args. @@ -2748,7 +2701,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2752: checking for $ac_word" >&5 +echo "configure:2705: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2781,7 +2734,7 @@ if test -z "$ac_cv_prog_AR" ; 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:2785: checking for $ac_word" >&5 +echo "configure:2738: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2820,7 +2773,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2824: checking for $ac_word" >&5 +echo "configure:2777: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2853,7 +2806,7 @@ if test -z "$ac_cv_prog_AS" ; 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:2857: checking for $ac_word" >&5 +echo "configure:2810: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2892,7 +2845,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2896: checking for $ac_word" >&5 +echo "configure:2849: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2925,7 +2878,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; 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:2929: checking for $ac_word" >&5 +echo "configure:2882: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2964,7 +2917,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2968: checking for $ac_word" >&5 +echo "configure:2921: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2997,7 +2950,7 @@ if test -z "$ac_cv_prog_LD" ; 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:3001: checking for $ac_word" >&5 +echo "configure:2954: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3036,7 +2989,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3040: checking for $ac_word" >&5 +echo "configure:2993: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3069,7 +3022,7 @@ if test -z "$ac_cv_prog_NM" ; 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:3073: checking for $ac_word" >&5 +echo "configure:3026: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3108,7 +3061,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3112: checking for $ac_word" >&5 +echo "configure:3065: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3141,7 +3094,7 @@ if test -z "$ac_cv_prog_RANLIB" ; 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:3145: checking for $ac_word" >&5 +echo "configure:3098: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3180,7 +3133,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3184: checking for $ac_word" >&5 +echo "configure:3137: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3213,7 +3166,7 @@ if test -z "$ac_cv_prog_WINDRES" ; 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:3217: checking for $ac_word" >&5 +echo "configure:3170: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3252,7 +3205,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3256: checking for $ac_word" >&5 +echo "configure:3209: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3285,7 +3238,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3289: checking for $ac_word" >&5 +echo "configure:3242: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3324,7 +3277,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3328: checking for $ac_word" >&5 +echo "configure:3281: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3357,7 +3310,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; 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:3361: checking for $ac_word" >&5 +echo "configure:3314: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3405,7 +3358,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3409: checking for $ac_word" >&5 +echo "configure:3362: 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 else @@ -3438,7 +3391,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; 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:3442: checking for $ac_word" >&5 +echo "configure:3395: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3477,7 +3430,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3481: checking for $ac_word" >&5 +echo "configure:3434: 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 else @@ -3510,7 +3463,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; 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:3514: checking for $ac_word" >&5 +echo "configure:3467: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3549,7 +3502,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3553: checking for $ac_word" >&5 +echo "configure:3506: 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 else @@ -3582,7 +3535,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; 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:3586: checking for $ac_word" >&5 +echo "configure:3539: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3621,7 +3574,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3625: checking for $ac_word" >&5 +echo "configure:3578: 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 else @@ -3654,7 +3607,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; 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:3658: checking for $ac_word" >&5 +echo "configure:3611: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3693,7 +3646,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3697: checking for $ac_word" >&5 +echo "configure:3650: 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 else @@ -3726,7 +3679,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; 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:3730: checking for $ac_word" >&5 +echo "configure:3683: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3765,7 +3718,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3769: checking for $ac_word" >&5 +echo "configure:3722: 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 else @@ -3798,7 +3751,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; 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:3802: checking for $ac_word" >&5 +echo "configure:3755: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3837,7 +3790,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3841: checking for $ac_word" >&5 +echo "configure:3794: 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 else @@ -3870,7 +3823,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; 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:3874: checking for $ac_word" >&5 +echo "configure:3827: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3936,6 +3889,28 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:3894: checking whether to enable maintainer-specific portions of Makefiles" >&5 +# 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 + + +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 + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -4113,8 +4088,6 @@ s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g s%@BUILD_PREFIX@%$BUILD_PREFIX%g s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g s%@configlinks@%$configlinks%g -s%@enable_shared@%$enable_shared%g -s%@enable_threads@%$enable_threads%g s%@enable_version_specific_runtime_libs@%$enable_version_specific_runtime_libs%g s%@gcc_version_trigger@%$gcc_version_trigger%g s%@gcc_version@%$gcc_version%g @@ -4192,6 +4165,9 @@ s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g s%@RAW_CXX_FOR_TARGET@%$RAW_CXX_FOR_TARGET%g s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g CEOF EOF diff --git a/configure.in b/configure.in index 19c1357..eb473b8 100644 --- a/configure.in +++ b/configure.in @@ -25,15 +25,6 @@ AC_ARG_PROGRAM sinclude(config/acx.m4) -# clear some things potentially inherited from environment. - -enable_threads=no -enable_shared=no -enable_libstdcxx_v3=yes -floating_point=default -gas=default -x11=default - ### we might need to use some other shell than /bin/sh for running subshells ### If we are on Windows, search for the shell. This will permit people ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure @@ -68,15 +59,6 @@ esac config_shell=${CONFIG_SHELL-/bin/sh} -## this is a little touchy and won't always work, but... -## -## if the argv[[0]] starts with a slash then it is an absolute name that can (and -## must) be used as is. -## -## otherwise, if argv[[0]] has no slash in it, we can assume that it is on the -## path. Since PATH might include "." we also add `pwd` to the end of PATH. -## - progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi @@ -137,8 +119,6 @@ fi # host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib" -libstdcxx_version="target-libstdc++-v3" - # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to # know that we are building the simulator. @@ -159,7 +139,7 @@ libgcj="target-libffi \ target_libs="target-libiberty \ target-libgloss \ target-newlib \ - ${libstdcxx_version} \ + target-libstdc++-v3 \ target-libf2c \ ${libgcj} \ target-libobjc" @@ -303,22 +283,22 @@ case "${host}" in ;; i[[3456]]86-*-go32* | i[[3456]]86-*-msdosdjgpp*) noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi" - ;; + ;; i[[3456]]86-*-mingw32*) # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv" - noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" - ;; + noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + ;; i[[3456]]86-*-beos*) - noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" - ;; + noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" + ;; *-*-cygwin*) - noconfigdirs="autoconf automake send-pr rcs guile perl" + noconfigdirs="autoconf automake send-pr rcs guile perl" ;; *-*-netbsd*) noconfigdirs="rcs" ;; ppc*-*-pe) - noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv" + noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv" ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline" @@ -348,9 +328,20 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + *-*-darwin*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" + noconfigdirs="$noconfigdirs target-libobjc ${libgcj}" + ;; *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + *-*-kaos*) + # Remove unsupported stuff on all kaOS configurations. + skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx" + skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf" + skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib" + noconfigdirs="$noconfigdirs target-libgloss" + ;; *-*-netbsd*) # Skip some stuff on all NetBSD configurations. noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss" @@ -364,7 +355,7 @@ case "${target}" in esac ;; *-*-netware) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}" ;; *-*-rtems*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -408,11 +399,11 @@ case "${target}" in noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim" noconfigdirs="$noconfigdirs expect dejagnu" # the C++ libraries don't build on top of CE's C libraries - noconfigdirs="$noconfigdirs ${libstdcxx_version}" + noconfigdirs="$noconfigdirs target-libstdc++-v3" noconfigdirs="$noconfigdirs target-newlib" case "${host}" in *-*-cygwin*) ;; # keep gdb and readline - *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}" + *) noconfigdirs="$noconfigdirs gdb readline" ;; esac ;; @@ -447,19 +438,19 @@ case "${target}" in noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; avr-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; c4x-*-* | tic4x-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; c54x*-*-* | tic54x-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; d10v-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; d30v-*-*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -474,7 +465,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libgloss" ;; h8500-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c" ;; hppa*64*-*-linux* | parisc*64*-*-linux*) # In this case, it's because the hppa64-linux target is for @@ -520,7 +511,7 @@ case "${target}" in # This section makes it possible to build newlib natively on linux. # If we are using a cross compiler then don't configure newlib. if test x${is_cross_compiler} != xno ; then - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib" fi noconfigdirs="$noconfigdirs target-libgloss" # If we are not using a cross compiler, do configure newlib. @@ -553,7 +544,7 @@ case "${target}" in esac ;; i[[3456]]86-*-pe) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; i[[3456]]86-*-sco3.2v5*) # The linker does not yet know about weak symbols in COFF, @@ -570,10 +561,10 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; i[[3456]]86-*-beos*) - noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" - ;; + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; m68k-*-elf*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -612,9 +603,6 @@ case "${target}" in powerpc-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}" - ;; powerpc-*-eabi) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -654,7 +642,7 @@ case "${target}" in ;; mipstx39-*-*) noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; + ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; @@ -696,7 +684,7 @@ case "${target}" in sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; v810-*-*) - noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; v850-*-*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -714,7 +702,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; ip2k-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; *-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" @@ -740,19 +728,19 @@ esac # go away some day. # NB: embedded tabs in this IF block -- do not untabify if test x"${enable_languages+set}" != xset; then - if test x"${LANGUAGES+set}" = xset; then - enable_languages="${LANGUAGES}" - echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 - else - enable_languages=all - fi + if test x"${LANGUAGES+set}" = xset; then + enable_languages="${LANGUAGES}" + echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 + else + enable_languages=all + fi else - if test x"${enable_languages}" = x || - test x"${enable_languages}" = xyes; - then - echo configure.in: --enable-languages needs at least one language argument 1>&2 - exit 1 - fi + if test x"${enable_languages}" = x || + test x"${enable_languages}" = xyes; + then + echo configure.in: --enable-languages needs at least one language argument 1>&2 + exit 1 + fi fi enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'` @@ -761,64 +749,60 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e # front ends it requires, even if some are required indirectly. for lang in ${srcdir}/gcc/*/config-lang.in .. do - case $lang in - ..) - ;; + case $lang in + ..) ;; # The odd quoting in the next line works around # an apparent bug in bash 1.12 on linux. - ${srcdir}/gcc/[[*]]/config-lang.in) - ;; + ${srcdir}/gcc/[[*]]/config-lang.in) ;; *) - lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang` - this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^ ]]*\).*$,\1,p' $lang` - for other in $this_lang_requires - do - case ,${enable_languages}, in - *,$other,*) - ;; - *,all,*) - ;; - *,$lang_alias,*) - echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2 - enable_languages="$enable_languages,$other" - ;; - esac - done - ;; - esac + lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang` + this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^ ]]*\).*$,\1,p' $lang` + for other in $this_lang_requires + do + case ,${enable_languages}, in + *,$other,*) ;; + *,all,*) ;; + *,$lang_alias,*) + echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2 + enable_languages="$enable_languages,$other" + ;; + esac + done + ;; + esac done subdirs= for lang in ${srcdir}/gcc/*/config-lang.in .. do - case $lang in - ..) ;; - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. - ${srcdir}/gcc/[[*]]/config-lang.in) ;; - *) - lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang` - this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^ ]]*\).*$,\1,p' $lang` - this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^ ]]*\).*$,\1,p' $lang` - build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^ ]]*\).*$,\1,p' $lang` - if test "x$lang_alias" = x - then - echo "$lang doesn't set \$language." 1>&2 - exit 1 - fi - case ${build_by_default},${enable_languages}, in - *,$lang_alias,*) add_this_lang=yes ;; - no,*) add_this_lang=no ;; - *,all,*) add_this_lang=yes ;; - *) add_this_lang=no ;; - esac - if test x"${add_this_lang}" = xyes; then - eval target_libs='"$target_libs "'\"$this_lang_libs\" - else - eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\" - fi - ;; - esac + case $lang in + ..) ;; + # The odd quoting in the next line works around + # an apparent bug in bash 1.12 on linux. + ${srcdir}/gcc/[[*]]/config-lang.in) ;; + *) + lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang` + this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^ ]]*\).*$,\1,p' $lang` + this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^ ]]*\).*$,\1,p' $lang` + build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^ ]]*\).*$,\1,p' $lang` + if test "x$lang_alias" = x + then + echo "$lang doesn't set \$language." 1>&2 + exit 1 + fi + case ${build_by_default},${enable_languages}, in + *,$lang_alias,*) add_this_lang=yes ;; + no,*) add_this_lang=no ;; + *,all,*) add_this_lang=yes ;; + *) add_this_lang=no ;; + esac + if test x"${add_this_lang}" = xyes; then + eval target_libs='"$target_libs "'\"$this_lang_libs\" + else + eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\" + fi + ;; + esac done # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and @@ -1023,7 +1007,6 @@ case "${host}" in ;; m88k-dg-dgux*) tentative_cc="gcc -Wall -ansi -D__using_DGUX" - host_makefile_frag="config/mh-dgux" ;; m88k-harris-cxux*) # Under CX/UX, we want to tell the compiler to use ANSI mode. @@ -1241,24 +1224,6 @@ if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target- extra_host_args="$extra_host_args --with-newlib" fi -# We default to --with-shared on platforms where -fpic is meaningless. -# Well, we don't yet, but we will. -if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then - case "${target}" in - alpha*-dec-osf*) enable_shared=yes ;; - alpha*-*-linux*) enable_shared=yes ;; - mips-sgi-irix5*) enable_shared=yes ;; - *) enable_shared=no ;; - esac -fi - -case "${enable_shared}" in - yes) shared=yes ;; - no) shared=no ;; - "") shared=no ;; - *) shared=yes ;; -esac - # Default to using --with-stabs for certain targets. if test x${with_stabs} = x ; then @@ -1634,12 +1599,10 @@ esac # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the # binutils tools will find libbfd.so. -if test "${shared}" = "yes" ; then - SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" -else - SET_LIB_PATH= -fi - +case "${enable_shared}" in + no | "") SET_LIB_PATH= ;; + *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;; +esac case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; @@ -1935,7 +1898,7 @@ esac # being built; programs in there won't even run. if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then # Search for pre-installed headers if nothing else fits. - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include' + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include' fi if test "x${use_gnu_ld}" = x && @@ -2026,8 +1989,6 @@ AC_SUBST(RPATH_ENVVAR) AC_SUBST(BUILD_PREFIX) AC_SUBST(BUILD_PREFIX_1) AC_SUBST(configlinks) -AC_SUBST(enable_shared) -AC_SUBST(enable_threads) AC_SUBST(enable_version_specific_runtime_libs) AC_SUBST(gcc_version_trigger) AC_SUBST(gcc_version) @@ -2126,4 +2087,23 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) +AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) +AC_MSG_RESULT($USE_MAINTAINER_MODE) +AC_SUBST(MAINTAINER_MODE_TRUE) +AC_SUBST(MAINTAINER_MODE_FALSE) +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 +AC_SUBST(MAINT)dnl + AC_OUTPUT(Makefile) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 97c1e50..5528bbd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,916 @@ +2003-03-05 Andrew Cagney <cagney@redhat.com> + + * d10v-tdep.c (struct frame_extra_info): Delete unused structure. + (struct d10v_unwind_cache): Delete field "frameless". Replace + "next_addr" with "sp_offset". Add "r11_offset". + (d10v_frame_unwind_cache): Update. + (prologue_find_regs): Update. When "mv r11, sp", save the + "sp_offset" in "r11_offset". Recognize "st rn, @r11", note that + RN was saved in r11_offset. + +2003-03-05 Andrew Cagney <cagney@redhat.com> + + * frame.c (deprecated_update_frame_pc_hack): Also update the the + cached PC value in the next frame. + +2003-03-05 Andrew Cagney <cagney@redhat.com> + + * frame.h (struct frame_info): Replace "id_unwind_cache_p" and + "id_unwind_cache" with "id". + (frame_id_unwind): Delete declaration. + * frame.c (frame_id_unwind): Delete function. + (get_prev_frame): Call the frame id unwind method directly. Store + the returned next frame's ID value in NEXT_FRAME. Note that there + is a problem with the wrong unwind ID being called with the wrong + unwind cache. + +2003-03-05 Daniel Jacobowitz <drow@mvista.com> + + * Makefile.in (FLAGS_TO_PASS): Add LDFLAGS. + +2003-03-05 James Ingham <jingham@apple.com> + Daniel Jacobowitz <drow@mvista.com> + + * cp-abi.c: Include "command.h", "gdbcmd.h", and "ui-out.h". + (auto_cp_abi): New variable. + (current_cp_abi, num_cp_abis): Make static. + (CP_ABI_MAX): Define. + (cp_abis): Turn into an array. + (value_virtual_fn_field): Fix formatting. + (switch_to_cp_abi, register_cp_abi): Update. register_cp_abi now + takes a pointer. + (set_cp_abi_as_auto_default, set_cp_abi_cmd, show_cp_abi_cmd) + (list_cp_abis, _initialize_cp_abi): New functions. + * cp-abi.h: Add prototype for set_cp_abi_as_auto_default. Remove + declarations for cp_abis, num_cp_abis, current_cp_abi, and + switch_to_cp_abi. Update prototype for register_cp_abi. + * Makefile.in (cp-abi.o): Update dependencies. + * minsyms.c (install_minimal_symbols): Call set_cp_abi_as_auto_default + instead of switch_to_cp_abi. + * gnu-v2-abi.c (_initialize_gnu_v2_abi): Likewise. Update call to + register_cp_abi. + * gnu-v3-abi.c (_initialize_gnu_v3_abi): Update call to + register_cp_abi. + * hpacc-abi.c (_initialize_hpacc_abi): Likewise. + +2003-03-05 Daniel Jacobowitz <drow@mvista.com> + + * dwarf2expr.c (new_dwarf_expr_context): Add (void) to definition. + * dwarf2loc.c: Include "regcache.h". + (dwarf_expr_read_reg): Rename regnum argument to dwarf_regnum. Use + register_size. + * Makefile.in (dwarf2loc.o): Update dependencies. + +2003-03-04 Theodore A. Roth <troth@openavr.org> + + * avr-tdep.c (avr_io_reg_read_command): Fix to handle case when the + number of io registers reported by remote target is not a multiple of + step. + +2003-03-04 David Carlton <carlton@math.stanford.edu> + + * symtab.c (lookup_partial_symbol): Add linkage_name argument. + (lookup_symbol_aux_psymtabs): Update call to + lookup_partial_symbol. + (lookup_transparent_type, find_main_psymtab) + (make_symbol_overload_list): Ditto. + +2003-03-04 Kazu Hirata <kazu@cs.umass.edu> + + * MAINTAINERS (Write after approval): Update my email address. + +2003-03-03 Andrew Cagney <cagney@redhat.com> + + Make MAX_REGISTER_RAW_SIZE and MAX_REGISTER_VIRTUAL_SIZE optional. + * gdbarch.sh (DEPRECATED_MAX_REGISTER_RAW_SIZE): Variable with + predicate. Replace MAX_REGISTER_RAW_SIZE. + (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto for + MAX_REGISTER_VIRTUAL_SIZE. + * regcache.c (legacy_max_register_raw_size): New function. + (legacy_max_register_virtual_size): New function. + * defs.h (MAX_REGISTER_VIRTUAL_SIZE): Define. + (MAX_REGISTER_RAW_SIZE): Define. + (legacy_max_register_raw_size): Declare. + (legacy_max_register_virtual_size): Declare. + * config/sparc/tm-sparc.h (DEPRECATED_MAX_REGISTER_RAW_SIZE) + (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Update. + * config/sparc/tm-sp64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE) + (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto. + * config/pa/tm-hppa.h (DEPRECATED_MAX_REGISTER_RAW_SIZE) + (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto. + * config/pa/tm-hppa64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto. + * config/ia64/tm-ia64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto. + * config/i386/tm-ptx.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * hppa-tdep.c (hppa_gdbarch_init): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Do not set + max_register_raw_size or max_register_virtual_size. + +2003-03-03 David Carlton <carlton@math.stanford.edu> + + * symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Rename from + SYMBOL_MATCHES_NAME, add comment. + (SYMBOL_MATCHES_NATURAL_NAME): New. + * minsyms.c (lookup_minimal_symbol_solib_trampoline): Replace + SYMBOL_MATCHES_NAME with DEPRECATED_SYMBOL_MATCHES_NAME. + (lookup_minimal_symbol, lookup_minimal_symbol_text): Ditto. + * symtab.c (lookup_partial_symbol): Use + SYMBOL_MATCHES_NATURAL_NAME, not SYMBOL_MATCHES_NAME. Delete + unhelpful comment. + (lookup_block_symbol): Use SYMBOL_MATCHES_NATURAL_NAME, not + SYMBOL_MATCHES_NAME. + Fix for PR c++/33. + +2003-03-03 David Carlton <carlton@math.stanford.edu> + + * symtab.h (SYMBOL_MATCHES_REGEXP): Delete. + * symtab.c (search_symbols): Replace uses of SYMBOL_MATCHES_REGEXP + by regexp matching against SYMBOL_NATURAL_NAME. + +2003-03-03 David Carlton <carlton@math.stanford.edu> + + * linespec.c (find_method): Extract code into collect_methods. + (collect_methods): New. + +2003-03-02 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-tdep.c (i386bsd_sigcontext_addr): Use get_next_frame and + get_frame_base. + + * i386-tdep.c (i386_pe_skip_trampoline_code): Replace usage of + DEPRECATED_SYMBOL_NAME with SYMBOL_LINKAGE_NAME. + +2003-03-02 Stephane Carrez <stcarrez@nerim.fr> + + * arch-utils.c (generic_register_byte): Fix to use the loop index + and not regnum when summing the size of all registers up to regnum. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_FRAME_INIT_SAVED_REGS): Rename + FRAME_INIT_SAVED_REGS. + * gdbarch.h, gdbarch.c: Regenerate. + * stack.c (frame_info): Update. + * sh-tdep.c (sh_find_callers_reg, sh64_get_saved_pr): Update. + (sh_init_extra_frame_info, sh64_init_extra_frame_info): Update. + (sh64_get_saved_register, sh_pop_frame, sh64_pop_frame): Update. + * ns32k-tdep.c (ns32k_pop_frame): Update. + * mips-tdep.c (mips_pop_frame): Update. + * m68hc11-tdep.c (m68hc11_pop_frame): Update. + * ia64-tdep.c (ia64_frame_chain): Update. + (ia64_frame_saved_pc, ia64_get_saved_register): Update. + (ia64_frameless_function_invocation): Update. + (ia64_init_extra_frame_info): Update. + (ia64_pop_frame_regular): Update. + * frame.h (struct frame_info): Update comment. + (DEPRECATED_FRAME_INIT_SAVED_REGS): Rename macro. + * frame.c (frame_saved_regs_register_unwind): Update. + (frame_saved_regs_register_unwind): Update. + (deprecated_generic_get_saved_register): Update. + * cris-tdep.c: Update comment. + * config/sparc/tm-sparc.h (DEPRECATED_FRAME_INIT_SAVED_REGS): + Rename macro. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_init_abi): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * ppc-linux-tdep.c (ppc_linux_init_abi): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * main.c (captured_main): Add OPT_WINDOWS and OPT_NOWINDOWS to + option enum and switch. When no windows, set the interpreter to + INTERP_CONSOLE. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * main.c (captured_main): Replace magic option characters with an + enum. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_INIT_EXTRA_FRAME_INFO): Rename + INIT_EXTRA_FRAME_INFO. + * gdbarch.h, gdbarch.c: Regenerate. + * arm-tdep.c: Update comments. + * sh-tdep.c, mcore-tdep.c, m68hc11-tdep.c: Ditto. + * i386-interix-tdep.c, hppa-tdep.c, h8300-tdep.c: Ditto. + * frame.h, avr-tdep.c: Ditto. + * frame.c (get_prev_frame): DEPRECATED_INIT_EXTRA_FRAME_INFO. + (create_new_frame, legacy_get_prev_frame): Ditto. + * config/sparc/tm-sparc.h (DEPRECATED_INIT_EXTRA_FRAME_INFO): Rename. + * config/pa/tm-hppa.h (DEPRECATED_INIT_EXTRA_FRAME_INFO): Rename. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Initialize + deprecated_init_extra_frame_info instead of init_extra_frame_info. + * x86-64-tdep.c (x86_64_init_abi): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * ppc-linux-tdep.c (ppc_linux_init_abi): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-interix-tdep.c (i386_interix_init_abi): Ditto. + * hppa-tdep.c (hppa_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (register_type): New function with predicate. + (REGISTER_VIRTUAL_TYPE): Change to function with predicate. + * gdbarch.h, gdbarch.c: Re-generate. + * arch-utils.c (generic_register_byte): Use generic_register_size. + (generic_register_size): When available, use + gdbarch_register_type. + * regcache.c (init_regcache_descr): When available, initialize the + register type array using gdbarch_register_type. If the + architecture supplies gdbarch_register_type, do not use the legacy + regcache layout. + * d10v-tdep.c (d10v_register_type): Replace + d10v_register_virtual_type. + (d10v_gdbarch_init): Set register_type instead of + register_virtual_type. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * Makefile.in (ax-gdb.o): Update dependencies. + * ax-gdb.c: Include "regcache.h". + (gen_expr): Use register_type instead of REGISTER_VIRTUAL_TYPE. + * findvar.c (value_of_register): Ditto. + * infcmd.c (default_print_registers_info): Ditto. + +2003-03-01 Mark Kettenis <kettenis@gnu.org> + + * i386-linux-tdep.c (find_minsym_and_objfile): Replace usage of + DEPRECATED_SYMBOL_NAME with SYMBOL_LINKAGE_NAME. + +2003-03-01 Mark Kettenis <kettenis@gnu.org> + + * i386-linux-tdep.c (find_minsym_and_objfile): Use strcmp instead + of STREQ. + +2003-02-28 Daniel Jacobowitz <drow@mvista.com> + + * Makefile.in (dwarf2loc.o): Update dependencies. + * ax-gdb.c (gen_var_ref): Handle LOC_COMPUTED and LOC_COMPUTED_ARG. + * dwarf2expr.c (read_uleb128, read_sleb128): Make non-static. + * dwarf2expr.h (read_uleb128, read_sleb128): Add prototypes. + * dwarf2loc.c: Include "ax.h" and "ax-gdb.h". + (locexpr_tracepoint_var_ref): New function. + (dwarf2_locexpr_funcs): Add locexpr_tracepoint_var_ref. + +2003-02-28 Andrew Cagney <cagney@redhat.com> + + * regcache.c (register_size): New function. + * regcache.h (register_size): Declare + * d10v-tdep.c: Use register_size instead of REGISTER_RAW_SIZE, use + max_register_size instead of MAX_REGISTER_RAW_SIZE. + +2003-02-28 David Carlton <carlton@math.stanford.edu> + + * linespec.c (decode_compound): Extract code into find_method. + (find_method): New. + +2003-02-28 J. Brobecker <brobecker@gnat.com> + + * Makefile.in: Add rules to build and link in observer.o. + +2003-02-27 J. Brobecker <brobecker@gnat.com> + + * observer.c: Minor comments edits. + +2003-02-27 J. Brobecker <brobecker@gnat.com> + + * observer.h, observer.c: New file. + +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * arm-tdep.c (gdb_print_insn_arm): Rename _bfd to just bfd. + +2003-02-27 Stephane Carrez <stcarrez@nerim.fr> + + * m68hc11-tdep.c (M6811_OP_LDX_EXT, M6811_OP_STS_EXT): New defines. + (M6812_OP_STS_EXT): Likewise. + (m6811_prologue): Use the above to recognize prologue. + (m6812_prologue): Likewise. + +2003-02-27 David Carlton <carlton@math.stanford.edu> + + * symfile.c (compare_symbols): Use SYMBOL_NATURAL_NAME, not + SYMBOL_PRINT_NAME. + (compare_psymbols): Ditto. + * symtab.c (lookup_partial_symbol, lookup_block_symbol): Ditto. + +2003-02-27 Michael Snyder <msnyder@redhat.com> + + * f-lang.c (build_fortran_types): New function. + (_initialize_f_language): Gdbarch-register built-in fortran types. + + * doublest.c (extract_floating): Fix warning text. + +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_PUSH_DUMMY_FRAME): Procedure with + predicate. Replaces PUSH_DUMMY_FRAME. + * gdbarch.h, gdbarch.c: Regnerate. + * valops.c (hand_function_call): Update. Call + generic_push_dummy_frame directly. + * vax-tdep.c (vax_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * hppa-tdep.c (hppa_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * config/sparc/tm-sparc.h (DEPRECATED_PUSH_DUMMY_FRAME): Update. + * config/pa/tm-hppa.h (DEPRECATED_PUSH_DUMMY_FRAME): Update. + * inferior.h (PUSH_DUMMY_FRAME): Delete definition. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Don't set + push_dummy_frame to generic_push_dummy_frame. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + +2003-02-26 Kevin Buettner <kevinb@redhat.com> + + * mips-tdep.c (show_mips_abi): New function. + (_initialize_mips_tdep): Use show_mips_abi() to implement the + command ``show mips abi''. + +2003-02-26 Jeff Johnston <jjohnstn@redhat.com> + + From Elena Zannoni <ezannoni@redhat.com> + * dbxread.c (process_one_symbol): Only record line 0 if one or + more sline entries have been seen for the function. + +2003-02-26 Michael Chastain <mec@shout.net> + + * configure: Regenerate with autoconf 000227. + +2003-02-26 Michael Chastain <mec@shout.net> + + Close PR build/660. + * PROBLEMS (i[3456]86-*-linux*): Note explicit error message + for old libc5/glibc. + * gdb_thread_db.h: Die if not HAVE_UINTPTR_T. + +2003-02-26 Kris Warkentin <kewarken@qnx.com> + + * defs.h (gdb_osabi): Add GDB_OSABI_QNXNTO. + * osabi.c (gdb_osabi_names): Add "QNX Neutrino". + +2003-02-26 Michael Chastain <mec@shout.net> + + * configure.in: New variable HAVE_UINTPTR_T. + * configure, config.in: Regenerated. + +2003-02-26 Daniel Jacobowitz <drow@mvista.com> + + Fix PR build/1097. + * utils.c (gdb_realpath): Move closing brace outwards one #endif. + +2003-02-25 Andrew Cagney <cagney@redhat.com> + + * frame.c (get_prev_frame): Add comment on check for + inside_entry_func. Only check for inside_entry_file when not a + dummy and not a sentinel. Check that the new frame is not inner + to the old frame. + +2003-02-25 Andrew Cagney <cagney@redhat.com> + + * frame.c (frame_debug): New variable. + (_initialize_frame): Add "set/show debug frame" command. + (get_prev_frame): When frame_debug, print reason why unwind + failed. + +2003-02-25 Michael Chastain <mec@shout.net> + + * PROBLEMS (i[3456]86-*-linux*): Require glibc 2.1.3 or later + to avoid uintptr_t definition problems. + +2003-02-25 David Carlton <carlton@math.stanford.edu> + + * symtab.h (SYMBOL_NATURAL_NAME): New macro. + (SYMBOL_LINKAGE_NAME): Ditto. + (SYMBOL_PRINT_NAME): Use SYMBOL_NATURAL_NAME and + SYMBOL_LINKAGE_NAME. + (struct general_symbol_info): Expand comment. + (DEPRECATED_SYMBOL_NAME): Rename from SYMBOL_NAME. + (SYMBOL_MATCHES_NAME): Use DEPRECATED_SYMBOL_NAME. + (SYMBOL_MATCHES_REGEXP): Ditto. + * symtab.c (symbol_natural_name): New function. + * objfiles.h: Replace all uses of SYMBOL_NAME by + DEPRECATED_SYMBOL_NAME. + * xcoffread.c, valops.c, typeprint.c, tracepoint.c: Ditto. + * symtab.c, symmisc.c, symfile.c, stack.c, stabsread.c: Ditto. + * somsolib.c, sol-thread.c, rs6000-tdep.c, p-valprint.c: Ditto. + * printcmd.c, objfiles.c, objc-lang.c, mipsread.c: Ditto. + * minsyms.c, mdebugread.c, linespec.c, jv-lang.c: Ditto. + * i386-tdep.c, i386-linux-tdep.c, hpread.c, hppa-tdep.c: Ditto. + * gnu-v2-abi.c, f-valprint.c, findvar.c, expprint.c: Ditto. + * dwarfread.c, dwarf2read.c, dbxread.c, c-valprint.c: Ditto. + * cp-valprint.c, coffread.c, buildsym.c, breakpoint.c: Ditto. + * blockframe.c, ax-gdb.c, arm-linux-tdep.c, ada-lang.c: Ditto. + * ada-exp.y: Ditto. + * ada-exp.y: Update copyright. + * sol-thread.c, mipsread.c, jv-lang.c, f-valprint.c: Ditto. + * cp-valprint.c: Ditto. + +2003-02-25 Jeff Johnston <jjohnstn@redhat.com> + + * infptrace.c (detach): Do not flag error if ptrace detach fails + and errno is set to ESRCH. + +2003-02-24 Andrew Cagney <cagney@redhat.com> + + * infptrace.c (udot_info): Change type of udot_off to long. Use + paddr when printing udot_off's value. + +2003-02-24 David Carlton <carlton@math.stanford.edu> + + * symtab.c (make_symbol_overload_list): Only read in partial + symtabs containing a matching partial symbol. + +2003-02-24 David Carlton <carlton@math.stanford.edu> + + * symtab.c (lookup_partial_symbol): Use strcmp_iw_ordered to + do the comparison, not strcmp. + * symfile.c (compare_psymbols): Ditto. + * defs.h: Declare strcmp_iw_ordered. + * utils.c (strcmp_iw_ordered): New function. + +2003-02-24 Jim Blandy <jimb@redhat.com> + + * MAINTAINERS (GNU/Linux/x86, linespec, breakpoints, Scheme + support, shared libs): Remove my name from here, to better reflect + reality. + +2003-02-24 Kris Warkentin <kewarken@qnx.com> + + * target.h: (HAVE_CONTINUABLE_WATCHPOINT): Define. + (target_ops): Add to_have_continuable_watchpoint. + * target.c (update_current_target): Add INHERIT line for + to_have_continuable_watchpoint. + * infrun.c: Remove HAVE_CONTINUABLE_WATCHPOINT defines. + * config/i386/nm-i386.h, config/i386/nm-i386sco5.h, + config/i386/nm-i386sol2.h, config/s390/nm-linux.h, + config/sparc/nm-sun4sol2.h: HAVE_CONTINUABLE_WATCHPOINT defined as 1. + +2003-02-24 Elena Zannoni <ezannoni@redhat.com> + + * MAINTAINERS (Core): Drop main.c and top.c. Clarify event loop + maintainership. + +2003-02-24 Kris Warkentin <kewarken@qnx.com> + + * solib.c (solib_open): Call target defined search function after + failing with solib-search-path. + * solist.h (target_so_ops): Add find_and_open_solib function hook and + create define TARGET_SO_FIND_AND_OPEN_SOLIB. + +2003-02-24 Kris Warkentin <kewarken@qnx.com> + + * MAINTAINERS: Add myself to Write After section. + +2003-02-23 Stephane Carrez <stcarrez@nerim.fr> + + * m68hc11-tdep.c (m68hc11_gdbarch_init): long double is 64-bit wide. + +2003-02-22 Stephane Carrez <stcarrez@nerim.fr> + + * m68hc11-tdep.c (m68hc11_init_reggroups): New function. + (m68hc11_add_reggroups): New function. + (m68hc11_register_reggroup_p): New to register hard/soft reggroups. + (m68hc11_gdbarch_init): Install the reggroups. + (_initialize_m68hc11_tdep): Initialize them. + +2003-02-21 James E Wilson <wilson@tuliptree.org> + + * MAINTAINERS: Update my email address. + +2003-02-21 David Carlton <carlton@math.stanford.edu> + + * arm-tdep.c (arm_gdbarch_init): Add break after default label. + +2003-02-21 Daniel Jacobowitz <drow@mvista.com> + + Based on a patch from Daniel Berlin (dberlin@dberlin.org). + * symtab.h: Add opaque declarations of struct axs_value and + struct agent_expr. + (enum address_class): Add LOC_COMPUTED and LOC_COMPUTED_ARG. + (struct location_funcs): New type. + (struct symbol): Add "loc" to aux_value. + (SYMBOL_LOCATION_BATON, SYMBOL_LOCATION_FUNCS): New macros. + * dwarf2read.c: Include "dwarf2expr.h". + (dwarf2_symbol_mark_computed): New function. + (read_func_scope): Use it. + (var_decode_location): New function. + (new_symbol): Use it. + * dwarf2expr.c, dwarf2expr.h, dwarf2loc.c, dwarf2loc.h: New files. + + * Makefile.in (SFILES): Add dwarf2loc.c and dwarf2expr.c. + (dwarf2expr_h, dwarf2loc_h): New variables. + (COMMON_OBS): Add dwarf2expr.o and dwarf2loc.o. + (dwarf2expr.o, dwarf2loc.o): New rules. + (dwarf2read.o): Add $(dwarf2expr_h) and $(dwarf2loc_h). + * buildsym.c (finish_block): Handle LOC_COMPUTED and + LOC_COMPUTED_ARG. + * findvar.c (symbol_read_needs_frame, read_var_value): Likewise. + * m2-exp.y (yylex): Likewise. + * printcmd.c (address_info, print_frame_args): Likewise. + * stack.c (print_block_frame_locals, print_frame_arg_vars): Likewise. + * symmisc.c (print_symbol, print_partial_symbols): Likewise. + * ada-lang.c (ada_resolve_subexp, symtab_for_sym) + (ada_add_block_symbols, fill_in_ada_prototype): Likewise. + * symtab.c (lookup_block_symbol): Likewise. + +2003-02-20 Adam Fedor <fedor@gnu.org> + + * symtab.h: Remove objc_specific struct + (SYMBOL_OBJC_DEMANGLED_NAME): Remove. + * symtab.c (symbol_init_language_specific, symbol_demangled_name): + Have language_objc use cplus_specific struct. + +2003-02-20 Tom Tromey <tromey@redhat.com> + + * jv-valprint.c (java_value_print): Look at TYPE_TAG_NAME, not + TYPE_NAME, when printing a String value. PR java/1075. + +2003-02-20 Adam Fedor <fedor@gnu.org> + + * objc-lang.h (find_methods): Remove declaration. + * objc-lang.c (find_methods): Make static. + +2003-02-20 Christopher Faylor <cgf@redhat.com> + + * win32-nat.c (get_image_name): Check return value from + ReadProcessMemory. + (child_xfer_memory): Ditto. + +2003-02-20 Alexandre Oliva <aoliva@redhat.com> + + * configure.in (TARGET_SYSTEM_ROOT): Set default to + ${exec_prefix}/${target_alias}/sys-root. Match explicit + '${exec_prefix}' (in addition to the expansion thereof) as + relocatable. + * configure: Rebuilt. + +2003-02-20 David Carlton <carlton@math.stanford.edu> + + * symtab.c (search_symbols): Revert the search_symbols part of my + 2002-12-23 patch. Add comment. + +2002-02-20 Daniel Jacobowitz <drow@mvista.com> + + * coffread.c (coff_symfile_read): Clean up minimal symbols earlier. + * dbxread.c (elfstab_build_psymtabs): Don't call + install_minimal_symbols. + (stabsect_build_psymtabs): Likewise. + * elfread.c (elf_symfile_read): Call install_minimal_symbols + earlier. + * somread.c (som_symfile_read): Call install_minimal_symbols + and do_cleanups earlier. + * nlmread.c (nlm_symfile_read): Likewise. + * mdebugread.c (elfmdebug_build_psymtabs): Call + install_minimal_symbols and make appropriate cleanups. + +2003-02-20 Kevin Buettner <kevinb@redhat.com> + + * solib.c (reload_shared_libraries): New function. + (_initialize_solib): Add callbacks for ``set solib-search-path'' + and ``set solib-absolute-prefix''. + +2003-02-20 David Carlton <carlton@math.stanford.edu> + + * symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME; + expand comment. + * ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace + SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME. + * ada-typeprint.c (ada_typedef_print): Ditto. + * ax-gdb.c (gen_var_ref): Ditto. + * breakpoint.c (print_one_breakpoint): Ditto. + * buildsym.c (finish_block): Ditto. + * c-valprint.c (c_val_print): Ditto. + * expprint.c (print_subexp): Ditto. + * findvar.c (locate_var_value): Ditto. + * infcmd.c (jump_command): Ditto. + * linespec.c (decode_line_2, decode_compound): Ditto. + * maint.c (maintenance_translate_address): Ditto. + * objc-lang.c (compare_selectors, compare_classes): Ditto. + * printcmd.c (build_address_symbolic, sym_info, print_frame_args): + Ditto. + * p-valprint.c (pascal_val_print): Ditto. + * stabsread.c (define_symbol): Ditto. + * stack.c (print_frame, frame_info, print_block_frame_locals) + (print_frame_arg_vars, return_command): Ditto. + * symfile.c (compare_symbols, compare_psymbols): Ditto. + * symmisc.c (print_symbol): Ditto. + * symtab.c (lookup_partial_symbol, lookup_block_symbol) + (compare_search_syms, print_symbol_info, print_msymbol_info) + (rbreak_command): Ditto. + * tracepoint.c (tracepoints_info): Ditto. + * typeprint.c (typedef_print): Ditto. + * valops.c (value_of_variable, hand_function_call): Ditto. + * cli/cli-cmds.c (edit_command, list_command): Ditto. + * ada-typeprint.c: Update Copyright. + * infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto. + * tracepoint.c, cli/cli-cmds.c: Ditto. + +2003-02-20 Kevin Buettner <kevinb@redhat.com> + + * frame.c (generic_unwind_get_saved_register): Make non-static. + * frame.h (generic_unwind_get_saved_register): Declare. + * mips-tdep.c (read_next_frame_reg): Fetch register from + current regcache when frame is NULL. + (mips_init_extra_frame_info): Pass NULL explicitly for parameter + that must be NULL. + (mips_get_saved_register): Call generic_unwind_get_saved_register() + instead of frame_register_unwind(). + +2003-02-20 Andrew Cagney <ac131313@redhat.com> + + * remote-sim.c (gdbsim_insert_breakpoint) + (gdbsim_remove_breakpoint): Delete #ifdef SIM_HAS_BREAKPOINTS + code. + +2003-02-20 Andrew Cagney <ac131313@redhat.com> + + * remote.c (_initialize_remote): Add commands "set/show remote + hardware-watchpoint-limit" and "set/show remote + hardware-breakpoint-limit". + (remote_hw_watchpoint_limit): Initialize to -1. + (remote_hw_breakpoint_limit): Ditto. + (remote_check_watch_resources): Treat a limit of -1 as unlimited. + +2003-02-19 Raoul Gough <RaoulGough@yahoo.co.uk> + + * coff-pe-read.c: New file - support reading of minimal symbols from a + portable executable using the export table. + * coff-pe-read.h: New file. + * coffread.c: Include coff-pe-read.h. + (coff_symtab_read): Call read_pe_exported_syms iff no recognized + debugging symbols found. + * Makefile.in (SFILES): Add coff-pe-read.o. + (coff_pe_read_h): Define. + (COMMON_OBS): Add coff-pe-read.o. + (coffread.o): Add coff_pe_read_h dependency. + (coff-pe-read.o): New target. + +2003-02-19 David Carlton <carlton@math.stanford.edu> + + * Makefile.in (SFILES): Add block.c. + (block_h): New. + (COMMON_OBS): Add block.o. + (block.o): New. + (x86-64-tdep.o): Add $(block_h). + (values.o, valops.o, tracepoint.o, symtab.o, symmisc.o, symfile.o) + (stack.o, printcmd.o, p-exp.tab.o, parse.o, objfiles.o) + (objc-exp.tab.o, objc-lang.o, nlmread.o, mips-tdep.o, mdebugread.o) + (m2-exp.tab.o, linespec.o, jv-lang.o, jv-exp.tab.o, infcmd.o) + (f-valprint.o, findvar.o, f-exp.tab.o, expprint.o, coffread.o) + (c-exp.tab.o, buildsym.o, breakpoint.o, blockframe.o, ax-gdb.o) + (alpha-tdep.o, ada-lang.o, ada-exp.tab.o, mi-cmd-stack.o): Ditto. + * value.h: Add opaque declaration for struct block. + * parser-defs.h, objc-lang.h, buildsym.h, breakpoint.h: Ditto. + * ada-lang.h: Ditto. + * x86-64-tdep.c: #include "block.h" + * values.c, valops.c, tracepoint.c, symtab.c, symmisc.c: Ditto. + * symfile.c, stack.c, printcmd.c, p-exp.y, parse.c: Ditto. + * objfiles.c, objc-exp.y, objc-lang.c, nlmread.c: Ditto. + * mips-tdep.c, mdebugread.c, m2-exp.y, linespec.c: Ditto. + * jv-lang.c, jv-exp.y, infcmd.c, f-valprint.c: Ditto. + * findvar.c, f-exp.y, expprint.c, coffread.c, c-exp.y: Ditto. + * buildsym.c, breakpoint.c, blockframe.c, ax-gdb.c: Ditto. + * alpha-tdep.c, ada-lang.c, ada-exp.y: Ditto. + * blockframe.c (blockvector_for_pc_sect): Move to "block.c". + (blockvector_for_pc, block_for_pc_sect, block_for_pc): Ditto. + * symtab.c (block_function): Ditto. + (contained_in): Ditto. + * frame.h: Move block_for_pc and block_for_pc_sect declarations to + block.h. Add opaque declaration for struct block. + * symtab.h: Move block_function and contained_in declarations to + block.h. Add opaque declarations for struct block, struct + blockvector. + (struct block): Move to block.h. + (struct blockvector): Ditto. + (BLOCK_START, BLOCK_END, BLOCK_FUNCTION, BLOCK_SUPERBLOCK) + (BLOCK_GCC_COMPILED, BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM) + (BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE) + (ALL_BLOCK_SYMBOLS, BLOCK_SHOULD_SORT, BLOCKVECTOR_NBLOCKS) + (BLOCKVECTOR_BLOCK, GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): + Ditto. + * block.c: New file. + * block.h: New file. + +2003-02-19 Theodore A. Roth <troth@openavr.org> + + * avr-tdep.c (avr_extract_return_value): Remove function. + (avr_store_return_value): Remove function. + (avr_extract_struct_value_address): Remove function. + (avr_gdbarch_init): Remove set_gdbarch_deprecated_*() calls. + +2003-02-19 Andrew Cagney <ac131313@redhat.com> + + * rs6000-tdep.c: Include "gdb_assert.h". + (registers_e500): Add "acc" and "spefscr". + (PPC_GPRS_PSEUDO_REGS): Remove trailing comma. + (rs6000_gdbarch_init): Update initialization of ppc_gp0_regnum, + ppc_gplast_regnum, sp_regnum and fp_regnum. Check that gp0_regnum + really is "r0". + (registers_e500): Mark the "acc" as a 64 bit (from Jim Willson). + +2003-02-18 Keith Seitz <keiths@redhat.com> + + * Makefile.in: Add gdbtk-interps.c. + +2003-02-18 Kevin Buettner <kevinb@redhat.com> + + * sparc-tdep.c (sparc_frame_chain): Adjust return value. + * config/sparc/tm-sparc.h (init_frame_pc_noop): Declare. + +2003-02-18 Andrew Cagney <cagney@redhat.com> + + * symtab.h (struct objfile): Add opaque declaration. + +2003-02-18 Elena Zannoni <ezannoni@redhat.com> + + From Jim Ingham <jingham@apple.com>: + * dbxread.c (process_one_symbol): Use last_function_start rather + than function_start_offset to find the real beginning of the + current function. The latter is just the text section offset on + some systems, the former is always the real function start. + +2003-02-17 Andrew Cagney <cagney@redhat.com> + + * configure.in: Revert ${target} != ${host}. + +2003-02-17 Andrew Cagney <ac131313@redhat.com> + + * configure.in (Makefile): Use the test ${target} != ${host}, + instead of the absence of the "nm.h" file, to determine of the + configuration non-native. + * configure: Regenerate. + +2003-02-14 Elena Zannoni <ezannoni@redhat.com> + + From Brian Ford <ford@vss.fsi.com> + + * cli/cli-decode.c (lookup_cmd_composition) [TUI]: Properly + conditionalize tui_active test. + (lookup_cmd_1): Ditto. + +2003-02-14 Mark Kettenis <kettenis@gnu.org> + + * configure.in: Add check for _etext. + * maint.c (maintenance_set_profile_cmd): Use etext if _etext isn't + available. + * config.in, configure: regenerated. + +2003-02-14 Daniel Jacobowitz <drow@mvista.com> + + * dwarf2read.c (dwarf2_get_pc_bounds): Offset addresses by base. + +2003-02-14 Andrew Cagney <ac131313@redhat.com> + + * main.c (tui_version): Delete variable. + (captured_main): When --tui, set interpreter_p to "tui" instead of + enabling tui_version. + * printcmd.c (display_command) [TUI]: Test tui_active instead of + tui_version. + * cli/cli-decode.c (lookup_cmd_composition): Ditto. + * cli/cli-cmds.c (disassemble_command): Ditto. + * defs.h (tui_version): Delete declaration. + * Makefile.in (SUBDIR_TUI_SRCS): Add "tui/tui-interp.c". + (tui-interp.o): Add rules. + (SUBDIR_TUI_OBS): Add "tui-interp.o". + +2003-02-14 Christopher Faylor <cgf@redhat.com> + + * win32-nat.c (register_loaded_dll): Correctly set address range for + just-loaded dll. + +2003-02-12 Jason Molenda (jmolenda@apple.com) + + * symmisc.c (print_objfile_statistics): Include information about + the number of psymtabs and symtabs in each object file. + +2003-02-13 Keith R Seitz <keiths@redhat.com> + + * main.h (struct captured_main_args): Add interpreter_p. + * main.c (captured_main): Initialize interpreter_p from context. + * gdb.c (main): Set interpreter_p argument. + * Makefile.in (gdb.o): Add dependency for interps.h. + +2003-02-12 Andrew Cagney <ac131313@redhat.com> + + * event-top.c (cli_command_loop): Delete declaration. + (_initialize_event_loop): Delete function setting event_loop_hook. + * event-top.h (cli_command_loop): Declare. Update copyright. + (EVENT_TOP_H): Define. Wrap header in #ifdef EVENT_TOP_H. + * interps.c (current_interp_command_loop): When event_loop_p, call + cli_command_loop. + +2003-02-12 Andrew Cagney <ac131313@redhat.com> + + * interps.h (interp_command_loop_ftype): Change return type to + void. + +2003-02-12 Michal Ludvig <mludvig@suse.cz> + + * x86-64-tdep.c (x86_64_extract_return_value) + (x86_64_store_return_value): Use regcache instead of regbuf. + (x86_64_gdbarch_init): Change related set_gdbarch_* functions. + * x86-64-linux-nat.c (fill_gregset): Use regcache. + +2003-02-11 Andrew Cagney <ac131313@redhat.com> + + * acinclude.m4 (no_tcl): SUBST TCL_CC_SEARCH_FLAGS. + * aclocal.m4: Regenerate. + * configure: Regenerate. + + * Makefile.in (TCL): Use TCL_CC_SEARCH_FLAGS instead of + TCL_LD_SEARCH_FLAGS. + +2003-02-10 Michal Ludvig <mludvig@suse.cz> + + * dwarf2cfi.c: Reindented. + +2003-02-09 Andrew Cagney <ac131313@redhat.com> + + * interps.c (clear_interpreter_hooks): Convert function definition + to ISO C. + +2003-02-07 David Carlton <carlton@math.stanford.edu> + + * gdb_mbuild.sh: Delete extra shift after parsing '-f'. + +2003-02-07 Kevin Buettner <kevinb@redhat.com> + + * gdbtypes.h (struct main_type): Move ``length'' field from here... + (struct type): ...to here. + (TYPE_LENGTH): Adjust to reflect different location of ``length'' + field. + * gdbtypes.c (make_qualified_type): Set length on newly created type. + (replace_type): Set length on all type variants for a given type. + +>>>>>>> 1.3924 2003-02-27 David Carlton <carlton@math.stanford.edu> * symtab.c (lookup_symbol_aux_namespace_scope): Rename from diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 88428aa..6315888 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -185,7 +185,6 @@ MS Windows (NT, '00, 9x, Me, XP) host & native Chris Faylor cgf@redhat.com GNU/Linux/x86 native & host Mark Kettenis kettenis@gnu.org - Jim Blandy jimb@redhat.com GNU/Linux PPC native Kevin Buettner kevinb@redhat.com GNU/Linux MIPS native & host Daniel Jacobowitz dan@debian.org @@ -209,8 +208,10 @@ generic arch support Andrew Cagney cagney@redhat.com Any host/target maintainer can add to gdbarch.{c,h,sh}. Send tricky ones to cagney. target vector Andrew Cagney cagney@redhat.com -main (main.c, top.c) Elena Zannoni ezannoni@redhat.com + event loop Elena Zannoni ezannoni@redhat.com + For the part of top.c related to the event loop, + send questions to ezannoni@redhat.com generic symtabs Jim Blandy jimb@redhat.com Elena Zannoni ezannoni@redhat.com @@ -223,8 +224,7 @@ generic symtabs Jim Blandy jimb@redhat.com coff reader Philippe De Muyter phdm@macqel.be xcoff reader Any maintainer can modify this; please send tricky ones to Kevin Buettner <kevinb@redhat.com> - linespec Jim Blandy jimb@redhat.com - Elena Zannoni ezannoni@redhat.com + linespec Elena Zannoni ezannoni@redhat.com Fernando Nasser fnasser@redhat.com HP/UX readers Any [past] maintainer can modify this. Please send tricky ones to the symtabs maintainers. @@ -234,15 +234,12 @@ tracing Michael Snyder msnyder@redhat.com threads Michael Snyder msnyder@redhat.com Mark Kettenis kettenis@gnu.org breakpoints Michael Snyder msnyder@redhat.com - Jim Blandy jimb@redhat.com language support (Blanket Write Privs Maintainers) C++ Daniel Jacobowitz dan@debian.org Java support (Global Maintainers) Pascal support Pierre Muller muller@sources.redhat.com - Scheme support Jim Blandy jimb@redhat.com -shared libs (devolved) Jim Blandy jimb@redhat.com - Kevin Buettner kevinb@redhat.com +shared libs (devolved) Kevin Buettner kevinb@redhat.com xcoffsolib Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de remote.c Andrew Cagney cagney@redhat.com @@ -342,7 +339,7 @@ Richard Henderson rth@redhat.com Aldy Hernandez aldyh@redhat.com Paul Hilfinger hilfinger@gnat.com Matt Hiller hiller@redhat.com -Kazu Hirata kazu@hxi.com +Kazu Hirata kazu@cs.umass.edu Jeff Holcomb jeffh@redhat.com Don Howard dhoward@redhat.com Martin Hunt hunt@redhat.com @@ -391,7 +388,8 @@ Jason Thorpe thorpej@wasabisystems.com Tom Tromey tromey@redhat.com Corinna Vinschen vinschen@redhat.com Keith Walker keith.walker@arm.com -Jim Wilson wilson@redhat.com +Kris Warkentin kewarken@qnx.com +Jim Wilson wilson@tuliptree.org Elena Zannoni ezannoni@redhat.com Eli Zaretskii eliz@gnu.org diff --git a/gdb/Makefile.in b/gdb/Makefile.in index f716b9e..ddc1e66 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -194,11 +194,13 @@ SUBDIR_MI_UNINSTALL= # SUBDIR_TUI_OBS = \ tui-file.o tui.o tuiData.o tuiSource.o tuiStack.o tuiIO.o \ + tui-interp.o \ tuiGeneralWin.o tuiLayout.o tuiWin.o tuiCommand.o \ tuiDisassem.o tuiSourceWin.o tuiRegs.o tuiDataWin.o \ tui-out.o tui-hooks.o SUBDIR_TUI_SRCS = \ tui/tui-file.c tui/tui.c tui/tuiData.c tui/tuiSource.c \ + tui/tui-interp.c \ tui/tuiStack.c tui/tuiIO.c \ tui/tuiGeneralWin.c tui/tuiLayout.c \ tui/tuiWin.c tui/tuiCommand.c \ @@ -240,9 +242,8 @@ WIN32LIBS = @WIN32LIBS@ LIB_INSTALL_DIR = $(libdir) # This variable is needed when doing dynamic linking. LIB_RUNTIME_DIR = $(libdir) -TCL = @TCL_LD_SEARCH_FLAGS@ @TCL_BUILD_LIB_SPEC@ +TCL = @TCL_CC_SEARCH_FLAGS@ @TCL_BUILD_LIB_SPEC@ TCL_CFLAGS = @TCLHDIR@ -TCL_DEPS = @TCL_DEPS@ GDBTKLIBS = @GDBTKLIBS@ # Extra flags that the GDBTK files need: GDBTK_CFLAGS = @GDBTK_CFLAGS@ @@ -250,17 +251,14 @@ GDBTK_CFLAGS = @GDBTK_CFLAGS@ # Where is the TK library? Typically in ../tk. TK = @TK_BUILD_LIB_SPEC@ TK_CFLAGS = @TKHDIR@ @TK_BUILD_INCLUDES@ -TK_DEPS = @TK_DEPS@ # Where is Itcl? Typically in ../itcl/itcl. ITCL_CFLAGS = @ITCLHDIR@ ITCL = @ITCLLIB@ -ITCL_DEPS = @ITCL_DEPS@ # Where is Itk? Typically in ../itcl/itk. ITK_CFLAGS = @ITKHDIR@ ITK = @ITKLIB@ -ITK_DEPS = @ITK_DEPS@ X11_CFLAGS = @TK_XINCLUDES@ X11_LDFLAGS = @@ -282,17 +280,17 @@ GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION) GDBTK_SRC_DIR = @GDBTK_SRC_DIR@ SUBDIR_GDBTK_OBS = \ - gdbtk.o gdbtk-bp.o gdbtk-cmds.o gdbtk-hooks.o \ + gdbtk.o gdbtk-bp.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-interp.o \ gdbtk-register.o gdbtk-stack.o gdbtk-varobj.o gdbtk-wrapper.o SUBDIR_GDBTK_SRCS = \ gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-bp.c \ - gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c \ + gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c gdbtk-interp.c \ gdbtk/generic/gdbtk-register.c gdbtk/generic/gdbtk-stack.c \ gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c \ gdbtk/generic/gdbtk-main.c SUBDIR_GDBTK_DEPS = \ $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TK_DEPS) $(TCL_DEPS) -SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c +SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-interp.c SUBDIR_GDBTK_LDFLAGS= SUBDIR_GDBTK_CFLAGS= -DGDBTK SUBDIR_GDBTK_ALL= all-gdbtk @@ -437,6 +435,7 @@ FLAGS_TO_PASS = \ "CXX=$(CXX)" \ "CXXFLAGS=$(CXXFLAGS)" \ "DLLTOOL=$(DLLTOOL)" \ + "LDFLAGS=$(LDFLAGS)" \ "RANLIB=$(RANLIB)" \ "MAKEINFO=$(MAKEINFO)" \ "MAKEHTML=$(MAKEHTML)" \ @@ -511,10 +510,11 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ ax-general.c ax-gdb.c \ bcache.c block.c blockframe.c breakpoint.c buildsym.c builtin-regs.c \ c-exp.y c-lang.c c-typeprint.c c-valprint.c \ - charset.c cli-out.c coffread.c complaints.c completer.c corefile.c \ + charset.c cli-out.c coffread.c coff-pe-read.c \ + complaints.c completer.c corefile.c \ cp-abi.c cp-support.c cp-valprint.c \ - dbxread.c demangle.c dictionary.c \ - disasm.c doublest.c dummy-frame.c dwarfread.c dwarf2read.c \ + dbxread.c demangle.c dictionary.c disasm.c doublest.c \ + dummy-frame.c dwarfread.c dwarf2expr.c dwarf2loc.c dwarf2read.c \ elfread.c environ.c eval.c event-loop.c event-top.c expprint.c \ f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c frame.c \ frame-unwind.c \ @@ -530,7 +530,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ mdebugread.c memattr.c mem-break.c minsyms.c mipsread.c \ nlmread.c \ objc-exp.y objc-lang.c \ - objfiles.c osabi.c \ + objfiles.c osabi.c observer.c \ p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \ regcache.c reggroups.c remote.c \ scm-exp.c scm-lang.c scm-valprint.c \ @@ -613,6 +613,7 @@ call_cmds_h = call-cmds.h ch_lang_h = ch-lang.h cli_out_h = cli-out.h coff_solib_h = coff-solib.h +coff_pe_read_h = coff-pe-read.h command_h = command.h complaints_h = complaints.h completer_h = completer.h @@ -629,6 +630,8 @@ doublest_h = doublest.h $(floatformat_h) dst_h = dst.h dummy_frame_h = dummy-frame.h dwarf2cfi_h = dwarf2cfi.h +dwarf2expr_h = dwarf2expr.h +dwarf2loc_h = dwarf2loc.h environ_h = environ.h event_loop_h = event-loop.h event_top_h = event-top.h @@ -683,6 +686,7 @@ nbsd_tdep_h = nbsd-tdep.h ns32k_tdep_h = ns32k-tdep.h objc_lang_h = objc-lang.h objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) +observer_h = observer.h ocd_h = ocd.h osabi_h = osabi.h p_lang_h = p-lang.h @@ -824,7 +828,7 @@ TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR) COMMON_OBS = version.o block.o blockframe.o breakpoint.o findvar.o regcache.o \ charset.o dictionary.o disasm.o dummy-frame.o \ source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ - symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ + block.o symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ expprint.o environ.o stack.o thread.o \ interps.o \ macrotab.o macrocmd.o macroexp.o macroscope.o \ @@ -835,9 +839,10 @@ COMMON_OBS = version.o block.o blockframe.o breakpoint.o findvar.o regcache.o \ signals.o \ kod.o kod-cisco.o \ gdb-events.o \ - exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \ - dbxread.o coffread.o elfread.o \ + exec.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o \ + dbxread.o coffread.o coff-pe-read.o elfread.o \ dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \ + dwarf2expr.o dwarf2loc.o \ c-lang.o f-lang.o \ ui-out.o cli-out.o \ varobj.o wrapper.o \ @@ -1435,7 +1440,7 @@ c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ objc-exp.tab.o: objc-exp.tab.c $(objc_lang_h) $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ - $(bfd_h) $(objfiles_h) $(symfile_h) + $(bfd_h) $(objfiles_h) $(symfile_h) $(block_h) jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ @@ -1491,8 +1496,8 @@ alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ alpha-tdep.o: alpha-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) $(symfile_h) \ $(objfiles_h) $(gdb_string_h) $(linespec_h) $(regcache_h) \ - $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) $(block_h) \ - $(osabi_h) + $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) \ + $(osabi_h) $(block_h) alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(alpha_tdep_h) $(alphabsd_tdep_h) $(gregset_h) alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \ @@ -1528,14 +1533,16 @@ avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ $(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \ - $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) + $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) \ + $(regcache_h) ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h) bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) -block.o: block.c $(defs_h) $(block_h) $(gdb_obstack_h) $(cp_support_h) +block.o: block.c $(defs_h) $(block_h) $(symtab_h) $(symfile_h) \ + $(gdb_obstack_h) $(cp_support_h) blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \ $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \ - $(dummy_frame_h) $(block_h) $(command_h) $(gdbcmd_h) + $(dummy_frame_h) $(command_h) $(gdbcmd_h) $(block_h) breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ $(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \ $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ @@ -1547,7 +1554,8 @@ buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(gdb_assert_h) \ $(complaints_h) $(gdb_string_h) $(expression_h) $(language_h) \ $(bcache_h) $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ - $(stabsread_h) $(dictionary_h) $(cp_support_h) $(block_h) + $(stabsread_h) $(block_h) $(dictionary_h) $(cp_support_h) \ + $(stabsread_h) $(block_h) builtin-regs.o: builtin-regs.c $(defs_h) $(builtin_regs_h) $(gdbtypes_h) \ $(gdb_string_h) $(gdb_assert_h) c-lang.o: c-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1570,7 +1578,10 @@ coffread.o: coffread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(demangle_h) \ $(breakpoint_h) $(bfd_h) $(gdb_obstack_h) $(gdb_string_h) \ $(coff_internal_h) $(libcoff_h) $(symfile_h) $(objfiles_h) \ $(buildsym_h) $(gdb_stabs_h) $(stabsread_h) $(complaints_h) \ - $(target_h) $(gdb_assert_h) $(dictionary_h) $(block_h) + $(target_h) $(gdb_assert_h) $(block_h) $(coff_pe_read_h) \ + $(dictionary_h) +coff-pe-read.o: coff-pe-read.c $(bfd_h) $(defs_h) $(symtab_h) \ + $(gdbtypes_h) $(symfile_h) $(objfiles_h) $(coff_pe_read_h) complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \ $(command_h) $(gdbcmd_h) completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1588,7 +1599,8 @@ corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ corelow.o: corelow.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(command_h) $(bfd_h) $(target_h) $(gdbcore_h) \ $(gdbthread_h) $(regcache_h) $(symfile_h) $(readline_h) -cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(gdb_string_h) +cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) \ + $(gdbcmd_h) $(ui_out_h) $(gdb_string_h) cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_h) \ $(demangle_h) $(gdb_obstack_h) $(gdb_assert_h) $(symtab_h) \ $(symfile_h) $(block_h) $(objfiles_h) $(gdbtypes_h) $(dictionary_h) \ @@ -1637,11 +1649,16 @@ dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(target_h) $(elf_dwarf2_h) $(inferior_h) \ $(regcache_h) $(dwarf2cfi_h) $(gdb_assert_h) +dwarf2expr.o: dwarf2expr.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) \ + $(gdbcore_h) $(dwarf2expr_h) +dwarf2loc.o: dwarf2loc.c $(defs_h) $(ui_out_h) $(value_h) $(frame_h) \ + $(gdbcore_h) $(target_h) $(inferior_h) $(dwarf2expr_h) \ + $(dwarf2loc_h) $(ax_h) $(ax_gdb_h) $(regcache_h) $(gdb_string_h) dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \ $(symfile_h) $(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) \ $(demangle_h) $(expression_h) $(filenames_h) $(macrotab_h) \ - $(language_h) $(complaints_h) $(gdb_string_h) \ - $(gdb_assert_h) $(cp_support_h) + $(language_h) $(complaints_h) $(bcache_h) $(dwarf2expr_h) \ + $(dwarf2loc_h) $(gdb_string_h) $(gdb_assert_h) $(cp_support_h) dwarfread.o: dwarfread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ $(objfiles_h) $(elf_dwarf_h) $(buildsym_h) $(demangle_h) \ $(expression_h) $(language_h) $(complaints_h) $(gdb_string_h) @@ -1693,7 +1710,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ $(arch_utils_h) $(regcache_h) gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \ $(elf_bfd_h) $(symfile_h) $(objfiles_h) -gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) +gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h) gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h) gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \ $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \ @@ -1842,7 +1859,7 @@ lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) \ $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(completer_h) \ - $(cp_abi_h) $(source_h) $(block_h) $(parser_defs_h) $(cp_support_h) + $(cp_abi_h) $(source_h) $(parser_defs_h) $(block_h) $(cp_support_h) linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) \ $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \ $(cli_decode_h) $(gdb_string_h) @@ -1905,6 +1922,7 @@ mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \ $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \ + $(block_h) \ $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \ $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \ $(aout_stab_gnu_h) $(expression_h) $(language_h) $(dictionary_h) \ @@ -1924,8 +1942,8 @@ mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ - $(regcache_h) $(osabi_h) $(mips_tdep_h) $(opcode_mips_h) \ - $(elf_mips_h) $(elf_bfd_h) $(symcat_h) $(block_h) + $(regcache_h) $(osabi_h) $(mips_tdep_h) $(block_h) $(opcode_mips_h) \ + $(elf_mips_h) $(elf_bfd_h) $(symcat_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(mipsnbsd_tdep_h) @@ -1961,11 +1979,12 @@ objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(parser_defs_h) $(language_h) $(c_lang_h) $(objc_lang_h) \ $(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) \ - $(gdb_regex_h) $(regcache_h) + $(gdb_regex_h) $(regcache_h) $(block_h) objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) \ $(dictionary_h) $(block_h) +observer.o: observer.c $(observer_h) $(defs_h) ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \ $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h) @@ -2015,7 +2034,8 @@ printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ $(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \ $(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \ $(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \ - $(gdb_assert_h) $(dictionary_h) $(block_h) + $(gdb_assert_h) $(dictionary_h) $(block_h) \ + $(gdb_assert_h) $(block_h) proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(gdb_wait_h) \ $(proc_utils_h) proc-events.o: proc-events.c $(defs_h) @@ -2214,7 +2234,7 @@ symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) $(source_h) \ - $(gdb_assert_h) $(readline_h) $(block_h) $(filenames_h) + $(gdb_assert_h) $(readline_h) $(filenames_h) $(block_h) symm-nat.o: symm-nat.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(target_h) $(regcache_h) $(gdb_wait_h) $(gdb_stat_h) $(gdbcore_h) \ $(gdbcore_h) @@ -2222,15 +2242,15 @@ symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(gdb_stat_h) $(gdbcore_h) symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ - $(gdb_obstack_h) $(language_h) $(bcache_h) $(dictionary_h) \ - $(gdb_string_h) $(readline_h) $(block_h) + $(gdb_obstack_h) $(language_h) $(bcache_h) $(gdb_string_h) \ + $(readline_h) $(block_h) $(dictionary_h) symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ - $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ - $(filenames_h) $(dictionary_h) $(gdb_obstack_h) \ - $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h) $(source_h) $(cp_support_h) \ - $(block_h) $(gdb_assert_h) + $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ + $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \ + $(cp_abi_h) $(source_h) $(block_h) $(dictionary_h) $(cp_support_h) \ + $(gdb_assert_h) target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ $(gdb_wait_h) $(dcache_h) $(regcache_h) @@ -2250,8 +2270,8 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \ tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ - $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) $(ax_h) \ - $(ax_gdb_h) $(dictionary_h) $(block_h) $(readline_h) + $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) \ + $(block_h) $(ax_h) $(ax_gdb_h) $(readline_h) typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) @@ -2276,7 +2296,7 @@ valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \ valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \ $(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \ $(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(gdb_string_h) \ - $(gdb_assert_h) $(dictionary_h) $(block_h) $(cp_support_h) + $(gdb_assert_h) $(block_h) $(dictionary_h) $(cp_support_h) valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \ $(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) @@ -2460,6 +2480,14 @@ gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" +gdbtk-interp.o: $(srcdir)/gdbtk/generic/gdbtk-interp.c \ + $(defs_h) $(interps_h) $(ui_out_h) $(ui_file_h) \ + $(cli_out_h) $(gdb_string_h) $(cli_cmds_h) $(cli_decode_h) \ + $(srcdir)/gdbtk/generic/gdbtk.h + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS) \ + $(srcdir)/gdbtk/generic/gdbtk-interp.c + gdbtk-main.o: $(srcdir)/gdbtk/generic/gdbtk-main.c $(defs_h) $(main_h) \ $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ @@ -2588,6 +2616,10 @@ tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(config_h) $(defs_h) $(symtab_h) \ $(tuiRegs_h) $(tuiWin_h) $(tuiStack_h) $(tuiDataWin_h) \ $(tuiSourceWin_h) $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c +tui-interp.o: $(srcdir)/tui/tui-interp.c $(defs_h) $(interps_h) $(top_h) \ + $(event_top_h) $(event_loop_h) $(ui_out_h) $(tui_tuiData_h) \ + $(readline_h) $(tui_tuiWin_h) $(tui_h) $(tui_tuiIO_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-interp.c tui-out.o: $(srcdir)/tui/tui-out.c $(defs_h) $(ui_out_h) $(tui_h) \ $(gdb_string_h) $(gdb_assert_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-out.c diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS index a26f3e0..8511263 100644 --- a/gdb/PROBLEMS +++ b/gdb/PROBLEMS @@ -69,6 +69,10 @@ building GDB vis: i[3456]86-*-linux* ------------------ +gdb/660: gdb does not build with GNU/Linux libc5. The symptom is a +parse error before `uintptr_t' or an error message about `uintptr_t'. +Upgrade to glibc 2.1.3 or later, which defines uintptr_t. + gdb/1030: GNU binutils 2.12.1 and earlier versions do not work properly with gdb. If you use GNU binutils, upgrade to version 2.13 or later. You can check the version of binutils with the command: diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index e8951df..d3c00ae 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -259,6 +259,7 @@ dnl not used, don't export to save symbols AC_SUBST(TCL_LD_FLAGS) dnl don't export, not used outside of configure AC_SUBST(TCL_LD_SEARCH_FLAGS) + AC_SUBST(TCL_CC_SEARCH_FLAGS) AC_SUBST(TCL_COMPAT_OBJS) AC_SUBST(TCL_RANLIB) AC_SUBST(TCL_BUILD_LIB_SPEC) diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 index d925c33..51e94f2 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 @@ -271,6 +271,7 @@ dnl not used, don't export to save symbols AC_SUBST(TCL_LD_FLAGS) dnl don't export, not used outside of configure AC_SUBST(TCL_LD_SEARCH_FLAGS) + AC_SUBST(TCL_CC_SEARCH_FLAGS) AC_SUBST(TCL_COMPAT_OBJS) AC_SUBST(TCL_RANLIB) AC_SUBST(TCL_BUILD_LIB_SPEC) diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 45d09a9..d17e0c8 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1,5 +1,5 @@ /* YACC parser for Ada expressions, for GDB. - Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1997, 2000 + Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1997, 2000, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -42,7 +42,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ctype.h> #include "expression.h" #include "value.h" -#include "block.h" #include "parser-defs.h" #include "language.h" #include "ada-lang.h" @@ -50,6 +49,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ #include "frame.h" +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple @@ -803,7 +803,7 @@ write_object_renaming (orig_left_context, renaming) struct block* orig_left_context; struct symbol* renaming; { - const char* qualification = SYMBOL_NAME (renaming); + const char* qualification = DEPRECATED_SYMBOL_NAME (renaming); const char* simple_tail; const char* expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0); const char* suffix; @@ -946,7 +946,7 @@ write_object_renaming (orig_left_context, renaming) BadEncoding: error ("Internal error in encoding of renaming declaration: %s", - SYMBOL_NAME (renaming)); + DEPRECATED_SYMBOL_NAME (renaming)); } /* Convert the character literal whose ASCII value would be VAL to the diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 8a76c39..97e8f2d 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -1,5 +1,6 @@ /* Ada language support routines for GDB, the GNU debugger. Copyright - 1992, 1993, 1994, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -24,7 +25,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "demangle.h" #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "gdbcmd.h" #include "expression.h" @@ -39,6 +39,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "ada-lang.h" #include "dictionary.h" #include "ui-out.h" +#include "block.h" struct cleanup *unresolved_names; @@ -707,7 +708,7 @@ ada_suppress_symbol_printing (struct symbol *sym) if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE) return 1; else - return is_suppressed_name (SYMBOL_NAME (sym)); + return is_suppressed_name (DEPRECATED_SYMBOL_NAME (sym)); } @@ -2175,6 +2176,8 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, case LOC_LOCAL_ARG: case LOC_BASEREG: case LOC_BASEREG_ARG: + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: goto FoundNonType; default: break; @@ -2566,8 +2569,8 @@ sort_choices (struct symbol *syms[], struct block *blocks[], int nsyms) for (j = i - 1; j >= 0; j -= 1) { - if (mangled_ordered_before (SYMBOL_NAME (syms[j]), - SYMBOL_NAME (sym))) + if (mangled_ordered_before (DEPRECATED_SYMBOL_NAME (syms[j]), + DEPRECATED_SYMBOL_NAME (sym))) break; syms[j + 1] = syms[j]; blocks[j + 1] = blocks[j]; @@ -3244,8 +3247,8 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) { struct type *type0 = SYMBOL_TYPE (sym0); struct type *type1 = SYMBOL_TYPE (sym1); - char *name0 = SYMBOL_NAME (sym0); - char *name1 = SYMBOL_NAME (sym1); + char *name0 = DEPRECATED_SYMBOL_NAME (sym0); + char *name1 = DEPRECATED_SYMBOL_NAME (sym1); int len0 = strlen (name0); return TYPE_CODE (type0) == TYPE_CODE (type1) @@ -3323,7 +3326,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, struct partial_symbol *psym = start[i]; if (SYMBOL_NAMESPACE (psym) == namespace && - wild_match (name, name_len, SYMBOL_NAME (psym))) + wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (psym))) return psym; } return NULL; @@ -3339,11 +3342,11 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { int M = (U + i) >> 1; struct partial_symbol *psym = start[M]; - if (SYMBOL_NAME (psym)[0] < name[0]) + if (DEPRECATED_SYMBOL_NAME (psym)[0] < name[0]) i = M + 1; - else if (SYMBOL_NAME (psym)[0] > name[0]) + else if (DEPRECATED_SYMBOL_NAME (psym)[0] > name[0]) U = M - 1; - else if (strcmp (SYMBOL_NAME (psym), name) < 0) + else if (strcmp (DEPRECATED_SYMBOL_NAME (psym), name) < 0) i = M + 1; else U = M; @@ -3358,7 +3361,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, if (SYMBOL_NAMESPACE (psym) == namespace) { - int cmp = strncmp (name, SYMBOL_NAME (psym), name_len); + int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym), name_len); if (cmp < 0) { @@ -3366,7 +3369,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, break; } else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (psym) + name_len)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (psym) + name_len)) return psym; } i += 1; @@ -3381,11 +3384,11 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { int M = (U + i) >> 1; struct partial_symbol *psym = start[M]; - if (SYMBOL_NAME (psym)[0] < '_') + if (DEPRECATED_SYMBOL_NAME (psym)[0] < '_') i = M + 1; - else if (SYMBOL_NAME (psym)[0] > '_') + else if (DEPRECATED_SYMBOL_NAME (psym)[0] > '_') U = M - 1; - else if (strcmp (SYMBOL_NAME (psym), "_ada_") < 0) + else if (strcmp (DEPRECATED_SYMBOL_NAME (psym), "_ada_") < 0) i = M + 1; else U = M; @@ -3402,12 +3405,12 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { int cmp; - cmp = (int) '_' - (int) SYMBOL_NAME (psym)[0]; + cmp = (int) '_' - (int) DEPRECATED_SYMBOL_NAME (psym)[0]; if (cmp == 0) { - cmp = strncmp ("_ada_", SYMBOL_NAME (psym), 5); + cmp = strncmp ("_ada_", DEPRECATED_SYMBOL_NAME (psym), 5); if (cmp == 0) - cmp = strncmp (name, SYMBOL_NAME (psym) + 5, name_len); + cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym) + 5, name_len); } if (cmp < 0) @@ -3416,7 +3419,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, break; } else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (psym) + name_len + 5)) return psym; } i += 1; @@ -3473,6 +3476,8 @@ symtab_for_sym (struct symbol *sym) case LOC_LOCAL_ARG: case LOC_BASEREG: case LOC_BASEREG_ARG: + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: for (j = FIRST_LOCAL_BLOCK; j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1) { @@ -3501,7 +3506,7 @@ ada_lookup_minimal_symbol (const char *name) ALL_MSYMBOLS (objfile, msymbol) { - if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match) + if (ada_match_name (DEPRECATED_SYMBOL_NAME (msymbol), name, wild_match) && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline) return msymbol; } @@ -3535,7 +3540,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, /* Initialize the local variable symbol that stands for the * static link (when it exists). */ static_link = &static_link_sym; - SYMBOL_NAME (static_link) = ""; + DEPRECATED_SYMBOL_NAME (static_link) = ""; SYMBOL_LANGUAGE (static_link) = language_unknown; SYMBOL_CLASS (static_link) = LOC_LOCAL; SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE; @@ -3604,15 +3609,15 @@ remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms) i = 0; while (i < nsyms) { - if (SYMBOL_NAME (syms[i]) != NULL + if (DEPRECATED_SYMBOL_NAME (syms[i]) != NULL && SYMBOL_CLASS (syms[i]) == LOC_STATIC && is_nondebugging_type (SYMBOL_TYPE (syms[i]))) { for (j = 0; j < nsyms; j += 1) { if (i != j - && SYMBOL_NAME (syms[j]) != NULL - && STREQ (SYMBOL_NAME (syms[i]), SYMBOL_NAME (syms[j])) + && DEPRECATED_SYMBOL_NAME (syms[j]) != NULL + && STREQ (DEPRECATED_SYMBOL_NAME (syms[i]), DEPRECATED_SYMBOL_NAME (syms[j])) && SYMBOL_CLASS (syms[i]) == SYMBOL_CLASS (syms[j]) && SYMBOL_VALUE_ADDRESS (syms[i]) == SYMBOL_VALUE_ADDRESS (syms[j])) @@ -3707,7 +3712,7 @@ ada_lookup_symbol_list (const char *name, struct block *block0, { ALL_MSYMBOLS (objfile, msymbol) { - if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)) + if (ada_match_name (DEPRECATED_SYMBOL_NAME (msymbol), name, wild_match)) { switch (MSYMBOL_TYPE (msymbol)) { @@ -3722,13 +3727,13 @@ ada_lookup_symbol_list (const char *name, struct block *block0, bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ada_add_block_symbols (block, - SYMBOL_NAME (msymbol), + DEPRECATED_SYMBOL_NAME (msymbol), namespace, objfile, wild_match); if (ndefns == old_ndefns) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ada_add_block_symbols (block, - SYMBOL_NAME (msymbol), + DEPRECATED_SYMBOL_NAME (msymbol), namespace, objfile, wild_match); } @@ -3967,7 +3972,7 @@ ada_add_block_symbols (struct block *block, const char *name, ALL_BLOCK_SYMBOLS (block, iter, sym) { if (SYMBOL_NAMESPACE (sym) == namespace && - wild_match (name, name_len, SYMBOL_NAME (sym))) + wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (sym))) { switch (SYMBOL_CLASS (sym)) { @@ -3977,6 +3982,7 @@ ada_add_block_symbols (struct block *block, const char *name, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: arg_sym = sym; break; case LOC_UNRESOLVED: @@ -3996,10 +4002,10 @@ ada_add_block_symbols (struct block *block, const char *name, { if (SYMBOL_NAMESPACE (sym) == namespace) { - int cmp = strncmp (name, SYMBOL_NAME (sym), name_len); + int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len); if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (sym) + name_len)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len)) { switch (SYMBOL_CLASS (sym)) { @@ -4009,6 +4015,7 @@ ada_add_block_symbols (struct block *block, const char *name, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: arg_sym = sym; break; case LOC_UNRESOLVED: @@ -4042,16 +4049,16 @@ ada_add_block_symbols (struct block *block, const char *name, { int cmp; - cmp = (int) '_' - (int) SYMBOL_NAME (sym)[0]; + cmp = (int) '_' - (int) DEPRECATED_SYMBOL_NAME (sym)[0]; if (cmp == 0) { - cmp = strncmp ("_ada_", SYMBOL_NAME (sym), 5); + cmp = strncmp ("_ada_", DEPRECATED_SYMBOL_NAME (sym), 5); if (cmp == 0) - cmp = strncmp (name, SYMBOL_NAME (sym) + 5, name_len); + cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym) + 5, name_len); } if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len + 5)) { switch (SYMBOL_CLASS (sym)) { @@ -4061,6 +4068,7 @@ ada_add_block_symbols (struct block *block, const char *name, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: arg_sym = sym; break; case LOC_UNRESOLVED: @@ -4136,7 +4144,7 @@ fill_in_ada_prototype (struct symbol *func) TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0; TYPE_FIELD_TYPE (ftype, nargs) = lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym))); - TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + TYPE_FIELD_NAME (ftype, nargs) = DEPRECATED_SYMBOL_NAME (sym); nargs += 1; break; @@ -4145,11 +4153,12 @@ fill_in_ada_prototype (struct symbol *func) case LOC_REGPARM: case LOC_LOCAL_ARG: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: TYPE_FIELD_BITPOS (ftype, nargs) = nargs; TYPE_FIELD_BITSIZE (ftype, nargs) = 0; TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0; TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym)); - TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + TYPE_FIELD_NAME (ftype, nargs) = DEPRECATED_SYMBOL_NAME (sym); nargs += 1; break; @@ -4418,7 +4427,7 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table, for (i = 0; i < selected.nelts; i += 1) (*canonical)[i] = extended_canonical_line_spec (selected.sals[i], - SYMBOL_BEST_NAME (symbols[i])); + SYMBOL_PRINT_NAME (symbols[i])); } discard_cleanups (old_chain); @@ -4701,14 +4710,15 @@ debug_print_block (struct block *b) fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]", b, BLOCK_START (b), BLOCK_END (b)); if (BLOCK_FUNCTION (b) != NULL) - fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION (b))); + fprintf (stderr, " Function: %s", DEPRECATED_SYMBOL_NAME (BLOCK_FUNCTION (b))); fprintf (stderr, "\n"); fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK (b)); fprintf (stderr, "\t Symbols:"); ALL_BLOCK_SYMBOLS (b, iter, sym) { - fprintf (stderr, "\n\t\t "); - fprintf (stderr, " %s", SYMBOL_NAME (sym)); + if (i > 0 && i % 4 == 0) + fprintf (stderr, "\n\t\t "); + fprintf (stderr, " %s", DEPRECATED_SYMBOL_NAME (sym)); } fprintf (stderr, "\n"); } diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index d2b426c..45c156a 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -23,6 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "value.h" #include "gdbtypes.h" +struct block; + /* A macro to reorder the bytes of an address depending on the endiannes of the target */ #define EXTRACT_ADDRESS(x) ((void *) extract_address (&(x), sizeof (x))) diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index f6c92d9..1939354 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -1,5 +1,6 @@ /* Support for printing Ada types for GDB, the GNU debugger. - Copyright 1986, 1988, 1989, 1991, 1997 Free Software Foundation, Inc. + Copyright 1986, 1988, 1989, 1991, 1997, 2003 Free Software + Foundation, Inc. This file is part of GDB. diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 416c1d3..b63a92f 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -23,7 +23,6 @@ #include "frame.h" #include "inferior.h" #include "symtab.h" -#include "block.h" #include "value.h" #include "gdbcmd.h" #include "gdbcore.h" @@ -36,6 +35,7 @@ #include "doublest.h" #include "arch-utils.h" #include "osabi.h" +#include "block.h" #include "elf-bfd.h" @@ -69,13 +69,10 @@ static gdbarch_skip_prologue_ftype alpha_skip_prologue; static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call; static gdbarch_frame_chain_ftype alpha_frame_chain; static gdbarch_frame_saved_pc_ftype alpha_frame_saved_pc; -static gdbarch_frame_init_saved_regs_ftype alpha_frame_init_saved_regs; static gdbarch_push_arguments_ftype alpha_push_arguments; -static gdbarch_push_dummy_frame_ftype alpha_push_dummy_frame; static gdbarch_pop_frame_ftype alpha_pop_frame; static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy; -static gdbarch_init_extra_frame_info_ftype alpha_init_extra_frame_info; static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target; @@ -1823,9 +1820,9 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES); set_gdbarch_register_byte (gdbarch, alpha_register_byte); set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE); set_gdbarch_register_virtual_size (gdbarch, alpha_register_virtual_size); - set_gdbarch_max_register_virtual_size (gdbarch, + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, ALPHA_MAX_REGISTER_VIRTUAL_SIZE); set_gdbarch_register_virtual_type (gdbarch, alpha_register_virtual_type); @@ -1848,7 +1845,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, alpha_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, alpha_frame_saved_pc); - set_gdbarch_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs); set_gdbarch_use_struct_convention (gdbarch, alpha_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, alpha_extract_return_value); @@ -1873,7 +1870,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); set_gdbarch_frame_args_address (gdbarch, alpha_frame_args_address); set_gdbarch_frame_locals_address (gdbarch, alpha_frame_locals_address); - set_gdbarch_init_extra_frame_info (gdbarch, alpha_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, alpha_init_extra_frame_info); /* Alpha OSF/1 inhibits execution of code on the stack. But there is no need for a dummy on the Alpha. PUSH_ARGUMENTS takes care of all @@ -1884,7 +1881,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_push_dummy_frame (gdbarch, alpha_push_dummy_frame); + set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first); diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 1202df9..1016ba1 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -440,7 +440,13 @@ int generic_register_size (int regnum) { gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS); - return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum)); + if (gdbarch_register_type_p (current_gdbarch)) + return TYPE_LENGTH (gdbarch_register_type (current_gdbarch, regnum)); + else + /* FIXME: cagney/2003-03-01: Once all architectures implement + gdbarch_register_type(), this entire function can go away. It + is made obsolete by register_size(). */ + return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum)); /* OK */ } /* Assume all registers are adjacent. */ @@ -454,7 +460,7 @@ generic_register_byte (int regnum) byte = 0; for (i = 0; i < regnum; i++) { - byte += TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i)); + byte += generic_register_size (i); } return byte; } diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index e0d8a93..1ebe600 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -363,8 +363,8 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p) ALL_OBJFILE_MSYMBOLS (objfile, msym) { - if (SYMBOL_NAME (msym) - && strcmp (SYMBOL_NAME (msym), name) == 0) + if (DEPRECATED_SYMBOL_NAME (msym) + && strcmp (DEPRECATED_SYMBOL_NAME (msym), name) == 0) { *objfile_p = objfile; return msym; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index cb7d50d..11b2350 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1014,7 +1014,7 @@ arm_find_callers_reg (struct frame_info *fi, int regnum) } /* Function: frame_chain Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new - GDB frame struct, and then INIT_EXTRA_FRAME_INFO and + GDB frame struct, and then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be called for the new frame. For ARM, we save the frame size when we initialize the frame_info. */ @@ -1112,7 +1112,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* Determine whether or not we're in a sigtramp frame. Unfortunately, it isn't sufficient to test (get_frame_type (fi) == SIGTRAMP_FRAME) because this value is sometimes set after - invoking INIT_EXTRA_FRAME_INFO. So we test *both* + invoking DEPRECATED_INIT_EXTRA_FRAME_INFO. So we test *both* (get_frame_type (fi) == SIGTRAMP_FRAME) and PC_IN_SIGTRAMP to determine if we need to use the sigcontext addresses for the saved registers. @@ -2101,7 +2101,7 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info) static asymbol *asym; static combined_entry_type ce; static struct coff_symbol_struct csym; - static struct _bfd fake_bfd; + static struct bfd fake_bfd; static bfd_target fake_target; if (csym.native == NULL) @@ -2904,7 +2904,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frame handling. */ set_gdbarch_frame_chain_valid (gdbarch, arm_frame_chain_valid); - set_gdbarch_init_extra_frame_info (gdbarch, arm_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, arm_init_extra_frame_info); set_gdbarch_read_fp (gdbarch, arm_read_fp); set_gdbarch_frame_chain (gdbarch, arm_frame_chain); set_gdbarch_frameless_function_invocation @@ -2914,8 +2914,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_locals_address (gdbarch, arm_frame_locals_address); set_gdbarch_frame_num_args (gdbarch, arm_frame_num_args); set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs); set_gdbarch_pop_frame (gdbarch, arm_pop_frame); /* Address manipulation. */ @@ -2951,8 +2950,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS); set_gdbarch_register_raw_size (gdbarch, arm_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, arm_register_virtual_size); - set_gdbarch_max_register_raw_size (gdbarch, FP_REGISTER_RAW_SIZE); - set_gdbarch_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, FP_REGISTER_RAW_SIZE); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE); set_gdbarch_register_virtual_type (gdbarch, arm_register_type); /* Internal <-> external register number maps. */ diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index a4893ba..975132a 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -418,7 +418,8 @@ avr_convert_from_func_ptr_addr (CORE_ADDR addr) return addr * 2; } -/* avr_scan_prologue is also used as the frame_init_saved_regs(). +/* avr_scan_prologue is also used as the + deprecated_frame_init_saved_regs(). Put here the code to store, into fi->saved_regs, the addresses of the saved registers of frame described by FRAME_INFO. This @@ -892,34 +893,6 @@ avr_saved_pc_after_call (struct frame_info *frame) return (m2 | (m1 << 8)) * 2; } -/* Figure out where in REGBUF the called function has left its return value. - Copy that into VALBUF. */ - -static void -avr_extract_return_value (struct type *type, char *regbuf, char *valbuf) -{ - int wordsize, len; - - wordsize = 2; - - len = TYPE_LENGTH (type); - - switch (len) - { - case 1: /* (char) */ - case 2: /* (short), (int) */ - memcpy (valbuf, regbuf + REGISTER_BYTE (24), 2); - break; - case 4: /* (long), (float) */ - memcpy (valbuf, regbuf + REGISTER_BYTE (22), 4); - break; - case 8: /* (double) (doesn't seem to happen, which is good, - because this almost certainly isn't right. */ - error ("I don't know how a double is returned."); - break; - } -} - /* Returns the return address for a dummy. */ static CORE_ADDR @@ -928,35 +901,6 @@ avr_call_dummy_address (void) return entry_point_address (); } -/* Place the appropriate value in the appropriate registers. - Primarily used by the RETURN command. */ - -static void -avr_store_return_value (struct type *type, char *valbuf) -{ - int wordsize, len, regval; - - wordsize = 2; - - len = TYPE_LENGTH (type); - switch (len) - { - case 1: /* char */ - case 2: /* short, int */ - regval = extract_address (valbuf, len); - write_register (0, regval); - break; - case 4: /* long, float */ - regval = extract_address (valbuf, len); - write_register (0, regval >> 16); - write_register (1, regval & 0xffff); - break; - case 8: /* presumeably double, but doesn't seem to happen */ - error ("I don't know how to return a double."); - break; - } -} - /* Setup the return address for a dummy frame, as called by call_function_by_hand. Only necessary when you are using an empty CALL_DUMMY. */ @@ -1031,8 +975,8 @@ avr_frame_address (struct frame_info *fi) /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. + then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC + will be called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ @@ -1067,17 +1011,6 @@ avr_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) write_register (0, addr); } -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). */ - -static CORE_ADDR -avr_extract_struct_value_address (char *regbuf) -{ - return (extract_address ((regbuf) + REGISTER_BYTE (0), - REGISTER_RAW_SIZE (0)) | AVR_SMEM_START); -} - /* Setup the function arguments for calling a function in the inferior. On the AVR architecture, there are 18 registers (R25 to R8) which are @@ -1227,9 +1160,9 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES); set_gdbarch_register_byte (gdbarch, avr_register_byte); set_gdbarch_register_raw_size (gdbarch, avr_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); set_gdbarch_register_virtual_size (gdbarch, avr_register_virtual_size); - set_gdbarch_max_register_virtual_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); set_gdbarch_register_virtual_type (gdbarch, avr_register_virtual_type); set_gdbarch_print_insn (gdbarch, print_insn_avr); @@ -1248,23 +1181,16 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer); set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address); - set_gdbarch_deprecated_extract_return_value (gdbarch, avr_extract_return_value); set_gdbarch_push_arguments (gdbarch, avr_push_arguments); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, avr_push_return_address); set_gdbarch_pop_frame (gdbarch, avr_pop_frame); - set_gdbarch_deprecated_store_return_value (gdbarch, avr_store_return_value); - set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return); - set_gdbarch_deprecated_extract_struct_value_address - (gdbarch, avr_extract_struct_value_address); - set_gdbarch_frame_init_saved_regs (gdbarch, avr_scan_prologue); - set_gdbarch_init_extra_frame_info (gdbarch, avr_init_extra_frame_info); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, avr_scan_prologue); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, avr_init_extra_frame_info); set_gdbarch_skip_prologue (gdbarch, avr_skip_prologue); -/* set_gdbarch_prologue_frameless_p (gdbarch, avr_prologue_frameless_p); */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_decr_pc_after_break (gdbarch, 0); @@ -1353,7 +1279,10 @@ avr_io_reg_read_command (char *args, int from_tty) for (i = 0; i < nreg; i += step) { - j = step - (nreg % step); /* how many registers this round? */ + /* how many registers this round? */ + j = step; + if ((i+j) >= nreg) + j = nreg - i; /* last block is less than 8 registers */ snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j); target_query ((int) 'R', query, buf, &bufsiz); diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 62063f0..5692c35 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -22,7 +22,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "symfile.h" #include "gdbtypes.h" #include "value.h" @@ -34,6 +33,8 @@ #include "ax.h" #include "ax-gdb.h" #include "gdb_string.h" +#include "block.h" +#include "regcache.h" /* To make sense of this file, you should read doc/agentexpr.texi. Then look at the types and enums in ax-gdb.h. For the code itself, @@ -608,7 +609,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) case LOC_UNRESOLVED: { struct minimal_symbol *msym - = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL); + = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL); if (!msym) error ("Couldn't resolve symbol `%s'.", SYMBOL_PRINT_NAME (var)); @@ -618,6 +619,11 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) } break; + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + (*SYMBOL_LOCATION_FUNCS (var)->tracepoint_var_ref) (var, ax, value); + break; + case LOC_OPTIMIZED_OUT: error ("The variable `%s' has been optimized out.", SYMBOL_PRINT_NAME (var)); @@ -1590,7 +1596,7 @@ gen_expr (union exp_element **pc, struct agent_expr *ax, (*pc) += 3; value->kind = axs_lvalue_register; value->u.reg = reg; - value->type = REGISTER_VIRTUAL_TYPE (reg); + value->type = register_type (current_gdbarch, reg); } break; diff --git a/gdb/block.c b/gdb/block.c index d5e9a4b..eda282a 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -21,6 +21,8 @@ #include "defs.h" #include "block.h" +#include "symtab.h" +#include "symfile.h" #include "gdb_obstack.h" #include "cp-support.h" @@ -65,6 +67,96 @@ block_function (const struct block *bl) return BLOCK_FUNCTION (bl); } +/* Return the blockvector immediately containing the innermost lexical block + containing the specified pc value and section, or 0 if there is none. + PINDEX is a pointer to the index value of the block. If PINDEX + is NULL, we don't pass this information back to the caller. */ + +struct blockvector * +blockvector_for_pc_sect (register CORE_ADDR pc, struct sec *section, + int *pindex, struct symtab *symtab) +{ + register struct block *b; + register int bot, top, half; + struct blockvector *bl; + + if (symtab == 0) /* if no symtab specified by caller */ + { + /* First search all symtabs for one whose file contains our pc */ + if ((symtab = find_pc_sect_symtab (pc, section)) == 0) + return 0; + } + + bl = BLOCKVECTOR (symtab); + b = BLOCKVECTOR_BLOCK (bl, 0); + + /* Then search that symtab for the smallest block that wins. */ + /* Use binary search to find the last block that starts before PC. */ + + bot = 0; + top = BLOCKVECTOR_NBLOCKS (bl); + + while (top - bot > 1) + { + half = (top - bot + 1) >> 1; + b = BLOCKVECTOR_BLOCK (bl, bot + half); + if (BLOCK_START (b) <= pc) + bot += half; + else + top = bot + half; + } + + /* Now search backward for a block that ends after PC. */ + + while (bot >= 0) + { + b = BLOCKVECTOR_BLOCK (bl, bot); + if (BLOCK_END (b) > pc) + { + if (pindex) + *pindex = bot; + return bl; + } + bot--; + } + return 0; +} + +/* Return the blockvector immediately containing the innermost lexical block + containing the specified pc value, or 0 if there is none. + Backward compatibility, no section. */ + +struct blockvector * +blockvector_for_pc (register CORE_ADDR pc, int *pindex) +{ + return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc), + pindex, NULL); +} + +/* Return the innermost lexical block containing the specified pc value + in the specified section, or 0 if there is none. */ + +struct block * +block_for_pc_sect (register CORE_ADDR pc, struct sec *section) +{ + register struct blockvector *bl; + int index; + + bl = blockvector_for_pc_sect (pc, section, &index, NULL); + if (bl) + return BLOCKVECTOR_BLOCK (bl, index); + return 0; +} + +/* Return the innermost lexical block containing the specified pc value, + or 0 if there is none. Backward compatibility, no section. */ + +struct block * +block_for_pc (register CORE_ADDR pc) +{ + return block_for_pc_sect (pc, find_pc_mapped_section (pc)); +} + /* Now come some functions designed to deal with C++ namespace issues. The accessors are safe to use even in the non-C++ case. */ diff --git a/gdb/block.h b/gdb/block.h index af0d047..36d9601 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -25,6 +25,7 @@ /* Opaque declarations. */ struct symbol; +struct symtab; struct dictionary; struct namespace_info; struct using_direct; @@ -139,6 +140,15 @@ extern struct symbol *block_function (const struct block *); extern int contained_in (const struct block *, const struct block *); +extern struct blockvector *blockvector_for_pc (CORE_ADDR, int *); + +extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, asection *, + int *, struct symtab *); + +extern struct block *block_for_pc (CORE_ADDR); + +extern struct block *block_for_pc_sect (CORE_ADDR, asection *); + extern const char *block_scope (const struct block *block); extern void block_set_scope (struct block *block, const char *scope, diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 2d48e87..69ca9d8 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -24,7 +24,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "bfd.h" #include "symfile.h" #include "objfiles.h" @@ -39,6 +38,7 @@ #include "dummy-frame.h" #include "command.h" #include "gdbcmd.h" +#include "block.h" /* Prototypes for exported functions. */ @@ -258,96 +258,6 @@ get_frame_function (struct frame_info *frame) } -/* Return the blockvector immediately containing the innermost lexical block - containing the specified pc value and section, or 0 if there is none. - PINDEX is a pointer to the index value of the block. If PINDEX - is NULL, we don't pass this information back to the caller. */ - -struct blockvector * -blockvector_for_pc_sect (register CORE_ADDR pc, struct sec *section, - int *pindex, struct symtab *symtab) -{ - register struct block *b; - register int bot, top, half; - struct blockvector *bl; - - if (symtab == 0) /* if no symtab specified by caller */ - { - /* First search all symtabs for one whose file contains our pc */ - if ((symtab = find_pc_sect_symtab (pc, section)) == 0) - return 0; - } - - bl = BLOCKVECTOR (symtab); - b = BLOCKVECTOR_BLOCK (bl, 0); - - /* Then search that symtab for the smallest block that wins. */ - /* Use binary search to find the last block that starts before PC. */ - - bot = 0; - top = BLOCKVECTOR_NBLOCKS (bl); - - while (top - bot > 1) - { - half = (top - bot + 1) >> 1; - b = BLOCKVECTOR_BLOCK (bl, bot + half); - if (BLOCK_START (b) <= pc) - bot += half; - else - top = bot + half; - } - - /* Now search backward for a block that ends after PC. */ - - while (bot >= 0) - { - b = BLOCKVECTOR_BLOCK (bl, bot); - if (BLOCK_END (b) > pc) - { - if (pindex) - *pindex = bot; - return bl; - } - bot--; - } - return 0; -} - -/* Return the blockvector immediately containing the innermost lexical block - containing the specified pc value, or 0 if there is none. - Backward compatibility, no section. */ - -struct blockvector * -blockvector_for_pc (register CORE_ADDR pc, int *pindex) -{ - return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc), - pindex, NULL); -} - -/* Return the innermost lexical block containing the specified pc value - in the specified section, or 0 if there is none. */ - -struct block * -block_for_pc_sect (register CORE_ADDR pc, struct sec *section) -{ - register struct blockvector *bl; - int index; - - bl = blockvector_for_pc_sect (pc, section, &index, NULL); - if (bl) - return BLOCKVECTOR_BLOCK (bl, index); - return 0; -} - -/* Return the innermost lexical block containing the specified pc value, - or 0 if there is none. Backward compatibility, no section. */ - -struct block * -block_for_pc (register CORE_ADDR pc) -{ - return block_for_pc_sect (pc, find_pc_mapped_section (pc)); -} - /* Return the function containing pc value PC in section SECTION. Returns 0 if function is not known. */ @@ -454,7 +364,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, { cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f)); cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f)); - cache_pc_function_name = SYMBOL_NAME (f); + cache_pc_function_name = DEPRECATED_SYMBOL_NAME (f); cache_pc_function_section = section; goto return_cached_value; } @@ -475,7 +385,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, if (address) *address = SYMBOL_VALUE_ADDRESS (psb); if (name) - *name = SYMBOL_NAME (psb); + *name = DEPRECATED_SYMBOL_NAME (psb); /* endaddr non-NULL can't happen here. */ return 1; } @@ -506,7 +416,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, } cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol); - cache_pc_function_name = SYMBOL_NAME (msymbol); + cache_pc_function_name = DEPRECATED_SYMBOL_NAME (msymbol); cache_pc_function_section = section; /* Use the lesser of the next minimal symbol in the same section, or @@ -516,14 +426,14 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, other sections, to find the next symbol in this section with a different address. */ - for (i = 1; SYMBOL_NAME (msymbol + i) != NULL; i++) + for (i = 1; DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL; i++) { if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol) && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol)) break; } - if (SYMBOL_NAME (msymbol + i) != NULL + if (DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr) cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + i); else diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 298cbca..5104c3d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -24,7 +24,6 @@ #include "defs.h" #include <ctype.h> #include "symtab.h" -#include "block.h" #include "frame.h" #include "breakpoint.h" #include "gdbtypes.h" @@ -50,6 +49,7 @@ #include "cli/cli-script.h" #include "dictionary.h" #include "gdb_assert.h" +#include "block.h" #include "gdb-events.h" @@ -5830,7 +5830,7 @@ get_catch_sals (int this_level_only) ALL_BLOCK_SYMBOLS (b, iter, sym) { - if (STREQ (SYMBOL_NAME (sym), "default")) + if (STREQ (DEPRECATED_SYMBOL_NAME (sym), "default")) { if (have_default) continue; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index d5d6171..e8c8750 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -28,6 +28,7 @@ #include "gdb-events.h" struct value; +struct block; /* This is the maximum number of bytes a breakpoint instruction can take. Feel free to increase it. It's just used in a few places to size diff --git a/gdb/buildsym.c b/gdb/buildsym.c index dce50f1..a6cbf77 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -205,7 +205,7 @@ find_symbol_in_list (struct pending *list, char *name, int length) { for (j = list->nsyms; --j >= 0;) { - pp = SYMBOL_NAME (list->symbol[j]); + pp = DEPRECATED_SYMBOL_NAME (list->symbol[j]); if (*pp == *name && strncmp (pp, name, length) == 0 && pp[length] == '\0') { @@ -366,6 +366,7 @@ finish_block (struct symbol *symbol, struct pending **listhead, case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: case LOC_LOCAL_ARG: + case LOC_COMPUTED_ARG: nparams++; break; case LOC_UNDEF: @@ -381,6 +382,7 @@ finish_block (struct symbol *symbol, struct pending **listhead, case LOC_BASEREG: case LOC_UNRESOLVED: case LOC_OPTIMIZED_OUT: + case LOC_COMPUTED: default: break; } @@ -405,6 +407,7 @@ finish_block (struct symbol *symbol, struct pending **listhead, case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: case LOC_LOCAL_ARG: + case LOC_COMPUTED_ARG: TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym); TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0; iparams++; @@ -422,6 +425,7 @@ finish_block (struct symbol *symbol, struct pending **listhead, case LOC_BASEREG: case LOC_UNRESOLVED: case LOC_OPTIMIZED_OUT: + case LOC_COMPUTED: default: break; } diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 30f6e83..1eb8239 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -43,7 +43,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <ctype.h> #include "expression.h" #include "value.h" -#include "block.h" #include "parser-defs.h" #include "language.h" #include "c-lang.h" @@ -51,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ #include "charset.h" +#include "block.h" /* Flag indicating we're dealing with HP-compiled objects */ extern int hp_som_som_object_present; diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 0e74575..108329a 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1,6 +1,6 @@ /* GDB CLI commands. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -852,7 +852,9 @@ disassemble_command (char *arg, int from_tty) if (find_pc_partial_function (pc, &name, &low, &high) == 0) error ("No function contains program counter for selected frame.\n"); #if defined(TUI) - else if (tui_version) + /* NOTE: cagney/2003-02-13 The `tui_active' was previously + `tui_version'. */ + else if (tui_active) low = tuiGetLowDisassemblyAddress (low, pc); #endif low += FUNCTION_START_OFFSET; @@ -864,7 +866,9 @@ disassemble_command (char *arg, int from_tty) if (find_pc_partial_function (pc, &name, &low, &high) == 0) error ("No function contains specified address.\n"); #if defined(TUI) - else if (tui_version) + /* NOTE: cagney/2003-02-13 The `tui_active' was previously + `tui_version'. */ + else if (tui_active) low = tuiGetLowDisassemblyAddress (low, pc); #endif low += FUNCTION_START_OFFSET; diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index bce0c2d..2a6d196 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -923,10 +923,14 @@ lookup_cmd_1 (char **text, struct cmd_list_element *clist, /* Treating underscores as part of command words is important so that "set args_foo()" doesn't get interpreted as "set args _foo()". */ + /* NOTE: cagney/2003-02-13 The `tui_active' was previously + `tui_version'. */ for (p = *text; *p && (isalnum (*p) || *p == '-' || *p == '_' || - (tui_version && +#if defined(TUI) + (tui_active && (*p == '+' || *p == '<' || *p == '>' || *p == '$')) || +#endif (xdb_commands && (*p == '!' || *p == '/' || *p == '?'))); p++) ; @@ -1293,10 +1297,14 @@ lookup_cmd_composition (char *text, /* Treating underscores as part of command words is important so that "set args_foo()" doesn't get interpreted as "set args _foo()". */ + /* NOTE: cagney/2003-02-13 The `tui_active' was previously + `tui_version'. */ for (p = text; *p && (isalnum (*p) || *p == '-' || *p == '_' || - (tui_version && +#if defined(TUI) + (tui_active && (*p == '+' || *p == '<' || *p == '>' || *p == '$')) || +#endif (xdb_commands && (*p == '!' || *p == '/' || *p == '?'))); p++) ; diff --git a/gdb/coffread.c b/gdb/coffread.c index 803afd8..f5eb127 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -23,7 +23,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "demangle.h" #include "breakpoint.h" @@ -45,6 +44,9 @@ #include "complaints.h" #include "target.h" #include "gdb_assert.h" +#include "block.h" + +#include "coff-pe-read.h" #include "dictionary.h" extern void _initialize_coffread (void); @@ -524,7 +526,7 @@ coff_symfile_read (struct objfile *objfile, int mainline) unsigned int num_symbols; int symtab_offset; int stringtab_offset; - struct cleanup *back_to; + struct cleanup *back_to, *cleanup_minimal_symbols; int stabstrsize; int len; char * target; @@ -604,7 +606,7 @@ coff_symfile_read (struct objfile *objfile, int mainline) error ("\"%s\": can't get string table", name); init_minimal_symbol_collection (); - make_cleanup_discard_minimal_symbols (); + cleanup_minimal_symbols = make_cleanup_discard_minimal_symbols (); /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ @@ -616,6 +618,9 @@ coff_symfile_read (struct objfile *objfile, int mainline) install_minimal_symbols (objfile); + /* Free the installed minimal symbol data. */ + do_cleanups (cleanup_minimal_symbols); + bfd_map_over_sections (abfd, coff_locate_sections, (void *) info); if (info->stabsects) @@ -1087,6 +1092,13 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, } } + if ((nsyms == 0) && (pe_file)) + { + /* We've got no debugging symbols, but it's is a portable + executable, so try to read the export table */ + read_pe_exported_syms (objfile); + } + if (last_source_file) coff_end_symtab (objfile); @@ -1417,15 +1429,15 @@ patch_opaque_types (struct symtab *s) TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0) { - register char *name = SYMBOL_NAME (real_sym); + register char *name = DEPRECATED_SYMBOL_NAME (real_sym); register int hash = hashname (name); register struct symbol *sym, *prev; prev = 0; for (sym = opaque_type_chain[hash]; sym;) { - if (name[0] == SYMBOL_NAME (sym)[0] && - STREQ (name + 1, SYMBOL_NAME (sym) + 1)) + if (name[0] == DEPRECATED_SYMBOL_NAME (sym)[0] && + STREQ (name + 1, DEPRECATED_SYMBOL_NAME (sym) + 1)) { if (prev) { @@ -1627,7 +1639,7 @@ process_coff_symbol (register struct coff_symbol *cs, } else TYPE_NAME (SYMBOL_TYPE (sym)) = - concat (SYMBOL_NAME (sym), NULL); + concat (DEPRECATED_SYMBOL_NAME (sym), NULL); } #ifdef CXUX_TARGET /* Ignore vendor section for Harris CX/UX targets. */ @@ -1645,7 +1657,7 @@ process_coff_symbol (register struct coff_symbol *cs, TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) != TYPE_CODE_UNDEF) { - register int i = hashname (SYMBOL_NAME (sym)); + register int i = hashname (DEPRECATED_SYMBOL_NAME (sym)); SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i]; opaque_type_chain[i] = sym; @@ -1663,11 +1675,11 @@ process_coff_symbol (register struct coff_symbol *cs, names for anonymous enums, structures, and unions, like "~0fake" or ".0fake". Thanks, but no thanks... */ if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0) - if (SYMBOL_NAME (sym) != NULL - && *SYMBOL_NAME (sym) != '~' - && *SYMBOL_NAME (sym) != '.') + if (DEPRECATED_SYMBOL_NAME (sym) != NULL + && *DEPRECATED_SYMBOL_NAME (sym) != '~' + && *DEPRECATED_SYMBOL_NAME (sym) != '.') TYPE_TAG_NAME (SYMBOL_TYPE (sym)) = - concat (SYMBOL_NAME (sym), NULL); + concat (DEPRECATED_SYMBOL_NAME (sym), NULL); add_symbol_to_list (sym, &file_symbols); break; @@ -2063,7 +2075,7 @@ coff_read_enum_type (int index, int length, int lastsym) sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = + DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), ¤t_objfile->symbol_obstack); SYMBOL_CLASS (sym) = LOC_CONST; @@ -2111,7 +2123,7 @@ coff_read_enum_type (int index, int length, int lastsym) { struct symbol *xsym = syms->symbol[j]; SYMBOL_TYPE (xsym) = type; - TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym); TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); if (SYMBOL_VALUE (xsym) < 0) unsigned_enum = 0; diff --git a/gdb/config.in b/gdb/config.in index 06f4670..4500519 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -431,6 +431,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC +/* Define to 1 if your system has the _etext variable. */ +#undef HAVE__ETEXT + /* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on Solaris 2.[78] when using GCC. */ #undef _MSE_INT_H @@ -441,6 +444,9 @@ /* Define to 1 if the regex included in libiberty should be used. */ #undef USE_INCLUDED_REGEX +/* Define if <stdint.h> provides the uintptr_t type. */ +#undef HAVE_UINTPTR_T + /* Define if malloc is not declared in system header files. */ #undef NEED_DECLARATION_MALLOC diff --git a/gdb/config/i386/nm-i386.h b/gdb/config/i386/nm-i386.h index eed05a4..97a7053 100644 --- a/gdb/config/i386/nm-i386.h +++ b/gdb/config/i386/nm-i386.h @@ -93,7 +93,7 @@ extern int i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow); one that caused the trap. Therefore we don't need to step over it. But we do need to reset the status register to avoid another trap. */ -#define HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_CONTINUABLE_WATCHPOINT 1 #define STOPPED_BY_WATCHPOINT(W) (i386_stopped_data_address () != 0) diff --git a/gdb/config/i386/nm-i386sco5.h b/gdb/config/i386/nm-i386sco5.h index 37a4b16..65f3176 100644 --- a/gdb/config/i386/nm-i386sco5.h +++ b/gdb/config/i386/nm-i386sco5.h @@ -63,7 +63,7 @@ extern int kernel_u_size (void); /* After a watchpoint trap, the PC points to the instruction which caused the trap. But we can continue over it without disabling the trap. */ -#define HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_CONTINUABLE_WATCHPOINT 1 #define HAVE_STEPPABLE_WATCHPOINT #define STOPPED_BY_WATCHPOINT(W) \ diff --git a/gdb/config/i386/nm-i386sol2.h b/gdb/config/i386/nm-i386sol2.h index 8a51942..aeb89a2 100644 --- a/gdb/config/i386/nm-i386sol2.h +++ b/gdb/config/i386/nm-i386sol2.h @@ -32,7 +32,7 @@ /* When a hardware watchpoint fires off the PC will be left at the instruction following the one which caused the watchpoint. It will *NOT* be necessary for GDB to step over the watchpoint. */ -#define HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_CONTINUABLE_WATCHPOINT 1 /* Solaris x86 2.6 and 2.7 targets have a kernel bug when stepping over an instruction that causes a page fault without triggering diff --git a/gdb/config/i386/tm-ptx.h b/gdb/config/i386/tm-ptx.h index 6a75298..80026e3 100644 --- a/gdb/config/i386/tm-ptx.h +++ b/gdb/config/i386/tm-ptx.h @@ -136,8 +136,8 @@ extern int ptx_register_u_addr (int, int); /* Largest value REGISTER_RAW_SIZE can have. */ -#undef MAX_REGISTER_RAW_SIZE -#define MAX_REGISTER_RAW_SIZE 10 +#undef DEPRECATED_MAX_REGISTER_RAW_SIZE +#define DEPRECATED_MAX_REGISTER_RAW_SIZE 10 /* Nonzero if register N requires conversion from raw format to virtual format. */ diff --git a/gdb/config/ia64/tm-ia64.h b/gdb/config/ia64/tm-ia64.h index d08e59b..9ebe9ae 100644 --- a/gdb/config/ia64/tm-ia64.h +++ b/gdb/config/ia64/tm-ia64.h @@ -66,7 +66,7 @@ /* Largest value REGISTER_RAW_SIZE can have. */ -#define MAX_REGISTER_RAW_SIZE 16 +#define DEPRECATED_MAX_REGISTER_RAW_SIZE 16 #define GDBSERVER_RESUME_REGS { IA64_IP_REGNUM, IA64_PSR_REGNUM, SP_REGNUM, IA64_BSP_REGNUM, IA64_CFM_REGNUM } diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 1b9e770..dc23a63 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -302,13 +302,13 @@ extern int hppa_register_byte (int reg_nr); /* Largest value REGISTER_RAW_SIZE can have. */ #if !GDB_MULTI_ARCH -#define MAX_REGISTER_RAW_SIZE 4 +#define DEPRECATED_MAX_REGISTER_RAW_SIZE 4 #endif /* Largest value REGISTER_VIRTUAL_SIZE can have. */ #if !GDB_MULTI_ARCH -#define MAX_REGISTER_VIRTUAL_SIZE 8 +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8 #endif #if !GDB_MULTI_ARCH @@ -383,7 +383,7 @@ extern int hppa_cannot_store_register (int regnum); #endif #if !GDB_MULTI_ARCH -#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame) +#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame) extern void hppa_init_extra_frame_info (int, struct frame_info *); #endif @@ -453,11 +453,11 @@ extern void hppa_frame_find_saved_regs (struct frame_info *, /* Push an empty stack frame, to record the current PC, etc. */ /* FIXME: brobecker 2002-12-26. This macro definition takes advantage - of the fact that PUSH_DUMMY_FRAME is called within a function where - a variable inf_status of type struct inferior_status * is defined. - Ugh! Until this is fixed, we will not be able to move to multiarch - partial. */ -#define PUSH_DUMMY_FRAME hppa_push_dummy_frame (inf_status) + of the fact that DEPRECATED_PUSH_DUMMY_FRAME is called within a + function where a variable inf_status of type struct inferior_status + * is defined. Ugh! Until this is fixed, we will not be able to + move to multiarch partial. */ +#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame (inf_status) extern void hppa_push_dummy_frame (struct inferior_status *); /* Discard from the stack the innermost frame, diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 775055f..e6177b0 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -51,8 +51,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Largest value REGISTER_RAW_SIZE can have. */ -#undef MAX_REGISTER_RAW_SIZE -#define MAX_REGISTER_RAW_SIZE 8 +#undef DEPRECATED_MAX_REGISTER_RAW_SIZE +#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8 /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ diff --git a/gdb/config/s390/nm-linux.h b/gdb/config/s390/nm-linux.h index 3846579..727a66eb 100644 --- a/gdb/config/s390/nm-linux.h +++ b/gdb/config/s390/nm-linux.h @@ -51,7 +51,7 @@ extern int kernel_u_size (void); /* WATCHPOINT SPECIFIC STUFF */ #define TARGET_HAS_HARDWARE_WATCHPOINTS -#define HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_CONTINUABLE_WATCHPOINT 1 #define target_insert_watchpoint(addr, len, type) \ s390_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type) diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h index 3cad417..8ad58a1 100644 --- a/gdb/config/sparc/nm-sun4sol2.h +++ b/gdb/config/sparc/nm-sun4sol2.h @@ -51,7 +51,7 @@ /* When a hardware watchpoint fires off the PC will be left at the instruction following the one which caused the watchpoint. It will *NOT* be necessary for GDB to step over the watchpoint. */ -#define HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_CONTINUABLE_WATCHPOINT 1 extern int procfs_stopped_by_watchpoint (ptid_t); #define STOPPED_BY_WATCHPOINT(W) \ diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index e8f5656..691e38f 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -400,14 +400,14 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int); /* Largest value REGISTER_RAW_SIZE can have. */ /* tm-sparc.h defines this as 8, but play it safe. */ -#undef MAX_REGISTER_RAW_SIZE -#define MAX_REGISTER_RAW_SIZE 8 +#undef DEPRECATED_MAX_REGISTER_RAW_SIZE +#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8 /* Largest value REGISTER_VIRTUAL_SIZE can have. */ /* tm-sparc.h defines this as 8, but play it safe. */ -#undef MAX_REGISTER_VIRTUAL_SIZE -#define MAX_REGISTER_VIRTUAL_SIZE 8 +#undef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8 /* Return the GDB type object for the "standard" data type of data in register N. */ diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 05495ed..20d5b37 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -227,11 +227,11 @@ extern int sparc_intreg_size (void); /* Largest value REGISTER_RAW_SIZE can have. */ -#define MAX_REGISTER_RAW_SIZE 8 +#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8 /* Largest value REGISTER_VIRTUAL_SIZE can have. */ -#define MAX_REGISTER_VIRTUAL_SIZE 8 +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8 /* Return the GDB type object for the "standard" data type of data in register N. */ @@ -466,9 +466,9 @@ void sparc_get_saved_register (char *raw_buffer, sparc_get_saved_register (RAW_BUFFER, OPTIMIZED, ADDRP, \ FRAME, REGNUM, LVAL) -#define FRAME_INIT_SAVED_REGS(FP) /*no-op */ +#define DEPRECATED_FRAME_INIT_SAVED_REGS(FP) /*no-op */ -#define INIT_EXTRA_FRAME_INFO(FROMLEAF, FCI) \ +#define DEPRECATED_INIT_EXTRA_FRAME_INFO(FROMLEAF, FCI) \ sparc_init_extra_frame_info (FROMLEAF, FCI) extern void sparc_init_extra_frame_info (int, struct frame_info *); @@ -509,8 +509,13 @@ extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *); sparc_print_extra_frame_info (FI) extern void sparc_print_extra_frame_info (struct frame_info *); -/* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */ +/* DEPRECATED_INIT_EXTRA_FRAME_INFO needs the PC to detect flat + frames. */ +/* NOTE: cagney/2002-12-08: Add local declaration of + init_frame_pc_noop() because it isn't possible to include + "arch-utils.h" here. */ +extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); #define DEPRECATED_INIT_FRAME_PC(FROMLEAF, PREV) (init_frame_pc_noop (FROMLEAF, PREV)) #define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \ ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \ @@ -578,18 +583,18 @@ extern void sparc_print_extra_frame_info (struct frame_info *); * I understand everything in this picture except what the space * between fp - 0xe0 and fp - 0x140 is used for. Oh, and I don't * understand why there's a large chunk of CALL_DUMMY that never gets - * executed (its function is superceeded by PUSH_DUMMY_FRAME; they - * are designed to do the same thing). + * executed (its function is superceeded by + * DEPRECATED_PUSH_DUMMY_FRAME; they are designed to do the same + * thing). * - * PUSH_DUMMY_FRAME saves the registers above sp' and pushes the - * register file stack down one. + * DEPRECATED_PUSH_DUMMY_FRAME saves the registers above sp' and + * pushes the * register file stack down one. * * call_function then writes CALL_DUMMY, pushes the args onto the * stack, and adjusts the stack pointer. * * run_stack_dummy then starts execution (in the middle of - * CALL_DUMMY, as directed by call_function). - */ + * CALL_DUMMY, as directed by call_function). */ #ifndef CALL_DUMMY /* This sequence of words is the instructions @@ -677,7 +682,7 @@ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, /* Push an empty stack frame, to record the current PC, etc. */ -#define PUSH_DUMMY_FRAME sparc_push_dummy_frame () +#define DEPRECATED_PUSH_DUMMY_FRAME sparc_push_dummy_frame () #define POP_FRAME sparc_pop_frame () void sparc_push_dummy_frame (void); diff --git a/gdb/configure b/gdb/configure index b16718a..207381a 100755 --- a/gdb/configure +++ b/gdb/configure @@ -3165,6 +3165,40 @@ else fi done +echo $ac_n "checking for _etext""... $ac_c" 1>&6 +echo "configure:3170: checking for _etext" >&5 +if eval "test \"`echo '$''{'ac_cv_var__etext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3175 "configure" +#include "confdefs.h" +#include <stdlib.h> +extern char _etext; + +int main() { +free (&_etext); +; return 0; } +EOF +if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_var__etext=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_var__etext=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_var__etext" 1>&6 +if test $ac_cv_var__etext = yes; then + cat >> confdefs.h <<\EOF +#define HAVE__ETEXT 1 +EOF + +fi if test "$enable_profiling" = yes ; then if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then { echo "configure: error: --enable-profiling requires monstartup and _mcleanup" 1>&2; exit 1; } @@ -3174,19 +3208,19 @@ if test "$enable_profiling" = yes ; then CFLAGS="$CFLAGS $PROFILE_CFLAGS" echo $ac_n "checking whether $CC supports -pg""... $ac_c" 1>&6 -echo "configure:3178: checking whether $CC supports -pg" >&5 +echo "configure:3212: checking whether $CC supports -pg" >&5 if eval "test \"`echo '$''{'ac_cv_cc_supports_pg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3183 "configure" +#line 3217 "configure" #include "confdefs.h" int main() { int x; ; return 0; } EOF -if { (eval echo configure:3190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cc_supports_pg=yes else @@ -3216,7 +3250,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3220: checking for $ac_word" >&5 +echo "configure:3254: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3257,7 +3291,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./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:3261: checking for a BSD compatible install" >&5 +echo "configure:3295: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3310,7 +3344,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3314: checking whether ln -s works" >&5 +echo "configure:3348: 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 else @@ -3333,7 +3367,7 @@ fi # 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:3337: checking for $ac_word" >&5 +echo "configure:3371: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3365,7 +3399,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3369: checking for $ac_word" >&5 +echo "configure:3403: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3399,7 +3433,7 @@ test -n "$YACC" || YACC="yacc" # 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3403: checking for $ac_word" >&5 +echo "configure:3437: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3431,7 +3465,7 @@ fi # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3435: checking for $ac_word" >&5 +echo "configure:3469: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3463,7 +3497,7 @@ fi # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3467: checking for $ac_word" >&5 +echo "configure:3501: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3497,7 +3531,7 @@ fi # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3501: checking for $ac_word" >&5 +echo "configure:3535: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3533,7 +3567,7 @@ fi # We might need to link with -lm; most simulators need it. echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:3537: checking for main in -lm" >&5 +echo "configure:3571: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3541,14 +3575,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 3545 "configure" +#line 3579 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3581,12 +3615,12 @@ fi # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 # is known to have this problem). Therefore we avoid libw if we can. echo $ac_n "checking for wctype""... $ac_c" 1>&6 -echo "configure:3585: checking for wctype" >&5 +echo "configure:3619: checking for wctype" >&5 if eval "test \"`echo '$''{'ac_cv_func_wctype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3590 "configure" +#line 3624 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char wctype(); below. */ @@ -3609,7 +3643,7 @@ wctype(); ; return 0; } EOF -if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_wctype=yes" else @@ -3627,7 +3661,7 @@ if eval "test \"`echo '$ac_cv_func_'wctype`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:3631: checking for wctype in -lw" >&5 +echo "configure:3665: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3635,7 +3669,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <<EOF -#line 3639 "configure" +#line 3673 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3646,7 +3680,7 @@ int main() { wctype() ; return 0; } EOF -if { (eval echo configure:3650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3679,14 +3713,14 @@ fi # Some systems (e.g. Solaris) have `socketpair' in libsocket. echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6 -echo "configure:3683: checking for library containing socketpair" >&5 +echo "configure:3717: checking for library containing socketpair" >&5 if eval "test \"`echo '$''{'ac_cv_search_socketpair'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_socketpair="no" cat > conftest.$ac_ext <<EOF -#line 3690 "configure" +#line 3724 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3697,7 +3731,7 @@ int main() { socketpair() ; return 0; } EOF -if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socketpair="none required" else @@ -3708,7 +3742,7 @@ rm -f conftest* test "$ac_cv_search_socketpair" = "no" && for i in socket; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 3712 "configure" +#line 3746 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3719,7 +3753,7 @@ int main() { socketpair() ; return 0; } EOF -if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socketpair="-l$i" break @@ -3755,14 +3789,14 @@ fi if test "$need_curses" = yes; then echo $ac_n "checking for library containing initscr""... $ac_c" 1>&6 -echo "configure:3759: checking for library containing initscr" >&5 +echo "configure:3793: checking for library containing initscr" >&5 if eval "test \"`echo '$''{'ac_cv_search_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_initscr="no" cat > conftest.$ac_ext <<EOF -#line 3766 "configure" +#line 3800 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3773,7 +3807,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_initscr="none required" else @@ -3784,7 +3818,7 @@ rm -f conftest* test "$ac_cv_search_initscr" = "no" && for i in ncurses Hcurses curses; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 3788 "configure" +#line 3822 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3795,7 +3829,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_initscr="-l$i" break @@ -3832,14 +3866,14 @@ case $host_os in # ??? Why? echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:3836: checking for library containing tgetent" >&5 +echo "configure:3870: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <<EOF -#line 3843 "configure" +#line 3877 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3850,7 +3884,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -3861,7 +3895,7 @@ rm -f conftest* test "$ac_cv_search_tgetent" = "no" && for i in tinfo ncurses curses termcap; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 3865 "configure" +#line 3899 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3872,7 +3906,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:3876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -3899,14 +3933,14 @@ esac # Readline doesn't, so I think we're safe with leaving them out. echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:3903: checking for library containing tgetent" >&5 +echo "configure:3937: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <<EOF -#line 3910 "configure" +#line 3944 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3917,7 +3951,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -3928,7 +3962,7 @@ rm -f conftest* test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo ncurses Hcurses curses; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 3932 "configure" +#line 3966 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3939,7 +3973,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:3943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -3973,12 +4007,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3977: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4011: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3982 "configure" +#line 4016 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -3986,7 +4020,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4011,7 +4045,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4015: checking for opendir in -ldir" >&5 +echo "configure:4049: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4019,7 +4053,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4023 "configure" +#line 4057 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4030,7 +4064,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4052,7 +4086,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4056: checking for opendir in -lx" >&5 +echo "configure:4090: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4060,7 +4094,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4064 "configure" +#line 4098 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4071,7 +4105,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4094,12 +4128,12 @@ fi fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:4098: checking whether stat file-mode macros are broken" >&5 +echo "configure:4132: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4103 "configure" +#line 4137 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -4150,12 +4184,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4154: checking for ANSI C header files" >&5 +echo "configure:4188: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4159 "configure" +#line 4193 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -4163,7 +4197,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4180,7 +4214,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4184 "configure" +#line 4218 "configure" #include "confdefs.h" #include <string.h> EOF @@ -4198,7 +4232,7 @@ 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 <<EOF -#line 4202 "configure" +#line 4236 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4219,7 +4253,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 4223 "configure" +#line 4257 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4230,7 +4264,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4257,17 +4291,17 @@ for ac_hdr in link.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4261: checking for $ac_hdr" >&5 +echo "configure:4295: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4266 "configure" +#line 4300 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4297,17 +4331,17 @@ for ac_hdr in nlist.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4301: checking for $ac_hdr" >&5 +echo "configure:4335: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4306 "configure" +#line 4340 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4337,17 +4371,17 @@ for ac_hdr in poll.h sys/poll.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4341: checking for $ac_hdr" >&5 +echo "configure:4375: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4346 "configure" +#line 4380 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4377,17 +4411,17 @@ for ac_hdr in proc_service.h thread_db.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4381: checking for $ac_hdr" >&5 +echo "configure:4415: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4386 "configure" +#line 4420 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4417,17 +4451,17 @@ for ac_hdr in stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4421: checking for $ac_hdr" >&5 +echo "configure:4455: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4426 "configure" +#line 4460 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4457,17 +4491,17 @@ for ac_hdr in stdlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4461: checking for $ac_hdr" >&5 +echo "configure:4495: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4466 "configure" +#line 4500 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4497,17 +4531,17 @@ for ac_hdr in stdint.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4501: checking for $ac_hdr" >&5 +echo "configure:4535: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4506 "configure" +#line 4540 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4537,17 +4571,17 @@ for ac_hdr in string.h memory.h strings.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4541: checking for $ac_hdr" >&5 +echo "configure:4575: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4546 "configure" +#line 4580 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4577,17 +4611,17 @@ for ac_hdr in sys/fault.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4581: checking for $ac_hdr" >&5 +echo "configure:4615: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4586 "configure" +#line 4620 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4617,17 +4651,17 @@ for ac_hdr in sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4621: checking for $ac_hdr" >&5 +echo "configure:4655: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4626 "configure" +#line 4660 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4657,17 +4691,17 @@ for ac_hdr in sys/filio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4661: checking for $ac_hdr" >&5 +echo "configure:4695: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4666 "configure" +#line 4700 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4697,17 +4731,17 @@ for ac_hdr in sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4701: checking for $ac_hdr" >&5 +echo "configure:4735: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4706 "configure" +#line 4740 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4737,17 +4771,17 @@ for ac_hdr in sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4741: checking for $ac_hdr" >&5 +echo "configure:4775: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4746 "configure" +#line 4780 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4777,17 +4811,17 @@ for ac_hdr in sys/proc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4781: checking for $ac_hdr" >&5 +echo "configure:4815: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4786 "configure" +#line 4820 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4817,17 +4851,17 @@ for ac_hdr in sys/procfs.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4821: checking for $ac_hdr" >&5 +echo "configure:4855: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4826 "configure" +#line 4860 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4857,17 +4891,17 @@ for ac_hdr in sys/ptrace.h ptrace.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4861: checking for $ac_hdr" >&5 +echo "configure:4895: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4866 "configure" +#line 4900 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4897,17 +4931,17 @@ for ac_hdr in sys/reg.h sys/debugreg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4901: checking for $ac_hdr" >&5 +echo "configure:4935: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4906 "configure" +#line 4940 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4937,17 +4971,17 @@ for ac_hdr in sys/select.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4941: checking for $ac_hdr" >&5 +echo "configure:4975: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4946 "configure" +#line 4980 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4977,17 +5011,17 @@ for ac_hdr in sys/syscall.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4981: checking for $ac_hdr" >&5 +echo "configure:5015: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4986 "configure" +#line 5020 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5017,17 +5051,17 @@ for ac_hdr in sys/user.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5021: checking for $ac_hdr" >&5 +echo "configure:5055: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5026 "configure" +#line 5060 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5057,17 +5091,17 @@ for ac_hdr in sys/wait.h wait.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5061: checking for $ac_hdr" >&5 +echo "configure:5095: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5066 "configure" +#line 5100 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5097,17 +5131,17 @@ for ac_hdr in termios.h termio.h sgtty.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5101: checking for $ac_hdr" >&5 +echo "configure:5135: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5106 "configure" +#line 5140 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5137,17 +5171,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5141: checking for $ac_hdr" >&5 +echo "configure:5175: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5146 "configure" +#line 5180 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5190,17 +5224,17 @@ for ac_hdr in curses.h ncurses.h term.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5194: checking for $ac_hdr" >&5 +echo "configure:5228: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5199 "configure" +#line 5233 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5233,17 +5267,17 @@ for ac_hdr in ctype.h time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5237: checking for $ac_hdr" >&5 +echo "configure:5271: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5242 "configure" +#line 5276 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5275,12 +5309,12 @@ done # ------------------ # echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5279: checking return type of signal handlers" >&5 +echo "configure:5313: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5284 "configure" +#line 5318 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -5297,7 +5331,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5321,12 +5355,12 @@ EOF # ------------------------------------- # echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5325: checking for working const" >&5 +echo "configure:5359: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5330 "configure" +#line 5364 "configure" #include "confdefs.h" int main() { @@ -5375,7 +5409,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:5379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5396,21 +5430,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5400: checking for inline" >&5 +echo "configure:5434: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 5407 "configure" +#line 5441 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:5414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5443,19 +5477,19 @@ esac # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5447: checking for working alloca.h" >&5 +echo "configure:5481: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5452 "configure" +#line 5486 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5476,12 +5510,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5480: checking for alloca" >&5 +echo "configure:5514: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5485 "configure" +#line 5519 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -5509,7 +5543,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5541,12 +5575,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5545: checking whether alloca needs Cray hooks" >&5 +echo "configure:5579: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5550 "configure" +#line 5584 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -5571,12 +5605,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5575: checking for $ac_func" >&5 +echo "configure:5609: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5580 "configure" +#line 5614 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5599,7 +5633,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5626,7 +5660,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5630: checking stack direction for C alloca" >&5 +echo "configure:5664: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5634,7 +5668,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 5638 "configure" +#line 5672 "configure" #include "confdefs.h" find_stack_direction () { @@ -5653,7 +5687,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:5657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5678,17 +5712,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5682: checking for $ac_hdr" >&5 +echo "configure:5716: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5687 "configure" +#line 5721 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5717,12 +5751,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5721: checking for $ac_func" >&5 +echo "configure:5755: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5726 "configure" +#line 5760 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5745,7 +5779,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5770,7 +5804,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5774: checking for working mmap" >&5 +echo "configure:5808: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5778,7 +5812,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 5782 "configure" +#line 5816 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -5918,7 +5952,7 @@ main() } EOF -if { (eval echo configure:5922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -5941,12 +5975,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5945: checking for pid_t" >&5 +echo "configure:5979: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5950 "configure" +#line 5984 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5975,17 +6009,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:5979: checking for vfork.h" >&5 +echo "configure:6013: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5984 "configure" +#line 6018 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6010,18 +6044,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:6014: checking for working vfork" >&5 +echo "configure:6048: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:6020: checking for vfork" >&5 +echo "configure:6054: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6025 "configure" +#line 6059 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -6044,7 +6078,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:6048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -6066,7 +6100,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 6070 "configure" +#line 6104 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -6161,7 +6195,7 @@ main() { } } EOF -if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -6186,12 +6220,12 @@ fi for ac_func in canonicalize_file_name realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6190: checking for $ac_func" >&5 +echo "configure:6224: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6195 "configure" +#line 6229 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6214,7 +6248,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6241,12 +6275,12 @@ done for ac_func in poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6245: checking for $ac_func" >&5 +echo "configure:6279: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6250 "configure" +#line 6284 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6269,7 +6303,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6296,12 +6330,12 @@ done for ac_func in pread64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6300: checking for $ac_func" >&5 +echo "configure:6334: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6305 "configure" +#line 6339 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6324,7 +6358,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6351,12 +6385,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6355: checking for $ac_func" >&5 +echo "configure:6389: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6360 "configure" +#line 6394 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6379,7 +6413,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6406,12 +6440,12 @@ done for ac_func in setpgid setpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6410: checking for $ac_func" >&5 +echo "configure:6444: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6415 "configure" +#line 6449 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6434,7 +6468,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6461,12 +6495,12 @@ done for ac_func in sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6465: checking for $ac_func" >&5 +echo "configure:6499: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6470 "configure" +#line 6504 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6489,7 +6523,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6516,12 +6550,12 @@ done for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6520: checking for $ac_func" >&5 +echo "configure:6554: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6525 "configure" +#line 6559 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6544,7 +6578,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6571,7 +6605,7 @@ done if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:6575: checking whether setpgrp takes no argument" >&5 +echo "configure:6609: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6579,7 +6613,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 6583 "configure" +#line 6617 "configure" #include "confdefs.h" #ifdef HAVE_UNISTD_H @@ -6599,7 +6633,7 @@ main() } EOF -if { (eval echo configure:6603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -6624,12 +6658,12 @@ fi else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:6628: checking whether setpgrp takes no argument" >&5 +echo "configure:6662: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6633 "configure" +#line 6667 "configure" #include "confdefs.h" #include <unistd.h> @@ -6643,7 +6677,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -6667,12 +6701,12 @@ fi # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do # since sigsetjmp might only be defined as a macro. echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:6671: checking for sigsetjmp" >&5 +echo "configure:6705: checking for sigsetjmp" >&5 if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6676 "configure" +#line 6710 "configure" #include "confdefs.h" #include <setjmp.h> @@ -6681,7 +6715,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:6685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -6707,12 +6741,12 @@ gdb_use_included_regex=yes # However, if the system regex is GNU regex, then default to *not* # using the included regex. echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:6711: checking for GNU regex" >&5 +echo "configure:6745: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6716 "configure" +#line 6750 "configure" #include "confdefs.h" #include <gnu-versions.h> int main() { @@ -6722,7 +6756,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:6726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6757,19 +6791,19 @@ fi # See if <machine/reg.h> supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 -echo "configure:6761: checking for r_fs in struct reg" >&5 +echo "configure:6795: checking for r_fs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6766 "configure" +#line 6800 "configure" #include "confdefs.h" #include <machine/reg.h> int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:6773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -6789,19 +6823,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:6793: checking for r_gs in struct reg" >&5 +echo "configure:6827: checking for r_gs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6798 "configure" +#line 6832 "configure" #include "confdefs.h" #include <machine/reg.h> int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:6805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -6823,19 +6857,19 @@ fi # See if <sys/ptrace.h> provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:6827: checking for PTRACE_GETREGS" >&5 +echo "configure:6861: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6832 "configure" +#line 6866 "configure" #include "confdefs.h" #include <sys/ptrace.h> int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:6839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -6857,19 +6891,19 @@ fi # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:6861: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:6895: checking for PTRACE_GETFPXREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6866 "configure" +#line 6900 "configure" #include "confdefs.h" #include <sys/ptrace.h> int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:6873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -6891,12 +6925,12 @@ fi # See if <sys/ptrace.h> provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:6895: checking for PT_GETDBREGS" >&5 +echo "configure:6929: checking for PT_GETDBREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6900 "configure" +#line 6934 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/ptrace.h> @@ -6904,7 +6938,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:6908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -6926,12 +6960,12 @@ fi # See if <sys/ptrace.h> provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:6930: checking for PT_GETXMMREGS" >&5 +echo "configure:6964: checking for PT_GETXMMREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6935 "configure" +#line 6969 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/ptrace.h> @@ -6939,7 +6973,7 @@ int main() { PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:6943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -6959,14 +6993,49 @@ EOF fi +# See if stdint.h provides the uintptr_t type. +# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this. +echo $ac_n "checking for uintptr_t in stdint.h""... $ac_c" 1>&6 +echo "configure:7000: checking for uintptr_t in stdint.h" >&5 +if eval "test \"`echo '$''{'gdb_cv_have_uintptr_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7005 "configure" +#include "confdefs.h" +#include <stdint.h> +int main() { +uintptr_t foo = 0; +; return 0; } +EOF +if { (eval echo configure:7012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_have_uintptr_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_have_uintptr_t=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gdb_cv_have_uintptr_t" 1>&6 +echo "$ac_t""$gdb_cv_have_uintptr_t" 1>&6 +if test $gdb_cv_have_uintptr_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_UINTPTR_T 1 +EOF + +fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:6965: checking whether malloc must be declared" >&5 +echo "configure:7034: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6970 "configure" +#line 7039 "configure" #include "confdefs.h" #include <stdio.h> @@ -6987,7 +7056,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:6991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -7008,12 +7077,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:7012: checking whether realloc must be declared" >&5 +echo "configure:7081: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7017 "configure" +#line 7086 "configure" #include "confdefs.h" #include <stdio.h> @@ -7034,7 +7103,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:7038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -7055,12 +7124,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:7059: checking whether free must be declared" >&5 +echo "configure:7128: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7064 "configure" +#line 7133 "configure" #include "confdefs.h" #include <stdio.h> @@ -7081,7 +7150,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:7085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -7102,12 +7171,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:7106: checking whether strerror must be declared" >&5 +echo "configure:7175: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7111 "configure" +#line 7180 "configure" #include "confdefs.h" #include <stdio.h> @@ -7128,7 +7197,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:7132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -7149,12 +7218,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:7153: checking whether strdup must be declared" >&5 +echo "configure:7222: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7158 "configure" +#line 7227 "configure" #include "confdefs.h" #include <stdio.h> @@ -7175,7 +7244,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:7179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -7196,12 +7265,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:7200: checking whether strstr must be declared" >&5 +echo "configure:7269: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7205 "configure" +#line 7274 "configure" #include "confdefs.h" #include <stdio.h> @@ -7222,7 +7291,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:7226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -7243,12 +7312,12 @@ EOF fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:7247: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:7316: checking whether canonicalize_file_name must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7252 "configure" +#line 7321 "configure" #include "confdefs.h" #include <stdio.h> @@ -7269,7 +7338,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:7273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -7295,9 +7364,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:7299: checking for HPUX save_state structure" >&5 +echo "configure:7368: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext <<EOF -#line 7301 "configure" +#line 7370 "configure" #include "confdefs.h" #include <machine/save_state.h> EOF @@ -7312,7 +7381,7 @@ fi rm -f conftest* cat > conftest.$ac_ext <<EOF -#line 7316 "configure" +#line 7385 "configure" #include "confdefs.h" #include <machine/save_state.h> EOF @@ -7382,12 +7451,12 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7386: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:7455: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7391 "configure" +#line 7460 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7396,7 +7465,7 @@ int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:7400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -7418,12 +7487,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7422: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:7491: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7427 "configure" +#line 7496 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7432,7 +7501,7 @@ int main() { prrun_t avar ; return 0; } EOF -if { (eval echo configure:7436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -7454,12 +7523,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7458: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:7527: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7463 "configure" +#line 7532 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7468,7 +7537,7 @@ int main() { gregset_t avar ; return 0; } EOF -if { (eval echo configure:7472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -7490,12 +7559,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7494: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:7563: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7499 "configure" +#line 7568 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7504,7 +7573,7 @@ int main() { fpregset_t avar ; return 0; } EOF -if { (eval echo configure:7508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -7526,12 +7595,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7530: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:7599: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7535 "configure" +#line 7604 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7540,7 +7609,7 @@ int main() { prgregset_t avar ; return 0; } EOF -if { (eval echo configure:7544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -7562,12 +7631,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7566: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:7635: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7571 "configure" +#line 7640 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7576,7 +7645,7 @@ int main() { prfpregset_t avar ; return 0; } EOF -if { (eval echo configure:7580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -7598,12 +7667,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7602: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:7671: checking for prgregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7607 "configure" +#line 7676 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7612,7 +7681,7 @@ int main() { prgregset32_t avar ; return 0; } EOF -if { (eval echo configure:7616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -7634,12 +7703,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7638: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:7707: checking for prfpregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7643 "configure" +#line 7712 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7648,7 +7717,7 @@ int main() { prfpregset32_t avar ; return 0; } EOF -if { (eval echo configure:7652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -7670,12 +7739,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7674: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:7743: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7679 "configure" +#line 7748 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7684,7 +7753,7 @@ int main() { lwpid_t avar ; return 0; } EOF -if { (eval echo configure:7688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -7706,12 +7775,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7710: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:7779: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7715 "configure" +#line 7784 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7720,7 +7789,7 @@ int main() { psaddr_t avar ; return 0; } EOF -if { (eval echo configure:7724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -7742,12 +7811,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7746: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:7815: checking for prsysent_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7751 "configure" +#line 7820 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7756,7 +7825,7 @@ int main() { prsysent_t avar ; return 0; } EOF -if { (eval echo configure:7760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -7778,12 +7847,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7782: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:7851: checking for pr_sigset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7787 "configure" +#line 7856 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7792,7 +7861,7 @@ int main() { pr_sigset_t avar ; return 0; } EOF -if { (eval echo configure:7796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -7814,12 +7883,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7818: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:7887: checking for pr_sigaction64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7823 "configure" +#line 7892 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7828,7 +7897,7 @@ int main() { pr_sigaction64_t avar ; return 0; } EOF -if { (eval echo configure:7832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -7850,12 +7919,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7854: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:7923: checking for pr_siginfo64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7859 "configure" +#line 7928 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7864,7 +7933,7 @@ int main() { pr_siginfo64_t avar ; return 0; } EOF -if { (eval echo configure:7868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -7891,7 +7960,7 @@ EOF if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 -echo "configure:7895: checking whether prfpregset_t type is broken" >&5 +echo "configure:7964: checking whether prfpregset_t type is broken" >&5 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7899,7 +7968,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext <<EOF -#line 7903 "configure" +#line 7972 "configure" #include "confdefs.h" #include <sys/procfs.h> int main () @@ -7909,7 +7978,7 @@ else return 0; } EOF -if { (eval echo configure:7913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_prfpregset_t_broken=no else @@ -7934,12 +8003,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7938: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:8007: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7943 "configure" +#line 8012 "configure" #include "confdefs.h" #include <unistd.h> #include <sys/types.h> @@ -7952,7 +8021,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:7956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -7976,19 +8045,19 @@ fi if test ${host} = ${target} ; then echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:7980: checking for member l_addr in struct link_map" >&5 +echo "configure:8049: checking for member l_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7985 "configure" +#line 8054 "configure" #include "confdefs.h" #include <link.h> int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:7992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -8010,12 +8079,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:8014: checking for member lm_addr in struct link_map" >&5 +echo "configure:8083: checking for member lm_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8019 "configure" +#line 8088 "configure" #include "confdefs.h" #include <sys/types.h> #include <link.h> @@ -8023,7 +8092,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:8027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -8045,12 +8114,12 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:8049: checking for member som_addr in struct so_map" >&5 +echo "configure:8118: checking for member som_addr in struct so_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8054 "configure" +#line 8123 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_NLIST_H @@ -8061,7 +8130,7 @@ int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:8065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -8083,12 +8152,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:8087: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:8156: checking for struct link_map32 in sys/link.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8092 "configure" +#line 8161 "configure" #include "confdefs.h" #define _SYSCALL32 #include <sys/link.h> @@ -8096,7 +8165,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:8100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -8123,12 +8192,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:8127: checking for long long support in compiler" >&5 +echo "configure:8196: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8132 "configure" +#line 8201 "configure" #include "confdefs.h" int main() { @@ -8138,7 +8207,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -8160,7 +8229,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:8164: checking for long long support in printf" >&5 +echo "configure:8233: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8168,7 +8237,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <<EOF -#line 8172 "configure" +#line 8241 "configure" #include "confdefs.h" int main () { @@ -8182,7 +8251,7 @@ int main () { return (strcmp ("0x0123456789abcdef", buf)); } EOF -if { (eval echo configure:8186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -8206,19 +8275,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:8210: checking for long double support in compiler" >&5 +echo "configure:8279: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8215 "configure" +#line 8284 "configure" #include "confdefs.h" int main() { long double foo; ; return 0; } EOF -if { (eval echo configure:8222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -8240,7 +8309,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:8244: checking for long double support in printf" >&5 +echo "configure:8313: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8248,7 +8317,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <<EOF -#line 8252 "configure" +#line 8321 "configure" #include "confdefs.h" int main () { @@ -8258,7 +8327,7 @@ int main () { return (strncmp ("3.14159", buf, 7)); } EOF -if { (eval echo configure:8262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -8282,7 +8351,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:8286: checking for long double support in scanf" >&5 +echo "configure:8355: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8290,7 +8359,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext <<EOF -#line 8294 "configure" +#line 8363 "configure" #include "confdefs.h" int main () { @@ -8300,7 +8369,7 @@ int main () { return !(f > 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:8304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -8325,7 +8394,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6 case ${host_os} in aix*) echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6 -echo "configure:8329: checking for -bbigtoc option" >&5 +echo "configure:8398: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8339,14 +8408,14 @@ else LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc cat > conftest.$ac_ext <<EOF -#line 8343 "configure" +#line 8412 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:8350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -8369,7 +8438,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:8373: checking for HPUX/OSF thread support" >&5 +echo "configure:8442: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -8392,7 +8461,7 @@ EOF # because version 0 (present on Solaris 2.4 or earlier) doesn't have # the same API. echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:8396: checking for Solaris thread debugging library" >&5 +echo "configure:8465: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -8402,7 +8471,7 @@ EOF CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:8406: checking for dlopen in -ldl" >&5 +echo "configure:8475: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8410,7 +8479,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 8414 "configure" +#line 8483 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8421,7 +8490,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:8425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8453,17 +8522,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:8457: checking for the ld -export-dynamic flag" >&5 +echo "configure:8526: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <<EOF -#line 8460 "configure" +#line 8529 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:8467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -8482,13 +8551,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in <proc_service.h> # at one point. echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6 -echo "configure:8486: checking if <proc_service.h> is old" >&5 +echo "configure:8555: checking if <proc_service.h> is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8492 "configure" +#line 8561 "configure" #include "confdefs.h" #include <proc_service.h> @@ -8499,7 +8568,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -8525,12 +8594,12 @@ EOF ;; aix*) echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6 -echo "configure:8529: checking for AiX thread debugging library" >&5 +echo "configure:8598: checking for AiX thread debugging library" >&5 if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8534 "configure" +#line 8603 "configure" #include "confdefs.h" #include <sys/pthdebug.h> int main() { @@ -8539,7 +8608,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:8543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_aix_thread_debug=yes else @@ -8564,19 +8633,19 @@ fi if test "x$ac_cv_header_thread_db_h" = "xyes"; then echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6 -echo "configure:8568: checking whether <thread_db.h> has TD_NOTALLOC" >&5 +echo "configure:8637: checking whether <thread_db.h> has TD_NOTALLOC" >&5 if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8573 "configure" +#line 8642 "configure" #include "confdefs.h" #include <thread_db.h> int main() { int i = TD_NOTALLOC; ; return 0; } EOF -if { (eval echo configure:8580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_thread_db_h_has_td_notalloc=yes else @@ -8605,7 +8674,7 @@ if test "${with_sysroot+set}" = set; then withval="$with_sysroot" case ${with_sysroot} in - yes) { echo "configure: error: with-sysroot must specify path" 1>&2; exit 1; } ;; + yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;; *) TARGET_SYSTEM_ROOT=$with_sysroot ;; esac @@ -8621,7 +8690,8 @@ if test "${with_sysroot+set}" = set; then test_prefix=$exec_prefix fi case ${TARGET_SYSTEM_ROOT} in - ${test_prefix}*) + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" TARGET_SYSTEM_ROOT_DEFINE="$t" ;; @@ -8686,7 +8756,7 @@ WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 -echo "configure:8690: checking compiler warning flags" >&5 +echo "configure:8760: checking compiler warning flags" >&5 # Separate out the -Werror flag as some files just cannot be # compiled with it enabled. for w in ${build_warnings}; do @@ -8696,14 +8766,14 @@ echo "configure:8690: checking compiler warning flags" >&5 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $w" cat > conftest.$ac_ext <<EOF -#line 8700 "configure" +#line 8770 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:8707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -8751,12 +8821,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:8755: checking for cygwin" >&5 +echo "configure:8825: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8760 "configure" +#line 8830 "configure" #include "confdefs.h" #if defined (__CYGWIN__) || defined (__CYGWIN32__) @@ -8834,7 +8904,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:8838: checking for Tcl configuration" >&5 +echo "configure:8908: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8922,6 +8992,7 @@ fi + @@ -8942,7 +9013,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:8946: checking for Tk configuration" >&5 +echo "configure:9017: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9051,7 +9122,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:9055: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:9126: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -9117,17 +9188,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:9121: checking for tclInt.h" >&5 +echo "configure:9192: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9126 "configure" +#line 9197 "configure" #include "confdefs.h" #include <tclInt.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9187,7 +9258,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:9191: checking for Tk private headers" >&5 +echo "configure:9262: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -9253,17 +9324,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:9257: checking for tk.h" >&5 +echo "configure:9328: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9262 "configure" +#line 9333 "configure" #include "confdefs.h" #include <tk.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9309,7 +9380,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9313: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:9384: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -9332,7 +9403,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9336: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:9407: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -9387,7 +9458,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:9391: checking for Itcl configuration" >&5 +echo "configure:9462: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9490,7 +9561,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:9494: checking for Itk configuration" >&5 +echo "configure:9565: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9633,7 +9704,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:9637: checking for X" >&5 +echo "configure:9708: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -9695,12 +9766,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 9699 "configure" +#line 9770 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9769,14 +9840,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 9773 "configure" +#line 9844 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:9780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -10024,7 +10095,7 @@ fi # We only build gdbserver automatically if host and target are the same. if test "x$target" = "x$host"; then echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6 -echo "configure:10028: checking whether gdbserver is supported on this host" >&5 +echo "configure:10099: checking whether gdbserver is supported on this host" >&5 if test "x$build_gdbserver" = xyes; then configdirs="$configdirs gdbserver" echo "$ac_t""yes" 1>&6 @@ -10088,12 +10159,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:10092: checking for Cygwin environment" >&5 +echo "configure:10163: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 10097 "configure" +#line 10168 "configure" #include "confdefs.h" int main() { @@ -10104,7 +10175,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:10108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -10121,19 +10192,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:10125: checking for mingw32 environment" >&5 +echo "configure:10196: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 10130 "configure" +#line 10201 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:10137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -10152,7 +10223,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:10156: checking for executable suffix" >&5 +echo "configure:10227: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10162,10 +10233,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:10166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:10237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -10204,7 +10275,7 @@ fi echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:10208: checking for iconv" >&5 +echo "configure:10279: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10212,7 +10283,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext <<EOF -#line 10216 "configure" +#line 10287 "configure" #include "confdefs.h" #include <stdlib.h> #include <iconv.h> @@ -10222,7 +10293,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -10234,7 +10305,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat > conftest.$ac_ext <<EOF -#line 10238 "configure" +#line 10309 "configure" #include "confdefs.h" #include <stdlib.h> #include <iconv.h> @@ -10244,7 +10315,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes @@ -10265,13 +10336,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:10269: checking for iconv declaration" >&5 +echo "configure:10340: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 10275 "configure" +#line 10346 "configure" #include "confdefs.h" #include <stdlib.h> @@ -10290,7 +10361,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:10294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else @@ -10529,6 +10600,7 @@ s%@TCL_SHLIB_SUFFIX@%$TCL_SHLIB_SUFFIX%g s%@TCL_DL_LIBS@%$TCL_DL_LIBS%g s%@TCL_LD_FLAGS@%$TCL_LD_FLAGS%g s%@TCL_LD_SEARCH_FLAGS@%$TCL_LD_SEARCH_FLAGS%g +s%@TCL_CC_SEARCH_FLAGS@%$TCL_CC_SEARCH_FLAGS%g s%@TCL_COMPAT_OBJS@%$TCL_COMPAT_OBJS%g s%@TCL_RANLIB@%$TCL_RANLIB%g s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g diff --git a/gdb/configure.in b/gdb/configure.in index 65b62f0..07aab35 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -204,6 +204,16 @@ AC_ARG_ENABLE(profiling, [enable_profiling=no]) AC_CHECK_FUNCS(monstartup _mcleanup) +AC_CACHE_CHECK([for _etext], ac_cv_var__etext, +[AC_TRY_LINK( +[#include <stdlib.h> +extern char _etext; +], +[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)]) +if test $ac_cv_var__etext = yes; then + AC_DEFINE(HAVE__ETEXT, 1, + [Define to 1 if your system has the _etext variable. ]) +fi if test "$enable_profiling" = yes ; then if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup) @@ -501,6 +511,18 @@ if test $gdb_cv_have_pt_getxmmregs = yes; then AC_DEFINE(HAVE_PT_GETXMMREGS) fi +# See if stdint.h provides the uintptr_t type. +# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this. +AC_CACHE_CHECK([for uintptr_t in stdint.h], gdb_cv_have_uintptr_t, + [AC_TRY_COMPILE( + [#include <stdint.h>], + [uintptr_t foo = 0;], + gdb_cv_have_uintptr_t=yes, + gdb_cv_have_uintptr_t=no)]) +AC_MSG_RESULT($gdb_cv_have_uintptr_t) +if test $gdb_cv_have_uintptr_t = yes; then + AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if <stdint.h> provides the uintptr_t type.]) +fi BFD_NEED_DECLARATION(malloc) BFD_NEED_DECLARATION(realloc) @@ -895,7 +917,7 @@ AC_ARG_WITH(sysroot, [ --with-sysroot[=DIR] Search for usr/lib et al within DIR.], [ case ${with_sysroot} in - yes) AC_ERROR(with-sysroot must specify path) ;; + yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;; *) TARGET_SYSTEM_ROOT=$with_sysroot ;; esac @@ -911,7 +933,8 @@ AC_ARG_WITH(sysroot, test_prefix=$exec_prefix fi case ${TARGET_SYSTEM_ROOT} in - ${test_prefix}*) + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" TARGET_SYSTEM_ROOT_DEFINE="$t" ;; diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 36d2992..3aa9966 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -21,13 +21,20 @@ #include "defs.h" #include "value.h" #include "cp-abi.h" +#include "command.h" +#include "gdbcmd.h" +#include "ui-out.h" + #include "gdb_string.h" -struct cp_abi_ops current_cp_abi; +static struct cp_abi_ops *find_cp_abi (const char *short_name); -struct cp_abi_ops *cp_abis; +static struct cp_abi_ops current_cp_abi = { "", NULL }; +static struct cp_abi_ops auto_cp_abi = { "auto", NULL }; -int num_cp_abis = 0; +#define CP_ABI_MAX 8 +static struct cp_abi_ops *cp_abis[CP_ABI_MAX]; +static int num_cp_abis = 0; enum ctor_kinds is_constructor_name (const char *name) @@ -71,8 +78,8 @@ baseclass_offset (struct type *type, int index, char *valaddr, } struct value * -value_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, - struct type * type, int offset) +value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, + struct type *type, int offset) { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; @@ -87,24 +94,157 @@ value_rtti_type (struct value *v, int *full, int *top, int *using_enc) return (*current_cp_abi.rtti_type) (v, full, top, using_enc); } +/* Set the current C++ ABI to SHORT_NAME. */ + +static int +switch_to_cp_abi (const char *short_name) +{ + struct cp_abi_ops *abi; + + abi = find_cp_abi (short_name); + if (abi == NULL) + return 0; + + current_cp_abi = *abi; + return 1; +} + +/* Add ABI to the list of supported C++ ABI's. */ + int -register_cp_abi (struct cp_abi_ops abi) +register_cp_abi (struct cp_abi_ops *abi) { - cp_abis = - xrealloc (cp_abis, (num_cp_abis + 1) * sizeof (struct cp_abi_ops)); + if (num_cp_abis == CP_ABI_MAX) + internal_error (__FILE__, __LINE__, + "Too many C++ ABIs, please increase CP_ABI_MAX in cp-abi.c"); + cp_abis[num_cp_abis++] = abi; return 1; +} + +/* Set the ABI to use in "auto" mode to SHORT_NAME. */ +void +set_cp_abi_as_auto_default (const char *short_name) +{ + char *new_longname, *new_doc; + struct cp_abi_ops *abi = find_cp_abi (short_name); + + if (abi == NULL) + internal_error (__FILE__, __LINE__, + "Cannot find C++ ABI \"%s\" to set it as auto default.", + short_name); + + if (auto_cp_abi.longname != NULL) + xfree ((char *) auto_cp_abi.longname); + if (auto_cp_abi.doc != NULL) + xfree ((char *) auto_cp_abi.doc); + + auto_cp_abi = *abi; + + auto_cp_abi.shortname = "auto"; + new_longname = xmalloc (strlen ("currently ") + 1 + strlen (abi->shortname) + + 1 + 1); + sprintf (new_longname, "currently \"%s\"", abi->shortname); + auto_cp_abi.longname = new_longname; + + new_doc = xmalloc (strlen ("Automatically selected; currently ") + + 1 + strlen (abi->shortname) + 1 + 1); + sprintf (new_doc, "Automatically selected; currently \"%s\"", abi->shortname); + auto_cp_abi.doc = new_doc; + + /* Since we copy the current ABI into current_cp_abi instead of + using a pointer, if auto is currently the default, we need to + reset it. */ + if (strcmp (current_cp_abi.shortname, "auto") == 0) + switch_to_cp_abi ("auto"); } -int -switch_to_cp_abi (const char *short_name) +/* Return the ABI operations associated with SHORT_NAME. */ + +static struct cp_abi_ops * +find_cp_abi (const char *short_name) { int i; + for (i = 0; i < num_cp_abis; i++) - if (strcmp (cp_abis[i].shortname, short_name) == 0) - current_cp_abi = cp_abis[i]; - return 1; + if (strcmp (cp_abis[i]->shortname, short_name) == 0) + return cp_abis[i]; + + return NULL; } +/* Display the list of registered C++ ABIs. */ + +static void +list_cp_abis (int from_tty) +{ + struct cleanup *cleanup_chain; + int i; + ui_out_text (uiout, "The available C++ ABIs are:\n"); + + cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "cp-abi-list"); + for (i = 0; i < num_cp_abis; i++) + { + char pad[14]; + int padcount; + + ui_out_text (uiout, " "); + ui_out_field_string (uiout, "cp-abi", cp_abis[i]->shortname); + + padcount = 16 - 2 - strlen (cp_abis[i]->shortname); + pad[padcount] = 0; + while (padcount > 0) + pad[--padcount] = ' '; + ui_out_text (uiout, pad); + + ui_out_field_string (uiout, "doc", cp_abis[i]->doc); + ui_out_text (uiout, "\n"); + } + do_cleanups (cleanup_chain); +} + +/* Set the current C++ ABI, or display the list of options if no + argument is given. */ + +static void +set_cp_abi_cmd (char *args, int from_tty) +{ + if (args == NULL) + { + list_cp_abis (from_tty); + return; + } + + if (!switch_to_cp_abi (args)) + error ("Could not find \"%s\" in ABI list", args); +} + +/* Show the currently selected C++ ABI. */ + +static void +show_cp_abi_cmd (char *args, int from_tty) +{ + ui_out_text (uiout, "The currently selected C++ ABI is \""); + + ui_out_field_string (uiout, "cp-abi", current_cp_abi.shortname); + ui_out_text (uiout, "\" ("); + ui_out_field_string (uiout, "longname", current_cp_abi.longname); + ui_out_text (uiout, ").\n"); +} + +void +_initialize_cp_abi (void) +{ + register_cp_abi (&auto_cp_abi); + switch_to_cp_abi ("auto"); + + add_cmd ("cp-abi", class_obscure, set_cp_abi_cmd, + "Set the ABI used for inspecting C++ objects.\n" + "\"set cp-abi\" with no arguments will list the available ABIs.", + &setlist); + + add_cmd ("cp-abi", class_obscure, show_cp_abi_cmd, + "Show the ABI used for inspecting C++ objects.", &showlist); +} diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index 7c1e952..e119514 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -163,11 +163,8 @@ struct cp_abi_ops }; -extern struct cp_abi_ops *cp_abis; -extern int num_cp_abis; -extern struct cp_abi_ops current_cp_abi; -extern int register_cp_abi (struct cp_abi_ops abi); -extern int switch_to_cp_abi (const char *short_name); +extern int register_cp_abi (struct cp_abi_ops *abi); +extern void set_cp_abi_as_auto_default (const char *short_name); #endif diff --git a/gdb/cp-support.c b/gdb/cp-support.c index cb59720..9e55ab9 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -503,7 +503,7 @@ cp_check_namespace_symbol (const char *name, int len) sym = obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); SYMBOL_LANGUAGE (sym) = language_cplus; - SYMBOL_NAME (sym) = name_copy; + DEPRECATED_SYMBOL_NAME (sym) = name_copy; SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_TYPE (sym) = type; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -562,7 +562,7 @@ check_one_possible_namespace_symbol (const char *name, int len) sym = obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); SYMBOL_LANGUAGE (sym) = language_cplus; - SYMBOL_NAME (sym) = name_copy; + DEPRECATED_SYMBOL_NAME (sym) = name_copy; SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_TYPE (sym) = type; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -637,12 +637,12 @@ maintenance_print_namespace (char *args, int from_tty) printf_unfiltered ("Definite namespaces:\n"); ALL_BLOCK_SYMBOLS (namespace_block, iter, sym) { - printf_unfiltered ("%s\n", SYMBOL_BEST_NAME (sym)); + printf_unfiltered ("%s\n", SYMBOL_PRINT_NAME (sym)); } printf_unfiltered ("Possible namespaces:\n"); ALL_BLOCK_SYMBOLS (possible_namespace_block, iter, sym) { - printf_unfiltered ("%s\n", SYMBOL_BEST_NAME (sym)); + printf_unfiltered ("%s\n", SYMBOL_PRINT_NAME (sym)); } } diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 29754f2..f1f64f8 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -1,6 +1,6 @@ /* Support for printing C++ values for GDB, the GNU debugger. Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -130,7 +130,7 @@ cp_print_class_method (char *valaddr, check_stub_method_group (domain, i); for (j = 0; j < len2; j++) { - if (strcmp (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j)) + if (strcmp (DEPRECATED_SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j)) == 0) goto common; } diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 5911318..a51f98c 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1146,9 +1146,10 @@ cris_frameless_function_invocation (struct frame_info *fi) return frameless_look_for_prologue (fi); } -/* See frame.h. Determines the address of all registers in the current stack - frame storing each in frame->saved_regs. Space for frame->saved_regs shall - be allocated by FRAME_INIT_SAVED_REGS using frame_saved_regs_zalloc. */ +/* See frame.h. Determines the address of all registers in the + current stack frame storing each in frame->saved_regs. Space for + frame->saved_regs shall be allocated by + DEPRECATED_FRAME_INIT_SAVED_REGS using frame_saved_regs_zalloc. */ void cris_frame_init_saved_regs (struct frame_info *fi) @@ -4242,13 +4243,13 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_raw_size (gdbarch, cris_register_size); /* The largest value REGISTER_RAW_SIZE can have. */ - set_gdbarch_max_register_raw_size (gdbarch, 32); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 32); /* The length of the registers in the program's representation. */ set_gdbarch_register_virtual_size (gdbarch, cris_register_size); /* The largest value REGISTER_VIRTUAL_SIZE can have. */ - set_gdbarch_max_register_virtual_size (gdbarch, 32); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 32); set_gdbarch_register_virtual_type (gdbarch, cris_register_virtual_type); @@ -4283,7 +4284,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* No register requires conversion from raw format to virtual format. */ set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, cris_push_return_address); set_gdbarch_pop_frame (gdbarch, cris_pop_frame); @@ -4292,8 +4292,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) (gdbarch, cris_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, cris_use_struct_convention); - set_gdbarch_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs); - set_gdbarch_init_extra_frame_info (gdbarch, cris_init_extra_frame_info); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, cris_init_extra_frame_info); set_gdbarch_skip_prologue (gdbarch, cris_skip_prologue); set_gdbarch_prologue_frameless_p (gdbarch, generic_prologue_frameless_p); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index c6b94bd..f37f191 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -45,13 +45,6 @@ #include "gdb_assert.h" -struct frame_extra_info - { - CORE_ADDR return_pc; - int frameless; - int size; - }; - struct gdbarch_tdep { int a0_regnum; @@ -348,7 +341,7 @@ d10v_register_raw_size (int reg_nr) of data in register N. */ static struct type * -d10v_register_virtual_type (int reg_nr) +d10v_register_type (struct gdbarch *gdbarch, int reg_nr) { if (reg_nr == PC_REGNUM) return builtin_type_void_func_ptr; @@ -617,10 +610,13 @@ d10v_skip_prologue (CORE_ADDR pc) struct d10v_unwind_cache { CORE_ADDR return_pc; - int frameless; int size; CORE_ADDR *saved_regs; - CORE_ADDR next_addr; + /* How far the SP and r11 (FP) have been offset from the start of + the stack frame (as defined by the previous frame's stack + pointer). */ + LONGEST sp_offset; + LONGEST r11_offset; int uses_frame; void **regs; }; @@ -635,8 +631,8 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, if ((op & 0x7E1F) == 0x6C1F) { n = (op & 0x1E0) >> 5; - info->next_addr -= 2; - info->saved_regs[n] = info->next_addr; + info->sp_offset -= 2; + info->saved_regs[n] = info->sp_offset; return 1; } @@ -644,9 +640,9 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, else if ((op & 0x7E3F) == 0x6E1F) { n = (op & 0x1E0) >> 5; - info->next_addr -= 4; - info->saved_regs[n] = info->next_addr; - info->saved_regs[n + 1] = info->next_addr + 2; + info->sp_offset -= 4; + info->saved_regs[n] = info->sp_offset; + info->saved_regs[n + 1] = info->sp_offset + 2; return 1; } @@ -656,7 +652,7 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, n = (op & 0x1E) >> 1; if (n == 0) n = 16; - info->next_addr -= n; + info->sp_offset -= n; return 1; } @@ -664,6 +660,15 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, if (op == 0x417E) { info->uses_frame = 1; + info->r11_offset = info->sp_offset; + return 1; + } + + /* st rn, @r11 */ + if ((op & 0x7E1F) == 0x6816) + { + n = (op & 0x1E0) >> 5; + info->saved_regs[n] = info->r11_offset; return 1; } @@ -675,7 +680,7 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, if ((op & 0x7E1F) == 0x681E) { n = (op & 0x1E0) >> 5; - info->saved_regs[n] = info->next_addr; + info->saved_regs[n] = info->sp_offset; return 1; } @@ -683,8 +688,8 @@ prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op, if ((op & 0x7E3F) == 0x3A1E) { n = (op & 0x1E0) >> 5; - info->saved_regs[n] = info->next_addr; - info->saved_regs[n + 1] = info->next_addr + 2; + info->saved_regs[n] = info->sp_offset; + info->saved_regs[n + 1] = info->sp_offset + 2; return 1; } @@ -714,12 +719,11 @@ d10v_frame_unwind_cache (struct frame_info *fi, (*cache) = info; info->saved_regs = frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS); - info->frameless = 0; info->size = 0; info->return_pc = 0; fp = get_frame_base (fi); - info->next_addr = 0; + info->sp_offset = 0; pc = get_pc_function_start (get_frame_pc (fi)); @@ -734,22 +738,22 @@ d10v_frame_unwind_cache (struct frame_info *fi, { /* add3 sp,sp,n */ short n = op & 0xFFFF; - info->next_addr += n; + info->sp_offset += n; } else if ((op & 0x3F0F0000) == 0x340F0000) { /* st rn, @(offset,sp) */ short offset = op & 0xFFFF; short n = (op >> 20) & 0xF; - info->saved_regs[n] = info->next_addr + offset; + info->saved_regs[n] = info->sp_offset + offset; } else if ((op & 0x3F1F0000) == 0x350F0000) { /* st2w rn, @(offset,sp) */ short offset = op & 0xFFFF; short n = (op >> 20) & 0xF; - info->saved_regs[n] = info->next_addr + offset; - info->saved_regs[n + 1] = info->next_addr + offset + 2; + info->saved_regs[n] = info->sp_offset + offset; + info->saved_regs[n + 1] = info->sp_offset + offset + 2; } else break; @@ -774,7 +778,7 @@ d10v_frame_unwind_cache (struct frame_info *fi, pc += 4; } - info->size = -info->next_addr; + info->size = -info->sp_offset; if (!(fp & 0xffff)) fp = d10v_read_sp (); @@ -782,14 +786,14 @@ d10v_frame_unwind_cache (struct frame_info *fi, for (i = 0; i < NUM_REGS - 1; i++) if (info->saved_regs[i]) { - info->saved_regs[i] = fp - (info->next_addr - info->saved_regs[i]); + info->saved_regs[i] = fp - (info->sp_offset - info->saved_regs[i]); } if (info->saved_regs[LR_REGNUM]) { CORE_ADDR return_pc = read_memory_unsigned_integer (info->saved_regs[LR_REGNUM], - REGISTER_RAW_SIZE (LR_REGNUM)); + register_size (current_gdbarch, LR_REGNUM)); info->return_pc = d10v_make_iaddr (return_pc); } else @@ -810,7 +814,6 @@ d10v_frame_unwind_cache (struct frame_info *fi, else { info->saved_regs[SP_REGNUM] = fp + info->size; - info->frameless = 1; info->saved_regs[FP_REGNUM] = 0; } } @@ -889,7 +892,7 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, int i; fprintf_filtered (file, " "); frame_register_read (frame, a, num); - for (i = 0; i < MAX_REGISTER_RAW_SIZE; i++) + for (i = 0; i < max_register_size (current_gdbarch); i++) { fprintf_filtered (file, "%02x", (num[i] & 0xff)); } @@ -1078,7 +1081,7 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache, printf("RET: TYPE=%d len=%d r%d=0x%x\n", TYPE_CODE (type), TYPE_LENGTH (type), RET1_REGNUM - R0_REGNUM, (int) extract_unsigned_integer (regbuf + REGISTER_BYTE(RET1_REGNUM), - REGISTER_RAW_SIZE (RET1_REGNUM))); + register_size (current_gdbarch, RET1_REGNUM))); #endif if (TYPE_LENGTH (type) == 1) { @@ -1464,7 +1467,7 @@ d10v_frame_id_unwind (struct frame_info *frame, } addr = read_memory_unsigned_integer (info->saved_regs[FP_REGNUM], - REGISTER_RAW_SIZE (FP_REGNUM)); + register_size (current_gdbarch, FP_REGNUM)); if (addr == 0) return; @@ -1495,7 +1498,7 @@ saved_regs_unwinder (struct frame_info *frame, *addrp = 0; *realnump = -1; if (bufferp != NULL) - store_address (bufferp, REGISTER_RAW_SIZE (regnum), + store_address (bufferp, register_size (current_gdbarch, regnum), saved_regs[regnum]); } else @@ -1510,7 +1513,7 @@ saved_regs_unwinder (struct frame_info *frame, { /* Read the value in from memory. */ read_memory (saved_regs[regnum], bufferp, - REGISTER_RAW_SIZE (regnum)); + register_size (current_gdbarch, regnum)); } } return; @@ -1566,7 +1569,8 @@ d10v_frame_pop (struct frame_info *fi, void **unwind_cache, frame_unwind_register (fi, LR_REGNUM, raw_buffer); regcache_cooked_write (regcache, PC_REGNUM, raw_buffer); - store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (SP_REGNUM), + store_unsigned_integer (raw_buffer, + register_size (current_gdbarch, SP_REGNUM), fp + info->size); regcache_cooked_write (regcache, SP_REGNUM, raw_buffer); @@ -1648,10 +1652,8 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, (d10v_num_regs - 2) * 2 + 16); set_gdbarch_register_byte (gdbarch, d10v_register_byte); set_gdbarch_register_raw_size (gdbarch, d10v_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 8); set_gdbarch_register_virtual_size (gdbarch, generic_register_size); - set_gdbarch_max_register_virtual_size (gdbarch, 8); - set_gdbarch_register_virtual_type (gdbarch, d10v_register_virtual_type); + set_gdbarch_register_type (gdbarch, d10v_register_type); set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_addr_bit (gdbarch, 32); @@ -1697,7 +1699,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value); set_gdbarch_push_arguments (gdbarch, d10v_push_arguments); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, d10v_push_return_address); set_gdbarch_store_struct_return (gdbarch, d10v_store_struct_return); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index c2f74eb..a80b0e5 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2783,9 +2783,10 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, peculiarities of function_start_offset. */ static CORE_ADDR last_function_start; - /* If this is nonzero, we've seen an N_SLINE since the start of the current - function. Initialized to nonzero to assure that last_function_start - is never used uninitialized. */ + /* If this is nonzero, we've seen an N_SLINE since the start of the + current function. We use this to tell us to move the first sline + to the beginning of the function regardless of what its given + value is. */ static int sline_found_in_function = 1; /* If this is nonzero, we've seen a non-gcc N_OPT symbol for this source @@ -2829,7 +2830,13 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, break; } - record_line (current_subfile, 0, function_start_offset + valu); + /* The following check is added before recording line 0 at + end of function so as to handle hand-generated stabs + which may have an N_FUN stabs at the end of the function, but + no N_SLINE stabs. */ + if (sline_found_in_function) + record_line (current_subfile, 0, last_function_start + valu); + within_function = 0; new = pop_context (); @@ -3259,13 +3266,13 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, int l = colon_pos - name; m = lookup_minimal_symbol_by_pc (last_pc_address); - if (m && STREQN (SYMBOL_NAME (m), name, l) - && SYMBOL_NAME (m)[l] == '\0') + if (m && STREQN (DEPRECATED_SYMBOL_NAME (m), name, l) + && DEPRECATED_SYMBOL_NAME (m)[l] == '\0') /* last_pc_address was in this function */ valu = SYMBOL_VALUE (m); - else if (m && SYMBOL_NAME (m + 1) - && STREQN (SYMBOL_NAME (m + 1), name, l) - && SYMBOL_NAME (m + 1)[l] == '\0') + else if (m && DEPRECATED_SYMBOL_NAME (m + 1) + && STREQN (DEPRECATED_SYMBOL_NAME (m + 1), name, l) + && DEPRECATED_SYMBOL_NAME (m + 1)[l] == '\0') /* last_pc_address was in last function */ valu = SYMBOL_VALUE (m + 1); else @@ -3554,7 +3561,6 @@ elfstab_build_psymtabs (struct objfile *objfile, int mainline, buildsym_new_init (); free_header_files (); init_header_files (); - install_minimal_symbols (objfile); processing_acc_compilation = 1; @@ -3566,7 +3572,10 @@ elfstab_build_psymtabs (struct objfile *objfile, int mainline, /* In an elf file, we've already installed the minimal symbols that came from the elf (non-stab) symbol table, so always act like an - incremental load here. */ + incremental load here. dbx_symfile_read should not generate any new + minimal symbols, since we will have already read the ELF dynamic symbol + table and normal symbol entries won't be in the ".stab" section; but in + case it does, it will install them itself. */ dbx_symfile_read (objfile, 0); if (back_to) @@ -3648,7 +3657,6 @@ stabsect_build_psymtabs (struct objfile *objfile, int mainline, char *stab_name, buildsym_new_init (); free_header_files (); init_header_files (); - install_minimal_symbols (objfile); /* Now, do an incremental load */ @@ -160,9 +160,6 @@ typedef bfd_vma CORE_ADDR; /* Check if a character is one of the commonly used C++ marker characters. */ extern int is_cplus_marker (int); -/* use tui interface if non-zero */ -extern int tui_version; - /* enable xdb commands if set */ extern int xdb_commands; @@ -1013,6 +1010,7 @@ enum gdb_osabi GDB_OSABI_ARM_EABI_V1, GDB_OSABI_ARM_EABI_V2, GDB_OSABI_ARM_APCS, + GDB_OSABI_QNXNTO, GDB_OSABI_INVALID /* keep this last */ }; @@ -1085,6 +1083,29 @@ extern void *alloca (); #include "arch-utils.h" #endif +/* FIXME: cagney/2003-03-01: Hack to prop up old targets while they + migrate to the overhauled register cache. + + The problem is that some architectures specify different sized raw + and cooked (nee virtual) register sizes. They shouldn't. Instead, + all architectures should just implement a gdbarch_register_type(). + That can be used to compute all needed register attributes. While + waiting for the conversion, provide compatibility macros that keep + old code working. */ + +#ifdef MAX_REGISTER_RAW_SIZE +#error MAX_REGISTER_RAW_SIZE defined +#endif +extern int legacy_max_register_raw_size (void); +#define MAX_REGISTER_RAW_SIZE legacy_max_register_raw_size () + +#ifdef MAX_REGISTER_VIRTUAL_SIZE +#error MAX_REGISTER_VIRTUAL_SIZE defined +#endif +extern int legacy_max_register_virtual_size (void); +#define MAX_REGISTER_VIRTUAL_SIZE legacy_max_register_virtual_size () + + /* Static target-system-dependent parameters for GDB. */ /* Number of bits in a char or unsigned char for the target machine. diff --git a/gdb/dictionary.c b/gdb/dictionary.c index 15b8ac0..bdd53b8 100644 --- a/gdb/dictionary.c +++ b/gdb/dictionary.c @@ -630,7 +630,7 @@ iter_name_first_hashed (const struct dictionary *dict, sym = sym->hash_next) { /* Warning: the order of arguments to strcmp_iw matters! */ - if (strcmp_iw (SYMBOL_BEST_NAME (sym), name) == 0) + if (strcmp_iw (SYMBOL_NATURAL_NAME (sym), name) == 0) { break; } @@ -649,7 +649,7 @@ iter_name_next_hashed (const char *name, struct dict_iterator *iterator) for (next = DICT_ITERATOR_CURRENT (iterator)->hash_next; next; next = next->hash_next) { - if (strcmp_iw (SYMBOL_BEST_NAME (next), name) == 0) + if (strcmp_iw (SYMBOL_NATURAL_NAME (next), name) == 0) break; } @@ -667,7 +667,7 @@ insert_symbol_hashed (struct dictionary *dict, unsigned int hash_index; struct symbol **buckets = DICT_HASHED_BUCKETS (dict); - hash_index = (msymbol_hash_iw (SYMBOL_BEST_NAME (sym)) + hash_index = (msymbol_hash_iw (SYMBOL_NATURAL_NAME (sym)) % DICT_HASHED_NBUCKETS (dict)); sym->hash_next = buckets[hash_index]; buckets[hash_index] = sym; @@ -770,7 +770,7 @@ iter_name_next_linear (const char *name, struct dict_iterator *iterator) for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nsyms; ++i) { sym = DICT_LINEAR_SYM (dict, i); - if (strcmp_iw (SYMBOL_BEST_NAME (sym), name) == 0) + if (strcmp_iw (SYMBOL_NATURAL_NAME (sym), name) == 0) { retval = sym; break; diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index abd5de9..dbdd1ba 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,48 @@ +2003-03-05 James Ingham <jingham@apple.com> + Daniel Jacobowitz <drow@mvista.com> + + * gdb.texinfo (Configuring the current ABI): Document "set cp-abi" + and "show cp-abi". + +2003-03-03 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Document + register_type. + +2003-03-03 Andrew Cagney <cagney@redhat.com> + + * stabs.texinfo (Structures): Use @samp and separate @var's + instead of a single @var containing a comma separated list. + (Unions): Ditto. + +2003-03-02 Daniel Jacobowitz <drow@mvista.com> + + * Makefile.in (distclean): Remove config.log. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Rename + FRAME_INIT_SAVED_REGS to DEPRECATED_FRAME_INIT_SAVED_REGS. + +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo: Rename INIT_EXTRA_FRAME_INFO to + DEPRECATED_INIT_EXTRA_FRAME_INFO. + +2003-02-23 Raoul Gough <RaoulGough@yahoo.co.uk> + + * gdb.texinfo (Cygwin Native): Links to Non-debug DLL symbols. + (Non-debug DLL symbols): New node, describing the minimal symbols + loaded from DLLs without real debugging symbols. + +2003-02-20 Andrew Cagney <ac131313@redhat.com> + + * gdb.texinfo (Set Breaks): Add cross reference to "set remote + hardware-breakpoint-limit". + (Set Watchpoints): Add cross reference to "set remote + hardware-watchpoint-limit". + (Remote configuration options): New section. + 2003-02-04 Andrew Cagney <ac131313@redhat.com> * gdbint.texinfo (Target Architecture Definition): Delete diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index b17cce8..1d5ad3e 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -440,7 +440,7 @@ clean: mostlyclean rm -f gdb-cfg.texi distclean: clean - rm -f Makefile config.status + rm -f Makefile config.status config.log # GDBvn.texi, the dvi files, the info files, and the postscript files, # are all part of the distribution, so it should not be removed by diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index c260102..25c0a93 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2514,6 +2514,8 @@ example, on the DSU, only two data breakpoints can be set at a time, and @value{GDBN} will reject this command if more than two are used. Delete or disable unused hardware breakpoints before setting new ones (@pxref{Disabling, ,Disabling}). @xref{Conditions, ,Break conditions}. +@xref{set remote hardware-breakpoint-limit}. + @kindex thbreak @item thbreak @var{args} @@ -2750,6 +2752,8 @@ when a non-current thread's activity changes the expression. (Hardware watchpoints, in contrast, watch an expression in all threads.) @end quotation +@xref{set remote hardware-watchpoint-limit}. + @node Set Catchpoints @subsection Setting catchpoints @cindex catchpoints, setting @@ -10352,6 +10356,7 @@ is supported other than to try it. @menu * Server:: Using the gdbserver program * NetWare:: Using the gdbserve.nlm program +* Remote configuration:: Remote configuration * remote stub:: Implementing a remote stub @end menu @@ -10524,6 +10529,23 @@ argument is a device name (usually a serial device, like communications with the server via serial line @file{/dev/ttyb}. @end table +@node Remote configuration +@section Remote configuration + +The following configuration options are available when debugging remote +programs: + +@table @code +@kindex set remote hardware-watchpoint-limit +@kindex set remote hardware-breakpoint-limit +@anchor{set remote hardware-watchpoint-limit} +@anchor{set remote hardware-breakpoint-limit} +@item set remote hardware-watchpoint-limit @var{limit} +@itemx set remote hardware-breakpoint-limit @var{limit} +Restrict @value{GDBN} to using @var{limit} remote hardware breakpoint or +watchpoints. A limit of -1, the default, is treated as unlimited. +@end table + @node remote stub @section Implementing a remote stub @@ -11142,9 +11164,12 @@ This command is supported only with some DPMI servers. @cindex native Cygwin debugging @cindex Cygwin-specific commands -@value{GDBN} supports native debugging of MS Windows programs, and -defines a few commands specific to the Cygwin port. This -subsection describes those commands. +@value{GDBN} supports native debugging of MS Windows programs, including +DLLs with and without symbolic debugging information. There are various +additional Cygwin-specific commands, described in this subsection. The +subsubsection @pxref{Non-debug DLL symbols} describes working with DLLs +that have no debugging symbols. + @table @code @kindex info w32 @@ -11222,6 +11247,130 @@ Displays if the debuggee will be started with a shell. @end table +@menu +* Non-debug DLL symbols:: Support for DLLs without debugging symbols +@end menu + +@node Non-debug DLL symbols +@subsubsection Support for DLLs without debugging symbols +@cindex DLLs with no debugging symbols +@cindex Minimal symbols and DLLs + +Very often on windows, some of the DLLs that your program relies on do +not include symbolic debugging information (for example, +@file{kernel32.dll}). When @value{GDBN} doesn't recognize any debugging +symbols in a DLL, it relies on the minimal amount of symbolic +information contained in the DLL's export table. This subsubsection +describes working with such symbols, known internally to @value{GDBN} as +``minimal symbols''. + +Note that before the debugged program has started execution, no DLLs +will have been loaded. The easiest way around this problem is simply to +start the program --- either by setting a breakpoint or letting the +program run once to completion. It is also possible to force +@value{GDBN} to load a particular DLL before starting the executable --- +see the shared library information in @pxref{Files} or the +@code{dll-symbols} command in @pxref{Cygwin Native}. Currently, +explicitly loading symbols from a DLL with no debugging information will +cause the symbol names to be duplicated in @value{GDBN}'s lookup table, +which may adversely affect symbol lookup performance. + +@subsubsection DLL name prefixes + +In keeping with the naming conventions used by the Microsoft debugging +tools, DLL export symbols are made available with a prefix based on the +DLL name, for instance @code{KERNEL32!CreateFileA}. The plain name is +also entered into the symbol table, so @code{CreateFileA} is often +sufficient. In some cases there will be name clashes within a program +(particularly if the executable itself includes full debugging symbols) +necessitating the use of the fully qualified name when referring to the +contents of the DLL. Use single-quotes around the name to avoid the +exclamation mark (``!'') being interpreted as a language operator. + +Note that the internal name of the DLL may be all upper-case, even +though the file name of the DLL is lower-case, or vice-versa. Since +symbols within @value{GDBN} are @emph{case-sensitive} this may cause +some confusion. If in doubt, try the @code{info functions} and +@code{info variables} commands or even @code{maint print msymbols} (see +@pxref{Symbols}). Here's an example: + +@smallexample +(gdb) info function CreateFileA +All functions matching regular expression "CreateFileA": + +Non-debugging symbols: +0x77e885f4 CreateFileA +0x77e885f4 KERNEL32!CreateFileA +@end smallexample + +@smallexample +(gdb) info function ! +All functions matching regular expression "!": + +Non-debugging symbols: +0x6100114c cygwin1!__assert +0x61004034 cygwin1!_dll_crt0@@0 +0x61004240 cygwin1!dll_crt0(per_process *) +[etc...] +@end smallexample + +@subsubsection Working with minimal symbols + +Symbols extracted from a DLL's export table do not contain very much +type information. All that @value{GDBN} can do is guess whether a symbol +refers to a function or variable depending on the linker section that +contains the symbol. Also note that the actual contents of the memory +contained in a DLL are not available unless the program is running. This +means that you cannot examine the contents of a variable or disassemble +a function within a DLL without a running program. + +Variables are generally treated as pointers and dereferenced +automatically. For this reason, it is often necessary to prefix a +variable name with the address-of operator (``&'') and provide explicit +type information in the command. Here's an example of the type of +problem: + +@smallexample +(gdb) print 'cygwin1!__argv' +$1 = 268572168 +@end smallexample + +@smallexample +(gdb) x 'cygwin1!__argv' +0x10021610: "\230y\"" +@end smallexample + +And two possible solutions: + +@smallexample +(gdb) print ((char **)'cygwin1!__argv')[0] +$2 = 0x22fd98 "/cygdrive/c/mydirectory/myprogram" +@end smallexample + +@smallexample +(gdb) x/2x &'cygwin1!__argv' +0x610c0aa8 <cygwin1!__argv>: 0x10021608 0x00000000 +(gdb) x/x 0x10021608 +0x10021608: 0x0022fd98 +(gdb) x/s 0x0022fd98 +0x22fd98: "/cygdrive/c/mydirectory/myprogram" +@end smallexample + +Setting a break point within a DLL is possible even before the program +starts execution. However, under these circumstances, @value{GDBN} can't +examine the initial instructions of the function in order to skip the +function's frame set-up code. You can work around this by using ``*&'' +to set the breakpoint at a raw memory address: + +@smallexample +(gdb) break *&'python22!PyOS_Readline' +Breakpoint 1 at 0x1e04eff0 +@end smallexample + +The author of these extensions is not entirely convinced that setting a +break point within a shared DLL like @file{kernel32.dll} is completely +safe. + @node Embedded OS @section Embedded Operating Systems @@ -12697,6 +12846,32 @@ Arguments of type @code{float} will be passed directly to unprototyped functions. @end table +@kindex set cp-abi +@kindex show cp-abi +@value{GDBN} needs to know the ABI used for your program's C@t{++} +objects. The correct C@t{++} ABI depends on which C@t{++} compiler was +used to build your application. @value{GDBN} only fully supports +programs with a single C@t{++} ABI; if your program contains code using +multiple C@t{++} ABI's or if @value{GDBN} can not identify your +program's ABI correctly, you can tell @value{GDBN} which ABI to use. +Currently supported ABI's include ``gnu-v2'', for @code{g++} versions +before 3.0, ``gnu-v3'', for @code{g++} versions 3.0 and later, and +``hpaCC'' for the HP ANSI C@t{++} compiler. Other C@t{++} compilers may +use the ``gnu-v2'' or ``gnu-v3'' ABI's as well. The default setting is +``auto''. + +@table @code +@item show cp-abi +Show the C@t{++} ABI currently in use. + +@item set cp-abi +With no argument, show the list of supported C@t{++} ABI's. + +@item set cp-abi @var{abi} +@itemx set cp-abi auto +Set the current C@t{++} ABI to @var{abi}, or return to automatic detection. +@end table + @node Messages/Warnings @section Optional warnings and messages diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 0bed0aa..9776a35 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -247,14 +247,15 @@ create_new_frame (read_register (FP_REGNUM), read_pc ())); Other than that, all the meaning imparted to @code{FP_REGNUM} is imparted by the machine-dependent code. So, @code{FP_REGNUM} can have any value that is convenient for the code that creates new frames. -(@code{create_new_frame} calls @code{INIT_EXTRA_FRAME_INFO} if it is -defined; that is where you should use the @code{FP_REGNUM} value, if -your frames are nonstandard.) +(@code{create_new_frame} calls @code{DEPRECATED_INIT_EXTRA_FRAME_INFO} +if it is defined; that is where you should use the @code{FP_REGNUM} +value, if your frames are nonstandard.) @cindex frame chain Given a @value{GDBN} frame, define @code{FRAME_CHAIN} to determine the address of the calling function's frame. This will be used to create a -new @value{GDBN} frame struct, and then @code{INIT_EXTRA_FRAME_INFO} and +new @value{GDBN} frame struct, and then +@code{DEPRECATED_INIT_EXTRA_FRAME_INFO} and @code{DEPRECATED_INIT_FRAME_PC} will be called for the new frame. @section Breakpoint Handling @@ -3251,12 +3252,13 @@ chain pointers, dummy frames, and frames whose PC values are inside the startup file (e.g.@: @file{crt0.o}), inside @code{main}, or inside @code{_start}. -@item FRAME_INIT_SAVED_REGS(@var{frame}) -@findex FRAME_INIT_SAVED_REGS +@item DEPRECATED_FRAME_INIT_SAVED_REGS(@var{frame}) +@findex DEPRECATED_FRAME_INIT_SAVED_REGS See @file{frame.h}. Determines the address of all registers in the current stack frame storing each in @code{frame->saved_regs}. Space for @code{frame->saved_regs} shall be allocated by -@code{FRAME_INIT_SAVED_REGS} using @code{frame_saved_regs_zalloc}. +@code{DEPRECATED_FRAME_INIT_SAVED_REGS} using +@code{frame_saved_regs_zalloc}. @code{FRAME_FIND_SAVED_REGS} and @code{EXTRA_FRAME_INFO} are deprecated. @@ -3357,8 +3359,8 @@ On HP-UX, certain system routines (millicode) have names beginning with @samp{$} or @samp{$$}. For example, @code{$$dyncall} is a millicode routine that handles inter-space procedure calls on PA-RISC. -@item INIT_EXTRA_FRAME_INFO (@var{fromleaf}, @var{frame}) -@findex INIT_EXTRA_FRAME_INFO +@item DEPRECATED_INIT_EXTRA_FRAME_INFO (@var{fromleaf}, @var{frame}) +@findex DEPRECATED_INIT_EXTRA_FRAME_INFO If additional information about the frame is required this should be stored in @code{frame->extra_info}. Space for @code{frame->extra_info} is allocated using @code{frame_extra_info_zalloc}. @@ -3504,6 +3506,12 @@ Return the virtual size of @var{reg}. Return the virtual type of @var{reg}. @xref{Target Architecture Definition, , Raw and Virtual Register Representations}. +@item struct type *register_type (@var{gdbarch}, @var{reg}) +@findex register_type +If defined, return the type of register @var{reg}. This function +superseeds @code{REGISTER_VIRTUAL_TYPE}. @xref{Target Architecture +Definition, , Raw and Virtual Register Representations}. + @item REGISTER_CONVERT_TO_VIRTUAL(@var{reg}, @var{type}, @var{from}, @var{to}) @findex REGISTER_CONVERT_TO_VIRTUAL Convert the value of register @var{reg} from its raw form to its virtual @@ -4095,7 +4103,7 @@ Some mechanisms do not work with multi-arch. They include: @item EXTRA_FRAME_INFO Delete. @item FRAME_FIND_SAVED_REGS -Replaced with @code{FRAME_INIT_SAVED_REGS} +Replaced with @code{DEPRECATED_FRAME_INIT_SAVED_REGS} @end table @noindent diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo index c334d45..33c835b 100644 --- a/gdb/doc/stabs.texinfo +++ b/gdb/doc/stabs.texinfo @@ -2047,8 +2047,9 @@ definition narrows the symbol type to structure. Following the @samp{s} type descriptor is the number of bytes the structure occupies, followed by a description of each structure element. -The structure element descriptions are of the form @var{name:type, bit -offset from the start of the struct, number of bits in the element}. +The structure element descriptions are of the form +@samp{@var{name}:@var{type}, @var{bit offset from the start of the +struct}, @var{number of bits in the element}}. @c FIXME: phony line break. Can probably be fixed by using an example @c with fewer fields. @@ -2146,8 +2147,8 @@ the stab describes an enumeration, structure, or union tag. The type descriptor @samp{u}, following the @samp{23=} of the type definition, narrows it down to a union type definition. Following the @samp{u} is the number of bytes in the union. After that is a list of union element -descriptions. Their format is @var{name:type, bit offset into the -union, number of bytes for the element;}. +descriptions. Their format is @samp{@var{name}:@var{type}, @var{bit +offset into the union}, @var{number of bytes for the element};}. The stab for the union variable is: diff --git a/gdb/doublest.c b/gdb/doublest.c index 49e3689..e601a4d 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -663,7 +663,7 @@ extract_floating (const void *addr, int len) if (fmt == NULL) { - warning ("Can't store a floating-point number of %d bytes.", len); + warning ("Can't extract a floating-point number of %d bytes.", len); return NAN; } diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 618bede..6bedddb 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -172,11 +172,11 @@ extern file_ptr dwarf_eh_frame_offset; extern unsigned int dwarf_eh_frame_size; extern asection *dwarf_frame_section; extern asection *dwarf_eh_frame_section; - + extern char *dwarf2_read_section (struct objfile *objfile, file_ptr offset, - unsigned int size, asection* sectp); + unsigned int size, asection *sectp); static struct fde_unit *fde_unit_alloc (void); static struct cie_unit *cie_unit_alloc (void); @@ -199,7 +199,8 @@ static LONGEST read_sleb128 (bfd *abfd, char **p); static CORE_ADDR read_pointer (bfd *abfd, char **p); static CORE_ADDR read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding); -static enum ptr_encoding pointer_encoding (unsigned char encoding, struct objfile *objfile); +static enum ptr_encoding pointer_encoding (unsigned char encoding, + struct objfile *objfile); static LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read); static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read, @@ -462,8 +463,9 @@ read_pointer (bfd *abfd, char **p) case 8: return read_8u (abfd, p); default: - error ("dwarf cfi error: unsupported target address length [in module %s]", - bfd_get_filename (abfd)); + error + ("dwarf cfi error: unsupported target address length [in module %s]", + bfd_get_filename (abfd)); } } @@ -527,8 +529,9 @@ pointer_encoding (unsigned char encoding, struct objfile *objfile) int ret; if (encoding & DW_EH_PE_indirect) - warning ("CFI: Unsupported pointer encoding: DW_EH_PE_indirect [in module %s]", - objfile->name); + warning + ("CFI: Unsupported pointer encoding: DW_EH_PE_indirect [in module %s]", + objfile->name); switch (encoding & 0x70) { @@ -540,7 +543,8 @@ pointer_encoding (unsigned char encoding, struct objfile *objfile) ret = encoding & 0x70; break; default: - internal_error (__FILE__, __LINE__, "CFI: unknown pointer encoding [in module %s]", + internal_error (__FILE__, __LINE__, + "CFI: unknown pointer encoding [in module %s]", objfile->name); } return ret; @@ -619,8 +623,9 @@ execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end, fs->addr_encoding); if (pointer_encoding (fs->addr_encoding, objfile) != PE_absptr) - warning ("CFI: DW_CFA_set_loc uses relative addressing [in module %s]", - objfile->name); + warning + ("CFI: DW_CFA_set_loc uses relative addressing [in module %s]", + objfile->name); break; @@ -769,8 +774,9 @@ execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end, break; default: - error ("dwarf cfi error: unknown cfa instruction %d [in module %s]", insn, - objfile->name); + error + ("dwarf cfi error: unknown cfa instruction %d [in module %s]", + insn, objfile->name); } } } @@ -1033,25 +1039,33 @@ execute_stack_op (struct objfile *objfile, case DW_OP_dup: if (stack_elt < 1) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); result = stack[stack_elt - 1]; break; case DW_OP_drop: if (--stack_elt < 0) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); goto no_push; case DW_OP_pick: offset = *op_ptr++; if (offset >= stack_elt - 1) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); result = stack[stack_elt - 1 - offset]; break; case DW_OP_over: if (stack_elt < 2) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); result = stack[stack_elt - 2]; break; @@ -1060,7 +1074,9 @@ execute_stack_op (struct objfile *objfile, CORE_ADDR t1, t2, t3; if (stack_elt < 3) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); t1 = stack[stack_elt - 1]; t2 = stack[stack_elt - 2]; t3 = stack[stack_elt - 3]; @@ -1078,7 +1094,9 @@ execute_stack_op (struct objfile *objfile, case DW_OP_plus_uconst: /* Unary operations. */ if (--stack_elt < 0) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); result = stack[stack_elt]; switch (op) @@ -1088,7 +1106,8 @@ execute_stack_op (struct objfile *objfile, int len = TARGET_ADDR_BIT / TARGET_CHAR_BIT; if (len != 4 && len != 8) internal_error (__FILE__, __LINE__, - "execute_stack_op error [in module %s]", objfile->name); + "execute_stack_op error [in module %s]", + objfile->name); result = read_memory_unsigned_integer (result, len); } break; @@ -1098,7 +1117,8 @@ execute_stack_op (struct objfile *objfile, int len = *op_ptr++; if (len != 1 && len != 2 && len != 4 && len != 8) internal_error (__FILE__, __LINE__, - "execute_stack_op error [in module %s]", objfile->name); + "execute_stack_op error [in module %s]", + objfile->name); result = read_memory_unsigned_integer (result, len); } break; @@ -1138,7 +1158,9 @@ execute_stack_op (struct objfile *objfile, /* Binary operations. */ CORE_ADDR first, second; if ((stack_elt -= 2) < 0) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); second = stack[stack_elt]; first = stack[stack_elt + 1]; @@ -1196,7 +1218,9 @@ execute_stack_op (struct objfile *objfile, result = (LONGEST) first != (LONGEST) second; break; default: - error ("execute_stack_op: Unknown DW_OP_ value [in module %s]", objfile->name); + error + ("execute_stack_op: Unknown DW_OP_ value [in module %s]", + objfile->name); break; } } @@ -1209,7 +1233,9 @@ execute_stack_op (struct objfile *objfile, case DW_OP_bra: if (--stack_elt < 0) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); offset = read_2s (objfile->obfd, &op_ptr); if (stack[stack_elt] != 0) op_ptr += offset; @@ -1219,12 +1245,16 @@ execute_stack_op (struct objfile *objfile, goto no_push; default: - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); } /* Most things push a result value. */ if ((size_t) stack_elt >= sizeof (stack) / sizeof (*stack)) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", + objfile->name); stack[++stack_elt] = result; no_push:; } @@ -1232,7 +1262,8 @@ execute_stack_op (struct objfile *objfile, /* We were executing this program to get a value. It should be at top of stack. */ if (--stack_elt < 0) - internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name); + internal_error (__FILE__, __LINE__, + "execute_stack_op error [in module %s]", objfile->name); return stack[stack_elt]; } @@ -1317,7 +1348,7 @@ update_context (struct context *context, struct frame_state *fs, int chain) orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr; break; default: - internal_error (__FILE__, __LINE__, "bad switch 0x%02X", + internal_error (__FILE__, __LINE__, "bad switch 0x%02X", orig_context->reg[fs->regs.reg[i].loc.reg].how); } break; @@ -1548,8 +1579,8 @@ parse_frame_info (struct objfile *objfile, file_ptr frame_offset, cie = cie->next; } if (!cie) - error ("CFI: can't find CIE pointer [in module %s]", - bfd_get_filename (abfd)); + error ("CFI: can't find CIE pointer [in module %s]", + bfd_get_filename (abfd)); } init_loc = read_encoded_pointer (abfd, &start, @@ -1566,7 +1597,7 @@ parse_frame_info (struct objfile *objfile, file_ptr frame_offset, break; default: warning ("CFI: Unsupported pointer encoding [in module %s]", - bfd_get_filename (abfd)); + bfd_get_filename (abfd)); } /* For relocatable objects we must add an offset telling @@ -1773,7 +1804,7 @@ cfi_init_frame_pc (int fromleaf, struct frame_info *fi) CORE_ADDR pc; /* FIXME: cagney/2002-12-04: This is straight wrong. It's assuming that the PC is CORE_ADDR (a host quantity) in size. */ - get_reg ((void *)&pc, UNWIND_CONTEXT (get_next_frame (fi)), PC_REGNUM); + get_reg ((void *) &pc, UNWIND_CONTEXT (get_next_frame (fi)), PC_REGNUM); return pc; } else @@ -1789,7 +1820,9 @@ cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi) unwind_tmp_obstack_init (); fs = frame_state_alloc (); - deprecated_set_frame_context (fi, frame_obstack_zalloc (sizeof (struct context))); + deprecated_set_frame_context (fi, + frame_obstack_zalloc (sizeof + (struct context))); UNWIND_CONTEXT (fi)->reg = frame_obstack_zalloc (sizeof (struct context_reg) * NUM_REGS); memset (UNWIND_CONTEXT (fi)->reg, 0, @@ -1874,8 +1907,8 @@ cfi_get_saved_register (char *raw_buffer, UNWIND_CONTEXT (frame)->reg[regnum].loc.offset; break; case REG_CTX_SAVED_REG: - deprecated_read_register_gen (UNWIND_CONTEXT (frame)->reg[regnum].loc.reg, - raw_buffer); + deprecated_read_register_gen (UNWIND_CONTEXT (frame)->reg[regnum]. + loc.reg, raw_buffer); if (lval != NULL) *lval = lval_register; if (addrp != NULL) diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 9ea9941..4180e05 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -118,7 +118,7 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset) SIZE, to find the current location of variable VAR in the context of FRAME. */ static struct value * -dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +dwarf2_evaluate_loc_desc (const struct symbol *var, struct frame_info *frame, unsigned char *data, unsigned short size, struct objfile *objfile) { @@ -244,7 +244,7 @@ dwarf2_loc_desc_needs_frame (unsigned char *data, unsigned short size) /* Return the value of SYMBOL in FRAME using the DWARF-2 expression evaluator to calculate the location. */ static struct value * -locexpr_read_variable (struct symbol *symbol, struct frame_info *frame) +locexpr_read_variable (const struct symbol *symbol, struct frame_info *frame) { struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); struct value *val; @@ -256,7 +256,7 @@ locexpr_read_variable (struct symbol *symbol, struct frame_info *frame) /* Return non-zero iff we need a frame to evaluate SYMBOL. */ static int -locexpr_read_needs_frame (struct symbol *symbol) +locexpr_read_needs_frame (const struct symbol *symbol) { struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); return dwarf2_loc_desc_needs_frame (dlbaton->data, dlbaton->size); @@ -264,7 +264,7 @@ locexpr_read_needs_frame (struct symbol *symbol) /* Print a natural-language description of SYMBOL to STREAM. */ static int -locexpr_describe_location (struct symbol *symbol, struct ui_file *stream) +locexpr_describe_location (const struct symbol *symbol, struct ui_file *stream) { /* FIXME: be more extensive. */ struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); @@ -294,7 +294,8 @@ locexpr_describe_location (struct symbol *symbol, struct ui_file *stream) against. When there is one this function should be revisited. */ void -locexpr_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax, +locexpr_tracepoint_var_ref (const struct symbol * symbol, + struct agent_expr * ax, struct axs_value * value) { struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9522d8c..63e0c7a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -38,9 +38,12 @@ #include "expression.h" #include "filenames.h" /* for DOSish file names */ #include "macrotab.h" - #include "language.h" #include "complaints.h" +#include "bcache.h" +#include "dwarf2expr.h" +#include "dwarf2loc.h" + #include <fcntl.h> #include "gdb_string.h" #include "gdb_assert.h" @@ -937,6 +940,11 @@ static void dwarf_decode_macros (struct line_header *, unsigned int, static int attr_form_is_block (struct attribute *); +static void +dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, + const struct comp_unit_head *, + struct objfile *objfile); + /* Try to locate the sections we need for DWARF 2 debugging information and return true if we have enough to do something. */ @@ -2230,6 +2238,13 @@ read_func_scope (struct die_info *die, struct objfile *objfile, new = push_context (0, lowpc); new->name = new_symbol (die, die->type, objfile, cu_header); + + /* If there was a location expression for DW_AT_frame_base above, + record it. We still need to decode it above because not all + symbols use location expressions exclusively. */ + if (attr) + dwarf2_symbol_mark_computed (attr, new->name, cu_header, objfile); + list_in_scope = &local_symbols; if (die->has_children) @@ -3211,7 +3226,7 @@ read_enumeration (struct die_info *die, struct objfile *objfile, * sizeof (struct field)); } - FIELD_NAME (fields[num_fields]) = SYMBOL_NAME (sym); + FIELD_NAME (fields[num_fields]) = DEPRECATED_SYMBOL_NAME (sym); FIELD_TYPE (fields[num_fields]) = NULL; FIELD_BITPOS (fields[num_fields]) = SYMBOL_VALUE (sym); FIELD_BITSIZE (fields[num_fields]) = 0; @@ -5273,6 +5288,61 @@ dwarf2_start_subfile (char *filename, char *dirname) start_subfile (filename, dirname); } +static void +var_decode_location (struct attribute *attr, struct symbol *sym, + struct objfile *objfile, + const struct comp_unit_head *cu_header) +{ + /* NOTE drow/2003-01-30: There used to be a comment and some special + code here to turn a symbol with DW_AT_external and a + SYMBOL_VALUE_ADDRESS of 0 into a LOC_UNRESOLVED symbol. This was + necessary for platforms (maybe Alpha, certainly PowerPC GNU/Linux + with some versions of binutils) where shared libraries could have + relocations against symbols in their debug information - the + minimal symbol would have the right address, but the debug info + would not. It's no longer necessary, because we will explicitly + apply relocations when we read in the debug information now. */ + + /* A DW_AT_location attribute with no contents indicates that a + variable has been optimized away. */ + if (attr_form_is_block (attr) && DW_BLOCK (attr)->size == 0) + { + SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT; + return; + } + + /* Handle one degenerate form of location expression specially, to + preserve GDB's previous behavior when section offsets are + specified. If this is just a DW_OP_addr then mark this symbol + as LOC_STATIC. */ + + if (attr_form_is_block (attr) + && DW_BLOCK (attr)->size == 1 + cu_header->addr_size + && DW_BLOCK (attr)->data[0] == DW_OP_addr) + { + int dummy; + + SYMBOL_VALUE_ADDRESS (sym) = + read_address (objfile->obfd, DW_BLOCK (attr)->data + 1, cu_header, + &dummy); + fixup_symbol_section (sym, objfile); + SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, + SYMBOL_SECTION (sym)); + SYMBOL_CLASS (sym) = LOC_STATIC; + return; + } + + /* NOTE drow/2002-01-30: It might be worthwhile to have a static + expression evaluator, and use LOC_COMPUTED only when necessary + (i.e. when the value of a register or memory location is + referenced, or a thread-local block, etc.). Then again, it might + not be worthwhile. I'm assuming that it isn't unless performance + or memory numbers show me otherwise. */ + + dwarf2_symbol_mark_computed (attr, sym, cu_header, objfile); + SYMBOL_CLASS (sym) = LOC_COMPUTED; +} + /* Given a pointer to a DWARF information entry, figure out if we need to make a symbol table entry for it, and if so, create a new entry and return a pointer to it. @@ -5361,106 +5431,12 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, attr = dwarf_attr (die, DW_AT_location); if (attr) { + var_decode_location (attr, sym, objfile, cu_header); attr2 = dwarf_attr (die, DW_AT_external); if (attr2 && (DW_UNSND (attr2) != 0)) - { - /* Support the .debug_loc offsets */ - if (attr_form_is_block (attr)) - { - SYMBOL_VALUE_ADDRESS (sym) = - decode_locdesc (DW_BLOCK (attr), objfile, cu_header); - } - else if (attr->form == DW_FORM_data4 - || attr->form == DW_FORM_data8) - { - dwarf2_complex_location_expr_complaint (); - } - else - { - dwarf2_invalid_attrib_class_complaint ("DW_AT_location", - "external variable"); - } - add_symbol_to_list (sym, &global_symbols); - if (is_thread_local) - { - /* SYMBOL_VALUE_ADDRESS contains at this point the - offset of the variable within the thread local - storage. */ - SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC; - SYMBOL_OBJFILE (sym) = objfile; - } - - /* In shared libraries the address of the variable - in the location descriptor might still be relocatable, - so its value could be zero. - Enter the symbol as a LOC_UNRESOLVED symbol, if its - value is zero, the address of the variable will then - be determined from the minimal symbol table whenever - the variable is referenced. */ - else if (SYMBOL_VALUE_ADDRESS (sym)) - { - fixup_symbol_section (sym, objfile); - SYMBOL_VALUE_ADDRESS (sym) += - ANOFFSET (objfile->section_offsets, - SYMBOL_SECTION (sym)); - SYMBOL_CLASS (sym) = LOC_STATIC; - } - else - SYMBOL_CLASS (sym) = LOC_UNRESOLVED; - } + add_symbol_to_list (sym, &global_symbols); else - { - /* Support the .debug_loc offsets */ - if (attr_form_is_block (attr)) - { - SYMBOL_VALUE (sym) = addr = - decode_locdesc (DW_BLOCK (attr), objfile, cu_header); - } - else if (attr->form == DW_FORM_data4 - || attr->form == DW_FORM_data8) - { - dwarf2_complex_location_expr_complaint (); - } - else - { - dwarf2_invalid_attrib_class_complaint ("DW_AT_location", - "external variable"); - addr = 0; - } - add_symbol_to_list (sym, list_in_scope); - if (optimized_out) - { - SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT; - } - else if (isreg) - { - SYMBOL_CLASS (sym) = LOC_REGISTER; - SYMBOL_VALUE (sym) = - DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym)); - } - else if (offreg) - { - SYMBOL_CLASS (sym) = LOC_BASEREG; - SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg); - } - else if (islocal) - { - SYMBOL_CLASS (sym) = LOC_LOCAL; - } - else if (is_thread_local) - { - SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC; - SYMBOL_OBJFILE (sym) = objfile; - } - else - { - fixup_symbol_section (sym, objfile); - SYMBOL_VALUE_ADDRESS (sym) = - addr + ANOFFSET (objfile->section_offsets, - SYMBOL_SECTION (sym)); - SYMBOL_CLASS (sym) = LOC_STATIC; - } - } + add_symbol_to_list (sym, list_in_scope); } else { @@ -5542,7 +5518,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, { /* FIXME: carlton/2003-01-10: We're being a bit profligate with memory names here. */ - SYMBOL_NAME (sym) + DEPRECATED_SYMBOL_NAME (sym) = obsavestring (TYPE_TAG_NAME (type), strlen (TYPE_TAG_NAME (type)), &objfile->symbol_obstack); @@ -5579,8 +5555,8 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) = - obsavestring (SYMBOL_NAME (sym), - strlen (SYMBOL_NAME (sym)), + obsavestring (DEPRECATED_SYMBOL_NAME (sym), + strlen (DEPRECATED_SYMBOL_NAME (sym)), &objfile->type_obstack); add_symbol_to_list (typedef_sym, list_to_add); } @@ -5590,10 +5566,10 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, if (processing_has_namespace_info && processing_current_prefix[0] != '\0') { - SYMBOL_NAME (sym) = obconcat (&objfile->symbol_obstack, - processing_current_prefix, - "::", - name); + DEPRECATED_SYMBOL_NAME (sym) = obconcat (&objfile->symbol_obstack, + processing_current_prefix, + "::", + name); } SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -5608,10 +5584,10 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, if (processing_has_namespace_info && processing_current_prefix[0] != '\0') { - SYMBOL_NAME (sym) = obconcat (&objfile->symbol_obstack, - processing_current_prefix, - "::", - name); + DEPRECATED_SYMBOL_NAME (sym) = obconcat (&objfile->symbol_obstack, + processing_current_prefix, + "::", + name); } attr = dwarf_attr (die, DW_AT_const_value); if (attr) @@ -5657,7 +5633,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, { case DW_FORM_addr: if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != cu_header->addr_size) - dwarf2_const_value_length_mismatch_complaint (SYMBOL_NAME (sym), + dwarf2_const_value_length_mismatch_complaint (DEPRECATED_SYMBOL_NAME (sym), cu_header->addr_size, TYPE_LENGTH (SYMBOL_TYPE (sym))); @@ -5673,7 +5649,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, case DW_FORM_block: blk = DW_BLOCK (attr); if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != blk->size) - dwarf2_const_value_length_mismatch_complaint (SYMBOL_NAME (sym), + dwarf2_const_value_length_mismatch_complaint (DEPRECATED_SYMBOL_NAME (sym), blk->size, TYPE_LENGTH (SYMBOL_TYPE (sym))); @@ -7796,3 +7772,32 @@ attr_form_is_block (struct attribute *attr) || attr->form == DW_FORM_block4 || attr->form == DW_FORM_block); } + +static void +dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, + const struct comp_unit_head *cu_header, + struct objfile *objfile) +{ + struct dwarf2_locexpr_baton *baton; + + /* When support for location lists is added, this will go away. */ + if (!attr_form_is_block (attr)) + { + dwarf2_complex_location_expr_complaint (); + return; + } + + baton = obstack_alloc (&objfile->symbol_obstack, + sizeof (struct dwarf2_locexpr_baton)); + baton->objfile = objfile; + + /* Note that we're just copying the block's data pointer here, not + the actual data. We're still pointing into the dwarf_info_buffer + for SYM's objfile; right now we never release that buffer, but + when we do clean up properly this may need to change. */ + baton->size = DW_BLOCK (attr)->size; + baton->data = DW_BLOCK (attr)->data; + + SYMBOL_LOCATION_FUNCS (sym) = &dwarf2_locexpr_funcs; + SYMBOL_LOCATION_BATON (sym) = baton; +} diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 9292d0b..6a13e55 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -1676,7 +1676,7 @@ enum_type (struct dieinfo *dip, struct objfile *objfile) sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = create_name (list->field.name, + DEPRECATED_SYMBOL_NAME (sym) = create_name (list->field.name, &objfile->symbol_obstack); SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language); SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -2978,7 +2978,7 @@ synthesize_typedef (struct dieinfo *dip, struct objfile *objfile, obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); OBJSTAT (objfile, n_syms++); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = create_name (dip->at_name, + DEPRECATED_SYMBOL_NAME (sym) = create_name (dip->at_name, &objfile->symbol_obstack); SYMBOL_INIT_LANGUAGE_SPECIFIC (sym, cu_language); SYMBOL_TYPE (sym) = type; diff --git a/gdb/elfread.c b/gdb/elfread.c index b96d6e7..7aee37c 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -542,6 +542,15 @@ elf_symfile_read (struct objfile *objfile, int mainline) elf_symtab_read (objfile, 1); + /* Install any minimal symbols that have been collected as the current + minimal symbols for this objfile. The debug readers below this point + should not generate new minimal symbols; if they do it's their + responsibility to install them. "mdebug" appears to be the only one + which will do this. */ + + install_minimal_symbols (objfile); + do_cleanups (back_to); + /* Now process debugging information, which is contained in special ELF sections. */ @@ -611,13 +620,6 @@ elf_symfile_read (struct objfile *objfile, int mainline) if (DWARF2_BUILD_FRAME_INFO_P ()) DWARF2_BUILD_FRAME_INFO(objfile); - - /* Install any minimal symbols that have been collected as the current - minimal symbols for this objfile. */ - - install_minimal_symbols (objfile); - - do_cleanups (back_to); } /* This cleans up the objfile's sym_stab_info pointer, and the chain of diff --git a/gdb/event-top.c b/gdb/event-top.c index 2b2c4ff..ceef7b9 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -39,15 +39,12 @@ /* readline defines this. */ #undef savestring -extern void _initialize_event_loop (void); - static void rl_callback_read_char_wrapper (gdb_client_data client_data); static void command_line_handler (char *rl); static void command_line_handler_continuation (struct continuation_arg *arg); static void change_line_handler (void); static void change_annotation_level (void); static void command_handler (char *command); -void cli_command_loop (void); static void async_do_nothing (gdb_client_data arg); static void async_disconnect (gdb_client_data arg); static void async_stop_sig (gdb_client_data arg); @@ -1199,12 +1196,3 @@ gdb_disable_readline (void) delete_file_handler (input_fd); } } - -void -_initialize_event_loop (void) -{ - /* Tell gdb to use the cli_command_loop as the main loop. */ - if (event_loop_p && command_loop_hook == NULL) - command_loop_hook = cli_command_loop; -} - diff --git a/gdb/event-top.h b/gdb/event-top.h index d8c0a96..4c06083 100644 --- a/gdb/event-top.h +++ b/gdb/event-top.h @@ -1,5 +1,7 @@ -/* Definitions used by GDB event-top.c. - Copyright 1999, 2001 Free Software Foundation, Inc. +/* Definitions used by event-top.c, for GDB, the GNU debugger. + + Copyright 1999, 2001, 2003 Free Software Foundation, Inc. + Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions. This file is part of GDB. @@ -19,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef EVENT_TOP_H +#define EVENT_TOP_H + /* Stack for prompts. Each prompt is composed as a prefix, a prompt and a suffix. The prompt to be displayed at any given time is the one on top of the stack. A stack is necessary because of cases in @@ -111,3 +116,7 @@ extern void (*call_readline) (void *); extern void (*input_handler) (char *); extern int input_fd; extern void (*after_char_processing_hook) (void); + +extern void cli_command_loop (void); + +#endif diff --git a/gdb/expprint.c b/gdb/expprint.c index 60c3e91..c242611 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -22,7 +22,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "value.h" @@ -31,6 +30,7 @@ #include "frame.h" /* For frame_map_regnum_to_name. */ #include "target.h" #include "gdb_string.h" +#include "block.h" #ifdef HAVE_CTYPE_H #include <ctype.h> @@ -890,7 +890,7 @@ dump_subexp (struct expression *exp, struct ui_file *stream, int elt) fprintf_filtered (stream, ", symbol @"); gdb_print_host_address (exp->elts[elt + 1].symbol, stream); fprintf_filtered (stream, " (%s)", - SYMBOL_NAME (exp->elts[elt + 1].symbol)); + DEPRECATED_SYMBOL_NAME (exp->elts[elt + 1].symbol)); elt += 3; break; case OP_LAST: diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 0de1d46..a9504c1 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -47,13 +47,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_string.h" #include "expression.h" #include "value.h" -#include "block.h" #include "parser-defs.h" #include "language.h" #include "f-lang.h" #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" #include <ctype.h> /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 85866b3..84e3d81 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -483,8 +483,8 @@ const struct language_defn f_language_defn = LANG_MAGIC }; -void -_initialize_f_language (void) +static void +build_fortran_types (void) { builtin_type_f_void = init_type (TYPE_CODE_VOID, 1, @@ -556,6 +556,42 @@ _initialize_f_language (void) 0, "complex*32", (struct objfile *) NULL); TYPE_TARGET_TYPE (builtin_type_f_complex_s32) = builtin_type_f_real_s16; +} + +void +_initialize_f_language (void) +{ + build_fortran_types (); + register_gdbarch_swap (&builtin_type_f_character, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_logical, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_logical_s1, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_logical_s2, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_integer, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_integer_s2, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_real, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_real_s8, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_real_s16, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_complex_s8, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_complex_s16, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_complex_s32, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_f_void, + sizeof (struct type *), NULL); + register_gdbarch_swap (&builtin_type_string, + sizeof (struct type *), NULL); + + register_gdbarch_swap (NULL, 0, build_fortran_types); builtin_type_string = init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 4c7adce..f67a260 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -1,5 +1,5 @@ /* Support for printing Fortran values for GDB, the GNU debugger. - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000 + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. Contributed by Motorola. Adapted from the C definitions by Farooq Butt (fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs. @@ -24,7 +24,6 @@ #include "defs.h" #include "gdb_string.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "value.h" @@ -34,6 +33,7 @@ #include "frame.h" #include "gdbcore.h" #include "command.h" +#include "block.h" #if 0 static int there_is_a_visible_common_named (char *); @@ -618,9 +618,9 @@ info_common_command (char *comname, int from_tty) if (msymbol != NULL && (SYMBOL_VALUE_ADDRESS (msymbol) > BLOCK_START (SYMBOL_BLOCK_VALUE (func)))) - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); else - funname = SYMBOL_NAME (func); + funname = DEPRECATED_SYMBOL_NAME (func); } else { @@ -628,7 +628,7 @@ info_common_command (char *comname, int from_tty) lookup_minimal_symbol_by_pc (get_frame_pc (fi)); if (msymbol != NULL) - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); } /* If comname is NULL, we assume the user wishes to see the @@ -654,7 +654,7 @@ info_common_command (char *comname, int from_tty) while (entry != NULL) { - printf_filtered ("%s = ", SYMBOL_NAME (entry->symbol)); + printf_filtered ("%s = ", DEPRECATED_SYMBOL_NAME (entry->symbol)); print_variable_value (entry->symbol, fi, gdb_stdout); printf_filtered ("\n"); entry = entry->next; @@ -710,9 +710,9 @@ there_is_a_visible_common_named (char *comname) if (msymbol != NULL && (SYMBOL_VALUE_ADDRESS (msymbol) > BLOCK_START (SYMBOL_BLOCK_VALUE (func)))) - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); else - funname = SYMBOL_NAME (func); + funname = DEPRECATED_SYMBOL_NAME (func); } else { @@ -720,7 +720,7 @@ there_is_a_visible_common_named (char *comname) lookup_minimal_symbol_by_pc (fi->pc); if (msymbol != NULL) - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); } the_common = find_common_for_function (comname, funname); diff --git a/gdb/findvar.c b/gdb/findvar.c index b970d8a..56f5b82 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -23,7 +23,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "frame.h" #include "value.h" @@ -36,6 +35,7 @@ #include "symfile.h" /* for overlay functions */ #include "regcache.h" #include "builtin-regs.h" +#include "block.h" /* Basic byte-swapping routines. GDB has needed these for a long time... All extract a target-format integer at ADDR which is LEN bytes long. */ @@ -288,7 +288,7 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr) /* Return a `value' with the contents of (virtual or cooked) register REGNUM as found in the specified FRAME. The register's type is - determined by REGISTER_VIRTUAL_TYPE. + determined by register_type(). NOTE: returns NULL if register value is not available. Caller will check return value or die! */ @@ -320,13 +320,13 @@ value_of_register (int regnum, struct frame_info *frame) if (register_cached (regnum) < 0) return NULL; /* register value not available */ - reg_val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum)); + reg_val = allocate_value (register_type (current_gdbarch, regnum)); /* Convert raw data to virtual format if necessary. */ if (REGISTER_CONVERTIBLE (regnum)) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum), + REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum), raw_buffer, VALUE_CONTENTS_RAW (reg_val)); } else if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (regnum)) @@ -384,6 +384,14 @@ symbol_read_needs_frame (const struct symbol *sym) { /* All cases listed explicitly so that gcc -Wall will detect it if we failed to consider one. */ + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + { + struct location_funcs *symfuncs = SYMBOL_LOCATION_FUNCS (sym); + return (symfuncs->read_needs_frame) (sym); + } + break; + case LOC_REGISTER: case LOC_ARG: case LOC_REF_ARG: @@ -605,11 +613,23 @@ addresses have not been bound by the dynamic loader. Try again when executable i } break; + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + { + struct location_funcs *funcs = SYMBOL_LOCATION_FUNCS (var); + + if (frame == 0 && (funcs->read_needs_frame) (var)) + return 0; + return (funcs->read_variable) (var, frame); + + } + break; + case LOC_UNRESOLVED: { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL); + msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL); if (msym == NULL) return 0; if (overlay_debugging) diff --git a/gdb/frame.c b/gdb/frame.c index 0c3009c..5d220c9 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -39,6 +39,10 @@ #include "command.h" #include "gdbcmd.h" +/* Flag to control debugging. */ + +static int frame_debug; + /* Flag to indicate whether backtraces should stop at main. */ static int backtrace_below_main; @@ -141,17 +145,6 @@ frame_pc_unwind (struct frame_info *frame) return frame->pc_unwind_cache; } -struct frame_id -frame_id_unwind (struct frame_info *frame) -{ - if (!frame->id_unwind_cache_p) - { - frame->unwind->id (frame, &frame->unwind_cache, &frame->id_unwind_cache); - frame->id_unwind_cache_p = 1; - } - return frame->id_unwind_cache; -} - void frame_pop (struct frame_info *frame) { @@ -307,7 +300,7 @@ frame_read_signed_register (struct frame_info *frame, int regnum, frame_unwind_signed_register (frame->next, regnum, val); } -static void +void generic_unwind_get_saved_register (char *raw_buffer, int *optimizedp, CORE_ADDR *addrp, @@ -605,12 +598,13 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, && (get_frame_type (frame) == DUMMY_FRAME))); /* Only (older) architectures that implement the - FRAME_INIT_SAVED_REGS method should be using this function. */ - gdb_assert (FRAME_INIT_SAVED_REGS_P ()); + DEPRECATED_FRAME_INIT_SAVED_REGS method should be using this + function. */ + gdb_assert (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()); /* Load the saved_regs register cache. */ if (get_frame_saved_regs (frame) == NULL) - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); if (get_frame_saved_regs (frame) != NULL && get_frame_saved_regs (frame)[regnum] != 0) @@ -791,7 +785,7 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, if (!target_has_registers) error ("No registers."); - gdb_assert (FRAME_INIT_SAVED_REGS_P ()); + gdb_assert (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()); /* Normal systems don't optimize out things with register numbers. */ if (optimized != NULL) @@ -827,7 +821,7 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, return; } - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); if (get_frame_saved_regs (frame) != NULL && get_frame_saved_regs (frame)[regnum] != 0) { @@ -901,8 +895,8 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc) fi->next = create_sentinel_frame (current_regcache); fi->type = frame_type_from_pc (pc); - if (INIT_EXTRA_FRAME_INFO_P ()) - INIT_EXTRA_FRAME_INFO (0, fi); + if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()) + DEPRECATED_INIT_EXTRA_FRAME_INFO (0, fi); /* Select/initialize an unwind function. */ fi->unwind = frame_unwind_find_by_pc (current_gdbarch, fi->pc); @@ -1033,25 +1027,25 @@ legacy_get_prev_frame (struct frame_info *next_frame) /* This change should not be needed, FIXME! We should determine whether any targets *need* DEPRECATED_INIT_FRAME_PC to happen - after INIT_EXTRA_FRAME_INFO and come up with a simple way to - express what goes on here. + after DEPRECATED_INIT_EXTRA_FRAME_INFO and come up with a simple + way to express what goes on here. - INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame - (where the PC is already set up) and here (where it isn't). - DEPRECATED_INIT_FRAME_PC is only called from here, always after - INIT_EXTRA_FRAME_INFO. + DEPRECATED_INIT_EXTRA_FRAME_INFO is called from two places: + create_new_frame (where the PC is already set up) and here (where + it isn't). DEPRECATED_INIT_FRAME_PC is only called from here, + always after DEPRECATED_INIT_EXTRA_FRAME_INFO. - The catch is the MIPS, where INIT_EXTRA_FRAME_INFO requires the - PC value (which hasn't been set yet). Some other machines appear - to require INIT_EXTRA_FRAME_INFO before they can do - DEPRECATED_INIT_FRAME_PC. Phoo. + The catch is the MIPS, where DEPRECATED_INIT_EXTRA_FRAME_INFO + requires the PC value (which hasn't been set yet). Some other + machines appear to require DEPRECATED_INIT_EXTRA_FRAME_INFO + before they can do DEPRECATED_INIT_FRAME_PC. Phoo. We shouldn't need DEPRECATED_INIT_FRAME_PC_FIRST to add more complication to an already overcomplicated part of GDB. gnu@cygnus.com, 15Sep92. Assuming that some machines need DEPRECATED_INIT_FRAME_PC after - INIT_EXTRA_FRAME_INFO, one possible scheme: + DEPRECATED_INIT_EXTRA_FRAME_INFO, one possible scheme: SETUP_INNERMOST_FRAME(): Default version is just create_new_frame (read_fp ()), read_pc ()). Machines with extra frame info would @@ -1061,13 +1055,14 @@ legacy_get_prev_frame (struct frame_info *next_frame) create_new_frame would no longer init extra frame info; SETUP_ARBITRARY_FRAME would have to do that. - INIT_PREV_FRAME(fromleaf, prev) Replace INIT_EXTRA_FRAME_INFO and - DEPRECATED_INIT_FRAME_PC. This should also return a flag saying - whether to keep the new frame, or whether to discard it, because - on some machines (e.g. mips) it is really awkward to have - FRAME_CHAIN_VALID called *before* INIT_EXTRA_FRAME_INFO (there is - no good way to get information deduced in FRAME_CHAIN_VALID into - the extra fields of the new frame). std_frame_pc(fromleaf, prev) + INIT_PREV_FRAME(fromleaf, prev) Replace + DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC. + This should also return a flag saying whether to keep the new + frame, or whether to discard it, because on some machines (e.g. + mips) it is really awkward to have FRAME_CHAIN_VALID called + BEFORE DEPRECATED_INIT_EXTRA_FRAME_INFO (there is no good way to + get information deduced in FRAME_CHAIN_VALID into the extra + fields of the new frame). std_frame_pc(fromleaf, prev) This is the default setting for INIT_PREV_FRAME. It just does what the default DEPRECATED_INIT_FRAME_PC does. Some machines @@ -1104,8 +1099,8 @@ legacy_get_prev_frame (struct frame_info *next_frame) if (DEPRECATED_INIT_FRAME_PC_FIRST_P ()) prev->pc = (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)); - if (INIT_EXTRA_FRAME_INFO_P ()) - INIT_EXTRA_FRAME_INFO (fromleaf, prev); + if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()) + DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, prev); /* This entry is in the frame queue now, which is good since FRAME_SAVED_PC may use that queue to figure out its value (see @@ -1223,14 +1218,22 @@ get_prev_frame (struct frame_info *next_frame) Note, this is done _before_ the frame has been marked as previously unwound. That way if the user later decides to allow unwinds past main(), that just happens. */ - return NULL; + { + if (frame_debug) + fprintf_unfiltered (gdb_stdlog, + "Outermost frame - inside main func.\n"); + return NULL; + } /* Only try to do the unwind once. */ if (next_frame->prev_p) return next_frame->prev; next_frame->prev_p = 1; - /* If we're inside the entry file, it isn't valid. */ + /* If we're inside the entry file, it isn't valid. Don't apply this + test to a dummy frame - dummy frame PC's typically land in the + entry file. Don't apply this test to the sentinel frame. + Sentinel frames should always be allowed to unwind. */ /* NOTE: drow/2002-12-25: should there be a way to disable this check? It assumes a single small entry file, and the way some debug readers (e.g. dbxread) figure out which object is the @@ -1238,8 +1241,31 @@ get_prev_frame (struct frame_info *next_frame) /* NOTE: cagney/2003-01-10: If there is a way of disabling this test then it should probably be moved to before the ->prev_p test, above. */ - if (inside_entry_file (get_frame_pc (next_frame))) + if (next_frame->type != DUMMY_FRAME && next_frame->level >= 0 + && inside_entry_file (get_frame_pc (next_frame))) + { + if (frame_debug) + fprintf_unfiltered (gdb_stdlog, + "Outermost frame - inside entry file\n"); return NULL; + } + + /* If we're already inside the entry function for the main objfile, + then it isn't valid. Don't apply this test to a dummy frame - + dummy frame PC's typically land in the entry func. Don't apply + this test to the sentinel frame. Sentinel frames should always + be allowed to unwind. */ + /* NOTE: cagney/2003-02-25: Don't enable until someone has found + hard evidence that this is needed. */ + if (0 + && next_frame->type != DUMMY_FRAME && next_frame->level >= 0 + && inside_entry_func (get_frame_pc (next_frame))) + { + if (frame_debug) + fprintf_unfiltered (gdb_stdlog, + "Outermost frame - inside entry func\n"); + return NULL; + } /* If any of the old frame initialization methods are around, use the legacy get_prev_frame method. Just don't try to unwind a @@ -1247,10 +1273,16 @@ get_prev_frame (struct frame_info *next_frame) frames use the new unwind code. */ if ((DEPRECATED_INIT_FRAME_PC_P () || DEPRECATED_INIT_FRAME_PC_FIRST_P () - || INIT_EXTRA_FRAME_INFO_P () + || DEPRECATED_INIT_EXTRA_FRAME_INFO_P () || FRAME_CHAIN_P ()) && next_frame->level >= 0) - return legacy_get_prev_frame (next_frame); + { + prev_frame = legacy_get_prev_frame (next_frame); + if (frame_debug && prev_frame == NULL) + fprintf_unfiltered (gdb_stdlog, + "Outermost frame - legacy_get_prev_frame NULL.\n"); + return prev_frame; + } /* Allocate the new frame but do not wire it in to the frame chain. Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along @@ -1274,7 +1306,8 @@ get_prev_frame (struct frame_info *next_frame) frame chain. This is ok since, for old targets, both frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume NEXT_FRAME's data structures have already been initialized (using - INIT_EXTRA_FRAME_INFO) and hence the call order doesn't matter. + DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order + doesn't matter. By unwinding the PC first, it becomes possible to, in the case of a dummy frame, avoid also unwinding the frame ID. This is @@ -1283,9 +1316,14 @@ get_prev_frame (struct frame_info *next_frame) prev_frame->pc = frame_pc_unwind (next_frame); if (prev_frame->pc == 0) - /* The allocated PREV_FRAME will be reclaimed when the frame - obstack is next purged. */ - return NULL; + { + /* The allocated PREV_FRAME will be reclaimed when the frame + obstack is next purged. */ + if (frame_debug) + fprintf_unfiltered (gdb_stdlog, + "Outermost frame - unwound PC zero\n"); + return NULL; + } prev_frame->type = frame_type_from_pc (prev_frame->pc); /* Set the unwind functions based on that identified PC. */ @@ -1295,14 +1333,42 @@ get_prev_frame (struct frame_info *next_frame) /* FIXME: cagney/2003-01-13: A dummy frame doesn't need to unwind the frame ID because the frame ID comes from the previous frame. The other frames do though. True? */ - { - /* FIXME: cagney/2002-12-18: Instead of this hack, should just - save the frame ID directly. */ - struct frame_id id = frame_id_unwind (next_frame); - if (!frame_id_p (id)) + /* FIXME: cagney/2003-03-04: The below call isn't right. It should + instead be doing something like "prev_frame -> unwind -> id + (next_frame, & prev_frame -> unwind_cache, & prev_frame -> id)" + but that requires more extensive (pending) changes. */ + next_frame->unwind->id (next_frame, &next_frame->unwind_cache, + &prev_frame->id); + /* Check that the unwound ID is valid. As of 2003-02-24 the x86-64 + was returning an invalid frame ID when trying to do an unwind a + sentinel frame that belonged to a frame dummy. */ + if (!frame_id_p (prev_frame->id)) + { + if (frame_debug) + fprintf_unfiltered (gdb_stdlog, + "Outermost frame - unwound frame ID invalid\n"); return NULL; - prev_frame->frame = id.base; - } + } + /* Check that the new frame isn't inner to (younger, below, next) + the old frame. If that happens the frame unwind is going + backwards. */ + /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since that + doesn't have a valid frame ID. Should instead set the sentinel + frame's frame ID to a `sentinel'. Leave it until after the + switch to storing the frame ID, instead of the frame base, in the + frame object. */ + if (next_frame->level >= 0 + && frame_id_inner (prev_frame->id, get_frame_id (next_frame))) + error ("Unwound frame inner-to selected frame (corrupt stack?)"); + /* Note that, due to frameless functions, the stronger test of the + new frame being outer to the old frame can't be used - frameless + functions differ by only their PC value. */ + + /* FIXME: cagney/2002-12-18: Instead of this hack, should only store + the frame ID in PREV_FRAME. Unfortunatly, some architectures + (HP/UX) still reply on EXTRA_FRAME_INFO and, hence, still poke at + the "struct frame_info" object directly. */ + prev_frame->frame = prev_frame->id.base; /* Link it in. */ next_frame->prev = prev_frame; @@ -1313,12 +1379,13 @@ get_prev_frame (struct frame_info *next_frame) (passed to the unwind functions) to store additional frame info. Unfortunatly legacy targets can't use legacy_get_prev_frame() to unwind the sentinel frame and, consequently, are forced to take - this code path and rely on the below call to INIT_EXTR_FRAME_INFO - to initialize the inner-most frame. */ - if (INIT_EXTRA_FRAME_INFO_P ()) + this code path and rely on the below call to + DEPRECATED_INIT_EXTRA_FRAME_INFO to initialize the inner-most + frame. */ + if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()) { gdb_assert (prev_frame->level == 0); - INIT_EXTRA_FRAME_INFO (0, prev_frame); + DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev_frame); } return prev_frame; @@ -1393,7 +1460,7 @@ deprecated_set_frame_type (struct frame_info *frame, enum frame_type type) #ifdef FRAME_FIND_SAVED_REGS /* XXX - deprecated. This is a compatibility function for targets - that do not yet implement FRAME_INIT_SAVED_REGS. */ + that do not yet implement DEPRECATED_FRAME_INIT_SAVED_REGS. */ /* Find the addresses in which registers are saved in FRAME. */ void @@ -1436,8 +1503,13 @@ void deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc) { /* See comment in "frame.h". */ - gdb_assert (frame->next != NULL); frame->pc = pc; + /* While we're at it, update this frame's cached PC value, found in + the next frame. Oh, for the day when "struct frame_info" is + opaque and this hack on hack can go. */ + gdb_assert (frame->next != NULL); + frame->next->pc_unwind_cache = pc; + frame->next->pc_unwind_cache_p = 1; } void @@ -1536,4 +1608,11 @@ Normally the caller of \"main\" is not of interest, so GDB will terminate\n\ the backtrace at \"main\". Set this variable if you need to see the rest\n\ of the stack trace.", NULL, NULL, &setlist, &showlist); + + + /* Debug this files internals. */ + add_show_from_set (add_set_cmd ("frame", class_maintenance, var_zinteger, + &frame_debug, "Set frame debugging.\n\ +When non-zero, frame specific internal debugging is enabled.", &setdebuglist), + &showdebuglist); } diff --git a/gdb/frame.h b/gdb/frame.h index 2cdf931..77db6ba 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -25,6 +25,7 @@ struct symtab_and_line; struct frame_unwind; +struct block; /* The traditional frame unwinder. */ extern const struct frame_unwind *trad_frame_unwind; @@ -242,7 +243,7 @@ extern enum frame_type get_frame_type (struct frame_info *); PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and DEPRECATED_PC_IN_CALL_DUMMY() indicates a DUMMY_FRAME. I suspect the real problem here is that get_prev_frame() only sets - initialized after INIT_EXTRA_FRAME_INFO as been called. + initialized after DEPRECATED_INIT_EXTRA_FRAME_INFO as been called. Consequently, some targets found that the frame's type was wrong and tried to fix it. The correct fix is to modify get_prev_frame() so that it initializes the frame's type before calling any other @@ -309,10 +310,6 @@ extern const char *frame_map_regnum_to_name (int regnum); extern CORE_ADDR frame_pc_unwind (struct frame_info *frame); -/* Unwind the frame ID. Return an ID that uniquely identifies the - caller's frame. */ -extern struct frame_id frame_id_unwind (struct frame_info *frame); - /* Discard the specified frame. Restoring the registers to the state of the caller. */ extern void frame_pop (struct frame_info *frame); @@ -380,7 +377,7 @@ struct frame_info special, the address here is the sp for the previous frame, not the address where the sp was saved. */ /* Allocated by frame_saved_regs_zalloc () which is called / - initialized by FRAME_INIT_SAVED_REGS(). */ + initialized by DEPRECATED_FRAME_INIT_SAVED_REGS(). */ CORE_ADDR *saved_regs; /*NUM_REGS + NUM_PSEUDO_REGS*/ #ifdef EXTRA_FRAME_INFO @@ -393,7 +390,7 @@ struct frame_info /* Anything extra for this structure that may have been defined in the machine dependent files. */ /* Allocated by frame_extra_info_zalloc () which is called / - initialized by INIT_EXTRA_FRAME_INFO */ + initialized by DEPRECATED_INIT_EXTRA_FRAME_INFO */ struct frame_extra_info *extra_info; /* If dwarf2 unwind frame informations is used, this structure holds all @@ -411,9 +408,9 @@ struct frame_info int pc_unwind_cache_p; CORE_ADDR pc_unwind_cache; - /* Cached copy of the previous frame's ID. */ - int id_unwind_cache_p; - struct frame_id id_unwind_cache; + /* This frame's ID. Note that the frame's ID, base and PC contain + redundant information. */ + struct frame_id id; /* Pointers to the next (down, inner, younger) and previous (up, outer, older) frame_info's in the frame cache. */ @@ -464,7 +461,7 @@ extern void generic_save_dummy_frame_tos (CORE_ADDR sp); #ifdef FRAME_FIND_SAVED_REGS /* XXX - deprecated */ -#define FRAME_INIT_SAVED_REGS(FI) deprecated_get_frame_saved_regs (FI, NULL) +#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) deprecated_get_frame_saved_regs (FI, NULL) extern void deprecated_get_frame_saved_regs (struct frame_info *, struct frame_saved_regs *); #endif @@ -506,10 +503,6 @@ extern CORE_ADDR frame_address_in_block (struct frame_info *); extern CORE_ADDR get_pc_function_start (CORE_ADDR); -extern struct block *block_for_pc (CORE_ADDR); - -extern struct block *block_for_pc_sect (CORE_ADDR, asection *); - extern int frameless_look_for_prologue (struct frame_info *); extern void print_frame_args (struct symbol *, struct frame_info *, @@ -553,6 +546,13 @@ extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); +void generic_unwind_get_saved_register (char *raw_buffer, + int *optimizedp, + CORE_ADDR *addrp, + struct frame_info *frame, + int regnum, + enum lval_type *lvalp); + /* The function generic_get_saved_register() has been made obsolete. GET_SAVED_REGISTER now defaults to the recursive equivalent - generic_unwind_get_saved_register() - so there is no need to even diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index b89e54e..d279707 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -38,7 +38,6 @@ static gdbarch_breakpoint_from_pc_ftype frv_breakpoint_from_pc; static gdbarch_frame_chain_ftype frv_frame_chain; static gdbarch_frame_saved_pc_ftype frv_frame_saved_pc; static gdbarch_skip_prologue_ftype frv_skip_prologue; -static gdbarch_frame_init_saved_regs_ftype frv_frame_init_saved_regs; static gdbarch_deprecated_extract_return_value_ftype frv_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype frv_extract_struct_value_address; static gdbarch_use_struct_convention_ftype frv_use_struct_convention; @@ -1067,9 +1066,9 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4); set_gdbarch_register_byte (gdbarch, frv_register_byte); set_gdbarch_register_raw_size (gdbarch, frv_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); set_gdbarch_register_virtual_size (gdbarch, frv_register_virtual_size); - set_gdbarch_max_register_virtual_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); set_gdbarch_register_virtual_type (gdbarch, frv_register_virtual_type); set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue); @@ -1084,7 +1083,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, frv_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, frv_frame_saved_pc); - set_gdbarch_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs); set_gdbarch_use_struct_convention (gdbarch, frv_use_struct_convention); set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value); @@ -1103,7 +1102,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words)); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); - set_gdbarch_init_extra_frame_info (gdbarch, frv_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, frv_init_extra_frame_info); /* Settings that should be unnecessary. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); @@ -1119,7 +1118,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_decr_pc_after_break (gdbarch, 0); @@ -21,6 +21,7 @@ #include "defs.h" #include "main.h" #include "gdb_string.h" +#include "interps.h" int main (int argc, char **argv) @@ -30,5 +31,6 @@ main (int argc, char **argv) args.argc = argc; args.argv = argv; args.use_windows = 0; + args.interpreter_p = INTERP_CONSOLE; return gdb_main (&args); } diff --git a/gdb/gdb_mbuild.sh b/gdb/gdb_mbuild.sh index c5f5729..fc17219 100755 --- a/gdb/gdb_mbuild.sh +++ b/gdb/gdb_mbuild.sh @@ -85,7 +85,7 @@ do ;; -f ) # Force a rebuild - force=true + force=true ; ;; -v ) # Be more, and more, and more, verbose diff --git a/gdb/gdb_thread_db.h b/gdb/gdb_thread_db.h index c47c424..81dd0a0 100644 --- a/gdb/gdb_thread_db.h +++ b/gdb/gdb_thread_db.h @@ -199,6 +199,16 @@ typedef struct td_notify } u; } td_notify_t; +/* Some people still have libc5 or old glibc with no uintptr_t. + They lose. glibc 2.1.3 was released on 2000-02-25, and it has + uintptr_t, so it's reasonable to force these people to upgrade. */ + +#ifndef HAVE_UINTPTR_T +#error No uintptr_t available; your C library is too old. +/* Inhibit further compilation errors after this error. */ +#define uintptr_t void * +#endif + /* Structure used to report event. */ typedef struct td_event_msg { diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 10f6397..68247d6 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -170,10 +170,11 @@ struct gdbarch int register_bytes; gdbarch_register_byte_ftype *register_byte; gdbarch_register_raw_size_ftype *register_raw_size; - int max_register_raw_size; + int deprecated_max_register_raw_size; gdbarch_register_virtual_size_ftype *register_virtual_size; - int max_register_virtual_size; + int deprecated_max_register_virtual_size; gdbarch_register_virtual_type_ftype *register_virtual_type; + gdbarch_register_type_ftype *register_type; gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info; gdbarch_print_registers_info_ftype *print_registers_info; gdbarch_print_float_info_ftype *print_float_info; @@ -213,7 +214,7 @@ struct gdbarch gdbarch_integer_to_address_ftype *integer_to_address; gdbarch_return_value_on_stack_ftype *return_value_on_stack; gdbarch_push_arguments_ftype *push_arguments; - gdbarch_push_dummy_frame_ftype *push_dummy_frame; + gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame; gdbarch_push_return_address_ftype *push_return_address; gdbarch_pop_frame_ftype *pop_frame; gdbarch_store_struct_return_ftype *store_struct_return; @@ -224,8 +225,8 @@ struct gdbarch gdbarch_extract_struct_value_address_ftype *extract_struct_value_address; gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address; gdbarch_use_struct_convention_ftype *use_struct_convention; - gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs; - gdbarch_init_extra_frame_info_ftype *init_extra_frame_info; + gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs; + gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info; gdbarch_skip_prologue_ftype *skip_prologue; gdbarch_prologue_frameless_p_ftype *prologue_frameless_p; gdbarch_inner_than_ftype *inner_than; @@ -339,6 +340,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, + 0, default_print_registers_info, 0, 0, @@ -517,9 +519,7 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->register_bytes = -1; current_gdbarch->register_byte = generic_register_byte; current_gdbarch->register_raw_size = generic_register_size; - current_gdbarch->max_register_raw_size = -1; current_gdbarch->register_virtual_size = generic_register_size; - current_gdbarch->max_register_virtual_size = -1; current_gdbarch->print_registers_info = default_print_registers_info; current_gdbarch->register_sim_regno = legacy_register_sim_regno; current_gdbarch->cannot_fetch_register = cannot_register_not; @@ -659,16 +659,11 @@ verify_gdbarch (struct gdbarch *gdbarch) fprintf_unfiltered (log, "\n\tregister_bytes"); /* Skip verify of register_byte, invalid_p == 0 */ /* Skip verify of register_raw_size, invalid_p == 0 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->max_register_raw_size == -1)) - fprintf_unfiltered (log, "\n\tmax_register_raw_size"); + /* Skip verify of deprecated_max_register_raw_size, has predicate */ /* Skip verify of register_virtual_size, invalid_p == 0 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->max_register_virtual_size == -1)) - fprintf_unfiltered (log, "\n\tmax_register_virtual_size"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->register_virtual_type == 0)) - fprintf_unfiltered (log, "\n\tregister_virtual_type"); + /* Skip verify of deprecated_max_register_virtual_size, has predicate */ + /* Skip verify of register_virtual_type, has predicate */ + /* Skip verify of register_type, has predicate */ /* Skip verify of deprecated_do_registers_info, has predicate */ /* Skip verify of print_registers_info, invalid_p == 0 */ /* Skip verify of print_float_info, has predicate */ @@ -724,9 +719,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of integer_to_address, has predicate */ /* Skip verify of return_value_on_stack, invalid_p == 0 */ /* Skip verify of push_arguments, invalid_p == 0 */ - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->push_dummy_frame == 0)) - fprintf_unfiltered (log, "\n\tpush_dummy_frame"); + /* Skip verify of deprecated_push_dummy_frame, has predicate */ /* Skip verify of push_return_address, has predicate */ /* Skip verify of pop_frame, has predicate */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) @@ -737,8 +730,8 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of extract_struct_value_address, has predicate */ /* Skip verify of deprecated_extract_struct_value_address, has predicate */ /* Skip verify of use_struct_convention, invalid_p == 0 */ - /* Skip verify of frame_init_saved_regs, has predicate */ - /* Skip verify of init_extra_frame_info, has predicate */ + /* Skip verify of deprecated_frame_init_saved_regs, has predicate */ + /* Skip verify of deprecated_init_extra_frame_info, has predicate */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->skip_prologue == 0)) fprintf_unfiltered (log, "\n\tskip_prologue"); @@ -1171,6 +1164,52 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_extract_struct_value_address /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif +#ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_INIT_SAVED_REGS_P()", + XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS_P() = %d\n", + DEPRECATED_FRAME_INIT_SAVED_REGS_P ()); +#endif +#ifdef DEPRECATED_FRAME_INIT_SAVED_REGS +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)", + XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n", + (long) current_gdbarch->deprecated_frame_init_saved_regs + /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/); +#endif +#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()", + XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO_P() = %d\n", + DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()); +#endif +#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)", + XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n", + (long) current_gdbarch->deprecated_init_extra_frame_info + /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/); +#endif #ifdef DEPRECATED_INIT_FRAME_PC_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1211,6 +1250,40 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_init_frame_pc_first /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/); #endif +#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_MAX_REGISTER_RAW_SIZE_P()", + XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE_P() = %d\n", + DEPRECATED_MAX_REGISTER_RAW_SIZE_P ()); +#endif +#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE # %s\n", + XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE = %d\n", + DEPRECATED_MAX_REGISTER_RAW_SIZE); +#endif +#ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P()", + XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() = %d\n", + DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ()); +#endif +#ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE # %s\n", + XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n", + DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE); +#endif #ifdef DEPRECATED_PC_IN_CALL_DUMMY_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1231,6 +1304,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_pc_in_call_dummy /*DEPRECATED_PC_IN_CALL_DUMMY ()*/); #endif +#ifdef DEPRECATED_PUSH_DUMMY_FRAME_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PUSH_DUMMY_FRAME_P()", + XSTRING (DEPRECATED_PUSH_DUMMY_FRAME_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME_P() = %d\n", + DEPRECATED_PUSH_DUMMY_FRAME_P ()); +#endif +#ifdef DEPRECATED_PUSH_DUMMY_FRAME +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PUSH_DUMMY_FRAME(-)", + XSTRING (DEPRECATED_PUSH_DUMMY_FRAME (-))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME = <0x%08lx>\n", + (long) current_gdbarch->deprecated_push_dummy_frame + /*DEPRECATED_PUSH_DUMMY_FRAME ()*/); +#endif #ifdef DEPRECATED_STORE_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1465,29 +1561,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->frame_chain_valid /*FRAME_CHAIN_VALID ()*/); #endif -#ifdef FRAME_INIT_SAVED_REGS_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_INIT_SAVED_REGS_P()", - XSTRING (FRAME_INIT_SAVED_REGS_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_INIT_SAVED_REGS_P() = %d\n", - FRAME_INIT_SAVED_REGS_P ()); -#endif -#ifdef FRAME_INIT_SAVED_REGS -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "FRAME_INIT_SAVED_REGS(frame)", - XSTRING (FRAME_INIT_SAVED_REGS (frame))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: FRAME_INIT_SAVED_REGS = <0x%08lx>\n", - (long) current_gdbarch->frame_init_saved_regs - /*FRAME_INIT_SAVED_REGS ()*/); -#endif #ifdef FRAME_LOCALS_ADDRESS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1589,29 +1662,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n", HAVE_NONSTEPPABLE_WATCHPOINT); #endif -#ifdef INIT_EXTRA_FRAME_INFO_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INIT_EXTRA_FRAME_INFO_P()", - XSTRING (INIT_EXTRA_FRAME_INFO_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: INIT_EXTRA_FRAME_INFO_P() = %d\n", - INIT_EXTRA_FRAME_INFO_P ()); -#endif -#ifdef INIT_EXTRA_FRAME_INFO -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INIT_EXTRA_FRAME_INFO(fromleaf, frame)", - XSTRING (INIT_EXTRA_FRAME_INFO (fromleaf, frame))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: INIT_EXTRA_FRAME_INFO = <0x%08lx>\n", - (long) current_gdbarch->init_extra_frame_info - /*INIT_EXTRA_FRAME_INFO ()*/); -#endif #ifdef INNER_THAN fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1665,22 +1715,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->in_solib_return_trampoline /*IN_SOLIB_RETURN_TRAMPOLINE ()*/); #endif -#ifdef MAX_REGISTER_RAW_SIZE - fprintf_unfiltered (file, - "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n", - XSTRING (MAX_REGISTER_RAW_SIZE)); - fprintf_unfiltered (file, - "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n", - MAX_REGISTER_RAW_SIZE); -#endif -#ifdef MAX_REGISTER_VIRTUAL_SIZE - fprintf_unfiltered (file, - "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n", - XSTRING (MAX_REGISTER_VIRTUAL_SIZE)); - fprintf_unfiltered (file, - "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n", - MAX_REGISTER_VIRTUAL_SIZE); -#endif #ifdef MEMORY_INSERT_BREAKPOINT fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1857,20 +1891,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->push_arguments /*PUSH_ARGUMENTS ()*/); #endif -#ifdef PUSH_DUMMY_FRAME -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PUSH_DUMMY_FRAME(-)", - XSTRING (PUSH_DUMMY_FRAME (-))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: PUSH_DUMMY_FRAME = <0x%08lx>\n", - (long) current_gdbarch->push_dummy_frame - /*PUSH_DUMMY_FRAME ()*/); -#endif #ifdef PUSH_RETURN_ADDRESS_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2024,6 +2044,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_to_value /*REGISTER_TO_VALUE ()*/); #endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_register_type_p() = %d\n", + gdbarch_register_type_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: register_type = 0x%08lx\n", + (long) current_gdbarch->register_type); #ifdef REGISTER_VIRTUAL_SIZE fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2035,6 +2063,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_virtual_size /*REGISTER_VIRTUAL_SIZE ()*/); #endif +#ifdef REGISTER_VIRTUAL_TYPE_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "REGISTER_VIRTUAL_TYPE_P()", + XSTRING (REGISTER_VIRTUAL_TYPE_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: REGISTER_VIRTUAL_TYPE_P() = %d\n", + REGISTER_VIRTUAL_TYPE_P ()); +#endif #ifdef REGISTER_VIRTUAL_TYPE fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -3281,22 +3318,26 @@ set_gdbarch_register_raw_size (struct gdbarch *gdbarch, } int -gdbarch_max_register_raw_size (struct gdbarch *gdbarch) +gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_max_register_raw_size != 0; +} + +int +gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->max_register_raw_size == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_max_register_raw_size invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n"); - return gdbarch->max_register_raw_size; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_raw_size called\n"); + return gdbarch->deprecated_max_register_raw_size; } void -set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, - int max_register_raw_size) +set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, + int deprecated_max_register_raw_size) { - gdbarch->max_register_raw_size = max_register_raw_size; + gdbarch->deprecated_max_register_raw_size = deprecated_max_register_raw_size; } int @@ -3319,22 +3360,33 @@ set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, } int -gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) +gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_max_register_virtual_size != 0; +} + +int +gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->max_register_virtual_size == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_max_register_virtual_size invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n"); - return gdbarch->max_register_virtual_size; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_virtual_size called\n"); + return gdbarch->deprecated_max_register_virtual_size; } void -set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, - int max_register_virtual_size) +set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, + int deprecated_max_register_virtual_size) { - gdbarch->max_register_virtual_size = max_register_virtual_size; + gdbarch->deprecated_max_register_virtual_size = deprecated_max_register_virtual_size; +} + +int +gdbarch_register_virtual_type_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->register_virtual_type != 0; } struct type * @@ -3357,6 +3409,32 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, } int +gdbarch_register_type_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->register_type != 0; +} + +struct type * +gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->register_type == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_type invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); + return gdbarch->register_type (gdbarch, reg_nr); +} + +void +set_gdbarch_register_type (struct gdbarch *gdbarch, + gdbarch_register_type_ftype register_type) +{ + gdbarch->register_type = register_type; +} + +int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); @@ -4154,23 +4232,30 @@ set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch->push_arguments = push_arguments; } +int +gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_push_dummy_frame != 0; +} + void -gdbarch_push_dummy_frame (struct gdbarch *gdbarch) +gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->push_dummy_frame == 0) + if (gdbarch->deprecated_push_dummy_frame == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_dummy_frame invalid"); + "gdbarch: gdbarch_deprecated_push_dummy_frame invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n"); - gdbarch->push_dummy_frame (); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_dummy_frame called\n"); + gdbarch->deprecated_push_dummy_frame (); } void -set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, - gdbarch_push_dummy_frame_ftype push_dummy_frame) +set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, + gdbarch_deprecated_push_dummy_frame_ftype deprecated_push_dummy_frame) { - gdbarch->push_dummy_frame = push_dummy_frame; + gdbarch->deprecated_push_dummy_frame = deprecated_push_dummy_frame; } int @@ -4392,55 +4477,55 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, } int -gdbarch_frame_init_saved_regs_p (struct gdbarch *gdbarch) +gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->frame_init_saved_regs != 0; + return gdbarch->deprecated_frame_init_saved_regs != 0; } void -gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) +gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_init_saved_regs == 0) + if (gdbarch->deprecated_frame_init_saved_regs == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_init_saved_regs invalid"); + "gdbarch: gdbarch_deprecated_frame_init_saved_regs invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n"); - gdbarch->frame_init_saved_regs (frame); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_init_saved_regs called\n"); + gdbarch->deprecated_frame_init_saved_regs (frame); } void -set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, - gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs) +set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, + gdbarch_deprecated_frame_init_saved_regs_ftype deprecated_frame_init_saved_regs) { - gdbarch->frame_init_saved_regs = frame_init_saved_regs; + gdbarch->deprecated_frame_init_saved_regs = deprecated_frame_init_saved_regs; } int -gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch) +gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->init_extra_frame_info != 0; + return gdbarch->deprecated_init_extra_frame_info != 0; } void -gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) +gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->init_extra_frame_info == 0) + if (gdbarch->deprecated_init_extra_frame_info == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_init_extra_frame_info invalid"); + "gdbarch: gdbarch_deprecated_init_extra_frame_info invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n"); - gdbarch->init_extra_frame_info (fromleaf, frame); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_extra_frame_info called\n"); + gdbarch->deprecated_init_extra_frame_info (fromleaf, frame); } void -set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, - gdbarch_init_extra_frame_info_ftype init_extra_frame_info) +set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, + gdbarch_deprecated_init_extra_frame_info_ftype deprecated_init_extra_frame_info) { - gdbarch->init_extra_frame_info = init_extra_frame_info; + gdbarch->deprecated_init_extra_frame_info = deprecated_init_extra_frame_info; } CORE_ADDR diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 0680916..59dd3d6 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -62,7 +62,7 @@ extern struct gdbarch *current_gdbarch; #if GDB_MULTI_ARCH #if defined (FRAME_FIND_SAVED_REGS) -#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS" +#error "FRAME_FIND_SAVED_REGS: replaced by DEPRECATED_FRAME_INIT_SAVED_REGS" #endif #endif @@ -721,6 +721,11 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE) #define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr)) @@ -738,17 +743,52 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi #endif #endif -extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch); -extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE) -#error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE" +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + +#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) +/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */ +#if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) +#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) +#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (0) +#endif + +extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) +#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P) +#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch)) +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) +#define DEPRECATED_MAX_REGISTER_RAW_SIZE (0) +#endif + +extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) +#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE) -#define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE) +#define DEPRECATED_MAX_REGISTER_RAW_SIZE (gdbarch_deprecated_max_register_raw_size (current_gdbarch)) #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE) #define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr)) @@ -766,17 +806,77 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_ #endif #endif -extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch); -extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE) -#error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE" +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + +#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) +/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */ +#if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (0) +#endif + +extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) +#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P) +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch)) +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (0) +#endif + +extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) +#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE) -#define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE) +#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (gdbarch_deprecated_max_register_virtual_size (current_gdbarch)) #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced + by REGISTER_TYPE. */ + +#if defined (REGISTER_VIRTUAL_TYPE) +/* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */ +#if !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (0) +#endif + +extern int gdbarch_register_virtual_type_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE_P) +#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (gdbarch_register_virtual_type_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE) +#define REGISTER_VIRTUAL_TYPE(reg_nr) (internal_error (__FILE__, __LINE__, "REGISTER_VIRTUAL_TYPE"), 0) +#endif + typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); @@ -789,6 +889,12 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_ #endif #endif +extern int gdbarch_register_type_p (struct gdbarch *gdbarch); + +typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr); +extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type); + #if defined (DEPRECATED_DO_REGISTERS_INFO) /* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */ #if !defined (DEPRECATED_DO_REGISTERS_INFO_P) @@ -1526,15 +1632,41 @@ extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_ar #endif #endif -typedef void (gdbarch_push_dummy_frame_ftype) (void); -extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch); -extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME) -#error "Non multi-arch definition of PUSH_DUMMY_FRAME" +#if defined (DEPRECATED_PUSH_DUMMY_FRAME) +/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_DUMMY_FRAME */ +#if !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) +#define DEPRECATED_PUSH_DUMMY_FRAME_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) +#define DEPRECATED_PUSH_DUMMY_FRAME_P() (0) +#endif + +extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME_P) +#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) +#define DEPRECATED_PUSH_DUMMY_FRAME_P() (gdbarch_deprecated_push_dummy_frame_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME) +#define DEPRECATED_PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_DUMMY_FRAME"), 0) +#define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch)) +#endif + +typedef void (gdbarch_deprecated_push_dummy_frame_ftype) (void); +extern void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME) +#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME) -#define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME) +#define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch)) #endif #endif @@ -1774,77 +1906,77 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_ #endif #endif -#if defined (FRAME_INIT_SAVED_REGS) -/* Legacy for systems yet to multi-arch FRAME_INIT_SAVED_REGS */ -#if !defined (FRAME_INIT_SAVED_REGS_P) -#define FRAME_INIT_SAVED_REGS_P() (1) +#if defined (DEPRECATED_FRAME_INIT_SAVED_REGS) +/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_INIT_SAVED_REGS */ +#if !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) +#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_INIT_SAVED_REGS_P) -#define FRAME_INIT_SAVED_REGS_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) +#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (0) #endif -extern int gdbarch_frame_init_saved_regs_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS_P) -#error "Non multi-arch definition of FRAME_INIT_SAVED_REGS" +extern int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) +#error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS_P) -#define FRAME_INIT_SAVED_REGS_P() (gdbarch_frame_init_saved_regs_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P) +#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (FRAME_INIT_SAVED_REGS) -#define FRAME_INIT_SAVED_REGS(frame) (internal_error (__FILE__, __LINE__, "FRAME_INIT_SAVED_REGS"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS) +#define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_INIT_SAVED_REGS"), 0) #endif -typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame); -extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); -extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS) -#error "Non multi-arch definition of FRAME_INIT_SAVED_REGS" +typedef void (gdbarch_deprecated_frame_init_saved_regs_ftype) (struct frame_info *frame); +extern void gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); +extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS) +#error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS) -#define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS) +#define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (gdbarch_deprecated_frame_init_saved_regs (current_gdbarch, frame)) #endif #endif -#if defined (INIT_EXTRA_FRAME_INFO) -/* Legacy for systems yet to multi-arch INIT_EXTRA_FRAME_INFO */ -#if !defined (INIT_EXTRA_FRAME_INFO_P) -#define INIT_EXTRA_FRAME_INFO_P() (1) +#if defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) +/* Legacy for systems yet to multi-arch DEPRECATED_INIT_EXTRA_FRAME_INFO */ +#if !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) +#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO_P) -#define INIT_EXTRA_FRAME_INFO_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) +#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (0) #endif -extern int gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO_P) -#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO" +extern int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) +#error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO_P) -#define INIT_EXTRA_FRAME_INFO_P() (gdbarch_init_extra_frame_info_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P) +#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (INIT_EXTRA_FRAME_INFO) -#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "INIT_EXTRA_FRAME_INFO"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) +#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_EXTRA_FRAME_INFO"), 0) #endif -typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); -extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); -extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO) -#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO" +typedef void (gdbarch_deprecated_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); +extern void gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); +extern void set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) +#error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO) -#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO) +#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_deprecated_init_extra_frame_info (current_gdbarch, fromleaf, frame)) #endif #endif diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 2408299..12953c2 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -470,11 +470,32 @@ f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_n v:2:REGISTER_SIZE:int:register_size::::0:-1 v:2:REGISTER_BYTES:int:register_bytes::::0:-1 f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte::0 +# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, +# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, +# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced +# by REGISTER_TYPE. f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0 -v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1 +# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, +# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, +# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced +# by REGISTER_TYPE. +V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size +# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, +# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, +# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced +# by REGISTER_TYPE. f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0 -v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1 -f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0 +# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, +# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, +# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced +# by REGISTER_TYPE. +V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size +# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, +# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, +# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced +# by REGISTER_TYPE. +F:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0 +M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr::0: # F:2:DEPRECATED_DO_REGISTERS_INFO:void:deprecated_do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs m:2:PRINT_REGISTERS_INFO:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0 @@ -536,7 +557,7 @@ F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf # f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0 f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0 -f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0 +F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0 F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0 F:2:POP_FRAME:void:pop_frame:void:-:::0 # @@ -551,8 +572,8 @@ F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:struct r F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:char *regbuf:regbuf:::0 f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0 # -F:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame:::0 -F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0 +F:2:DEPRECATED_FRAME_INIT_SAVED_REGS:void:deprecated_frame_init_saved_regs:struct frame_info *frame:frame:::0 +F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0 # f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0 f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0 @@ -797,7 +818,7 @@ extern struct gdbarch *current_gdbarch; #if GDB_MULTI_ARCH #if defined (FRAME_FIND_SAVED_REGS) -#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS" +#error "FRAME_FIND_SAVED_REGS: replaced by DEPRECATED_FRAME_INIT_SAVED_REGS" #endif #endif diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 3cb3a78..c3c6581 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -469,6 +469,9 @@ make_qualified_type (struct type *type, int new_flags, /* Now set the instance flags and return the new type. */ TYPE_INSTANCE_FLAGS (ntype) = new_flags; + /* Set length of new type to that of the original type. */ + TYPE_LENGTH (ntype) = TYPE_LENGTH (type); + return ntype; } @@ -556,10 +559,26 @@ make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr) void replace_type (struct type *ntype, struct type *type) { - struct type *cv_chain, *as_chain, *ptr, *ref; + struct type *chain; *TYPE_MAIN_TYPE (ntype) = *TYPE_MAIN_TYPE (type); + /* The type length is not a part of the main type. Update it for each + type on the variant chain. */ + chain = ntype; + do { + /* Assert that this element of the chain has no address-class bits + set in its flags. Such type variants might have type lengths + which are supposed to be different from the non-address-class + variants. This assertion shouldn't ever be triggered because + symbol readers which do construct address-class variants don't + call replace_type(). */ + gdb_assert (TYPE_ADDRESS_CLASS_ALL (chain) == 0); + + TYPE_LENGTH (ntype) = TYPE_LENGTH (type); + chain = TYPE_CHAIN (chain); + } while (ntype != chain); + /* Assert that the two types have equivalent instance qualifiers. This should be true for at least all of our debug readers. */ gdb_assert (TYPE_INSTANCE_FLAGS (ntype) == TYPE_INSTANCE_FLAGS (type)); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 2766b17..fa5907e 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -298,32 +298,6 @@ struct main_type char *tag_name; - /* Length of storage for a value of this type. This is what - sizeof(type) would return; use it for address arithmetic, - memory reads and writes, etc. This size includes padding. For - example, an i386 extended-precision floating point value really - only occupies ten bytes, but most ABI's declare its size to be - 12 bytes, to preserve alignment. A `struct type' representing - such a floating-point type would have a `length' value of 12, - even though the last two bytes are unused. - - There's a bit of a host/target mess here, if you're concerned - about machines whose bytes aren't eight bits long, or who don't - have byte-addressed memory. Various places pass this to memcpy - and such, meaning it must be in units of host bytes. Various - other places expect they can calculate addresses by adding it - and such, meaning it must be in units of target bytes. For - some DSP targets, in which HOST_CHAR_BIT will (presumably) be 8 - and TARGET_CHAR_BIT will be (say) 32, this is a problem. - - One fix would be to make this field in bits (requiring that it - always be a multiple of HOST_CHAR_BIT and TARGET_CHAR_BIT) --- - the other choice would be to make it consistently in units of - HOST_CHAR_BIT. However, this would still fail to address - machines based on a ternary or decimal representation. */ - - unsigned length; - /* FIXME, these should probably be restricted to a Fortran-specific field in some fashion. */ #define BOUND_CANNOT_BE_DETERMINED 5 @@ -490,15 +464,42 @@ struct type struct type *reference_type; /* Variant chain. This points to a type that differs from this one only - in qualifiers. Currently, the possible qualifiers are const, volatile, - code-space, and data-space. The variants are linked in a circular - ring and share MAIN_TYPE. */ + in qualifiers and length. Currently, the possible qualifiers are + const, volatile, code-space, data-space, and address class. The + length may differ only when one of the address class flags are set. + The variants are linked in a circular ring and share MAIN_TYPE. */ struct type *chain; /* Flags specific to this instance of the type, indicating where on the ring we are. */ int instance_flags; + /* Length of storage for a value of this type. This is what + sizeof(type) would return; use it for address arithmetic, + memory reads and writes, etc. This size includes padding. For + example, an i386 extended-precision floating point value really + only occupies ten bytes, but most ABI's declare its size to be + 12 bytes, to preserve alignment. A `struct type' representing + such a floating-point type would have a `length' value of 12, + even though the last two bytes are unused. + + There's a bit of a host/target mess here, if you're concerned + about machines whose bytes aren't eight bits long, or who don't + have byte-addressed memory. Various places pass this to memcpy + and such, meaning it must be in units of host bytes. Various + other places expect they can calculate addresses by adding it + and such, meaning it must be in units of target bytes. For + some DSP targets, in which HOST_CHAR_BIT will (presumably) be 8 + and TARGET_CHAR_BIT will be (say) 32, this is a problem. + + One fix would be to make this field in bits (requiring that it + always be a multiple of HOST_CHAR_BIT and TARGET_CHAR_BIT) --- + the other choice would be to make it consistently in units of + HOST_CHAR_BIT. However, this would still fail to address + machines based on a ternary or decimal representation. */ + + unsigned length; + /* Core type, shared by a group of qualified types. */ struct main_type *main_type; }; @@ -759,7 +760,7 @@ extern void allocate_cplus_struct_type (struct type *); But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, so you only have to call check_typedef once. Since allocate_value calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ -#define TYPE_LENGTH(thistype) TYPE_MAIN_TYPE(thistype)->length +#define TYPE_LENGTH(thistype) (thistype)->length #define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile #define TYPE_FLAGS(thistype) TYPE_MAIN_TYPE(thistype)->flags /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index cb80c95..47d6e12 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -250,7 +250,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) /* Try to find a symbol that is the vtable */ minsym=lookup_minimal_symbol_by_pc(vtbl); if (minsym==NULL - || (demangled_name=SYMBOL_NAME(minsym))==NULL + || (demangled_name=DEPRECATED_SYMBOL_NAME (minsym))==NULL || !is_vtable_name (demangled_name)) return NULL; @@ -405,6 +405,6 @@ void _initialize_gnu_v2_abi (void) { init_gnuv2_ops (); - register_cp_abi (gnu_v2_abi_ops); - switch_to_cp_abi ("gnu-v2"); + register_cp_abi (&gnu_v2_abi_ops); + set_cp_abi_as_auto_default (gnu_v2_abi_ops.shortname); } diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 2b4e01a..7e66ee9 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -453,5 +453,5 @@ _initialize_gnu_v3_abi (void) { init_gnuv3_ops (); - register_cp_abi (gnu_v3_abi_ops); + register_cp_abi (&gnu_v3_abi_ops); } diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 8119a2d..b90f6ed 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -485,8 +485,8 @@ h8300_frame_init_saved_regs (struct frame_info *fi) /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. + then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC + will be called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ @@ -1108,9 +1108,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD); set_gdbarch_register_byte (gdbarch, h8300_register_byte); set_gdbarch_register_raw_size (gdbarch, h8300_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, h8300h_reg_size); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, h8300h_reg_size); set_gdbarch_register_virtual_size (gdbarch, h8300_register_raw_size); - set_gdbarch_max_register_virtual_size (gdbarch, h8300h_reg_size); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, h8300h_reg_size); set_gdbarch_register_virtual_type (gdbarch, h8300_register_virtual_type); set_gdbarch_print_registers_info (gdbarch, h8300_print_registers_info); set_gdbarch_print_float_info (gdbarch, h8300_print_float_info); @@ -1118,8 +1118,8 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* * Frame Info */ - set_gdbarch_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info); - set_gdbarch_frame_init_saved_regs (gdbarch, h8300_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, h8300_frame_init_saved_regs); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info); set_gdbarch_frame_chain (gdbarch, h8300_frame_chain); set_gdbarch_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call); set_gdbarch_frame_saved_pc (gdbarch, h8300_frame_saved_pc); @@ -1148,7 +1148,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, h8300_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value); set_gdbarch_push_arguments (gdbarch, h8300_push_arguments); diff --git a/gdb/hpacc-abi.c b/gdb/hpacc-abi.c index 6753cd7..799d4c7 100644 --- a/gdb/hpacc-abi.c +++ b/gdb/hpacc-abi.c @@ -324,5 +324,5 @@ _initialize_hpacc_abi (void) regcomp (&operator_pattern, "^This will never match anything, please fill it in$", REG_NOSUB); - register_cp_abi (hpacc_abi_ops); + register_cp_abi (&hpacc_abi_ops); } diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 3eaefcc..99ef145 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -677,7 +677,7 @@ pc_in_interrupt_handler (CORE_ADDR pc) msym_us = lookup_minimal_symbol_by_pc (pc); return (u->HP_UX_interrupt_marker - && !PC_IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us))); + && !PC_IN_SIGTRAMP (pc, DEPRECATED_SYMBOL_NAME (msym_us))); } /* Called when no unwind descriptor was found for PC. Returns 1 if it @@ -795,7 +795,7 @@ find_proc_framesize (CORE_ADDR pc) if (u->Save_SP && !pc_in_interrupt_handler (pc) && msym_us - && !PC_IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us))) + && !PC_IN_SIGTRAMP (pc, DEPRECATED_SYMBOL_NAME (msym_us))) return -1; return u->Total_frame_size << 3; @@ -1110,8 +1110,8 @@ hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame) /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. + then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC + will be called for the new frame. This may involve searching through prologues for several functions at boundaries where GCC calls HP C code, or where code which has @@ -1153,7 +1153,7 @@ hppa_frame_chain (struct frame_info *frame) pthread library itself, you'd get errors. So for today, we don't make that check. */ - frame_symbol_name = SYMBOL_NAME (min_frame_symbol); + frame_symbol_name = DEPRECATED_SYMBOL_NAME (min_frame_symbol); if (frame_symbol_name != 0) { if (0 == strncmp (frame_symbol_name, @@ -1983,7 +1983,7 @@ find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle) buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL); msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL); endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym); - namelen = strlen (SYMBOL_NAME (function)); + namelen = strlen (DEPRECATED_SYMBOL_NAME (function)); value_return_addr = endo_buff_addr + namelen; ftype = check_typedef (SYMBOL_TYPE (get_sym)); @@ -1996,7 +1996,7 @@ find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle) /* set up stuff needed by __d_shl_get in buffer in end.o */ - target_write_memory (endo_buff_addr, SYMBOL_NAME (function), namelen); + target_write_memory (endo_buff_addr, DEPRECATED_SYMBOL_NAME (function), namelen); target_write_memory (value_return_addr, (char *) &tmp, 4); @@ -2234,10 +2234,10 @@ hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, { stub_symbol = lookup_minimal_symbol_solib_trampoline - (SYMBOL_NAME (funsymbol), NULL, objfile); + (DEPRECATED_SYMBOL_NAME (funsymbol), NULL, objfile); if (!stub_symbol) - stub_symbol = lookup_minimal_symbol (SYMBOL_NAME (funsymbol), + stub_symbol = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (funsymbol), NULL, objfile); /* Found a symbol with the right name. */ @@ -2338,7 +2338,7 @@ hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, new_stub = find_stub_with_shl_get (fmsymbol, solib_handle); if (new_stub == 0) - error ("Can't find an import stub for %s", SYMBOL_NAME (fmsymbol)); + error ("Can't find an import stub for %s", DEPRECATED_SYMBOL_NAME (fmsymbol)); /* We have to store the address of the stub in __shlib_funcptr. */ msymbol = lookup_minimal_symbol ("__shlib_funcptr", NULL, @@ -3014,7 +3014,7 @@ hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name) return 1; minsym = lookup_minimal_symbol_by_pc (pc); - if (minsym && strcmp (SYMBOL_NAME (minsym), ".stub") == 0) + if (minsym && strcmp (DEPRECATED_SYMBOL_NAME (minsym), ".stub") == 0) return 1; /* Get the unwind descriptor corresponding to PC, return zero @@ -3257,7 +3257,7 @@ hppa_skip_trampoline_code (CORE_ADDR pc) ALL_MSYMBOLS (objfile, msymbol) { if (MSYMBOL_TYPE (msymbol) == mst_text - && STREQ (SYMBOL_NAME (msymbol), SYMBOL_NAME (msym))) + && STREQ (DEPRECATED_SYMBOL_NAME (msymbol), DEPRECATED_SYMBOL_NAME (msym))) { function_found = 1; break; @@ -3352,11 +3352,11 @@ hppa_skip_trampoline_code (CORE_ADDR pc) return orig_pc == pc ? 0 : pc & ~0x3; } - libsym = lookup_minimal_symbol (SYMBOL_NAME (stubsym), NULL, NULL); + libsym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (stubsym), NULL, NULL); if (libsym == NULL) { warning ("Unable to find library symbol for %s\n", - SYMBOL_NAME (stubsym)); + DEPRECATED_SYMBOL_NAME (stubsym)); return orig_pc == pc ? 0 : pc & ~0x3; } @@ -4992,8 +4992,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, hppa_num_regs * 4); set_gdbarch_register_byte (gdbarch, hppa_register_byte); set_gdbarch_register_virtual_size (gdbarch, hppa_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 4); - set_gdbarch_max_register_virtual_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); set_gdbarch_register_virtual_type (gdbarch, hppa_register_virtual_type); set_gdbarch_store_struct_return (gdbarch, hppa_store_struct_return); set_gdbarch_deprecated_extract_return_value (gdbarch, @@ -5003,7 +5003,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_struct_value_address (gdbarch, hppa_extract_struct_value_address); set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register); - set_gdbarch_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info); set_gdbarch_frame_chain (gdbarch, hppa_frame_chain); set_gdbarch_frame_chain_valid (gdbarch, hppa_frame_chain_valid); set_gdbarch_frameless_function_invocation @@ -5013,7 +5013,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_locals_address (gdbarch, hppa_frame_locals_address); set_gdbarch_frame_num_args (gdbarch, hppa_frame_num_args); set_gdbarch_frame_args_skip (gdbarch, 0); - /* set_gdbarch_push_dummy_frame (gdbarch, hppa_push_dummy_frame); */ + /* set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); */ set_gdbarch_pop_frame (gdbarch, hppa_pop_frame); set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28); set_gdbarch_call_dummy_start_offset (gdbarch, 0); diff --git a/gdb/hpread.c b/gdb/hpread.c index 6f8d899..9ad2100 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -3122,7 +3122,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp, sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = obsavestring (name, strlen (name), + DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack); SYMBOL_CLASS (sym) = LOC_CONST; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -3156,7 +3156,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp, { struct symbol *xsym = syms->symbol[j]; SYMBOL_TYPE (xsym) = type; - TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym); TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); TYPE_FIELD_BITSIZE (type, n) = 0; TYPE_FIELD_STATIC_KIND (type, n) = 0; @@ -3230,7 +3230,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); (void) memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = obsavestring (name, strlen (name), + DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack); /* Figure out where it lives. */ @@ -3317,7 +3317,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, for (j = 0; j < syms->nsyms; j++, n++) { struct symbol *xsym = syms->symbol[j]; - TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym); TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym); TYPE_FIELD_ARTIFICIAL (type, n) = 0; TYPE_FIELD_BITSIZE (type, n) = 0; @@ -3404,7 +3404,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); (void) memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = name; + DEPRECATED_SYMBOL_NAME (sym) = name; /* Figure out where it lives. */ if (paramp->dfparam.regparam) @@ -3491,7 +3491,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, for (j = 0; j < syms->nsyms; j++, n++) { struct symbol *xsym = syms->symbol[j]; - TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym); TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym); TYPE_FIELD_ARTIFICIAL (type, n) = 0; TYPE_FIELD_BITSIZE (type, n) = 0; @@ -5084,7 +5084,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack); + DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack); SYMBOL_LANGUAGE (sym) = language_auto; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; SYMBOL_LINE (sym) = 0; @@ -5254,22 +5254,22 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, if (SYMBOL_LANGUAGE (sym) == language_cplus) TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED; - /* The "SYMBOL_NAME" field is expected to be the mangled name + /* The "DEPRECATED_SYMBOL_NAME" field is expected to be the mangled name * (if any), which we get from the "alias" field of the SOM record * if that exists. */ if ((dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) && dn_bufp->dfunc.alias && /* has an alias */ *(char *) (VT (objfile) + dn_bufp->dfunc.alias)) /* not a null string */ - SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias; + DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias; else - SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name; + DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name; /* Special hack to get around HP compilers' insistence on * reporting "main" as "_MAIN_" for C/C++ */ - if ((strcmp (SYMBOL_NAME (sym), "_MAIN_") == 0) && + if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) && (strcmp (VT (objfile) + dn_bufp->dfunc.name, "main") == 0)) - SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name; + DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name; /* The SYMBOL_CPLUS_DEMANGLED_NAME field is expected to * be the demangled name. @@ -5288,7 +5288,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, * working around the issue in stack.c. - RT */ SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack); - if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) && + if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) && (!SYMBOL_CPLUS_DEMANGLED_NAME (sym))) { @@ -5372,22 +5372,22 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, SYMBOL_CLASS (sym) = LOC_BLOCK; SYMBOL_TYPE (sym) = hpread_read_doc_function_type (hp_type, dn_bufp, objfile, 1); - /* The "SYMBOL_NAME" field is expected to be the mangled name + /* The "DEPRECATED_SYMBOL_NAME" field is expected to be the mangled name * (if any), which we get from the "alias" field of the SOM record * if that exists. */ if ((dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) && dn_bufp->ddocfunc.alias && /* has an alias */ *(char *) (VT (objfile) + dn_bufp->ddocfunc.alias)) /* not a null string */ - SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias; + DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias; else - SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name; + DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name; /* Special hack to get around HP compilers' insistence on * reporting "main" as "_MAIN_" for C/C++ */ - if ((strcmp (SYMBOL_NAME (sym), "_MAIN_") == 0) && + if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) && (strcmp (VT (objfile) + dn_bufp->ddocfunc.name, "main") == 0)) - SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name; + DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name; if (dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) { @@ -5405,7 +5405,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, */ SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack); - if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) && + if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) && (!SYMBOL_CPLUS_DEMANGLED_NAME (sym))) { @@ -5710,7 +5710,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, * in the symbol table contains a pointer to the real "g". * We use the storage class LOC_INDIRECT to indicate this. RT */ - if (is_in_import_list (SYMBOL_NAME (sym), objfile)) + if (is_in_import_list (DEPRECATED_SYMBOL_NAME (sym), objfile)) SYMBOL_CLASS (sym) = LOC_INDIRECT; SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location + data_offset; @@ -5825,8 +5825,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, * record that actually defines the type. */ SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile); - TYPE_NAME (sym->type) = SYMBOL_NAME (sym); - TYPE_TAG_NAME (sym->type) = SYMBOL_NAME (sym); + TYPE_NAME (sym->type) = DEPRECATED_SYMBOL_NAME (sym); + TYPE_TAG_NAME (sym->type) = DEPRECATED_SYMBOL_NAME (sym); if (dn_bufp->dtag.global) add_symbol_to_list (sym, &global_symbols); else if (WITHIN_FUNCTION (objfile)) @@ -5872,7 +5872,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, newsym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (newsym, 0, sizeof (struct symbol)); - SYMBOL_NAME (newsym) = name; + DEPRECATED_SYMBOL_NAME (newsym) = name; SYMBOL_LANGUAGE (newsym) = language_auto; SYMBOL_NAMESPACE (newsym) = VAR_NAMESPACE; SYMBOL_LINE (newsym) = 0; diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c index f8252e2..b9ad2ff 100644 --- a/gdb/i386-interix-tdep.c +++ b/gdb/i386-interix-tdep.c @@ -100,7 +100,8 @@ static int i386_interix_pc_in_sigtramp (CORE_ADDR pc, char *name) { /* This is sufficient, where used, but is NOT a complete test; There - is more in INIT_EXTRA_FRAME_INFO (a.k.a. interix_back_one_frame). */ + is more in DEPRECATED_INIT_EXTRA_FRAME_INFO + (a.k.a. interix_back_one_frame). */ return ((pc >= tramp_start && pc < tramp_end) || (pc >= null_start && pc < null_end)); } @@ -330,7 +331,7 @@ i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_interix_in_solib_call_trampoline); set_gdbarch_skip_trampoline_code (gdbarch, i386_interix_skip_trampoline_code); - set_gdbarch_init_extra_frame_info (gdbarch, i386_interix_back_one_frame); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, i386_interix_back_one_frame); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc); diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 9bf5a16..f92f1ea 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -332,8 +332,8 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p) ALL_OBJFILE_MSYMBOLS (objfile, msym) { - if (SYMBOL_NAME (msym) - && STREQ (SYMBOL_NAME (msym), name)) + if (SYMBOL_LINKAGE_NAME (msym) + && strcmp (SYMBOL_LINKAGE_NAME (msym), name) == 0) { *objfile_p = objfile; return msym; diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index d85073b..018f073 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1293,7 +1293,7 @@ i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name) unsigned long indirect = read_memory_unsigned_integer (pc + 2, 4); struct minimal_symbol *indsym = indirect ? lookup_minimal_symbol_by_pc (indirect) : 0; - char *symname = indsym ? SYMBOL_NAME (indsym) : 0; + char *symname = indsym ? SYMBOL_LINKAGE_NAME (indsym) : 0; if (symname) { @@ -1558,8 +1558,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, i386_register_name); set_gdbarch_register_size (gdbarch, 4); set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS); - set_gdbarch_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE); - set_gdbarch_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE); set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type); set_gdbarch_print_float_info (gdbarch, i387_print_float_info); @@ -1590,7 +1590,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_extract_return_value (gdbarch, i386_extract_return_value); set_gdbarch_push_arguments (gdbarch, i386_push_arguments); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, i386_push_return_address); set_gdbarch_pop_frame (gdbarch, i386_pop_frame); set_gdbarch_store_struct_return (gdbarch, i386_store_struct_return); @@ -1599,7 +1598,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, i386_use_struct_convention); - set_gdbarch_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs); set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue); /* Stack grows downward. */ diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c index af30df1..c0c544d 100644 --- a/gdb/i386bsd-tdep.c +++ b/gdb/i386bsd-tdep.c @@ -50,11 +50,13 @@ i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name) CORE_ADDR i386bsd_sigcontext_addr (struct frame_info *frame) { - if (frame->next) + struct frame_info *next_frame = get_next_frame (frame); + + if (next_frame) /* If this isn't the top frame, the next frame must be for the signal handler itself. A pointer to the sigcontext structure is passed as the third argument to the signal handler. */ - return read_memory_unsigned_integer (frame->next->frame + 16, 4); + return read_memory_unsigned_integer (get_frame_base (next_frame) + 16, 4); /* This is the top frame. We'll have to find the address of the sigcontext structure by looking at the stack pointer. */ diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index b37da52..36036f2 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -94,13 +94,11 @@ static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc; static gdbarch_frame_chain_ftype ia64_frame_chain; static gdbarch_frame_saved_pc_ftype ia64_frame_saved_pc; static gdbarch_skip_prologue_ftype ia64_skip_prologue; -static gdbarch_frame_init_saved_regs_ftype ia64_frame_init_saved_regs; static gdbarch_get_saved_register_ftype ia64_get_saved_register; static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address; static gdbarch_use_struct_convention_ftype ia64_use_struct_convention; static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation; -static gdbarch_init_extra_frame_info_ftype ia64_init_extra_frame_info; static gdbarch_store_struct_return_ftype ia64_store_struct_return; static gdbarch_push_arguments_ftype ia64_push_arguments; static gdbarch_push_return_address_ftype ia64_push_return_address; @@ -711,7 +709,7 @@ ia64_frame_chain (struct frame_info *frame) return get_frame_base (frame); else { - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); if (get_frame_saved_regs (frame)[IA64_VFP_REGNUM]) return read_memory_integer (get_frame_saved_regs (frame)[IA64_VFP_REGNUM], 8); else @@ -732,7 +730,7 @@ ia64_frame_saved_pc (struct frame_info *frame) get_frame_base (frame), pc_regnum); else { - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); if (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM]) return read_memory_integer (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM], 8); @@ -1312,7 +1310,7 @@ ia64_get_saved_register (char *raw_buffer, if (!is_dummy_frame) { - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); gr_addr = get_frame_saved_regs (frame)[ regnum - IA64_NAT0_REGNUM + IA64_GR0_REGNUM]; } @@ -1354,7 +1352,7 @@ ia64_get_saved_register (char *raw_buffer, CORE_ADDR addr = 0; if (!is_dummy_frame) { - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); addr = get_frame_saved_regs (frame)[regnum]; } @@ -1462,7 +1460,7 @@ ia64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) int ia64_frameless_function_invocation (struct frame_info *frame) { - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); return (get_frame_extra_info (frame)->mem_stack_frame_size == 0); } @@ -1523,7 +1521,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) { struct frame_info *frn = get_next_frame (frame); - FRAME_INIT_SAVED_REGS (frn); + DEPRECATED_FRAME_INIT_SAVED_REGS (frn); if (get_frame_saved_regs (frn)[IA64_CFM_REGNUM] != 0) cfm = read_memory_integer (get_frame_saved_regs (frn)[IA64_CFM_REGNUM], 8); @@ -1990,7 +1988,7 @@ ia64_pop_frame_regular (struct frame_info *frame) int regno; CORE_ADDR bsp, cfm, pfs; - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); for (regno = 0; regno < ia64_num_regs; regno++) { @@ -2186,9 +2184,9 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8); set_gdbarch_register_byte (gdbarch, ia64_register_byte); set_gdbarch_register_raw_size (gdbarch, ia64_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 16); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16); set_gdbarch_register_virtual_size (gdbarch, ia64_register_virtual_size); - set_gdbarch_max_register_virtual_size (gdbarch, 16); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16); set_gdbarch_register_virtual_type (gdbarch, ia64_register_virtual_type); set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue); @@ -2201,7 +2199,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, ia64_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, ia64_frame_saved_pc); - set_gdbarch_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs); set_gdbarch_get_saved_register (gdbarch, ia64_get_saved_register); set_gdbarch_register_convertible (gdbarch, ia64_register_convertible); @@ -2231,7 +2229,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words)); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); - set_gdbarch_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info); set_gdbarch_frame_args_address (gdbarch, ia64_frame_args_address); set_gdbarch_frame_locals_address (gdbarch, ia64_frame_locals_address); @@ -2252,7 +2250,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_decr_pc_after_break (gdbarch, 0); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index baba6f3..19077b4 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1,6 +1,6 @@ /* Memory-access and commands for "inferior" process, for GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002 + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -24,7 +24,6 @@ #include <signal.h> #include "gdb_string.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "frame.h" #include "inferior.h" @@ -43,6 +42,7 @@ #include "parser-defs.h" #include "regcache.h" #include "reggroups.h" +#include "block.h" #include <ctype.h> /* Functions exported for general use, in inferior.h: */ @@ -1665,7 +1665,7 @@ default_print_registers_info (struct gdbarch *gdbarch, /* Convert raw data to virtual format if necessary. */ if (REGISTER_CONVERTIBLE (i)) { - REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i), + REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i), raw_buffer, virtual_buffer); } else @@ -1676,11 +1676,11 @@ default_print_registers_info (struct gdbarch *gdbarch, /* If virtual format is floating, print it that way, and in raw hex. */ - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) + if (TYPE_CODE (register_type (current_gdbarch, i)) == TYPE_CODE_FLT) { int j; - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, file, 0, 1, 0, Val_pretty_default); fprintf_filtered (file, "\t(raw 0x"); @@ -1698,14 +1698,14 @@ default_print_registers_info (struct gdbarch *gdbarch, else { /* Print the register in hex. */ - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, file, 'x', 1, 0, Val_pretty_default); /* If not a vector register, print it also according to its natural format. */ - if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0) + if (TYPE_VECTOR (register_type (current_gdbarch, i)) == 0) { fprintf_filtered (file, "\t"); - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, file, 0, 1, 0, Val_pretty_default); } } diff --git a/gdb/infptrace.c b/gdb/infptrace.c index 601e157..a142080 100644 --- a/gdb/infptrace.c +++ b/gdb/infptrace.c @@ -301,7 +301,7 @@ detach (int signal) errno = 0; ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1, signal); - if (errno) + if (errno && errno != ESRCH) perror_with_name ("ptrace"); attach_flag = 0; } @@ -629,7 +629,7 @@ static void udot_info (char *dummy1, int dummy2) { #if defined (KERNEL_U_SIZE) - int udot_off; /* Offset into user struct */ + long udot_off; /* Offset into user struct */ int udot_val; /* Value from user struct at udot_off */ char mess[128]; /* For messages */ #endif @@ -657,12 +657,13 @@ udot_info (char *dummy1, int dummy2) { printf_filtered ("\n"); } - printf_filtered ("%04x:", udot_off); + printf_filtered ("%s:", paddr (udot_off)); } udot_val = ptrace (PT_READ_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) udot_off, 0); if (errno != 0) { - sprintf (mess, "\nreading user struct at offset 0x%x", udot_off); + sprintf (mess, "\nreading user struct at offset 0x%s", + paddr_nz (udot_off)); perror_with_name (mess); } /* Avoid using nonportable (?) "*" in print specs */ diff --git a/gdb/infrun.c b/gdb/infrun.c index f864442..f65af35 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -226,13 +226,6 @@ a command like `return' or `jump' to continue execution."); #define HAVE_STEPPABLE_WATCHPOINT 1 #endif -#ifndef HAVE_CONTINUABLE_WATCHPOINT -#define HAVE_CONTINUABLE_WATCHPOINT 0 -#else -#undef HAVE_CONTINUABLE_WATCHPOINT -#define HAVE_CONTINUABLE_WATCHPOINT 1 -#endif - #ifndef CANNOT_STEP_HW_WATCHPOINTS #define CANNOT_STEP_HW_WATCHPOINTS 0 #else diff --git a/gdb/interps.c b/gdb/interps.c index 551f416..748b5b6 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -275,6 +275,8 @@ current_interp_command_loop (void) else if (current_interpreter != NULL && current_interpreter->procs->command_loop_proc != NULL) current_interpreter->procs->command_loop_proc (current_interpreter->data); + else if (event_loop_p) + cli_command_loop (); else command_loop (); } @@ -318,7 +320,7 @@ interp_exec (struct interp *interp, const char *command_str) common command hooks. Use it when removing your interpreter in its suspend proc. */ void -clear_interpreter_hooks () +clear_interpreter_hooks (void) { init_ui_hook = 0; print_frame_info_listing_hook = 0; diff --git a/gdb/interps.h b/gdb/interps.h index 21362f4..3954e55 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -39,7 +39,7 @@ typedef int (interp_resume_ftype) (void *data); typedef int (interp_suspend_ftype) (void *data); typedef int (interp_prompt_p_ftype) (void *data); typedef int (interp_exec_ftype) (void *data, const char *command); -typedef int (interp_command_loop_ftype) (void *data); +typedef void (interp_command_loop_ftype) (void *data); struct interp_procs { diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index c7b6e1c..7780c37 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -42,13 +42,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <ctype.h> #include "expression.h" #include "value.h" -#include "block.h" #include "parser-defs.h" #include "language.h" #include "jv-lang.h" #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index ffd6108..ecd486c 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -1,5 +1,5 @@ /* Java language support routines for GDB, the GNU debugger. - Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -20,7 +20,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "parser-defs.h" @@ -34,6 +33,7 @@ #include "c-lang.h" #include "jv-lang.h" #include "gdbcore.h" +#include "block.h" #include "dictionary.h" #include <ctype.h> @@ -147,7 +147,7 @@ add_class_symbol (struct type *type, CORE_ADDR addr) obstack_alloc (&dynamics_objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); SYMBOL_LANGUAGE (sym) = language_java; - SYMBOL_NAME (sym) = TYPE_TAG_NAME (type); + DEPRECATED_SYMBOL_NAME (sym) = TYPE_TAG_NAME (type); SYMBOL_CLASS (sym) = LOC_TYPEDEF; /* SYMBOL_VALUE (sym) = valu; */ SYMBOL_TYPE (sym) = type; diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 38439aa..8f888c3 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -199,8 +199,9 @@ java_value_print (struct value *val, struct ui_file *stream, int format, if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_TARGET_TYPE (type) - && TYPE_NAME (TYPE_TARGET_TYPE (type)) - && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0 + && TYPE_TAG_NAME (TYPE_TARGET_TYPE (type)) + && strcmp (TYPE_TAG_NAME (TYPE_TARGET_TYPE (type)), + "java.lang.String") == 0 && (format == 0 || format == 's') && address != 0 && value_as_address (val) != 0) diff --git a/gdb/linespec.c b/gdb/linespec.c index 5afc992..69528d2 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1264,7 +1264,7 @@ select_symbols_args (struct symbol **sym_arr, int nelts, { if (canonical_arr[j] == NULL) { - char *symname = SYMBOL_NAME (sym_arr[j]); + char *symname = DEPRECATED_SYMBOL_NAME (sym_arr[j]); canonical_arr[j] = savestring (symname, strlen (symname)); } @@ -1288,7 +1288,7 @@ select_symbols_args (struct symbol **sym_arr, int nelts, { if (canonical_arr != NULL) { - char *symname = SYMBOL_NAME (sym_arr[num]); + char *symname = DEPRECATED_SYMBOL_NAME (sym_arr[num]); make_cleanup (xfree, symname); canonical_arr[i] = savestring (symname, strlen (symname)); } diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index ad406ed..ef0197a 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -45,12 +45,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "expression.h" #include "language.h" #include "value.h" -#include "block.h" #include "parser-defs.h" #include "m2-lang.h" #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple @@ -1042,6 +1042,8 @@ yylex () case LOC_CONST: case LOC_CONST_BYTES: case LOC_OPTIMIZED_OUT: + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: return NAME; case LOC_TYPEDEF: diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 69c54d1..6af823e 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "objfiles.h" #include "arch-utils.h" #include "regcache.h" +#include "reggroups.h" #include "target.h" #include "opcode/m68hc11.h" @@ -441,7 +442,7 @@ m68hc11_pop_frame (void) else { fp = get_frame_base (frame); - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame. */ for (regnum = 0; regnum < M68HC11_ALL_REGS; regnum++) @@ -464,24 +465,27 @@ m68hc11_pop_frame (void) /* 68HC11 opcodes. */ #undef M6811_OP_PAGE2 -#define M6811_OP_PAGE2 (0x18) -#define M6811_OP_LDX (0xde) -#define M6811_OP_PSHX (0x3c) -#define M6811_OP_STS (0x9f) -#define M6811_OP_TSX (0x30) -#define M6811_OP_XGDX (0x8f) -#define M6811_OP_ADDD (0xc3) -#define M6811_OP_TXS (0x35) -#define M6811_OP_DES (0x34) +#define M6811_OP_PAGE2 (0x18) +#define M6811_OP_LDX (0xde) +#define M6811_OP_LDX_EXT (0xfe) +#define M6811_OP_PSHX (0x3c) +#define M6811_OP_STS (0x9f) +#define M6811_OP_STS_EXT (0xbf) +#define M6811_OP_TSX (0x30) +#define M6811_OP_XGDX (0x8f) +#define M6811_OP_ADDD (0xc3) +#define M6811_OP_TXS (0x35) +#define M6811_OP_DES (0x34) /* 68HC12 opcodes. */ -#define M6812_OP_PAGE2 (0x18) -#define M6812_OP_MOVW (0x01) -#define M6812_PB_PSHW (0xae) -#define M6812_OP_STS (0x7f) -#define M6812_OP_LEAS (0x1b) -#define M6812_OP_PSHX (0x34) -#define M6812_OP_PSHY (0x35) +#define M6812_OP_PAGE2 (0x18) +#define M6812_OP_MOVW (0x01) +#define M6812_PB_PSHW (0xae) +#define M6812_OP_STS (0x5f) +#define M6812_OP_STS_EXT (0x7f) +#define M6812_OP_LEAS (0x1b) +#define M6812_OP_PSHX (0x34) +#define M6812_OP_PSHY (0x35) /* Operand extraction. */ #define OP_DIRECT (0x100) /* 8-byte direct addressing. */ @@ -513,6 +517,10 @@ static struct insn_sequence m6811_prologue[] = { M6811_OP_PSHX } }, { P_SAVE_REG, 5, { M6811_OP_PAGE2, M6811_OP_LDX, OP_DIRECT, M6811_OP_PAGE2, M6811_OP_PSHX } }, + { P_SAVE_REG, 4, { M6811_OP_LDX_EXT, OP_IMM_HIGH, OP_IMM_LOW, + M6811_OP_PSHX } }, + { P_SAVE_REG, 6, { M6811_OP_PAGE2, M6811_OP_LDX_EXT, OP_IMM_HIGH, OP_IMM_LOW, + M6811_OP_PAGE2, M6811_OP_PSHX } }, /* Sequences to allocate local variables. */ { P_LOCAL_N, 7, { M6811_OP_TSX, @@ -531,6 +539,7 @@ static struct insn_sequence m6811_prologue[] = { /* Initialize the frame pointer. */ { P_SET_FRAME, 2, { M6811_OP_STS, OP_DIRECT } }, + { P_SET_FRAME, 3, { M6811_OP_STS_EXT, OP_IMM_HIGH, OP_IMM_LOW } }, { P_LAST, 0, { 0 } } }; @@ -539,7 +548,8 @@ static struct insn_sequence m6811_prologue[] = { static struct insn_sequence m6812_prologue[] = { { P_SAVE_REG, 5, { M6812_OP_PAGE2, M6812_OP_MOVW, M6812_PB_PSHW, OP_IMM_HIGH, OP_IMM_LOW } }, - { P_SET_FRAME, 3, { M6812_OP_STS, OP_IMM_HIGH, OP_IMM_LOW } }, + { P_SET_FRAME, 2, { M6812_OP_STS, OP_DIRECT } }, + { P_SET_FRAME, 3, { M6812_OP_STS_EXT, OP_IMM_HIGH, OP_IMM_LOW } }, { P_LOCAL_N, 2, { M6812_OP_LEAS, OP_PBYTE } }, { P_LOCAL_2, 1, { M6812_OP_PSHX } }, { P_LOCAL_2, 1, { M6812_OP_PSHY } }, @@ -806,8 +816,8 @@ m68hc11_skip_prologue (CORE_ADDR pc) /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. */ + then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC + will be called for the new frame. */ static CORE_ADDR m68hc11_frame_chain (struct frame_info *frame) @@ -1205,6 +1215,66 @@ gdb_print_insn_m68hc11 (bfd_vma memaddr, disassemble_info *info) return print_insn_m68hc12 (memaddr, info); } + + +/* 68HC11/68HC12 register groups. + Identify real hard registers and soft registers used by gcc. */ + +static struct reggroup *m68hc11_soft_reggroup; +static struct reggroup *m68hc11_hard_reggroup; + +static void +m68hc11_init_reggroups (void) +{ + m68hc11_hard_reggroup = reggroup_new ("hard", USER_REGGROUP); + m68hc11_soft_reggroup = reggroup_new ("soft", USER_REGGROUP); +} + +static void +m68hc11_add_reggroups (struct gdbarch *gdbarch) +{ + reggroup_add (gdbarch, m68hc11_hard_reggroup); + reggroup_add (gdbarch, m68hc11_soft_reggroup); + reggroup_add (gdbarch, general_reggroup); + reggroup_add (gdbarch, float_reggroup); + reggroup_add (gdbarch, all_reggroup); + reggroup_add (gdbarch, save_reggroup); + reggroup_add (gdbarch, restore_reggroup); + reggroup_add (gdbarch, vector_reggroup); + reggroup_add (gdbarch, system_reggroup); +} + +static int +m68hc11_register_reggroup_p (struct gdbarch *gdbarch, int regnum, + struct reggroup *group) +{ + /* We must save the real hard register as well as gcc + soft registers including the frame pointer. */ + if (group == save_reggroup || group == restore_reggroup) + { + return (regnum <= gdbarch_num_regs (gdbarch) + || ((regnum == SOFT_FP_REGNUM + || regnum == SOFT_TMP_REGNUM + || regnum == SOFT_ZS_REGNUM + || regnum == SOFT_XY_REGNUM) + && m68hc11_register_name (regnum))); + } + + /* Group to identify gcc soft registers (d1..dN). */ + if (group == m68hc11_soft_reggroup) + { + return regnum >= SOFT_D1_REGNUM && m68hc11_register_name (regnum); + } + + if (group == m68hc11_hard_reggroup) + { + return regnum == HARD_PC_REGNUM || regnum == HARD_SP_REGNUM + || regnum == HARD_X_REGNUM || regnum == HARD_D_REGNUM + || regnum == HARD_Y_REGNUM || regnum == HARD_CCR_REGNUM; + } + return default_register_reggroup_p (gdbarch, regnum, group); +} + static struct gdbarch * m68hc11_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) @@ -1283,16 +1353,16 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_int_bit (gdbarch, elf_flags & E_M68HC11_I32 ? 32 : 16); set_gdbarch_float_bit (gdbarch, 32); set_gdbarch_double_bit (gdbarch, elf_flags & E_M68HC11_F64 ? 64 : 32); - set_gdbarch_long_double_bit (gdbarch, elf_flags & E_M68HC11_F64 ? 64 : 32); + set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_long_bit (gdbarch, 32); set_gdbarch_ptr_bit (gdbarch, 16); set_gdbarch_long_long_bit (gdbarch, 64); /* Set register info. */ set_gdbarch_fp0_regnum (gdbarch, -1); - set_gdbarch_max_register_raw_size (gdbarch, 2); - set_gdbarch_max_register_virtual_size (gdbarch, 2); - set_gdbarch_frame_init_saved_regs (gdbarch, m68hc11_frame_init_saved_regs); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 2); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 2); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, m68hc11_frame_init_saved_regs); set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_read_pc (gdbarch, generic_target_read_pc); @@ -1324,7 +1394,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value); set_gdbarch_push_arguments (gdbarch, m68hc11_push_arguments); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, m68hc11_push_return_address); set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); @@ -1348,7 +1417,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention); - set_gdbarch_init_extra_frame_info (gdbarch, m68hc11_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, m68hc11_init_extra_frame_info); set_gdbarch_pop_frame (gdbarch, m68hc11_pop_frame); set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); @@ -1358,6 +1427,9 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_stack_align (gdbarch, m68hc11_stack_align); set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11); + m68hc11_add_reggroups (gdbarch); + set_gdbarch_register_reggroup_p (gdbarch, m68hc11_register_reggroup_p); + /* Minsymbol frobbing. */ set_gdbarch_elf_make_msymbol_special (gdbarch, m68hc11_elf_make_msymbol_special); @@ -1372,6 +1444,7 @@ _initialize_m68hc11_tdep (void) { register_gdbarch_init (bfd_arch_m68hc11, m68hc11_gdbarch_init); register_gdbarch_init (bfd_arch_m68hc12, m68hc11_gdbarch_init); + m68hc11_init_reggroups (); add_com ("regs", class_vars, show_regs, "Print all registers"); } diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 182cac6..6008a62 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1012,7 +1012,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, m68k_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc); - set_gdbarch_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs); set_gdbarch_frameless_function_invocation (gdbarch, m68k_frameless_function_invocation); /* OK to default this value to 'unknown'. */ @@ -1021,8 +1021,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, m68k_register_virtual_size); - set_gdbarch_max_register_raw_size (gdbarch, 12); - set_gdbarch_max_register_virtual_size (gdbarch, 12); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 12); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 12); set_gdbarch_register_virtual_type (gdbarch, m68k_register_virtual_type); set_gdbarch_register_name (gdbarch, m68k_register_name); set_gdbarch_register_size (gdbarch, 4); @@ -1050,7 +1050,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words)); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy); - set_gdbarch_push_dummy_frame (gdbarch, m68k_push_dummy_frame); + set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame); set_gdbarch_pop_frame (gdbarch, m68k_pop_frame); return gdbarch; @@ -60,9 +60,6 @@ int event_loop_p = 1; do_setshow_command will free it. */ char *interpreter_p; -/* Whether this is the command line version or not */ -int tui_version = 0; - /* Whether xdb commands will be handled */ int xdb_commands = 0; @@ -229,10 +226,10 @@ captured_main (void *data) #endif /* There will always be an interpreter. Either the one passed into - this captured main (not yet implemented), or one specified by the - user at start up, or the console. Make life easier by always - initializing the interpreter to something. */ - interpreter_p = xstrdup (INTERP_CONSOLE); + this captured main, or one specified by the user at start up, or + the console. Initialize the interpreter to the one requested by + the application. */ + interpreter_p = xstrdup (context->interpreter_p); /* Parse arguments and options. */ { @@ -240,12 +237,21 @@ captured_main (void *data) /* When var field is 0, use flag field to record the equivalent short option (or arbitrary numbers starting at 10 for those with no equivalent). */ + enum { + OPT_SE = 10, + OPT_CD, + OPT_ANNOTATE, + OPT_STATISTICS, + OPT_TUI, + OPT_NOWINDOWS, + OPT_WINDOWS + }; static struct option long_options[] = { {"async", no_argument, &event_loop_p, 1}, {"noasync", no_argument, &event_loop_p, 0}, #if defined(TUI) - {"tui", no_argument, &tui_version, 1}, + {"tui", no_argument, 0, OPT_TUI}, #endif {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 1}, @@ -267,9 +273,9 @@ captured_main (void *data) {"fullname", no_argument, 0, 'f'}, {"f", no_argument, 0, 'f'}, - {"annotate", required_argument, 0, 12}, + {"annotate", required_argument, 0, OPT_ANNOTATE}, {"help", no_argument, &print_help, 1}, - {"se", required_argument, 0, 10}, + {"se", required_argument, 0, OPT_SE}, {"symbols", required_argument, 0, 's'}, {"s", required_argument, 0, 's'}, {"exec", required_argument, 0, 'e'}, @@ -291,15 +297,15 @@ captured_main (void *data) {"i", required_argument, 0, 'i'}, {"directory", required_argument, 0, 'd'}, {"d", required_argument, 0, 'd'}, - {"cd", required_argument, 0, 11}, + {"cd", required_argument, 0, OPT_CD}, {"tty", required_argument, 0, 't'}, {"baud", required_argument, 0, 'b'}, {"b", required_argument, 0, 'b'}, - {"nw", no_argument, &use_windows, 0}, - {"nowindows", no_argument, &use_windows, 0}, - {"w", no_argument, &use_windows, 1}, - {"windows", no_argument, &use_windows, 1}, - {"statistics", no_argument, 0, 13}, + {"nw", no_argument, NULL, OPT_NOWINDOWS}, + {"nowindows", no_argument, NULL, OPT_NOWINDOWS}, + {"w", no_argument, NULL, OPT_WINDOWS}, + {"windows", no_argument, NULL, OPT_WINDOWS}, + {"statistics", no_argument, 0, OPT_STATISTICS}, {"write", no_argument, &write_files, 1}, {"args", no_argument, &set_args, 1}, {0, no_argument, 0, 0} @@ -323,22 +329,38 @@ captured_main (void *data) case 0: /* Long option that just sets a flag. */ break; - case 10: + case OPT_SE: symarg = optarg; execarg = optarg; break; - case 11: + case OPT_CD: cdarg = optarg; break; - case 12: + case OPT_ANNOTATE: /* FIXME: what if the syntax is wrong (e.g. not digits)? */ annotation_level = atoi (optarg); break; - case 13: + case OPT_STATISTICS: /* Enable the display of both time and space usage. */ display_time = 1; display_space = 1; break; + case OPT_TUI: + /* --tui is equivalent to -i=tui. */ + xfree (interpreter_p); + interpreter_p = xstrdup ("tui"); + break; + case OPT_WINDOWS: + /* FIXME: cagney/2003-03-01: Not sure if this option is + actually useful, and if it is, what it should do. */ + use_windows = 1; + break; + case OPT_NOWINDOWS: + /* -nw is equivalent to -i=console. */ + xfree (interpreter_p); + interpreter_p = xstrdup (INTERP_CONSOLE); + use_windows = 0; + break; case 'f': annotation_level = 1; /* We have probably been invoked from emacs. Disable window interface. */ @@ -455,19 +477,8 @@ extern int gdbtk_test (char *); if (print_help || print_version) { use_windows = 0; -#ifdef TUI - /* Disable the TUI as well. */ - tui_version = 0; -#endif } -#ifdef TUI - /* An explicit --tui flag overrides the default UI, which is the - window system. */ - if (tui_version) - use_windows = 0; -#endif - if (set_args) { /* The remaining options are the command-line options for the @@ -27,6 +27,7 @@ struct captured_main_args int argc; char **argv; int use_windows; + const char *interpreter_p; }; extern int gdb_main (struct captured_main_args *); diff --git a/gdb/maint.c b/gdb/maint.c index b118a56..f2dfa68 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -645,6 +645,14 @@ static int maintenance_profile_p; #if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP) +#ifdef HAVE__ETEXT +extern char _etext; +#define TEXTEND &_etext +#else +extern char etext; +#define TEXTEND &etext +#endif + static int profiling_state; static void @@ -669,7 +677,6 @@ maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element * static int profiling_initialized; extern void monstartup (unsigned long, unsigned long); - extern char _etext; extern int main(); if (!profiling_initialized) @@ -680,7 +687,7 @@ maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element * /* "main" is now always the first function in the text segment, so use its address for monstartup. */ - monstartup ((unsigned long) &main, (unsigned long) &_etext); + monstartup ((unsigned long) &main, (unsigned long) TEXTEND); } else { diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 134f9dd..e5b6434 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -643,8 +643,8 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue) /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. */ + then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC + will be called for the new frame. */ CORE_ADDR mcore_frame_chain (struct frame_info * fi) @@ -1101,8 +1101,8 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* All registers are 32 bits */ set_gdbarch_register_size (gdbarch, MCORE_REG_SIZE); - set_gdbarch_max_register_raw_size (gdbarch, MCORE_REG_SIZE); - set_gdbarch_max_register_virtual_size (gdbarch, MCORE_REG_SIZE); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, MCORE_REG_SIZE); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, MCORE_REG_SIZE); set_gdbarch_register_name (gdbarch, mcore_register_name); set_gdbarch_register_virtual_type (gdbarch, mcore_register_virtual_type); set_gdbarch_register_virtual_size (gdbarch, mcore_register_size); @@ -1131,15 +1131,14 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_breakpoint_from_pc (gdbarch, mcore_breakpoint_from_pc); set_gdbarch_push_return_address (gdbarch, mcore_push_return_address); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, mcore_push_arguments); set_gdbarch_call_dummy_length (gdbarch, 0); /* Frames: */ - set_gdbarch_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info); set_gdbarch_frame_chain (gdbarch, mcore_frame_chain); - set_gdbarch_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs); set_gdbarch_frame_saved_pc (gdbarch, mcore_frame_saved_pc); set_gdbarch_deprecated_store_return_value (gdbarch, mcore_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index f1bc7fe..a40a548 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -43,7 +43,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "gdbcore.h" #include "symfile.h" @@ -54,6 +53,7 @@ #include "complaints.h" #include "demangle.h" #include "gdb_assert.h" +#include "block.h" #include "dictionary.h" /* These are needed if the tm.h file does not contain the necessary @@ -668,7 +668,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, /* It is a FORTRAN common block. At least for SGI Fortran the address is not in the symbol; we need to fix it later in scan_file_globals. */ - int bucket = hashname (SYMBOL_NAME (s)); + int bucket = hashname (DEPRECATED_SYMBOL_NAME (s)); SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket]; global_sym_chain[bucket] = s; } @@ -1100,7 +1100,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, obstack_alloc (¤t_objfile->symbol_obstack, sizeof (struct symbol))); memset (enum_sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (enum_sym) = + DEPRECATED_SYMBOL_NAME (enum_sym) = obsavestring (f->name, strlen (f->name), ¤t_objfile->symbol_obstack); SYMBOL_CLASS (enum_sym) = LOC_CONST; @@ -1371,7 +1371,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, for anything except pointers or functions. */ } else - TYPE_NAME (SYMBOL_TYPE (s)) = SYMBOL_NAME (s); + TYPE_NAME (SYMBOL_TYPE (s)) = DEPRECATED_SYMBOL_NAME (s); } break; @@ -4444,10 +4444,10 @@ mylookup_symbol (char *name, register struct block *block, inc = name[0]; ALL_BLOCK_SYMBOLS (block, iter, sym) { - if (SYMBOL_NAME (sym)[0] == inc + if (DEPRECATED_SYMBOL_NAME (sym)[0] == inc && SYMBOL_NAMESPACE (sym) == namespace && SYMBOL_CLASS (sym) == class - && strcmp (SYMBOL_NAME (sym), name) == 0) + && strcmp (DEPRECATED_SYMBOL_NAME (sym), name) == 0) return sym; } @@ -4747,6 +4747,14 @@ elfmdebug_build_psymtabs (struct objfile *objfile, { bfd *abfd = objfile->obfd; struct ecoff_debug_info *info; + struct cleanup *back_to; + + /* FIXME: It's not clear whether we should be getting minimal symbol + information from .mdebug in an ELF file, or whether we will. + Re-initialize the minimal symbol reader in case we do. */ + + init_minimal_symbol_collection (); + back_to = make_cleanup_discard_minimal_symbols (); info = ((struct ecoff_debug_info *) obstack_alloc (&objfile->psymbol_obstack, @@ -4757,6 +4765,9 @@ elfmdebug_build_psymtabs (struct objfile *objfile, bfd_errmsg (bfd_get_error ())); mdebug_build_psymtabs (objfile, swap, info); + + install_minimal_symbols (objfile); + do_cleanups (back_to); } diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 17c6614..4d137be 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,27 @@ +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * mi-main.c (get_register): Use register_type instead of + REGISTER_VIRTUAL_TYPE. + +2003-02-25 David Carlton <carlton@math.stanford.edu> + + * mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with + DEPRECATED_SYMBOL_NAME. Update copyright. + +2003-02-21 Daniel Jacobowitz <drow@mvista.com> + + * mi-cmd-stack.c (list_args_or_locals): Handle LOC_COMPUTED and + LOC_COMPUTED_ARG. + +2003-02-19 David Carlton <carlton@math.stanford.edu> + + * mi-cmd-stack.c: #include "block.h" + +2003-02-09 Andrew Cagney <ac131313@redhat.com> + + * mi-interp.c (mi_remove_notify_hooks): Convert function + definition to ISO C. + 2003-02-06 Andrew Cagney <ac131313@redhat.com> * mi-cmd-env.c: Include "gdb_stat.h" instead of <sys/stat.h>. diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 2711119..fa2fb5c 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -1,5 +1,5 @@ /* MI Command Set - stack commands. - Copyright 2000, 2002 Free Software Foundation, Inc. + Copyright 2000, 2002, 2003 Free Software Foundation, Inc. Contributed by Cygnus Solutions (a Red Hat company). This file is part of GDB. @@ -254,6 +254,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) case LOC_REGPARM_ADDR: /* indirect register arg */ case LOC_LOCAL_ARG: /* stack arg */ case LOC_BASEREG_ARG: /* basereg arg */ + case LOC_COMPUTED_ARG: /* arg with computed location */ if (!locals) print_me = 1; break; @@ -262,6 +263,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) case LOC_BASEREG: /* basereg local */ case LOC_STATIC: /* static */ case LOC_REGISTER: /* register */ + case LOC_COMPUTED: /* computed location */ if (locals) print_me = 1; break; @@ -272,13 +274,13 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) if (values) cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); - ui_out_field_string (uiout, "name", SYMBOL_NAME (sym)); + ui_out_field_string (uiout, "name", DEPRECATED_SYMBOL_NAME (sym)); if (values) { struct symbol *sym2; if (!locals) - sym2 = lookup_symbol (SYMBOL_NAME (sym), + sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), block, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index bf5873a..87ed17f 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -285,7 +285,7 @@ mi_insert_notify_hooks (void) } static void -mi_remove_notify_hooks () +mi_remove_notify_hooks (void) { query_hook = NULL; } diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 8a54108..f08bd3f 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -534,7 +534,8 @@ get_register (int regnum, int format) if (REGISTER_CONVERTIBLE (regnum)) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum), + REGISTER_CONVERT_TO_VIRTUAL (regnum, + register_type (current_gdbarch, regnum), raw_buffer, virtual_buffer); } else @@ -559,7 +560,7 @@ get_register (int regnum, int format) } else { - val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, regnum), virtual_buffer, 0, 0, stb->stream, format, 1, 0, Val_pretty_default); ui_out_field_stream (uiout, "value", stb); ui_out_stream_delete (stb); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 8f77ec1..9216d86 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -113,7 +113,7 @@ add_minsym_to_hash_table (struct minimal_symbol *sym, { if (sym->hash_next == NULL) { - unsigned int hash = msymbol_hash (SYMBOL_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE; + unsigned int hash = msymbol_hash (DEPRECATED_SYMBOL_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE; sym->hash_next = table[hash]; table[hash] = sym; } @@ -188,7 +188,7 @@ lookup_minimal_symbol (register const char *name, const char *sfile, while (msymbol != NULL && found_symbol == NULL) { - if (SYMBOL_MATCHES_NAME (msymbol, name)) + if (DEPRECATED_SYMBOL_MATCHES_NAME (msymbol, name)) { switch (MSYMBOL_TYPE (msymbol)) { @@ -288,7 +288,7 @@ lookup_minimal_symbol_text (register const char *name, const char *sfile, msymbol != NULL && found_symbol == NULL; msymbol = msymbol->hash_next) { - if (SYMBOL_MATCHES_NAME (msymbol, name) && + if (DEPRECATED_SYMBOL_MATCHES_NAME (msymbol, name) && (MSYMBOL_TYPE (msymbol) == mst_text || MSYMBOL_TYPE (msymbol) == mst_file_text)) { @@ -364,7 +364,7 @@ lookup_minimal_symbol_solib_trampoline (register const char *name, msymbol != NULL && found_symbol == NULL; msymbol = msymbol->hash_next) { - if (SYMBOL_MATCHES_NAME (msymbol, name) && + if (DEPRECATED_SYMBOL_MATCHES_NAME (msymbol, name) && MSYMBOL_TYPE (msymbol) == mst_solib_trampoline) return msymbol; } @@ -659,8 +659,8 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p) else /* addrs are equal: sort by name */ { - char *name1 = SYMBOL_NAME (fn1); - char *name2 = SYMBOL_NAME (fn2); + char *name1 = DEPRECATED_SYMBOL_NAME (fn1); + char *name2 = DEPRECATED_SYMBOL_NAME (fn2); if (name1 && name2) /* both have names */ return strcmp (name1, name2); @@ -752,7 +752,7 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount, { if (SYMBOL_VALUE_ADDRESS (copyfrom) == SYMBOL_VALUE_ADDRESS ((copyfrom + 1)) && - (STREQ (SYMBOL_NAME (copyfrom), SYMBOL_NAME ((copyfrom + 1))))) + (STREQ (DEPRECATED_SYMBOL_NAME (copyfrom), DEPRECATED_SYMBOL_NAME ((copyfrom + 1))))) { if (MSYMBOL_TYPE ((copyfrom + 1)) == mst_unknown) { @@ -867,9 +867,9 @@ install_minimal_symbols (struct objfile *objfile) for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++) { msymbols[mcount] = bunch->contents[bindex]; - if (SYMBOL_NAME (&msymbols[mcount])[0] == leading_char) + if (DEPRECATED_SYMBOL_NAME (&msymbols[mcount])[0] == leading_char) { - SYMBOL_NAME (&msymbols[mcount])++; + DEPRECATED_SYMBOL_NAME (&msymbols[mcount])++; } } msym_bunch_index = BUNCH_SIZE; @@ -898,7 +898,7 @@ install_minimal_symbols (struct objfile *objfile) symbol count does *not* include this null symbol, which is why it is indexed by mcount and not mcount-1. */ - SYMBOL_NAME (&msymbols[mcount]) = NULL; + DEPRECATED_SYMBOL_NAME (&msymbols[mcount]) = NULL; SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0; MSYMBOL_INFO (&msymbols[mcount]) = NULL; MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown; @@ -918,10 +918,10 @@ install_minimal_symbols (struct objfile *objfile) for (i = 0; i < mcount; i++) { - const char *name = SYMBOL_NAME (&objfile->msymbols[i]); + const char *name = DEPRECATED_SYMBOL_NAME (&objfile->msymbols[i]); if (name[0] == '_' && name[1] == 'Z') { - switch_to_cp_abi ("gnu-v3"); + set_cp_abi_as_auto_default ("gnu-v3"); break; } } @@ -981,7 +981,7 @@ find_solib_trampoline_target (CORE_ADDR pc) ALL_MSYMBOLS (objfile, msymbol) { if (MSYMBOL_TYPE (msymbol) == mst_text - && STREQ (SYMBOL_NAME (msymbol), SYMBOL_NAME (tsymbol))) + && STREQ (DEPRECATED_SYMBOL_NAME (msymbol), DEPRECATED_SYMBOL_NAME (tsymbol))) return SYMBOL_VALUE_ADDRESS (msymbol); } } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 3555eed..7ade6a2 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -28,7 +28,6 @@ #include "frame.h" #include "inferior.h" #include "symtab.h" -#include "block.h" #include "value.h" #include "gdbcmd.h" #include "language.h" @@ -41,6 +40,7 @@ #include "regcache.h" #include "osabi.h" #include "mips-tdep.h" +#include "block.h" #include "opcode/mips.h" #include "elf/mips.h" @@ -1590,20 +1590,28 @@ read_next_frame_reg (struct frame_info *fi, int regno) int realnum; enum lval_type lval; void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); - frame_register_unwind (fi, regno, &optimized, &lval, &addr, &realnum, - raw_buffer); - /* FIXME: cagney/2002-09-13: This is just soooo bad. The MIPS - should have a pseudo register range that correspons to the ABI's, - rather than the ISA's, view of registers. These registers would - then implicitly describe their size and hence could be used - without the below munging. */ - if (lval == lval_memory) + + if (fi == NULL) + { + regcache_cooked_read (current_regcache, regno, raw_buffer); + } + else { - if (regno < 32) + frame_register_unwind (fi, regno, &optimized, &lval, &addr, &realnum, + raw_buffer); + /* FIXME: cagney/2002-09-13: This is just soooo bad. The MIPS + should have a pseudo register range that correspons to the ABI's, + rather than the ISA's, view of registers. These registers would + then implicitly describe their size and hence could be used + without the below munging. */ + if (lval == lval_memory) { - /* Only MIPS_SAVED_REGSIZE bytes of GP registers are - saved. */ - return read_memory_integer (addr, MIPS_SAVED_REGSIZE); + if (regno < 32) + { + /* Only MIPS_SAVED_REGSIZE bytes of GP registers are + saved. */ + return read_memory_integer (addr, MIPS_SAVED_REGSIZE); + } } } @@ -2474,11 +2482,16 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) if (get_frame_type (fci) == DUMMY_FRAME) return; - /* Use proc_desc calculated in frame_chain */ + /* Use proc_desc calculated in frame_chain. When there is no + next frame, i.e, get_next_frame (fci) == NULL, we call + find_proc_desc () to calculate it, passing an explicit + NULL as the frame parameter. */ proc_desc = get_next_frame (fci) ? cached_proc_desc - : find_proc_desc (get_frame_pc (fci), get_next_frame (fci), 1); + : find_proc_desc (get_frame_pc (fci), + NULL /* i.e, get_next_frame (fci) */, + 1); frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info)); @@ -3833,7 +3846,7 @@ mips_pop_frame (void) write_register (PC_REGNUM, FRAME_SAVED_PC (frame)); if (get_frame_saved_regs (frame) == NULL) - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); for (regnum = 0; regnum < NUM_REGS; regnum++) if (regnum != SP_REGNUM && regnum != PC_REGNUM && get_frame_saved_regs (frame)[regnum]) @@ -5482,7 +5495,6 @@ mips_get_saved_register (char *raw_buffer, CORE_ADDR addrx; enum lval_type lvalx; int optimizedx; - int realnum; if (!target_has_registers) error ("No registers."); @@ -5494,8 +5506,8 @@ mips_get_saved_register (char *raw_buffer, lvalp = &lvalx; if (optimizedp == NULL) optimizedp = &optimizedx; - frame_register_unwind (get_next_frame (frame), regnum, optimizedp, lvalp, - addrp, &realnum, raw_buffer); + generic_unwind_get_saved_register (raw_buffer, optimizedp, addrp, frame, + regnum, lvalp); /* FIXME: cagney/2002-09-13: This is just so bad. The MIPS should have a pseudo register range that correspons to the ABI's, rather than the ISA's, view of registers. These registers would then @@ -5741,8 +5753,8 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_double_bit (gdbarch, 64); set_gdbarch_long_double_bit (gdbarch, 64); set_gdbarch_register_raw_size (gdbarch, mips_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 8); - set_gdbarch_max_register_virtual_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); tdep->found_abi = found_abi; tdep->mips_abi = mips_abi; @@ -5970,8 +5982,8 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum); /* Initialize a frame */ - set_gdbarch_init_extra_frame_info (gdbarch, mips_init_extra_frame_info); - set_gdbarch_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mips_init_extra_frame_info); /* MIPS version of CALL_DUMMY */ @@ -5979,7 +5991,6 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address); set_gdbarch_push_return_address (gdbarch, mips_push_return_address); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_pop_frame (gdbarch, mips_pop_frame); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); @@ -6054,6 +6065,38 @@ mips_abi_update (char *ignore_args, int from_tty, gdbarch_update_p (info); } +/* Print out which MIPS ABI is in use. */ + +static void +show_mips_abi (char *ignore_args, int from_tty) +{ + if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips) + printf_filtered ( + "The MIPS ABI is unknown because the current architecture is not MIPS.\n"); + else + { + enum mips_abi global_abi = global_mips_abi (); + enum mips_abi actual_abi = mips_abi (current_gdbarch); + const char *actual_abi_str = mips_abi_strings[actual_abi]; + + if (global_abi == MIPS_ABI_UNKNOWN) + printf_filtered ("The MIPS ABI is set automatically (currently \"%s\").\n", + actual_abi_str); + else if (global_abi == actual_abi) + printf_filtered ( + "The MIPS ABI is assumed to be \"%s\" (due to user setting).\n", + actual_abi_str); + else + { + /* Probably shouldn't happen... */ + printf_filtered ( + "The (auto detected) MIPS ABI \"%s\" is in use even though the user setting was \"%s\".\n", + actual_abi_str, + mips_abi_strings[global_abi]); + } + } +} + static void mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) { @@ -6501,8 +6544,9 @@ This option can be set to one of:\n\ " eabi32\n" " eabi64", &setmipscmdlist); - add_show_from_set (c, &showmipscmdlist); set_cmd_sfunc (c, mips_abi_update); + add_cmd ("abi", class_obscure, show_mips_abi, + "Show ABI in use by MIPS target", &showmipscmdlist); /* Let the user turn off floating point and set the fence post for heuristic_proc_start. */ diff --git a/gdb/mipsread.c b/gdb/mipsread.c index 1f869f4..293eaed 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -1,6 +1,6 @@ /* Read a symbol table in MIPS' format (Third-Eye). Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1998, 1999, 2000, 2001 + 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by Alessandro Forin (af@cs.cmu.edu) at CMU. Major work by Per Bothner, John Gilmore and Ian Lance Taylor at Cygnus Support. @@ -118,7 +118,7 @@ mipscoff_symfile_read (struct objfile *objfile, int mainline) struct minimal_symbol *m; m = lookup_minimal_symbol_by_pc (objfile->ei.entry_point); - if (m && SYMBOL_NAME (m + 1)) + if (m && DEPRECATED_SYMBOL_NAME (m + 1)) { objfile->ei.entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m); objfile->ei.entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index a3dd012..bcd96ad 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1146,10 +1146,10 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_register_size (gdbarch, 4); set_gdbarch_register_bytes (gdbarch, num_regs * gdbarch_register_size (gdbarch)); - set_gdbarch_max_register_raw_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size); set_gdbarch_register_byte (gdbarch, mn10300_register_byte); - set_gdbarch_max_register_virtual_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); set_gdbarch_register_virtual_size (gdbarch, mn10300_register_virtual_size); set_gdbarch_register_virtual_type (gdbarch, mn10300_register_virtual_type); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum); @@ -1167,9 +1167,9 @@ mn10300_gdbarch_init (struct gdbarch_info info, /* Stack unwinding. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_saved_pc_after_call (gdbarch, mn10300_saved_pc_after_call); - set_gdbarch_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); - set_gdbarch_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs); set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, mn10300_frame_saved_pc); set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value); @@ -1197,7 +1197,6 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, mn10300_push_arguments); set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); set_gdbarch_push_return_address (gdbarch, mn10300_push_return_address); diff --git a/gdb/nlmread.c b/gdb/nlmread.c index 1ad4a02..883a170 100644 --- a/gdb/nlmread.c +++ b/gdb/nlmread.c @@ -23,11 +23,11 @@ #include "defs.h" #include "bfd.h" #include "symtab.h" -#include "block.h" #include "symfile.h" #include "objfiles.h" #include "buildsym.h" #include "stabsread.h" +#include "block.h" extern void _initialize_nlmread (void); @@ -191,6 +191,12 @@ nlm_symfile_read (struct objfile *objfile, int mainline) nlm_symtab_read (abfd, offset, objfile); + /* Install any minimal symbols that have been collected as the current + minimal symbols for this objfile. */ + + install_minimal_symbols (objfile); + do_cleanups (back_to); + stabsect_build_psymtabs (objfile, mainline, ".stab", ".stabstr", ".text"); @@ -205,13 +211,6 @@ nlm_symfile_read (struct objfile *objfile, int mainline) /* FIXME: We could locate and read the optional native debugging format here and add the symbols to the minimal symbol table. */ - - /* Install any minimal symbols that have been collected as the current - minimal symbols for this objfile. */ - - install_minimal_symbols (objfile); - - do_cleanups (back_to); } diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index fe5ebdf..36ccadc 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -429,7 +429,7 @@ ns32k_pop_frame (void) int regnum; fp = get_frame_base (frame); - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); for (regnum = 0; regnum < 8; regnum++) if (get_frame_saved_regs (frame)[regnum]) @@ -558,9 +558,9 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_size (gdbarch, NS32K_REGISTER_SIZE); set_gdbarch_register_raw_size (gdbarch, ns32k_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE); set_gdbarch_register_virtual_size (gdbarch, ns32k_register_virtual_size); - set_gdbarch_max_register_virtual_size (gdbarch, + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, NS32K_MAX_REGISTER_VIRTUAL_SIZE); set_gdbarch_register_virtual_type (gdbarch, ns32k_register_virtual_type); @@ -578,7 +578,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_address (gdbarch, ns32k_frame_args_address); set_gdbarch_frame_locals_address (gdbarch, ns32k_frame_locals_address); - set_gdbarch_frame_init_saved_regs (gdbarch, ns32k_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ns32k_frame_init_saved_regs); set_gdbarch_frame_args_skip (gdbarch, 8); @@ -592,7 +592,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) ns32k_extract_struct_value_address); /* Call dummy info */ - set_gdbarch_push_dummy_frame (gdbarch, ns32k_push_dummy_frame); + set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame); set_gdbarch_pop_frame (gdbarch, ns32k_pop_frame); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_p (gdbarch, 1); diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 5b70b65..dc8866c 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -44,7 +44,6 @@ #include "objc-lang.h" /* For objc language constructs. */ #include "value.h" -#include "block.h" #include "parser-defs.h" #include "language.h" #include "c-lang.h" @@ -53,6 +52,7 @@ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols. */ #include "top.h" #include "completer.h" /* For skip_quoted(). */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 3517697..cee41eb 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1,6 +1,6 @@ /* Objective-C language support routines for GDB, the GNU debugger. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by Apple Computer, Inc. Written by Michael Snyder. @@ -24,7 +24,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "parser-defs.h" @@ -42,6 +41,7 @@ #include "frame.h" #include "gdb_regex.h" #include "regcache.h" +#include "block.h" #include <ctype.h> @@ -799,8 +799,8 @@ compare_selectors (const void *a, const void *b) { char *aname, *bname; - aname = SYMBOL_BEST_NAME (*(struct symbol **) a); - bname = SYMBOL_BEST_NAME (*(struct symbol **) b); + aname = SYMBOL_PRINT_NAME (*(struct symbol **) a); + bname = SYMBOL_PRINT_NAME (*(struct symbol **) b); if (aname == NULL || bname == NULL) error ("internal: compare_selectors(1)"); @@ -868,7 +868,7 @@ selectors_info (char *regexp, int from_tty) QUIT; name = SYMBOL_DEMANGLED_NAME (msymbol); if (name == NULL) - name = SYMBOL_NAME (msymbol); + name = DEPRECATED_SYMBOL_NAME (msymbol); if (name && (name[0] == '-' || name[0] == '+') && name[1] == '[') /* Got a method name. */ @@ -901,7 +901,7 @@ selectors_info (char *regexp, int from_tty) QUIT; name = SYMBOL_DEMANGLED_NAME (msymbol); if (name == NULL) - name = SYMBOL_NAME (msymbol); + name = DEPRECATED_SYMBOL_NAME (msymbol); if (name && (name[0] == '-' || name[0] == '+') && name[1] == '[') /* Got a method name. */ @@ -927,7 +927,7 @@ selectors_info (char *regexp, int from_tty) QUIT; name = SYMBOL_DEMANGLED_NAME (sym_arr[ix]); if (name == NULL) - name = SYMBOL_NAME (sym_arr[ix]); + name = DEPRECATED_SYMBOL_NAME (sym_arr[ix]); name = strchr (name, ' ') + 1; if (p[0] && specialcmp(name, p) == 0) continue; /* Seen this one already (not unique). */ @@ -957,8 +957,8 @@ compare_classes (const void *a, const void *b) { char *aname, *bname; - aname = SYMBOL_BEST_NAME (*(struct symbol **) a); - bname = SYMBOL_BEST_NAME (*(struct symbol **) b); + aname = SYMBOL_PRINT_NAME (*(struct symbol **) a); + bname = SYMBOL_PRINT_NAME (*(struct symbol **) b); if (aname == NULL || bname == NULL) error ("internal: compare_classes(1)"); @@ -1011,7 +1011,7 @@ classes_info (char *regexp, int from_tty) QUIT; name = SYMBOL_DEMANGLED_NAME (msymbol); if (name == NULL) - name = SYMBOL_NAME (msymbol); + name = DEPRECATED_SYMBOL_NAME (msymbol); if (name && (name[0] == '-' || name[0] == '+') && name[1] == '[') /* Got a method name. */ @@ -1037,7 +1037,7 @@ classes_info (char *regexp, int from_tty) QUIT; name = SYMBOL_DEMANGLED_NAME (msymbol); if (name == NULL) - name = SYMBOL_NAME (msymbol); + name = DEPRECATED_SYMBOL_NAME (msymbol); if (name && (name[0] == '-' || name[0] == '+') && name[1] == '[') /* Got a method name. */ @@ -1056,7 +1056,7 @@ classes_info (char *regexp, int from_tty) QUIT; name = SYMBOL_DEMANGLED_NAME (sym_arr[ix]); if (name == NULL) - name = SYMBOL_NAME (sym_arr[ix]); + name = DEPRECATED_SYMBOL_NAME (sym_arr[ix]); name += 2; if (p[0] && specialcmp(name, p) == 0) continue; /* Seen this one already (not unique). */ @@ -1273,7 +1273,7 @@ parse_method (char *method, char *type, char **class, return s2; } -void +static void find_methods (struct symtab *symtab, char type, const char *class, const char *category, const char *selector, struct symbol **syms, @@ -1319,7 +1319,7 @@ find_methods (struct symtab *symtab, char type, symname = SYMBOL_DEMANGLED_NAME (msymbol); if (symname == NULL) - symname = SYMBOL_NAME (msymbol); + symname = DEPRECATED_SYMBOL_NAME (msymbol); if (symname == NULL) continue; @@ -1358,7 +1358,7 @@ find_methods (struct symtab *symtab, char type, const char *newsymname = SYMBOL_DEMANGLED_NAME (sym); if (newsymname == NULL) - newsymname = SYMBOL_NAME (sym); + newsymname = DEPRECATED_SYMBOL_NAME (sym); if (strcmp (symname, newsymname) == 0) { /* Found a high-level method sym: swap it into the diff --git a/gdb/objc-lang.h b/gdb/objc-lang.h index 58f1884..8506818 100644 --- a/gdb/objc-lang.h +++ b/gdb/objc-lang.h @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ struct value; +struct block; extern int objc_parse (void); /* Defined in c-exp.y */ @@ -45,11 +46,6 @@ extern char *parse_method (char *method, char *type, char **class, char **category, char **selector); -extern void find_methods (struct symtab *symtab, char type, - const char *class, const char *category, - const char *selector, struct symbol **syms, - unsigned int *nsym, unsigned int *ndebug); - extern char *find_imps (struct symtab *symtab, struct block *block, char *method, struct symbol **syms, unsigned int *nsym, unsigned int *ndebug); diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 80ed790..5057e9b 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -28,7 +28,6 @@ #include "defs.h" #include "bfd.h" /* Binary File Description */ #include "symtab.h" -#include "block.h" #include "symfile.h" #include "objfiles.h" #include "gdb-stabs.h" @@ -43,6 +42,7 @@ #include "hashtab.h" #include "breakpoint.h" +#include "block.h" #include "dictionary.h" /* Prototypes for local functions */ @@ -374,7 +374,7 @@ terminate_minimal_symbol_table (struct objfile *objfile) = &objfile->msymbols[objfile->minimal_symbol_count]; memset (m, 0, sizeof (*m)); - SYMBOL_NAME (m) = NULL; + DEPRECATED_SYMBOL_NAME (m) = NULL; SYMBOL_VALUE_ADDRESS (m) = 0; MSYMBOL_INFO (m) = NULL; MSYMBOL_TYPE (m) = mst_unknown; @@ -684,7 +684,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) else if (SYMBOL_CLASS (sym) == LOC_CONST && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE - && strcmp (SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0) + && strcmp (DEPRECATED_SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0) ecoff_relocate_efi (sym, ANOFFSET (delta, s->block_line_section)); #endif diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 7546623..e710263 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -587,7 +587,7 @@ extern int is_in_import_list (char *, struct objfile *); /* Traverse all minimal symbols in one objfile. */ #define ALL_OBJFILE_MSYMBOLS(objfile, m) \ - for ((m) = (objfile) -> msymbols; SYMBOL_NAME(m) != NULL; (m)++) + for ((m) = (objfile) -> msymbols; DEPRECATED_SYMBOL_NAME(m) != NULL; (m)++) /* Traverse all symtabs in all objfiles. */ diff --git a/gdb/osabi.c b/gdb/osabi.c index 5b4531a..ab49f9a 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -72,6 +72,7 @@ static const char * const gdb_osabi_names[] = "ARM EABI v1", "ARM EABI v2", "ARM APCS", + "QNX Neutrino", "<invalid>" }; diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 0187711..bdfcf05 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -50,13 +50,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <ctype.h> #include "expression.h" #include "value.h" -#include "block.h" #include "parser-defs.h" #include "language.h" #include "p-lang.h" #include "bfd.h" /* Required by objfiles.h. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +#include "block.h" /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 4e092302..3d2023e 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -1,5 +1,5 @@ /* Support for printing Pascal values for GDB, the GNU debugger. - Copyright 2000, 2001 + Copyright 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -225,7 +225,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset, int is_this_fld; if (msymbol != NULL) - wsym = lookup_symbol (SYMBOL_NAME (msymbol), block, + wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block, VAR_NAMESPACE, &is_this_fld, NULL); if (wsym) @@ -646,7 +646,7 @@ pascal_object_print_class_method (char *valaddr, struct type *type, check_stub_method_group (domain, i); for (j = 0; j < len2; j++) { - if (STREQ (SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j))) + if (STREQ (DEPRECATED_SYMBOL_NAME (sym), TYPE_FN_FIELD_PHYSNAME (f, j))) goto common; } } diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index e675384..f03f537 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -28,6 +28,8 @@ #include "doublest.h" +struct block; + extern struct expression *expout; extern int expout_size; extern int expout_ptr; diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 3677d9f..f02581b 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -732,9 +732,9 @@ ppc_linux_init_abi (struct gdbarch_info info, set_gdbarch_frame_chain (gdbarch, ppc_linux_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc); - set_gdbarch_frame_init_saved_regs (gdbarch, + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ppc_linux_frame_init_saved_regs); - set_gdbarch_init_extra_frame_info (gdbarch, + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, ppc_linux_init_extra_frame_info); set_gdbarch_memory_remove_breakpoint (gdbarch, diff --git a/gdb/printcmd.c b/gdb/printcmd.c index d1fc2a7..96736f7 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -25,7 +25,6 @@ #include "gdb_string.h" #include "frame.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "value.h" #include "language.h" @@ -42,6 +41,7 @@ #include "completer.h" /* for completion functions */ #include "ui-out.h" #include "gdb_assert.h" +#include "block.h" #include "dictionary.h" extern int asm_demangle; /* Whether to demangle syms in asm printouts */ @@ -645,7 +645,7 @@ build_address_symbolic (CORE_ADDR addr, /* IN */ if (do_demangle || asm_demangle) name_temp = SYMBOL_PRINT_NAME (symbol); else - name_temp = SYMBOL_NAME (symbol); + name_temp = DEPRECATED_SYMBOL_NAME (symbol); } if (msymbol != NULL) @@ -660,7 +660,7 @@ build_address_symbolic (CORE_ADDR addr, /* IN */ if (do_demangle || asm_demangle) name_temp = SYMBOL_PRINT_NAME (msymbol); else - name_temp = SYMBOL_NAME (msymbol); + name_temp = DEPRECATED_SYMBOL_NAME (msymbol); } } if (symbol == NULL && msymbol == NULL) @@ -1124,7 +1124,7 @@ address_info (char *exp, int from_tty) } printf_filtered ("Symbol \""); - fprintf_symbol_filtered (gdb_stdout, SYMBOL_NAME (sym), + fprintf_symbol_filtered (gdb_stdout, DEPRECATED_SYMBOL_NAME (sym), current_language->la_language, DMGL_ANSI); printf_filtered ("\" is "); val = SYMBOL_VALUE (sym); @@ -1151,6 +1151,11 @@ address_info (char *exp, int from_tty) } break; + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + (SYMBOL_LOCATION_FUNCS (sym)->describe_location) (sym, gdb_stdout); + break; + case LOC_REGISTER: printf_filtered ("a variable in register %s", REGISTER_NAME (val)); break; @@ -1237,7 +1242,7 @@ address_info (char *exp, int from_tty) { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, NULL); + msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL); if (msym == NULL) printf_filtered ("unresolved"); else @@ -1366,7 +1371,9 @@ display_command (char *exp, int from_tty) int display_it = 1; #if defined(TUI) - if (tui_version && *exp == '$') + /* NOTE: cagney/2003-02-13 The `tui_active' was previously + `tui_version'. */ + if (tui_active && *exp == '$') display_it = (tui_set_layout (exp) == TUI_FAILURE); #endif @@ -1811,6 +1818,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, case LOC_REGPARM_ADDR: case LOC_LOCAL_ARG: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: break; /* Other types of symbols we just skip over. */ @@ -1831,11 +1839,11 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, Null parameter names occur on the RS/6000, for traceback tables. FIXME, should we even print them? */ - if (*SYMBOL_NAME (sym)) + if (*DEPRECATED_SYMBOL_NAME (sym)) { struct symbol *nsym; nsym = lookup_symbol - (SYMBOL_NAME (sym), + (DEPRECATED_SYMBOL_NAME (sym), b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); if (SYMBOL_CLASS (nsym) == LOC_REGISTER) { diff --git a/gdb/regcache.c b/gdb/regcache.c index 1bbdb61..3f2be7b 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -172,13 +172,20 @@ init_regcache_descr (struct gdbarch *gdbarch) struct type *); for (i = 0; i < descr->nr_cooked_registers; i++) { - descr->register_type[i] = REGISTER_VIRTUAL_TYPE (i); + if (gdbarch_register_type_p (gdbarch)) + { + gdb_assert (!REGISTER_VIRTUAL_TYPE_P ()); /* OK */ + descr->register_type[i] = gdbarch_register_type (gdbarch, i); + } + else + descr->register_type[i] = REGISTER_VIRTUAL_TYPE (i); /* OK */ } /* If an old style architecture, fill in the remainder of the register cache descriptor using the register macros. */ if (!gdbarch_pseudo_register_read_p (gdbarch) - && !gdbarch_pseudo_register_write_p (gdbarch)) + && !gdbarch_pseudo_register_write_p (gdbarch) + && !gdbarch_register_type_p (gdbarch)) { descr->legacy_p = 1; init_legacy_regcache_descr (gdbarch, descr); @@ -285,6 +292,36 @@ max_register_size (struct gdbarch *gdbarch) return descr->max_register_size; } +int +legacy_max_register_raw_size (void) +{ + if (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ()) + return DEPRECATED_MAX_REGISTER_RAW_SIZE; + else + return max_register_size (current_gdbarch); +} + +int +legacy_max_register_virtual_size (void) +{ + if (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ()) + return DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE; + else + return max_register_size (current_gdbarch); +} + +int +register_size (struct gdbarch *gdbarch, int regnum) +{ + struct regcache_descr *descr = regcache_descr (gdbarch); + int size; + gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)); + size = descr->sizeof_register[regnum]; + gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */ + gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */ + return size; +} + /* The register cache for storing raw register values. */ struct regcache diff --git a/gdb/regcache.h b/gdb/regcache.h index 8dfd2e9..ee10505 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -129,6 +129,32 @@ extern struct type *register_type (struct gdbarch *gdbarch, int regnum); extern int max_register_size (struct gdbarch *gdbarch); +/* Return the size of register REGNUM. All registers should have only + one size. + + FIXME: cagney/2003-02-28: + + Unfortunatly, thanks to some legacy architectures, this doesn't + hold. A register's cooked (nee virtual) and raw size can differ + (see MIPS). Such architectures should be using different register + numbers for the different sized views of identical registers. + + Anyway, the up-shot is that, until that mess is fixed, core code + can end up being very confused - should the RAW or VIRTUAL size be + used? As a rule of thumb, use REGISTER_VIRTUAL_SIZE in cooked + code, but with the comment: + + OK: REGISTER_VIRTUAL_SIZE + + or just + + OK + + appended to the end of the line. */ + +extern int register_size (struct gdbarch *gdbarch, int regnum); + + /* Save/restore a register cache. The registers saved/restored is determined by the save_reggroup and restore_reggroup (although you can't restore a register that wasn't saved as well :-). You can diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index cc21649..f934bd4 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -814,46 +814,13 @@ gdbsim_mourn_inferior (void) static int gdbsim_insert_breakpoint (CORE_ADDR addr, char *contents_cache) { -#ifdef SIM_HAS_BREAKPOINTS - SIM_RC retcode; - - retcode = sim_set_breakpoint (gdbsim_desc, addr); - - switch (retcode) - { - case SIM_RC_OK: - return 0; - case SIM_RC_INSUFFICIENT_RESOURCES: - return ENOMEM; - default: - return EIO; - } -#else return memory_insert_breakpoint (addr, contents_cache); -#endif } static int gdbsim_remove_breakpoint (CORE_ADDR addr, char *contents_cache) { -#ifdef SIM_HAS_BREAKPOINTS - SIM_RC retcode; - - retcode = sim_clear_breakpoint (gdbsim_desc, addr); - - switch (retcode) - { - case SIM_RC_OK: - case SIM_RC_UNKNOWN_BREAKPOINT: - return 0; - case SIM_RC_INSUFFICIENT_RESOURCES: - return ENOMEM; - default: - return EIO; - } -#else return memory_remove_breakpoint (addr, contents_cache); -#endif } /* Pass the command argument through to the simulator verbatim. The diff --git a/gdb/remote.c b/gdb/remote.c index d47dad7..5edea01 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4839,8 +4839,8 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type) } -int remote_hw_watchpoint_limit = 0; -int remote_hw_breakpoint_limit = 0; +int remote_hw_watchpoint_limit = -1; +int remote_hw_breakpoint_limit = -1; int remote_check_watch_resources (int type, int cnt, int ot) @@ -4849,6 +4849,8 @@ remote_check_watch_resources (int type, int cnt, int ot) { if (remote_hw_breakpoint_limit == 0) return 0; + else if (remote_hw_breakpoint_limit < 0) + return 1; else if (cnt <= remote_hw_breakpoint_limit) return 1; } @@ -4856,6 +4858,8 @@ remote_check_watch_resources (int type, int cnt, int ot) { if (remote_hw_watchpoint_limit == 0) return 0; + else if (remote_hw_watchpoint_limit < 0) + return 1; else if (ot) return -1; else if (cnt <= remote_hw_watchpoint_limit) @@ -6144,6 +6148,19 @@ terminating `#' character and checksum.", "Show the maximum number of bytes per memory-read packet.\n", &remote_show_cmdlist); + add_setshow_cmd ("hardware-watchpoint-limit", no_class, + var_zinteger, &remote_hw_watchpoint_limit, "\ +Set the maximum number of target hardware watchpoints.\n\ +Specify a negative limit for unlimited.", "\ +Show the maximum number of target hardware watchpoints.\n", + NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist); + add_setshow_cmd ("hardware-breakpoint-limit", no_class, + var_zinteger, &remote_hw_breakpoint_limit, "\ +Set the maximum number of target hardware breakpoints.\n\ +Specify a negative limit for unlimited.", "\ +Show the maximum number of target hardware breakpoints.\n", + NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist); + add_show_from_set (add_set_cmd ("remoteaddresssize", class_obscure, var_integer, (char *) &remote_address_size, diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index a3a8d3d..ac33578 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -47,6 +47,8 @@ #include "solib-svr4.h" #include "ppc-tdep.h" +#include "gdb_assert.h" + /* If the kernel has to deliver a signal, it pushes a sigcontext structure on the stack and then calls the signal handler, passing the address of the sigcontext in an argument register. Usually @@ -1442,7 +1444,7 @@ rs6000_skip_trampoline_code (CORE_ADDR pc) /* Check for bigtoc fixup code. */ msymbol = lookup_minimal_symbol_by_pc (pc); - if (msymbol && rs6000_in_solib_return_trampoline (pc, SYMBOL_NAME (msymbol))) + if (msymbol && rs6000_in_solib_return_trampoline (pc, DEPRECATED_SYMBOL_NAME (msymbol))) { /* Double-check that the third instruction from PC is relative "b". */ op = read_memory_integer (pc + 8, 4); @@ -2271,7 +2273,7 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr) /* 0 */ P(r0), P(r1), P(r2), P(r3), P(r4), P(r5), P(r6), P(r7), \ /* 8 */ P(r8), P(r9), P(r10),P(r11),P(r12),P(r13),P(r14),P(r15), \ /* 16 */ P(r16),P(r17),P(r18),P(r19),P(r20),P(r21),P(r22),P(r23), \ - /* 24 */ P(r24),P(r25),P(r26),P(r27),P(r28),P(r29),P(r30),P(r31), \ + /* 24 */ P(r24),P(r25),P(r26),P(r27),P(r28),P(r29),P(r30),P(r31) /* IBM POWER (pre-PowerPC) architecture, user-level view. We only cover user-level SPR's. */ @@ -2450,6 +2452,9 @@ static const struct reg registers_e500[] = PPC_UISA_NOFP_SPRS, /* 7...38 */ PPC_EV_REGS, + R8(acc), R(spefscr), + /* NOTE: Add new registers here the end of the raw register + list and just before the first pseudo register. */ /* 39...70 */ PPC_GPRS_PSEUDO_REGS }; @@ -2801,8 +2806,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->ppc_ev31_regnum = -1; break; case bfd_mach_ppc_e500: - tdep->ppc_gp0_regnum = 39; - tdep->ppc_gplast_regnum = 70; + tdep->ppc_gp0_regnum = 41; + tdep->ppc_gplast_regnum = tdep->ppc_gp0_regnum + 32 - 1; tdep->ppc_toc_regnum = -1; tdep->ppc_ps_regnum = 1; tdep->ppc_cr_regnum = 2; @@ -2812,8 +2817,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->ppc_ev0_regnum = 7; tdep->ppc_ev31_regnum = 38; set_gdbarch_pc_regnum (gdbarch, 0); - set_gdbarch_sp_regnum (gdbarch, 40); - set_gdbarch_fp_regnum (gdbarch, 40); + set_gdbarch_sp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1); + set_gdbarch_fp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1); set_gdbarch_dwarf2_reg_to_regnum (gdbarch, e500_dwarf2_reg_to_regnum); set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write); @@ -2828,6 +2833,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; } + /* Sanity check on registers. */ + gdb_assert (strcmp (tdep->regs[tdep->ppc_gp0_regnum].name, "r0") == 0); + /* Set lr_frame_offset. */ if (wordsize == 8) tdep->lr_frame_offset = 16; @@ -2863,9 +2871,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, off); set_gdbarch_register_byte (gdbarch, rs6000_register_byte); set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, 16); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16); set_gdbarch_register_virtual_size (gdbarch, generic_register_size); - set_gdbarch_max_register_virtual_size (gdbarch, 16); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16); set_gdbarch_register_virtual_type (gdbarch, rs6000_register_virtual_type); set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT); @@ -2887,7 +2895,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy); set_gdbarch_frame_align (gdbarch, rs6000_frame_align); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_push_return_address (gdbarch, ppc_push_return_address); set_gdbarch_believe_pcc_promotion (gdbarch, 1); @@ -2933,8 +2940,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, rs6000_frame_saved_pc); - set_gdbarch_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs); - set_gdbarch_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info); if (!sysv_abi) { diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 21efca8..9ad34c8 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1809,7 +1809,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frame_args_address (gdbarch, s390_frame_args_address); set_gdbarch_frame_chain (gdbarch, s390_frame_chain); - set_gdbarch_frame_init_saved_regs (gdbarch, s390_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, s390_frame_init_saved_regs); set_gdbarch_frame_locals_address (gdbarch, s390_frame_args_address); /* We can't do this */ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); @@ -1826,11 +1826,11 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Offset from address of function to start of its code. Zero on most machines. */ set_gdbarch_function_start_offset (gdbarch, 0); - set_gdbarch_max_register_raw_size (gdbarch, 8); - set_gdbarch_max_register_virtual_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc); set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue); - set_gdbarch_init_extra_frame_info (gdbarch, s390_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, s390_init_extra_frame_info); set_gdbarch_deprecated_init_frame_pc_first (gdbarch, s390_init_frame_pc_first); set_gdbarch_read_fp (gdbarch, s390_read_fp); /* This function that tells us whether the function invocation represented @@ -1866,7 +1866,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, s390_push_arguments); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 46b7dee..91f3f62 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -943,8 +943,8 @@ gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info) /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and - then INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be - called for the new frame. + then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC + will be called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ @@ -1029,7 +1029,7 @@ sh_find_callers_reg (struct frame_info *fi, int regnum) get_frame_base (fi), regnum); else { - FRAME_INIT_SAVED_REGS (fi); + DEPRECATED_FRAME_INIT_SAVED_REGS (fi); if (!get_frame_pc (fi)) return 0; if (get_frame_saved_regs (fi)[regnum] != 0) @@ -1053,7 +1053,7 @@ sh64_get_saved_pr (struct frame_info *fi, int pr_regnum) get_frame_base (fi), pr_regnum); else { - FRAME_INIT_SAVED_REGS (fi); + DEPRECATED_FRAME_INIT_SAVED_REGS (fi); if (!get_frame_pc (fi)) return 0; @@ -1776,7 +1776,7 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi) } else { - FRAME_INIT_SAVED_REGS (fi); + DEPRECATED_FRAME_INIT_SAVED_REGS (fi); get_frame_extra_info (fi)->return_pc = sh_find_callers_reg (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM); } @@ -1807,7 +1807,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi) } else { - FRAME_INIT_SAVED_REGS (fi); + DEPRECATED_FRAME_INIT_SAVED_REGS (fi); get_frame_extra_info (fi)->return_pc = sh64_get_saved_pr (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM); } @@ -1864,7 +1864,7 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, return; } - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); if (get_frame_saved_regs (frame) != NULL && get_frame_saved_regs (frame)[regnum] != 0) { @@ -1953,7 +1953,7 @@ sh_pop_frame (void) else { fp = get_frame_base (frame); - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame */ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) @@ -1985,7 +1985,7 @@ sh64_pop_frame (void) else { fp = get_frame_base (frame); - FRAME_INIT_SAVED_REGS (frame); + DEPRECATED_FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame */ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) @@ -4359,8 +4359,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, -1); set_gdbarch_num_pseudo_regs (gdbarch, 0); - set_gdbarch_max_register_raw_size (gdbarch, 4); - set_gdbarch_max_register_virtual_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_num_regs (gdbarch, SH_DEFAULT_NUM_REGS); @@ -4373,7 +4373,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc); set_gdbarch_frame_chain (gdbarch, sh_frame_chain); set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register); - set_gdbarch_init_extra_frame_info (gdbarch, sh_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh_init_extra_frame_info); set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value); set_gdbarch_push_arguments (gdbarch, sh_push_arguments); set_gdbarch_store_struct_return (gdbarch, sh_store_struct_return); @@ -4392,7 +4392,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh_generic_show_regs; sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4402,7 +4402,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh_generic_show_regs; sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4412,7 +4412,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh2e_show_regs; sh_store_return_value = sh3e_sh4_store_return_value; sh_register_virtual_type = sh_sh3e_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4426,7 +4426,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh_dsp_show_regs; sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4451,7 +4451,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh3_show_regs; sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4463,7 +4463,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh3e_show_regs; sh_store_return_value = sh3e_sh4_store_return_value; sh_register_virtual_type = sh_sh3e_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4480,7 +4480,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh3_dsp_show_regs; sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4506,15 +4506,15 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh4_show_regs; sh_store_return_value = sh3e_sh4_store_return_value; sh_register_virtual_type = sh_sh4_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs); set_gdbarch_deprecated_extract_return_value (gdbarch, sh3e_sh4_extract_return_value); set_gdbarch_fp0_regnum (gdbarch, 25); set_gdbarch_register_raw_size (gdbarch, sh_sh4_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_sh4_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_sh4_register_byte); set_gdbarch_num_pseudo_regs (gdbarch, 12); - set_gdbarch_max_register_raw_size (gdbarch, 4 * 4); - set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4); set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); tdep->FPUL_REGNUM = 23; @@ -4601,19 +4601,19 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_virtual_size (gdbarch, sh_sh64_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_sh64_register_byte); /* This seems awfully wrong!*/ - /*set_gdbarch_max_register_raw_size (gdbarch, 8);*/ + /*set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);*/ /* should include the size of the pseudo regs. */ - set_gdbarch_max_register_raw_size (gdbarch, 4 * 4); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4); /* Or should that go in the virtual_size? */ - /*set_gdbarch_max_register_virtual_size (gdbarch, 8);*/ - set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4); + /*set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);*/ + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4); set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write); set_gdbarch_deprecated_do_registers_info (gdbarch, sh64_do_registers_info); - set_gdbarch_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs); set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc); - set_gdbarch_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info); set_gdbarch_frame_chain (gdbarch, sh64_frame_chain); set_gdbarch_get_saved_register (gdbarch, sh64_get_saved_register); set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value); @@ -4630,7 +4630,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh_generic_show_regs; sh_store_return_value = sh_default_store_return_value; sh_register_virtual_type = sh_default_register_virtual_type; - set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs); set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size); set_gdbarch_register_byte (gdbarch, sh_default_register_byte); @@ -4664,7 +4664,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, sh_push_return_address); set_gdbarch_deprecated_store_return_value (gdbarch, sh_store_return_value); diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index dbff6e2..1d379e9 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1,5 +1,5 @@ /* Low level interface for debugging Solaris threads for GDB, the GNU debugger. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -1476,7 +1476,7 @@ info_cb (const td_thrhandle_t *th, void *s) struct minimal_symbol *msym; msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); if (msym) - printf_filtered (" startfunc: %s\n", SYMBOL_NAME (msym)); + printf_filtered (" startfunc: %s\n", DEPRECATED_SYMBOL_NAME (msym)); else printf_filtered (" startfunc: 0x%s\n", paddr (ti.ti_startfunc)); } @@ -1487,7 +1487,7 @@ info_cb (const td_thrhandle_t *th, void *s) struct minimal_symbol *msym; msym = lookup_minimal_symbol_by_pc (ti.ti_pc); if (msym) - printf_filtered (" - Sleep func: %s\n", SYMBOL_NAME (msym)); + printf_filtered (" - Sleep func: %s\n", DEPRECATED_SYMBOL_NAME (msym)); else printf_filtered (" - Sleep func: 0x%s\n", paddr (ti.ti_startfunc)); } diff --git a/gdb/solib.c b/gdb/solib.c index a49614b..289b84f 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -160,6 +160,11 @@ solib_open (char *in_pathname, char **found_pathname) 1, lbasename (in_pathname), O_RDONLY, 0, &temp_pathname); + /* If not found, try to use target supplied solib search method */ + if (found_file < 0 && TARGET_SO_FIND_AND_OPEN_SOLIB != NULL) + found_file = TARGET_SO_FIND_AND_OPEN_SOLIB + (in_pathname, O_RDONLY, &temp_pathname); + /* If not found, next search the inferior's $PATH environment variable. */ if (found_file < 0 && solib_search_path != NULL) found_file = openp (get_in_environ (inferior_environ, "PATH"), @@ -844,6 +849,13 @@ no_shared_libraries (char *ignored, int from_tty) do_clear_solib (NULL); } +static void +reload_shared_libraries (char *ignored, int from_tty) +{ + no_shared_libraries (NULL, from_tty); + solib_add (NULL, from_tty, NULL, auto_solib_add); +} + void _initialize_solib (void) { @@ -873,6 +885,7 @@ inferior. Otherwise, symbols must be loaded manually, using `sharedlibrary'.", For other (relative) files, you can add values using `set solib-search-path'.", &setlist); add_show_from_set (c, &showlist); + set_cmd_cfunc (c, reload_shared_libraries); set_cmd_completer (c, filename_completer); /* Set the default value of "solib-absolute-prefix" from the sysroot, if @@ -885,5 +898,6 @@ For other (relative) files, you can add values using `set solib-search-path'.", This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.", &setlist); add_show_from_set (c, &showlist); + set_cmd_cfunc (c, reload_shared_libraries); set_cmd_completer (c, filename_completer); } diff --git a/gdb/solist.h b/gdb/solist.h index dd1100c..8e5c432 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -99,6 +99,12 @@ struct target_so_ops /* Determine if PC lies in the dynamic symbol resolution code of the run time loader */ int (*in_dynsym_resolve_code) (CORE_ADDR pc); + + /* Extra hook for finding and opening a solib. Convenience function + for remote debuggers finding host libs */ + int (*find_and_open_solib) (char *soname, + unsigned o_flags, char **temp_pathname); + }; void free_so (struct so_list *so); @@ -122,5 +128,7 @@ extern struct target_so_ops *current_target_so_ops; (current_target_so_ops->open_symbol_file_object) #define TARGET_SO_IN_DYNSYM_RESOLVE_CODE \ (current_target_so_ops->in_dynsym_resolve_code) +#define TARGET_SO_FIND_AND_OPEN_SOLIB \ + (current_target_so_ops->find_and_open_solib) #endif diff --git a/gdb/somread.c b/gdb/somread.c index 6ba95a6..85d4f0a 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -353,6 +353,14 @@ som_symfile_read (struct objfile *objfile, int mainline) som_symtab_read (abfd, objfile, objfile->section_offsets); + /* Install any minimal symbols that have been collected as the current + minimal symbols for this objfile. + Further symbol-reading is done incrementally, file-by-file, + in a step known as "psymtab-to-symtab" expansion. hp-symtab-read.c + contains the code to do the actual DNTT scanning and symtab building. */ + install_minimal_symbols (objfile); + do_cleanups (back_to); + /* Now read information from the stabs debug sections. This is a no-op for SOM. Perhaps it is intended for some kind of mixed STABS/SOM @@ -366,16 +374,8 @@ som_symfile_read (struct objfile *objfile, int mainline) together with a scan of the GNTT. See hp-psymtab-read.c. */ hpread_build_psymtabs (objfile, mainline); - /* Install any minimal symbols that have been collected as the current - minimal symbols for this objfile. - Further symbol-reading is done incrementally, file-by-file, - in a step known as "psymtab-to-symtab" expansion. hp-symtab-read.c - contains the code to do the actual DNTT scanning and symtab building. */ - install_minimal_symbols (objfile); - /* Force hppa-tdep.c to re-read the unwind descriptors. */ objfile->obj_private = NULL; - do_cleanups (back_to); } /* Initialize anything that needs initializing when a completely new symbol diff --git a/gdb/somsolib.c b/gdb/somsolib.c index c66946b..08d3e1c 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -938,7 +938,7 @@ som_solib_create_inferior_hook (void) struct minimal_symbol *msymbol2; /* What a crock. */ - msymbol2 = lookup_minimal_symbol_solib_trampoline (SYMBOL_NAME (msymbol), + msymbol2 = lookup_minimal_symbol_solib_trampoline (DEPRECATED_SYMBOL_NAME (msymbol), NULL, objfile); /* Found a symbol with the right name. */ if (msymbol2) diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 3fe4dfc..b22474a 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -431,8 +431,20 @@ sparc_frame_chain (struct frame_info *frame) { /* Value that will cause FRAME_CHAIN_VALID to not worry about the chain value. If it really is zero, we detect it later in - sparc_init_prev_frame. */ - return (CORE_ADDR) 1; + sparc_init_prev_frame. + + Note: kevinb/2003-02-18: The constant 1 used to be returned + here, but, after some recent changes to frame_chain_valid(), + this value is no longer suitable for causing frame_chain_valid() + to "not worry about the chain value." The constant ~0 (i.e, + 0xfff...) causes the failing test in frame_chain_valid() to + succeed thus preserving the "not worry" property. I had considered + using something like ``get_frame_base (frame) + 1''. However, I think + a constant value is better, because when debugging this problem, + I knew that something funny was going on as soon as I saw the + constant 1 being used as the frame chain elsewhere in GDB. */ + + return ~ (CORE_ADDR) 0; } CORE_ADDR @@ -3133,22 +3145,22 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp_regnum (gdbarch, SPARC_FP_REGNUM); set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM); set_gdbarch_frame_chain (gdbarch, sparc_frame_chain); - set_gdbarch_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_saved_pc (gdbarch, sparc_frame_saved_pc); set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); set_gdbarch_get_saved_register (gdbarch, sparc_get_saved_register); - set_gdbarch_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT); set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT); - set_gdbarch_max_register_raw_size (gdbarch, 8); - set_gdbarch_max_register_virtual_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); set_gdbarch_pop_frame (gdbarch, sparc_pop_frame); set_gdbarch_push_return_address (gdbarch, sparc_push_return_address); - set_gdbarch_push_dummy_frame (gdbarch, sparc_push_dummy_frame); + set_gdbarch_deprecated_push_dummy_frame (gdbarch, sparc_push_dummy_frame); set_gdbarch_read_pc (gdbarch, generic_target_read_pc); set_gdbarch_register_convert_to_raw (gdbarch, sparc_convert_to_raw); set_gdbarch_register_convert_to_virtual (gdbarch, diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 17a2fc5..88ab300 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -420,7 +420,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, memset (sym, 0, sizeof (struct symbol)); SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT; - SYMBOL_NAME (sym) = + DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, pp - name, &objfile->symbol_obstack); pp += 2; if (*(pp - 1) == 'F' || *(pp - 1) == 'f') @@ -940,13 +940,13 @@ read_type_number (register char **pp, register int *typenums) // OBSOLETE /* Get symbol typs name and validate // OBSOLETE eg: p = "A;;__ct__1AFv foo__1AFv ;;;" */ // OBSOLETE sname = get_substring (&p, ';'); -// OBSOLETE if (!sname || strcmp (sname, SYMBOL_NAME (sym))) +// OBSOLETE if (!sname || strcmp (sname, DEPRECATED_SYMBOL_NAME (sym))) // OBSOLETE error ("Internal error: base symbol type name does not match\n"); // OBSOLETE /* Find symbol's internal gdb reference using demangled_name. // OBSOLETE This is the real sym that we want; // OBSOLETE sym was a temp hack to make debugger happy */ -// OBSOLETE ref_sym = lookup_symbol (SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0); +// OBSOLETE ref_sym = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), 0, STRUCT_NAMESPACE, 0, 0); // OBSOLETE type = SYMBOL_TYPE (ref_sym); @@ -1073,7 +1073,7 @@ resolve_symbol_reference (struct objfile *objfile, struct symbol *sym, char *p) will correctly print the name. Don't add_symbol_to_list so that lookup_symbol won't find it. nope... needed for fixups. */ - SYMBOL_NAME (sym) = SYMBOL_NAME (ref_sym); + DEPRECATED_SYMBOL_NAME (sym) = DEPRECATED_SYMBOL_NAME (ref_sym); /* Done! */ return 1; @@ -1277,16 +1277,16 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, switch (string[1]) { case 't': - SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"), + DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"), &objfile->symbol_obstack); break; case 'v': /* $vtbl_ptr_type */ - /* Was: SYMBOL_NAME (sym) = "vptr"; */ + /* Was: DEPRECATED_SYMBOL_NAME (sym) = "vptr"; */ goto normal; case 'e': - SYMBOL_NAME (sym) = obsavestring ("eh_throw", strlen ("eh_throw"), + DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("eh_throw", strlen ("eh_throw"), &objfile->symbol_obstack); break; @@ -1324,14 +1324,14 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, return NULL; /* S..P contains the name of the symbol. We need to store - the correct name into SYMBOL_NAME. */ + the correct name into DEPRECATED_SYMBOL_NAME. */ nlen = p - s; if (refnum >= 0) { if (nlen > 0) SYMBOL_SET_NAMES (sym, s, nlen, objfile); else - /* FIXME! Want SYMBOL_NAME (sym) = 0; + /* FIXME! Want DEPRECATED_SYMBOL_NAME (sym) = 0; Get error if leave name 0. So give it something. */ { nlen = p - string; @@ -1576,9 +1576,9 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, Symbol references don't have valid names and wont't match up with minimal symbols when the global_sym_chain is relocated. We'll fixup symbol references when we fixup the defining symbol. */ - if (SYMBOL_NAME (sym) && SYMBOL_NAME (sym)[0] != '#') + if (DEPRECATED_SYMBOL_NAME (sym) && DEPRECATED_SYMBOL_NAME (sym)[0] != '#') { - i = hashname (SYMBOL_NAME (sym)); + i = hashname (DEPRECATED_SYMBOL_NAME (sym)); SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i]; global_sym_chain[i] = sym; } @@ -1778,7 +1778,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, prev_sym = local_symbols->symbol[local_symbols->nsyms - 1]; if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG || SYMBOL_CLASS (prev_sym) == LOC_ARG) - && STREQ (SYMBOL_NAME (prev_sym), SYMBOL_NAME (sym))) + && STREQ (DEPRECATED_SYMBOL_NAME (prev_sym), DEPRECATED_SYMBOL_NAME (sym))) { SYMBOL_CLASS (prev_sym) = LOC_REGPARM; /* Use the type from the LOC_REGISTER; that is the type @@ -1801,13 +1801,13 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = valu; #ifdef STATIC_TRANSFORM_NAME - if (IS_STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym))) + if (IS_STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym))) { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile); + msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile); if (msym != NULL) { - SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)); + DEPRECATED_SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym)); SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); } } @@ -1852,7 +1852,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, extern const char vtbl_ptr_name[]; if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR - && strcmp (SYMBOL_NAME (sym), vtbl_ptr_name)) + && strcmp (DEPRECATED_SYMBOL_NAME (sym), vtbl_ptr_name)) || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC) { /* If we are giving a name to a type such as "pointer to @@ -1892,11 +1892,11 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, /* Pascal accepts names for pointer types. */ if (current_subfile->language == language_pascal) { - TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NAME (sym); + TYPE_NAME (SYMBOL_TYPE (sym)) = DEPRECATED_SYMBOL_NAME (sym); } } else - TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NAME (sym); + TYPE_NAME (SYMBOL_TYPE (sym)) = DEPRECATED_SYMBOL_NAME (sym); } add_symbol_to_list (sym, &file_symbols); @@ -1931,7 +1931,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_TAG_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->type_obstack, "", "", SYMBOL_NAME (sym)); + = obconcat (&objfile->type_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym)); add_symbol_to_list (sym, &file_symbols); if (synonym) @@ -1945,7 +1945,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_NAMESPACE (typedef_sym) = VAR_NAMESPACE; if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) TYPE_NAME (SYMBOL_TYPE (sym)) - = obconcat (&objfile->type_obstack, "", "", SYMBOL_NAME (sym)); + = obconcat (&objfile->type_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym)); add_symbol_to_list (typedef_sym, &file_symbols); } break; @@ -1956,13 +1956,13 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = valu; #ifdef STATIC_TRANSFORM_NAME - if (IS_STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym))) + if (IS_STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym))) { struct minimal_symbol *msym; - msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile); + msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile); if (msym != NULL) { - SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)); + DEPRECATED_SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym)); SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); } } @@ -2395,7 +2395,7 @@ again: if (SYMBOL_CLASS (sym) == LOC_TYPEDEF && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE && (TYPE_CODE (SYMBOL_TYPE (sym)) == code) - && STREQ (SYMBOL_NAME (sym), type_name)) + && STREQ (DEPRECATED_SYMBOL_NAME (sym), type_name)) { obstack_free (&objfile->type_obstack, type_name); type = SYMBOL_TYPE (sym); @@ -4497,7 +4497,7 @@ read_enum_type (register char **pp, register struct type *type, sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); - SYMBOL_NAME (sym) = name; + DEPRECATED_SYMBOL_NAME (sym) = name; SYMBOL_LANGUAGE (sym) = current_subfile->language; SYMBOL_CLASS (sym) = LOC_CONST; SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -4539,7 +4539,7 @@ read_enum_type (register char **pp, register struct type *type, { struct symbol *xsym = syms->symbol[j]; SYMBOL_TYPE (xsym) = type; - TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym); TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); TYPE_FIELD_BITSIZE (type, n) = 0; } @@ -5072,7 +5072,7 @@ common_block_end (struct objfile *objfile) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); memset (sym, 0, sizeof (struct symbol)); /* Note: common_block_name already saved on symbol_obstack */ - SYMBOL_NAME (sym) = common_block_name; + DEPRECATED_SYMBOL_NAME (sym) = common_block_name; SYMBOL_CLASS (sym) = LOC_BLOCK; /* Now we copy all the symbols which have been defined since the BCOMM. */ @@ -5099,7 +5099,7 @@ common_block_end (struct objfile *objfile) /* Should we be putting local_symbols back to what it was? Does it matter? */ - i = hashname (SYMBOL_NAME (sym)); + i = hashname (DEPRECATED_SYMBOL_NAME (sym)); SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i]; global_sym_chain[i] = sym; common_block_name = NULL; @@ -5190,7 +5190,7 @@ cleanup_undefined_types (void) && SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE && (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE (*type)) - && STREQ (SYMBOL_NAME (sym), typename)) + && STREQ (DEPRECATED_SYMBOL_NAME (sym), typename)) replace_type (*type, SYMBOL_TYPE (sym)); } } @@ -5246,7 +5246,7 @@ scan_file_globals (struct objfile *objfile) return; for (msymbol = resolve_objfile->msymbols; - msymbol && SYMBOL_NAME (msymbol) != NULL; + msymbol && DEPRECATED_SYMBOL_NAME (msymbol) != NULL; msymbol++) { QUIT; @@ -5267,12 +5267,12 @@ scan_file_globals (struct objfile *objfile) /* Get the hash index and check all the symbols under that hash index. */ - hash = hashname (SYMBOL_NAME (msymbol)); + hash = hashname (DEPRECATED_SYMBOL_NAME (msymbol)); for (sym = global_sym_chain[hash]; sym;) { - if (SYMBOL_NAME (msymbol)[0] == SYMBOL_NAME (sym)[0] && - STREQ (SYMBOL_NAME (msymbol) + 1, SYMBOL_NAME (sym) + 1)) + if (DEPRECATED_SYMBOL_NAME (msymbol)[0] == DEPRECATED_SYMBOL_NAME (sym)[0] && + STREQ (DEPRECATED_SYMBOL_NAME (msymbol) + 1, DEPRECATED_SYMBOL_NAME (sym) + 1)) { struct alias_list *aliases; @@ -5364,7 +5364,7 @@ scan_file_globals (struct objfile *objfile) else complaint (&symfile_complaints, "%s: common block `%s' from global_sym_chain unresolved", - objfile->name, SYMBOL_NAME (prev)); + objfile->name, DEPRECATED_SYMBOL_NAME (prev)); } } memset (global_sym_chain, 0, sizeof (global_sym_chain)); diff --git a/gdb/stack.c b/gdb/stack.c index d31fe64..d8ac980 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -26,7 +26,6 @@ #include "gdb_string.h" #include "value.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "expression.h" #include "language.h" @@ -40,6 +39,7 @@ #include "inferior.h" #include "annotate.h" #include "ui-out.h" +#include "block.h" #include "dictionary.h" /* Prototypes for exported functions. */ @@ -357,7 +357,7 @@ print_frame (struct frame_info *fi, /* We also don't know anything about the function besides its address and name. */ func = 0; - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); funlang = SYMBOL_LANGUAGE (msymbol); } else @@ -374,7 +374,7 @@ print_frame (struct frame_info *fi, here, while we still have our hands on the function symbol.) */ char *demangled; - funname = SYMBOL_NAME (func); + funname = DEPRECATED_SYMBOL_NAME (func); funlang = SYMBOL_LANGUAGE (func); if (funlang == language_cplus) { @@ -392,7 +392,7 @@ print_frame (struct frame_info *fi, struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (frame_address_in_block (fi)); if (msymbol != NULL) { - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); funlang = SYMBOL_LANGUAGE (msymbol); } } @@ -654,7 +654,7 @@ frame_info (char *addr_exp, int from_tty) * have our hands on the function symbol.) */ char *demangled; - funname = SYMBOL_NAME (func); + funname = DEPRECATED_SYMBOL_NAME (func); funlang = SYMBOL_LANGUAGE (func); if (funlang == language_cplus) { @@ -672,7 +672,7 @@ frame_info (char *addr_exp, int from_tty) register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi)); if (msymbol != NULL) { - funname = SYMBOL_NAME (msymbol); + funname = DEPRECATED_SYMBOL_NAME (msymbol); funlang = SYMBOL_LANGUAGE (msymbol); } } @@ -783,9 +783,9 @@ frame_info (char *addr_exp, int from_tty) } } - if (FRAME_INIT_SAVED_REGS_P () + if (DEPRECATED_FRAME_INIT_SAVED_REGS_P () && get_frame_saved_regs (fi) == NULL) - FRAME_INIT_SAVED_REGS (fi); + DEPRECATED_FRAME_INIT_SAVED_REGS (fi); /* Print as much information as possible on the location of all the registers. */ { @@ -1085,6 +1085,7 @@ print_block_frame_locals (struct block *b, register struct frame_info *fi, case LOC_REGISTER: case LOC_STATIC: case LOC_BASEREG: + case LOC_COMPUTED: values_printed = 1; for (j = 0; j < num_tabs; j++) fputs_filtered ("\t", stream); @@ -1114,7 +1115,7 @@ print_block_frame_labels (struct block *b, int *have_default, ALL_BLOCK_SYMBOLS (b, iter, sym) { - if (STREQ (SYMBOL_NAME (sym), "default")) + if (STREQ (DEPRECATED_SYMBOL_NAME (sym), "default")) { if (*have_default) continue; @@ -1311,6 +1312,7 @@ print_frame_arg_vars (register struct frame_info *fi, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: values_printed = 1; fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); fputs_filtered (" = ", stream); @@ -1326,7 +1328,7 @@ print_frame_arg_vars (register struct frame_info *fi, float). There are also LOC_ARG/LOC_REGISTER pairs which are not combined in symbol-reading. */ - sym2 = lookup_symbol (SYMBOL_NAME (sym), + sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), b, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); print_variable_value (sym2, fi, stream); fprintf_filtered (stream, "\n"); diff --git a/gdb/symfile.c b/gdb/symfile.c index 4534c30..69c07f0 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -25,7 +25,6 @@ #include "defs.h" #include "bfdlink.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "gdbcore.h" #include "frame.h" @@ -48,6 +47,7 @@ #include "hashtab.h" #include <readline/readline.h> #include "gdb_assert.h" +#include "block.h" #include <sys/types.h> #include <fcntl.h> @@ -210,7 +210,7 @@ compare_symbols (const void *s1p, const void *s2p) s1 = (struct symbol **) s1p; s2 = (struct symbol **) s2p; - return (strcmp (SYMBOL_BEST_NAME (*s1), SYMBOL_BEST_NAME (*s2))); + return (strcmp (SYMBOL_NATURAL_NAME (*s1), SYMBOL_NATURAL_NAME (*s2))); } /* This compares two partial symbols by names, using strcmp_iw_ordered @@ -222,8 +222,8 @@ compare_psymbols (const void *s1p, const void *s2p) struct partial_symbol *const *s1 = s1p; struct partial_symbol *const *s2 = s2p; - return strcmp_iw_ordered (SYMBOL_BEST_NAME (*s1), - SYMBOL_BEST_NAME (*s2)); + return strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*s1), + SYMBOL_NATURAL_NAME (*s2)); } void @@ -2685,7 +2685,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name, memcpy (buf, name, namelength); buf[namelength] = '\0'; - SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, objfile->psymbol_cache); + DEPRECATED_SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, objfile->psymbol_cache); buf = alloca (dem_namelength + 1); memcpy (buf, dem_name, dem_namelength); diff --git a/gdb/symfile.h b/gdb/symfile.h index 157552a..3c055c0 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -28,6 +28,7 @@ /* Opaque declarations. */ struct obstack; +struct block; /* Partial symbols are stored in the psymbol_cache and pointers to them are kept in a dynamically grown array that is obtained from malloc and diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 8e456bf..1712c90 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -1,8 +1,8 @@ /* Do various things to symbol tables (other than lookup), for GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, - Inc. + 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software + Foundation, Inc. This file is part of GDB. @@ -23,7 +23,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "bfd.h" #include "symfile.h" @@ -33,6 +32,7 @@ #include "gdb_obstack.h" #include "language.h" #include "bcache.h" +#include "block.h" #include "dictionary.h" #include "gdb_string.h" @@ -101,12 +101,12 @@ free_symtab_block (struct objfile *objfile, struct block *b) for (sym = dict_iterator_next (&iter); sym; sym = dict_iterator_next (&iter)) { - xmfree (objfile->md, SYMBOL_NAME (prev_sym)); + xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (prev_sym)); xmfree (objfile->md, prev_sym); prev_sym = sym; } - xmfree (objfile->md, SYMBOL_NAME (prev_sym)); + xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (prev_sym)); xmfree (objfile->md, prev_sym); } @@ -189,6 +189,9 @@ void print_objfile_statistics (void) { struct objfile *objfile; + struct symtab *s; + struct partial_symtab *ps; + int i, linetables, blockvectors; immediate_quit++; ALL_OBJFILES (objfile) @@ -209,6 +212,28 @@ print_objfile_statistics (void) if (OBJSTAT (objfile, n_types) > 0) printf_filtered (" Number of \"types\" defined: %d\n", OBJSTAT (objfile, n_types)); + i = 0; + ALL_OBJFILE_PSYMTABS (objfile, ps) + { + if (ps->readin == 0) + i++; + } + printf_filtered (" Number of psym tables (not yet expanded): %d\n", i); + i = linetables = blockvectors = 0; + ALL_OBJFILE_SYMTABS (objfile, s) + { + i++; + if (s->linetable != NULL) + linetables++; + if (s->primary == 1) + blockvectors++; + } + printf_filtered (" Number of symbol tables: %d\n", i); + printf_filtered (" Number of symbol tables with line tables: %d\n", + linetables); + printf_filtered (" Number of symbol tables with blockvectors: %d\n", + blockvectors); + if (OBJSTAT (objfile, sz_strtab) > 0) printf_filtered (" Space used by a.out string tables: %d\n", OBJSTAT (objfile, sz_strtab)); @@ -296,7 +321,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile) return; } for (index = 0, msymbol = objfile->msymbols; - SYMBOL_NAME (msymbol) != NULL; msymbol++, index++) + DEPRECATED_SYMBOL_NAME (msymbol) != NULL; msymbol++, index++) { switch (msymbol->type) { @@ -333,7 +358,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile) } fprintf_filtered (outfile, "[%2d] %c ", index, ms_type); print_address_numeric (SYMBOL_VALUE_ADDRESS (msymbol), 1, outfile); - fprintf_filtered (outfile, " %s", SYMBOL_NAME (msymbol)); + fprintf_filtered (outfile, " %s", DEPRECATED_SYMBOL_NAME (msymbol)); if (SYMBOL_BFD_SECTION (msymbol)) fprintf_filtered (outfile, " section %s", bfd_section_name (objfile->obfd, @@ -497,7 +522,7 @@ dump_symtab (struct objfile *objfile, struct symtab *symtab, print_address_numeric (BLOCK_END (b), 1, outfile); if (BLOCK_FUNCTION (b)) { - fprintf_filtered (outfile, ", function %s", SYMBOL_NAME (BLOCK_FUNCTION (b))); + fprintf_filtered (outfile, ", function %s", DEPRECATED_SYMBOL_NAME (BLOCK_FUNCTION (b))); if (SYMBOL_DEMANGLED_NAME (BLOCK_FUNCTION (b)) != NULL) { fprintf_filtered (outfile, ", %s", @@ -615,7 +640,7 @@ print_symbol (void *args) ? "enum" : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT ? "struct" : "union")), - SYMBOL_NAME (symbol)); + DEPRECATED_SYMBOL_NAME (symbol)); LA_PRINT_TYPE (SYMBOL_TYPE (symbol), "", outfile, 1, depth); } fprintf_filtered (outfile, ";\n"); @@ -744,6 +769,11 @@ print_symbol (void *args) SYMBOL_BFD_SECTION (symbol))); break; + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + fprintf_filtered (outfile, "computed at runtime"); + break; + case LOC_UNRESOLVED: fprintf_filtered (outfile, "unresolved"); break; @@ -818,7 +848,7 @@ print_partial_symbols (struct partial_symbol **p, int count, char *what, fprintf_filtered (outfile, " %s partial symbols:\n", what); while (count-- > 0) { - fprintf_filtered (outfile, " `%s'", SYMBOL_NAME (*p)); + fprintf_filtered (outfile, " `%s'", DEPRECATED_SYMBOL_NAME (*p)); if (SYMBOL_DEMANGLED_NAME (*p) != NULL) { fprintf_filtered (outfile, " `%s'", SYMBOL_DEMANGLED_NAME (*p)); @@ -895,6 +925,10 @@ print_partial_symbols (struct partial_symbol **p, int count, char *what, case LOC_OPTIMIZED_OUT: fputs_filtered ("optimized out", outfile); break; + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + fputs_filtered ("computed at runtime", outfile); + break; default: fputs_filtered ("<invalid location>", outfile); break; @@ -993,12 +1027,12 @@ maintenance_check_symtabs (char *ignore, int from_tty) length = ps->n_static_syms; while (length--) { - sym = lookup_block_symbol (b, SYMBOL_NAME (*psym), + sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym), NULL, SYMBOL_NAMESPACE (*psym)); if (!sym) { printf_filtered ("Static symbol `"); - puts_filtered (SYMBOL_NAME (*psym)); + puts_filtered (DEPRECATED_SYMBOL_NAME (*psym)); printf_filtered ("' only found in "); puts_filtered (ps->filename); printf_filtered (" psymtab\n"); @@ -1010,12 +1044,12 @@ maintenance_check_symtabs (char *ignore, int from_tty) length = ps->n_global_syms; while (length--) { - sym = lookup_block_symbol (b, SYMBOL_NAME (*psym), + sym = lookup_block_symbol (b, DEPRECATED_SYMBOL_NAME (*psym), NULL, SYMBOL_NAMESPACE (*psym)); if (!sym) { printf_filtered ("Global symbol `"); - puts_filtered (SYMBOL_NAME (*psym)); + puts_filtered (DEPRECATED_SYMBOL_NAME (*psym)); printf_filtered ("' only found in "); puts_filtered (ps->filename); printf_filtered (" psymtab\n"); diff --git a/gdb/symtab.c b/gdb/symtab.c index abe7e29..c71c6ee 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -23,7 +23,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "gdbcore.h" #include "frame.h" @@ -46,6 +45,7 @@ #include "hashtab.h" #include "gdb_obstack.h" +#include "block.h" #include <sys/types.h> #include <fcntl.h> @@ -80,6 +80,7 @@ static int find_line_common (struct linetable *, int, int *); char *operator_chars (char *p, char **end); static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *, + const char *, const char *, int, namespace_enum); @@ -442,14 +443,11 @@ symbol_init_language_specific (struct general_symbol_info *gsymbol, { gsymbol->language = language; if (gsymbol->language == language_cplus - || gsymbol->language == language_java) + || gsymbol->language == language_java + || gsymbol->language == language_objc) { gsymbol->language_specific.cplus_specific.demangled_name = NULL; } - else if (gsymbol->language == language_objc) - { - gsymbol->language_specific.objc_specific.demangled_name = NULL; - } else { memset (&gsymbol->language_specific, 0, @@ -608,18 +606,35 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol, } +/* Return the source code name of a symbol. In languages where + demangling is necessary, this is the demangled name. */ + +char * +symbol_natural_name (const struct general_symbol_info *gsymbol) +{ + if ((gsymbol->language == language_cplus + || gsymbol->language == language_java + || gsymbol->language == language_objc) + && (gsymbol->language_specific.cplus_specific.demangled_name != NULL)) + { + return gsymbol->language_specific.cplus_specific.demangled_name; + } + else + { + return gsymbol->name; + } +} + /* Return the demangled name for a symbol based on the language for that symbol. If no demangled name exists, return NULL. */ const char * symbol_demangled_name (const struct general_symbol_info *gsymbol) { if (gsymbol->language == language_cplus - || gsymbol->language == language_java) + || gsymbol->language == language_java + || gsymbol->language == language_objc) return gsymbol->language_specific.cplus_specific.demangled_name; - else if (gsymbol->language == language_objc) - return gsymbol->language_specific.objc_specific.demangled_name; - else return NULL; } @@ -1214,7 +1229,8 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name, ALL_PSYMTABS (objfile, ps) { if (!ps->readin - && lookup_partial_symbol (ps, name, psymtab_index, namespace)) + && lookup_partial_symbol (ps, name, linkage_name, + psymtab_index, namespace)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); @@ -1362,7 +1378,7 @@ lookup_symbol_minsym (const struct minimal_symbol *minsym) int block_index = minsym_static (minsym) ? STATIC_BLOCK : GLOBAL_BLOCK; return lookup_symbol_aux_nonlocal (block_index, - SYMBOL_BEST_NAME (minsym), + SYMBOL_NATURAL_NAME (minsym), SYMBOL_LINKAGE_NAME (minsym), VAR_NAMESPACE, NULL); @@ -1458,12 +1474,15 @@ lookup_nested_type (struct type *parent_type, } } -/* Look, in partial_symtab PST, for symbol NAME. Check the global - symbols if GLOBAL, the static symbols if not */ +/* Look, in partial_symtab PST, for symbol whose natural name is NAME. + If LINKAGE_NAME is non-NULL, check in addition that the symbol's + linkage name matches it. Check the global symbols if GLOBAL, the + static symbols if not */ static struct partial_symbol * lookup_partial_symbol (struct partial_symtab *pst, const char *name, - int global, namespace_enum namespace) + const char *linkage_name, int global, + namespace_enum namespace) { struct partial_symbol *temp; struct partial_symbol **start, **psym; @@ -1485,8 +1504,9 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, /* Binary search. This search is guaranteed to end with center pointing at the earliest partial symbol whose name might be - correct. At that point *all* partial symbols with that name - will be checked against the correct namespace. */ + correct. At that point *all* partial symbols with an + appropriate name will be checked against the correct + namespace. */ bottom = start; top = start + length - 1; @@ -1502,7 +1522,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, { do_linear_search = 1; } - if (strcmp_iw_ordered (SYMBOL_BEST_NAME (*center), name) >= 0) + if (strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*center), name) >= 0) { top = center; } @@ -1515,10 +1535,10 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, internal_error (__FILE__, __LINE__, "failed internal consistency check"); - /* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so - we don't have to force a linear search on C++. Probably holds true - for JAVA as well, no way to check. */ - while (top <= real_top && SYMBOL_MATCHES_NAME (*top, name)) + while (top <= real_top + && (linkage_name != NULL + ? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0 + : SYMBOL_MATCHES_NATURAL_NAME (*top,name))) { if (SYMBOL_NAMESPACE (*top) == namespace) { @@ -1537,7 +1557,9 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, { if (namespace == SYMBOL_NAMESPACE (*psym)) { - if (SYMBOL_MATCHES_NAME (*psym, name)) + if (linkage_name != NULL + ? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0 + : SYMBOL_MATCHES_NATURAL_NAME (*psym, name)) { return (*psym); } @@ -1597,7 +1619,8 @@ lookup_transparent_type (const char *name) ALL_PSYMTABS (objfile, ps) { - if (!ps->readin && lookup_partial_symbol (ps, name, 1, STRUCT_NAMESPACE)) + if (!ps->readin && lookup_partial_symbol (ps, name, NULL, + 1, STRUCT_NAMESPACE)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); @@ -1644,7 +1667,7 @@ lookup_transparent_type (const char *name) ALL_PSYMTABS (objfile, ps) { - if (!ps->readin && lookup_partial_symbol (ps, name, 0, STRUCT_NAMESPACE)) + if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_NAMESPACE)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); @@ -1685,7 +1708,7 @@ find_main_psymtab (void) ALL_PSYMTABS (objfile, pst) { - if (lookup_partial_symbol (pst, main_name (), 1, VAR_NAMESPACE)) + if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_NAMESPACE)) { return (pst); } @@ -1743,6 +1766,7 @@ lookup_block_symbol (register const struct block *block, const char *name, if (SYMBOL_NAMESPACE (sym) == namespace && (linkage_name ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1)) + { /* If SYM has aliases, then use any alias that is active at the current PC. If no alias is active at the current @@ -1773,7 +1797,8 @@ lookup_block_symbol (register const struct block *block, const char *name, SYMBOL_CLASS (sym) != LOC_REF_ARG && SYMBOL_CLASS (sym) != LOC_REGPARM && SYMBOL_CLASS (sym) != LOC_REGPARM_ADDR && - SYMBOL_CLASS (sym) != LOC_BASEREG_ARG) + SYMBOL_CLASS (sym) != LOC_BASEREG_ARG && + SYMBOL_CLASS (sym) != LOC_COMPUTED_ARG) { break; } @@ -2040,8 +2065,7 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) if (msymbol != NULL) if (MSYMBOL_TYPE (msymbol) == mst_solib_trampoline) { - mfunsym = - lookup_minimal_symbol_text (SYMBOL_NAME (msymbol), NULL, NULL); + mfunsym = lookup_minimal_symbol_text (DEPRECATED_SYMBOL_NAME (msymbol), NULL, NULL); if (mfunsym == NULL) /* I eliminated this warning since it is coming out * in the following situation: @@ -2052,14 +2076,12 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) * so of course we can't find the real func/line info, * but the "break" still works, and the warning is annoying. * So I commented out the warning. RT */ - /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_NAME(msymbol)) */ - ; + /* warning ("In stub for %s; unable to find real function/line info", DEPRECATED_SYMBOL_NAME (msymbol)) */ ; /* fall through */ else if (SYMBOL_VALUE (mfunsym) == SYMBOL_VALUE (msymbol)) /* Avoid infinite recursion */ /* See above comment about why warning is commented out */ - /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_NAME(msymbol)) */ - ; + /* warning ("In stub for %s; unable to find real function/line info", DEPRECATED_SYMBOL_NAME (msymbol)) */ ; /* fall through */ else return find_pc_line (SYMBOL_VALUE (mfunsym), 0); @@ -2769,8 +2791,8 @@ compare_search_syms (const void *sa, const void *sb) struct symbol_search **sym_a = (struct symbol_search **) sa; struct symbol_search **sym_b = (struct symbol_search **) sb; - return strcmp (SYMBOL_BEST_NAME ((*sym_a)->symbol), - SYMBOL_BEST_NAME ((*sym_b)->symbol)); + return strcmp (SYMBOL_PRINT_NAME ((*sym_a)->symbol), + SYMBOL_PRINT_NAME ((*sym_b)->symbol)); } /* Sort the ``nfound'' symbols in the list after prevtail. Leave @@ -2949,17 +2971,13 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], /* If it would match (logic taken from loop below) load the file and go on to the next one */ if (file_matches (ps->filename, files, nfiles) - && ((regexp == NULL || SYMBOL_MATCHES_REGEXP (*psym)) - && - ((kind == VARIABLES_NAMESPACE - && SYMBOL_CLASS (*psym) != LOC_TYPEDEF - && SYMBOL_CLASS (*psym) != LOC_BLOCK) - || (kind == FUNCTIONS_NAMESPACE - && SYMBOL_CLASS (*psym) == LOC_BLOCK) - || (kind == TYPES_NAMESPACE - && SYMBOL_CLASS (*psym) == LOC_TYPEDEF) - || (kind == METHODS_NAMESPACE - && SYMBOL_CLASS (*psym) == LOC_BLOCK)))) + && ((regexp == NULL + || re_exec (SYMBOL_NATURAL_NAME (*psym)) != 0) + && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (*psym) != LOC_TYPEDEF + && SYMBOL_CLASS (*psym) != LOC_BLOCK) + || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK) + || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_TYPEDEF) + || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (*psym) == LOC_BLOCK)))) { PSYMTAB_TO_SYMTAB (ps); keep_going = 0; @@ -2990,7 +3008,8 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], MSYMBOL_TYPE (msymbol) == ourtype3 || MSYMBOL_TYPE (msymbol) == ourtype4) { - if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol)) + if (regexp == NULL + || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0) { if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))) { @@ -3018,39 +3037,33 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], int nfound = 0; b = BLOCKVECTOR_BLOCK (bv, i); ALL_BLOCK_SYMBOLS (b, iter, sym) - { - QUIT; - if (file_matches (s->filename, files, nfiles) - && ((regexp == NULL || SYMBOL_MATCHES_REGEXP (sym)) - && - ((kind == VARIABLES_NAMESPACE - && SYMBOL_CLASS (sym) != LOC_TYPEDEF - && SYMBOL_CLASS (sym) != LOC_BLOCK - && SYMBOL_CLASS (sym) != LOC_CONST) - || (kind == FUNCTIONS_NAMESPACE - && SYMBOL_CLASS (sym) == LOC_BLOCK) - || (kind == TYPES_NAMESPACE - && SYMBOL_CLASS (sym) == LOC_TYPEDEF) - || (kind == METHODS_NAMESPACE - && SYMBOL_CLASS (sym) == LOC_BLOCK)))) - { - /* match */ - psr = - (struct symbol_search *) - xmalloc (sizeof (struct symbol_search)); - psr->block = i; - psr->symtab = s; - psr->symbol = sym; - psr->msymbol = NULL; - psr->next = NULL; - if (tail == NULL) - sr = psr; - else - tail->next = psr; - tail = psr; - nfound++; - } - } + { + QUIT; + if (file_matches (s->filename, files, nfiles) + && ((regexp == NULL + || re_exec (SYMBOL_NATURAL_NAME (sym)) != 0) + && ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (sym) != LOC_TYPEDEF + && SYMBOL_CLASS (sym) != LOC_BLOCK + && SYMBOL_CLASS (sym) != LOC_CONST) + || (kind == FUNCTIONS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK) + || (kind == TYPES_NAMESPACE && SYMBOL_CLASS (sym) == LOC_TYPEDEF) + || (kind == METHODS_NAMESPACE && SYMBOL_CLASS (sym) == LOC_BLOCK)))) + { + /* match */ + psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search)); + psr->block = i; + psr->symtab = s; + psr->symbol = sym; + psr->msymbol = NULL; + psr->next = NULL; + if (tail == NULL) + sr = psr; + else + tail->next = psr; + tail = psr; + nfound ++; + } + } if (nfound > 0) { if (prevtail == NULL) @@ -3082,7 +3095,8 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[], MSYMBOL_TYPE (msymbol) == ourtype3 || MSYMBOL_TYPE (msymbol) == ourtype4) { - if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol)) + if (regexp == NULL + || re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0) { /* Functions: Look up by address. */ if (kind != FUNCTIONS_NAMESPACE || @@ -3148,7 +3162,8 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym, { type_print (SYMBOL_TYPE (sym), (SYMBOL_CLASS (sym) == LOC_TYPEDEF - ? "" : SYMBOL_PRINT_NAME (sym)), gdb_stdout, 0); + ? "" : SYMBOL_PRINT_NAME (sym)), + gdb_stdout, 0); printf_filtered (";\n"); } @@ -3166,8 +3181,10 @@ print_msymbol_info (struct minimal_symbol *msymbol) tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol) & (CORE_ADDR) 0xffffffff, "08l"); else - tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), "016l"); - printf_filtered ("%s %s\n", tmp, SYMBOL_PRINT_NAME (msymbol)); + tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), + "016l"); + printf_filtered ("%s %s\n", + tmp, SYMBOL_PRINT_NAME (msymbol)); } /* This is the guts of the commands "info functions", "info types", and @@ -3260,11 +3277,11 @@ rbreak_command (char *regexp, int from_tty) if (p->msymbol == NULL) { char *string = (char *) alloca (strlen (p->symtab->filename) - + strlen (SYMBOL_NAME (p->symbol)) + + strlen (DEPRECATED_SYMBOL_NAME (p->symbol)) + 4); strcpy (string, p->symtab->filename); strcat (string, ":'"); - strcat (string, SYMBOL_NAME (p->symbol)); + strcat (string, DEPRECATED_SYMBOL_NAME (p->symbol)); strcat (string, "'"); break_command (string, from_tty); print_symbol_info (FUNCTIONS_NAMESPACE, @@ -3273,7 +3290,7 @@ rbreak_command (char *regexp, int from_tty) } else { - break_command (SYMBOL_NAME (p->msymbol), from_tty); + break_command (DEPRECATED_SYMBOL_NAME (p->msymbol), from_tty); printf_filtered ("<function, no debug info> %s;\n", SYMBOL_PRINT_NAME (p->msymbol)); } @@ -3299,7 +3316,7 @@ static char **return_val; (SYMBOL_DEMANGLED_NAME (symbol), (sym_text), (len), (text), (word)); \ else \ completion_list_add_name \ - (SYMBOL_NAME (symbol), (sym_text), (len), (text), (word)); \ + (DEPRECATED_SYMBOL_NAME (symbol), (sym_text), (len), (text), (word)); \ } while (0) /* Test to see if the symbol specified by SYMNAME (which is already @@ -3955,7 +3972,7 @@ overload_list_add_symbol (struct symbol *sym, const char *oload_name) /* skip any symbols that we've already considered. */ for (i = 0; i < sym_return_val_index; ++i) - if (!strcmp (SYMBOL_NAME (sym), SYMBOL_NAME (sym_return_val[i]))) + if (!strcmp (DEPRECATED_SYMBOL_NAME (sym), DEPRECATED_SYMBOL_NAME (sym_return_val[i]))) return; /* Get the demangled name without parameters */ @@ -4154,8 +4171,10 @@ read_in_psymtabs (const char *func_name) if (ps->readin) continue; - if ((lookup_partial_symbol (ps, func_name, 1, VAR_NAMESPACE) != NULL) - || (lookup_partial_symbol (ps, func_name, 0, VAR_NAMESPACE) != NULL)) + if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_NAMESPACE) + != NULL) + || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_NAMESPACE) + != NULL)) psymtab_to_symtab (ps); } } diff --git a/gdb/symtab.h b/gdb/symtab.h index 358d58c..ace4f34 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -30,6 +30,8 @@ struct obstack; struct objfile; struct block; struct blockvector; +struct axs_value; +struct agent_expr; /* Don't do this; it means that if some .o's are compiled with GNU C and some are not (easy to do accidentally the way we configure @@ -52,9 +54,11 @@ struct blockvector; struct general_symbol_info { - /* Name of the symbol. This is a required field. Storage for the name is - allocated on the psymbol_obstack or symbol_obstack for the associated - objfile. */ + /* Name of the symbol. This is a required field. Storage for the + name is allocated on the psymbol_obstack or symbol_obstack for + the associated objfile. For languages like C++ that make a + distinction between the mangled name and demangled name, this is + the mangled name. */ char *name; @@ -88,17 +92,12 @@ struct general_symbol_info union { - struct cplus_specific /* For C++ */ - /* and Java */ + struct cplus_specific { - const char *demangled_name; + /* This is in fact used for C++, Java, and Objective C. */ + char *demangled_name; } cplus_specific; - struct objc_specific - { - const char *demangled_name; - } - objc_specific; } language_specific; @@ -132,6 +131,7 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *); functions, unless the callers are changed to pass in the ginfo field only, instead of the SYMBOL parameter. */ +#define DEPRECATED_SYMBOL_NAME(symbol) (symbol)->ginfo.name #define SYMBOL_VALUE(symbol) (symbol)->ginfo.value.ivalue #define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->ginfo.value.address #define SYMBOL_VALUE_BYTES(symbol) (symbol)->ginfo.value.bytes @@ -141,14 +141,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *); #define SYMBOL_SECTION(symbol) (symbol)->ginfo.section #define SYMBOL_BFD_SECTION(symbol) (symbol)->ginfo.bfd_section -/* FIXME: carlton/2002-12-20: The situation with all of these names is - a mess. As a first step, try to avoid using SYMBOL_NAME to access - the name of a symbol: use SYMBOL_BEST_NAME or SYMBOL_LINKAGE_NAME - instead, depending on which one you want. I'll try to add some - initialization functions later, too. */ - -#define SYMBOL_NAME(symbol) (symbol)->ginfo.name - #define SYMBOL_CPLUS_DEMANGLED_NAME(symbol) \ (symbol)->ginfo.language_specific.cplus_specific.demangled_name @@ -170,6 +162,37 @@ extern void symbol_set_names (struct general_symbol_info *symbol, const char *name, int len, struct objfile *objfile); +/* Now come lots of name accessor macros. Short version as to when to + use which: Use SYMBOL_NATURAL_NAME to refer to the name of the + symbol in the original source code. Use SYMBOL_LINKAGE_NAME if you + want to know what the linker thinks the symbol's name is. Use + SYMBOL_PRINT_NAME for output. Use SYMBOL_DEMANGLED_NAME if you + specifically need to know whether SYMBOL_NATURAL_NAME and + SYMBOL_LINKAGE_NAME are different. Don't use + DEPRECATED_SYMBOL_NAME at all: instances of that macro should be + replaced by SYMBOL_NATURAL_NAME, SYMBOL_LINKAGE_NAME, or perhaps + SYMBOL_PRINT_NAME. */ + +/* Return SYMBOL's "natural" name, i.e. the name that it was called in + the original source code. In languages like C++ where symbols may + be mangled for ease of manipulation by the linker, this is the + demangled name. */ + +#define SYMBOL_NATURAL_NAME(symbol) \ + (symbol_natural_name (&(symbol)->ginfo)) +extern char *symbol_natural_name (const struct general_symbol_info *symbol); + +/* Return SYMBOL's name from the point of view of the linker. In + languages like C++ where symbols may be mangled for ease of + manipulation by the linker, this is the mangled name; otherwise, + it's the same as SYMBOL_NATURAL_NAME. This is currently identical + to DEPRECATED_SYMBOL_NAME, but please use SYMBOL_LINKAGE_NAME when + appropriate: it conveys the additional semantic information that + you really have thought about the issue and decided that you mean + SYMBOL_LINKAGE_NAME instead of SYMBOL_NATURAL_NAME. */ + +#define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name + /* Return the demangled name for a symbol based on the language for that symbol. If no demangled name exists, return NULL. */ #define SYMBOL_DEMANGLED_NAME(symbol) \ @@ -177,34 +200,16 @@ extern void symbol_set_names (struct general_symbol_info *symbol, extern const char *symbol_demangled_name (const struct general_symbol_info *symbol); -/* Macro that returns the demangled name of the symbol if if possible - and the symbol name if not possible. The result should never be - NULL. */ - -#define SYMBOL_BEST_NAME(symbol) \ - (SYMBOL_DEMANGLED_NAME (symbol) != NULL \ - ? SYMBOL_DEMANGLED_NAME (symbol) \ - : SYMBOL_NAME (symbol)) - -/* Use this if you want to get at the linkage name of a symbol (which - might be mangled). */ - -#define SYMBOL_LINKAGE_NAME(symbol) SYMBOL_NAME (symbol) - -#define SYMBOL_OBJC_DEMANGLED_NAME(symbol) \ - (symbol)->ginfo.language_specific.objc_specific.demangled_name - -/* Macro that returns the name of a name of a symbol that we want to - print. In C++ this is the "demangled" form of the name if demangle - is on and the "mangled" form of the name if demangle is off. In - other languages this is just the symbol name. The result should - never be NULL. */ - -/* NOTE: carlton/2002-09-26: For external use only; in many - situations, SYMBOL_BEST_NAME is more appropriate. */ +/* Macro that returns a version of the name of a symbol that is + suitable for output. In C++ this is the "demangled" form of the + name if demangle is on and the "mangled" form of the name if + demangle is off. In other languages this is just the symbol name. + The result should never be NULL. Don't use this for internal + purposes (e.g. storing in a hashtable): it's only suitable for + output. */ #define SYMBOL_PRINT_NAME(symbol) \ - (demangle ? SYMBOL_BEST_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol)) + (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol)) /* Macro that tests a symbol for a match against a specified name string. First test the unencoded name, then looks for and test a C++ encoded @@ -213,26 +218,23 @@ extern const char *symbol_demangled_name (const struct general_symbol_info "foo :: bar (int, long)". Evaluates to zero if the match fails, or nonzero if it succeeds. */ -/* FIXME: carlton/2002-09-26: Should these two be rewritten to always - match against SYMBOL_BEST_NAME (symbol) instead? Or should there - be separate SYMBOL_BMATCHES_BEST_NAME and - SYMBOL_MATCHES_BEST_REGEXP macros? I'm worried about false - positive matches against mangled names. */ +/* FIXME: carlton/2003-02-27: This is an unholy mixture of linkage + names and natural names. If you want to test the linkage names + with strcmp, do that. If you want to test the natural names with + strcmp_iw, use SYMBOL_MATCHES_NATURAL_NAME. */ -#define SYMBOL_MATCHES_NAME(symbol, name) \ - (STREQ (SYMBOL_NAME (symbol), (name)) \ +#define DEPRECATED_SYMBOL_MATCHES_NAME(symbol, name) \ + (STREQ (DEPRECATED_SYMBOL_NAME (symbol), (name)) \ || (SYMBOL_DEMANGLED_NAME (symbol) != NULL \ && strcmp_iw (SYMBOL_DEMANGLED_NAME (symbol), (name)) == 0)) -/* Macro that tests a symbol for an re-match against the last compiled regular - expression. First test the unencoded name, then look for and test a C++ - encoded name if it exists. - Evaluates to zero if the match fails, or nonzero if it succeeds. */ +/* Macro that tests a symbol for a match against a specified name + string. It tests against SYMBOL_NATURAL_NAME, and it ignores + whitespace and trailing parentheses. (See strcmp_iw for details + about its behavior.) */ -#define SYMBOL_MATCHES_REGEXP(symbol) \ - (re_exec (SYMBOL_NAME (symbol)) != 0 \ - || (SYMBOL_DEMANGLED_NAME (symbol) != NULL \ - && re_exec (SYMBOL_DEMANGLED_NAME (symbol)) != 0)) +#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \ + (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0) /* Define a simple structure used to hold some very basic information about all defined global symbols (text, data, bss, abs, etc). The only required @@ -512,7 +514,60 @@ enum address_class * with a level of indirection. */ - LOC_INDIRECT + LOC_INDIRECT, + + /* The variable's address is computed by a set of location + functions (see "struct location_funcs" below). */ + LOC_COMPUTED, + + /* Same as LOC_COMPUTED, but for function arguments. */ + LOC_COMPUTED_ARG +}; + +/* A structure of function pointers describing the location of a + variable, structure member, or structure base class. + + These functions' BATON arguments are generic data pointers, holding + whatever data the functions need --- the code which provides this + structure also provides the actual contents of the baton, and + decides its form. However, there may be other rules about where + the baton data must be allocated; whoever is pointing to this + `struct location_funcs' object will know the rules. For example, + when a symbol S's location is LOC_COMPUTED, then + SYMBOL_LOCATION_FUNCS(S) is pointing to a location_funcs structure, + and SYMBOL_LOCATION_BATON(S) is the baton, which must be allocated + on the same obstack as the symbol itself. */ + +struct location_funcs +{ + + /* Return the value of the variable SYMBOL, relative to the stack + frame FRAME. If the variable has been optimized out, return + zero. + + Iff `read_needs_frame (SYMBOL)' is zero, then FRAME may be zero. */ + + struct value *(*read_variable) (const struct symbol * symbol, + struct frame_info * frame); + + /* Return non-zero if we need a frame to find the value of the SYMBOL. */ + int (*read_needs_frame) (const struct symbol * symbol); + + /* Write to STREAM a natural-language description of the location of + SYMBOL. */ + int (*describe_location) (const struct symbol * symbol, + struct ui_file * stream); + + /* Tracepoint support. Append bytecodes to the tracepoint agent + expression AX that push the address of the object SYMBOL. Set + VALUE appropriately. Note --- for objects in registers, this + needn't emit any code; as long as it sets VALUE properly, then + the caller will generate the right code in the process of + treating this as an lvalue or rvalue. */ + + void (*tracepoint_var_ref) (const struct symbol * symbol, + struct agent_expr * ax, + struct axs_value * value); }; /* Linked list of symbol's live ranges. */ @@ -574,6 +629,21 @@ struct symbol variable declared with the `__thread' storage class), we may need to know which object file it's in. */ struct objfile *objfile; + + /* For a LOC_COMPUTED or LOC_COMPUTED_ARG symbol, this is the + baton and location_funcs structure to find its location. For a + LOC_BLOCK symbol for a function in a compilation unit compiled + with DWARF 2 information, this is information used internally + by the DWARF 2 code --- specifically, the location expression + for the frame base for this function. */ + /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better + to add a magic symbol to the block containing this information, + or to have a generic debug info annotation slot for symbols. */ + struct + { + void *baton; + struct location_funcs *funcs; + } loc; } aux_value; @@ -598,6 +668,8 @@ struct symbol #define SYMBOL_OBJFILE(symbol) (symbol)->aux_value.objfile #define SYMBOL_ALIASES(symbol) (symbol)->aliases #define SYMBOL_RANGES(symbol) (symbol)->ranges +#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value.loc.baton +#define SYMBOL_LOCATION_FUNCS(symbol) (symbol)->aux_value.loc.funcs /* A partial_symbol records the name, namespace, and address class of symbols whose types we have not parsed yet. For functions, it also @@ -756,9 +828,6 @@ struct symtab /* A function to call to free space, if necessary. This is IN ADDITION to the action indicated by free_code. */ - /* NOTE: carlton/2002-09-20: This is currently only used by - jv-lang.c. */ - void (*free_func)(struct symtab *symtab); /* Total number of lines found in source file. */ @@ -1242,13 +1311,6 @@ extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *); extern struct symtab_and_line find_function_start_sal (struct symbol *sym, int); -/* blockframe.c */ - -extern struct blockvector *blockvector_for_pc (CORE_ADDR, int *); - -extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, asection *, - int *, struct symtab *); - /* symfile.c */ extern void clear_symtab_users (void); diff --git a/gdb/target.c b/gdb/target.c index 683561f..4de246c 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -573,6 +573,7 @@ update_current_target (void) INHERIT (to_remove_watchpoint, t); INHERIT (to_stopped_data_address, t); INHERIT (to_stopped_by_watchpoint, t); + INHERIT (to_have_continuable_watchpoint, t); INHERIT (to_region_size_ok_for_hw_watchpoint, t); INHERIT (to_terminal_init, t); INHERIT (to_terminal_inferior, t); diff --git a/gdb/target.h b/gdb/target.h index 80e6538..f081bd3 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -256,6 +256,7 @@ struct target_ops int (*to_remove_watchpoint) (CORE_ADDR, int, int); int (*to_insert_watchpoint) (CORE_ADDR, int, int); int (*to_stopped_by_watchpoint) (void); + int to_have_continuable_watchpoint; CORE_ADDR (*to_stopped_data_address) (void); int (*to_region_size_ok_for_hw_watchpoint) (int); void (*to_terminal_init) (void); @@ -963,6 +964,13 @@ extern void (*target_new_objfile_hook) (struct objfile *); (*current_target.to_stopped_by_watchpoint) () #endif +/* Non-zero if we have continuable watchpoints */ + +#ifndef HAVE_CONTINUABLE_WATCHPOINT +#define HAVE_CONTINUABLE_WATCHPOINT \ + (current_target.to_have_continuable_watchpoint) +#endif + /* HP-UX supplies these operations, which respectively disable and enable the memory page-protections that are used to implement hardware watchpoints on that platform. See wait_for_inferior's use of these. */ diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5f2126c..4c46ecb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,100 @@ +2003-03-04 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/templates.exp (do_tests): Accept valid const in "print + Garply<Garply<char> >:: garply". + (test_ptype_of_templates): KFAIL "ptype T5<int>" and "ptype t5i" + with respect to PR c++/1111; note also PR c++/1113. + (test_template_breakpoints): KFAIL "constructor breakpoint" with + respect to PR c++/1062. + KFAIL "destructor breakpoint" with respect to PR c++/1112. + +2003-03-03 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/classes.exp (test_enums): KFAIL "ptype obj_with_enum" + with respect to PR c++/57. + KFAIL "print (ClassWithEnum::PrivEnum) 42" with respect to PR + c++/826. + Create "print ('ClassWithEnum::PrivEnum') 42"; KFAIL it with + respect to PR c++/57. + +2003-03-03 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/templates.exp (do_tests): Convert the KFAILs with + respect to PR c++/33 into FAILs. + +2003-03-03 Michael Chastain <mec@shout.net> + + * configure.in: Update copyright years. + +2003-03-03 Michael Chastain <mec@shout.net> + + * Makefile.in: Update copyright years. + +2003-02-28 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/classes.exp (test_ptype_class_objects): Accept it if we + print class instead of struct and/or superfluous protection + specifiers, as long as the resulting output is equivalent to the + source code. + Delete FIXME from end of messages on tests that don't need + fixing. + +2003-02-28 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/templates.exp (do_tests): Allow const in the two + Foo<volatile char *>::foo tests. + +2003-02-27 Michael Snyder <msnyder@redhat.com> + + * gdb.base/restore.c (main): Return zero, so exit code + will be consistant. + +2003-02-26 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/templates.exp (do_tests): KFAIL the "print Foo<volatile + char *>::foo" test with respect to PR c++/33. Create a new test + which is identical to that one except that it doesn't put the + space between the "char" and the "*"; KFAIL it, too. + +2003-02-26 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/templates.exp (do_tests): Convert XFAILs about printing + template types into either PASSes or KFAILs (corresponding to PR + c++/57). Tweak indentation. Update copyright. + +2003-02-23 Stephane Carrez <stcarrez@nerim.fr> + + * lib/gdb.exp: Don't execute C++ tests on m6811/m6812 targets. + +2003-02-13 Michael Chastain <mec@shout.net> + + * gdb.base/exprs.exp: Remove i960 remnants. + * gdb.base/funcargs.exp: Likewise. + * gdb.base/list.exp: Likewise. + * gdb.base/ptype.exp: Likewise. + +2003-02-14 David Carlton <carlton@math.stanford.edu> + + * gdb.c++/virtfunc.exp (test_virtual_calls): Change 'print + pEe->D::vg()" from XFAIL to KFAIL. + +2003-02-13 Jason Molenda (jmolenda@apple.com) + + * gdb.base/maint.exp: Update maint print statistics regexp to include + new entries. + +2003-02-13 Michael Chastain <mec@shout.net> + + * gdb.c++/inherit.exp: Remove call to get_debug_format. + +2003-02-12 Michael Chastain <mec@shout.net> + + * gdb.c++/classes.exp: Remove setup_xfail_format for DWARF 1. + * gdb.c++/inherit.exp: Likewise. + * gdb.c++/cplusfuncs.exp: Remove suppression logic for DWARF 1. + * gdb.c++/templates.exp: Likewise. + * gdb.c++/virtfunc.exp: Likewise. + 2003-02-06 Jason Molenda (jason-cl@molenda.com) * gdb.mi/mi-syn-frame.c (subroutine): Add a comment explaining @@ -107,6 +204,8 @@ 2003-01-29 Michael Snyder <msnyder@redhat.com> + * gdb.base/maint.exp: Allow for leading underscore in symbol. + * gdb.base/display.exp: Allow for leading underscore in symbol. * gdb.base/args.exp: Skip if target does not support args passing. 2003-01-22 Daniel Jacobowitz <drow@mvista.com> diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index 29079d4..c0ba9ab 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -1,5 +1,5 @@ # Makefile for regression testing the GNU debugger. -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # This file is part of GDB. diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in index 70bbee2..8ba930f 100644 --- a/gdb/testsuite/configure.in +++ b/gdb/testsuite/configure.in @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -# Copyright (C) 2002 +# Copyright 2002, 2003 # Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index 49df15a..f6ce719 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -1,5 +1,5 @@ -# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, +# 2001, 2003 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 @@ -98,13 +98,7 @@ test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[ test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char <" test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $false" "print unsigned char >" # make char a minus -# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've -# set up an expected failure for this case. -setup_xfail "i960-*-*" 1821 test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)" -# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've -# set up an expected failure for this case. -setup_xfail "i960-*-*" 1821 test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print v_unsigned_char != ~0" "\\$\[0-9\]* = $true" "print unsigned char != (~0)" test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)" test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)" diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp index 2ed154a..38949f1 100644 --- a/gdb/testsuite/gdb.base/funcargs.exp +++ b/gdb/testsuite/gdb.base/funcargs.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002 +# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -177,7 +177,6 @@ proc float_and_integral_args {} { # Run; should stop at call2a and print actual arguments. - setup_xfail "i960-*-*" 1813 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" } # The debug info. for "f" is not correct. It's a known bug. if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*} @@ -680,9 +679,6 @@ $gdb_prompt $" { # Continue; should stop at call6k and print actual arguments. # Print backtrace. - # This fails on i960-*-vxworks because gdb gets confused by - # breakpoints on adjacent instructions. - setup_xfail "i960-*-vxworks" 1786 gdb_continue call6k if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*} @@ -742,7 +738,6 @@ proc shuffle_round_robin {} { timeout { fail "(timeout) run to call7a" ; gdb_suppress_tests; } } - setup_xfail "i960-*-*" 1813 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" } # The debug info. for "f" is not correct. It's a known bug. if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*} diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index 881e0e6..dee9152 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2002 +# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -405,8 +405,6 @@ proc test_list_filename_and_function {} { timeout { fail "list list0.c:main (timeout)" } } - # The i960 is a second case - # Not sure what the point of having this function be unused is. # AIX is legitimately removing it. setup_xfail "rs6000-*-aix*" @@ -465,8 +463,6 @@ proc test_list_filename_and_function {} { timeout { fail "list list1.c:bar (timeout)" } } - # The i960 is a second case - # Not sure what the point of having this function be unused is. # AIX is legitimately removing it. setup_xfail "rs6000-*-aix*" diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 69fecad..d828650 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -180,7 +180,7 @@ gdb_expect { send_gdb "maint print statistics\n" gdb_expect { - -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\ + -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Number of psym tables \\(not yet expanded\\).*Number of symbol tables.*Number of symbol tables with line tables.*Number of symbol tables with blockvectors.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\ { pass "maint print statistics" } -re ".*$gdb_prompt $" { fail "maint print statistics" } timeout { fail "(timeout) maint print statistics" } diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp index 8ef738e..6e33d85 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -172,7 +172,6 @@ gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera # acts like whatis for basic types. If it is thought to be necessary to # test both whatis and ptype for all the types, the tests should be # merged into whatis.exp, or else maintenance will be a royal pain -kingdon -#setup_xfail "i960-*-*" 1821 #setup_xfail "mips-idt-*" "mips-sgi-*" #send "ptype v_char\n" #gdb_expect { @@ -277,7 +276,6 @@ gdb_test "ptype v_int" "type = int.*" "ptype int" # # test ptype command with arrays # -#setup_xfail "i960-*-*" 1821 #setup_xfail "mips-idt-*" "mips-sgi-*" #send "ptype v_char_array\n" #gdb_expect { @@ -380,7 +378,6 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]" ## ## test ptype command with pointers ## -#setup_xfail "i960-*-*" 1821 #setup_xfail "mips-idt-*" "mips-sgi-*" #send "ptype v_char_pointer\n" #gdb_expect { diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c index e05d68c..a8282ee 100644 --- a/gdb/testsuite/gdb.base/restore.c +++ b/gdb/testsuite/gdb.base/restore.c @@ -257,4 +257,5 @@ int main () #endif driver (); printf("exiting\n"); + return 0; } diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp index dbdea5d..3f398ac 100644 --- a/gdb/testsuite/gdb.c++/classes.exp +++ b/gdb/testsuite/gdb.c++/classes.exp @@ -1,5 +1,5 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003 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 @@ -55,7 +55,7 @@ proc test_ptype_class_objects {} { # Note that struct members are public by default, so we don't print # "public:" for the public members of structs. - # Accept it as an expected failure if gdb just fails to distinguish between + # Accept it if gdb just fails to distinguish between # class and struct, and everything else is OK. send_gdb "ptype struct default_public_struct\n" @@ -64,8 +64,7 @@ proc test_ptype_class_objects {} { pass "ptype struct default_public_struct" } -re "type = class default_public_struct \{$nl.*int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype struct default_public_struct" + pass "ptype struct default_public_struct" } -re ".*$gdb_prompt $" { fail "ptype struct default_public_struct" } timeout { fail "ptype struct default_public_struct (timeout)" ; return } @@ -73,7 +72,7 @@ proc test_ptype_class_objects {} { # Note that struct members are public by default, so we don't print # "public:" for the public members of structs. - # Accept it as an expected failure if gdb just fails to distinguish between + # Accept it if gdb just fails to distinguish between # class and struct, and everything else is OK. send_gdb "ptype struct explicit_public_struct\n" @@ -82,78 +81,70 @@ proc test_ptype_class_objects {} { pass "ptype struct explicit_public_struct" } -re "type = class explicit_public_struct \{$nl.*int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype struct explicit_public_struct" + pass "ptype struct explicit_public_struct" } -re ".*$gdb_prompt $" { fail "ptype struct explicit_public_struct" } timeout { fail "ptype struct explicit_public_struct (timeout)" ; return } } - # Accept it as an expected failure if gdb just fails to distinguish between + # Accept it if gdb just fails to distinguish between # class and struct, and everything else is OK. - setup_xfail_format "DWARF 1" send_gdb "ptype struct protected_struct\n" gdb_expect { -re "type = struct protected_struct \{${ws}protected:${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" { - pass "ptype struct protected_struct (FIXME)" + pass "ptype struct protected_struct" } -re "type = class protected_struct \{${ws}protected:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype struct protected_struct (FIXME)" + pass "ptype struct protected_struct" } -re ".*$gdb_prompt $" { fail "ptype struct protected_struct" } timeout { fail "ptype struct protected_struct (timeout)" ; return } } - # Accept it as an expected failure if gdb just fails to distinguish between + # Accept it if gdb just fails to distinguish between # class and struct, and everything else is OK. - setup_xfail_format "DWARF 1" send_gdb "ptype struct private_struct\n" gdb_expect { -re "type = struct private_struct \{${ws}private:${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" { - pass "ptype struct private_struct (FIXME)" + pass "ptype struct private_struct" } -re "type = class private_struct \{${ws}private:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype struct private_struct (FIXME)" + pass "ptype struct private_struct" } -re ".*$gdb_prompt $" { fail "ptype struct private_struct" } timeout { fail "ptype struct private_struct (timeout)" ; return } } - # Accept it as an expected failure if gdb just fails to distinguish between + # Accept it if gdb just fails to distinguish between # class and struct, and everything else is OK. - setup_xfail_format "DWARF 1" send_gdb "ptype struct mixed_protection_struct\n" gdb_expect { -re "type = struct mixed_protection_struct \{${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl\}$nl$gdb_prompt $" { - pass "ptype struct mixed_protection_struct (FIXME)" + pass "ptype struct mixed_protection_struct" } -re "type = struct mixed_protection_struct \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" { pass "ptype struct mixed_protection_struct (extra public)" } -re "type = class mixed_protection_struct \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype struct mixed_protection_struct (FIXME)" + pass "ptype struct mixed_protection_struct" } -re ".*$gdb_prompt $" { fail "ptype struct mixed_protection_struct" } timeout { fail "ptype struct mixed_protection_struct (timeout)" ; return } } - # Accept it as an expected failure if gdb just fails to distinguish between + # Accept it if gdb just fails to distinguish between # class and struct, and everything else is OK. send_gdb "ptype class public_class\n" gdb_expect { -re "type = class public_class \{${ws}public:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - pass "ptype class public_class (FIXME)" + pass "ptype class public_class" } -re "type = struct public_class \{${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype class public_class (FIXME)" + pass "ptype class public_class" } -re ".*$gdb_prompt $" { fail "ptype class public_class" } timeout { fail "ptype class public_class (timeout)" ; return } @@ -165,27 +156,24 @@ proc test_ptype_class_objects {} { pass "ptype class protected_class" } -re "type = struct protected_class \{${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" fail "ptype class protected_class" } -re ".*$gdb_prompt $" { fail "ptype class protected_class" } timeout { fail "ptype class protected_class (timeout)" ; return } } - # Accept it as an expected failure if gdb just emits a superflous "private:" + # Accept it if gdb just emits a superflous "private:" # attribute, since classes default to private and for consistency with # structs (where we don't print the "public:" attribute) we don't print # the "private:" attribute. - setup_xfail_format "DWARF 1" send_gdb "ptype class default_private_class\n" gdb_expect { -re "type = class default_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - pass "ptype class default_private_class (FIXME)" + pass "ptype class default_private_class" } -re "type = class default_private_class \{${ws}private:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" - fail "ptype class default_private_class (FIXME)" + pass "ptype class default_private_class" } -re ".*$gdb_prompt $" { fail "ptype class default_private_class" } timeout { fail "ptype class default_private_class (timeout)" ; return } @@ -197,10 +185,9 @@ proc test_ptype_class_objects {} { pass "ptype class explicit_private_class" } -re "type = class explicit_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - pass "ptype class explicit_private_class (OK for HP aCC)" + pass "ptype class explicit_private_class" } -re "type = struct explicit_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" fail "ptype class explicit_private_class" } -re ".*$gdb_prompt $" { fail "ptype class explicit_private_class" } @@ -213,7 +200,6 @@ proc test_ptype_class_objects {} { pass "ptype class mixed_protection_class" } -re "type = struct mixed_protection_class \{${ws}int a;${ws}int b;${ws}int c;${ws}int d;${ws}int e;${ws}int f;${ws}int g;${ws}int h;${ws}int i;$nl.*\}$nl$gdb_prompt $" { - setup_xfail "*-*-*" fail "ptype class mixed_protection_class" } -re ".*$gdb_prompt $" { fail "ptype class mixed_protection_class" } @@ -236,7 +222,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class B\n" gdb_expect { -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;${ws}B & operator=\\(B const ?&\\);${ws}B\\((B const|const B) ?&\\);${ws}B\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -254,7 +239,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class C\n" gdb_expect { -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;${ws}C & operator=\\(C const ?&\\);${ws}C\\((C const|const C) ?&\\);${ws}C\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -272,7 +256,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class D\n" gdb_expect { -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -290,7 +273,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class E\n" gdb_expect { -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;${ws}E & operator=\\(E const ?&\\);${ws}E\\((E const|const E) ?&\\);${ws}E\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -354,7 +336,6 @@ proc test_ptype_class_objects {} { # The format of a g++ virtual base pointer. set vbptr "(_vb\[$.\]|__vb_)\[0-9\]?" - setup_xfail_format "DWARF 1" send_gdb "ptype class vB\n" gdb_expect { -re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}vB & operator=\\(vB const ?&\\);${ws}vB\\((vB const|const vB) ?&\\);${ws}vB\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -384,7 +365,6 @@ proc test_ptype_class_objects {} { # for now, but with a FIXME. At some future point, gdb should use a # portable representation for the virtual table constructs. - setup_xfail_format "DWARF 1" send_gdb "ptype class vC\n" gdb_expect { -re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}vC & operator=\\(vC const ?&\\);${ws}vC\\((vC const|const vC) ?&\\);${ws}vC\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -414,7 +394,6 @@ proc test_ptype_class_objects {} { # for now, but with a FIXME. At some future point, gdb should use a # portable representation for the virtual table constructs. - setup_xfail_format "DWARF 1" send_gdb "ptype class vD\n" gdb_expect { -re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}vD & operator=\\(vD const ?&\\);${ws}vD\\((vD const|const vD) ?&\\);${ws}vD\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -444,7 +423,6 @@ proc test_ptype_class_objects {} { # for now, but with a FIXME. At some future point, gdb should use a # portable representation for the virtual table constructs. - setup_xfail_format "DWARF 1" send_gdb "ptype class vE\n" gdb_expect { -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}vE & operator=\\(vE const ?&\\);${ws}vE\\((vE const|const vE) ?&\\);${ws}vE\\((void|)\\);${ws}\}$nl$gdb_prompt $" { @@ -470,7 +448,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class Base1\n" gdb_expect { -re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1 & operator=\\(Base1 const ?&\\);${ws}Base1\\(((Base1 const)|(const Base1)) ?&\\);${ws}Base1\\(int\\);${ws}\}$nl$gdb_prompt $" { @@ -491,7 +468,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class Foo\n" gdb_expect { -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;\r\n${ws}Foo\\(int, int\\);${ws}int operator!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);$nl\}$nl$gdb_prompt $" { @@ -512,7 +488,6 @@ proc test_ptype_class_objects {} { } } - setup_xfail_format "DWARF 1" send_gdb "ptype class Bar\n" gdb_expect { -re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;${ws}Bar & operator=\\(Bar const ?&\\);${ws}Bar\\((Bar const|const Bar) ?&\\);${ws}Bar\\(int, int, int\\);${ws}\}$nl$gdb_prompt $" { @@ -682,23 +657,45 @@ proc test_enums {} { } # ptype on the object - # g++ is putting out the wrong debug info. This works with aCC - if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} send_gdb "ptype obj_with_enum\n" gdb_expect { -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" } + -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)PrivEnum priv_enum;\r\n\[ \t\]*int x;.*\\}\r\n$gdb_prompt $" + { + # NOTE: carlton/2003-02-28: One could certainly argue that + # this output is acceptable: PrivEnum is a member of + # ClassWithEnum, so there's no need to explicitly qualify + # its name with "ClassWithEnum::". The truth, though, is + # that GDB is simply forgetting that PrivEnum is a member + # of ClassWithEnum, so we do that output for a bad reason + # instead of a good reason. Under stabs, we probably + # can't get this right; under DWARF-2, we can. + kfail "gdb/57" "ptype obj_with_enum" + } -re "$gdb_prompt $" { fail "ptype obj_with_enum" } timeout { fail "(timeout) ptype obj_with_enum" } } - # g++ is putting out the wrong debug info. This works with aCC - if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} + # We'll do this test twice, because of a parser bug: see + # PR gdb/826. + send_gdb "print (ClassWithEnum::PrivEnum) 42\n" gdb_expect { -re "\\$\[0-9\]* = yellow.*$gdb_prompt $" { pass "print (ClassWithEnum::PrivEnum) 42" } + -re "A parse error in expression, near `42'.\r\n$gdb_prompt $" + { kfail "gdb/826" "print (ClassWithEnum::PrivEnum) 42" } -re "$gdb_prompt $" { fail "print (ClassWithEnum::PrivEnum) 42" } timeout { fail "(timeout) print (ClassWithEnum::PrivEnum) 42" } } + + send_gdb "print ('ClassWithEnum::PrivEnum') 42\n" + gdb_expect { + -re "\\$\[0-9\]* = yellow.*$gdb_prompt $" { pass "print ('ClassWithEnum::PrivEnum') 42" } + -re "No symbol \"ClassWithEnum::PrivEnum\" in current context.\r\n$gdb_prompt $" + { kfail "gdb/57" "print ('ClassWithEnum::PrivEnum') 42" } + -re "$gdb_prompt $" { fail "print ('ClassWithEnum::PrivEnum') 42" } + timeout { fail "(timeout) print ('ClassWithEnum::PrivEnum') 42" } + } } # @@ -737,7 +734,6 @@ proc test_pointers_to_class_members {} { } clear_xfail "*-*-*" - setup_xfail_format "DWARF 1" gdb_test "print (int)pmi == sizeof(int)" ".* = false" "print (int)pmi == sizeof(int)" } @@ -822,11 +818,9 @@ proc test_static_members {} { "print cnsi without static members" gdb_test "set print static-members on" "" - setup_xfail_format "DWARF 1" gdb_test "print csi" \ "{x = 10, y = 20, static null = {x = 0, y = 0, static null = <same as static member of an already seen type>}}" \ "print csi with static members" - setup_xfail_format "DWARF 1" gdb_test "print cnsi" \ "{x = 30, y = 40, static null = {x = 0, y = 0, static null = <same as static member of an already seen type>, static yy = {z = 5, static xx = {x = 1, y = 2, static null = <same as static member of an already seen type>, static yy = <same as static member of an already seen type>}}}, static yy = <same as static member of an already seen type>}" \ "print cnsi with static members" @@ -856,12 +850,7 @@ proc do_tests {} { send_gdb "set width 0\n" gdb_expect -re "$gdb_prompt $" - # Get the debug format for the compiled test case. - - if [ runto_main ] then { - get_debug_format - } - + runto_main test_ptype_class_objects if [ runto 'inheritance2' ] then { diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp index 6f92817..0a5e1b3 100644 --- a/gdb/testsuite/gdb.c++/cplusfuncs.exp +++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp @@ -552,18 +552,7 @@ proc do_tests {} { send_gdb "set width 0\n" gdb_expect -re "$gdb_prompt $" - # Get the debug format for the compiled test case. If that - # format is DWARF 1 then just skip all the tests since none of - # them will pass. - - if [ runto_main] then { - get_debug_format - if [ setup_xfail_format "DWARF 1" ] then { - fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format" - return - } - clear_xfail "*-*-*" - } + runto_main probe_demangler test_paddr_overloaded_functions diff --git a/gdb/testsuite/gdb.c++/inherit.exp b/gdb/testsuite/gdb.c++/inherit.exp index 66c2a52..86c1f83 100644 --- a/gdb/testsuite/gdb.c++/inherit.exp +++ b/gdb/testsuite/gdb.c++/inherit.exp @@ -79,7 +79,6 @@ proc test_print_si_members {} { # Print members of g_B using nonambiguous compact form. - setup_xfail_format "DWARF 1" gdb_test "print g_B.a" ".* = 3" "print g_B.a" gdb_test "print g_B.b" ".* = 5" "print g_B.b" @@ -98,7 +97,6 @@ proc test_print_si_members {} { # Print members of g_C using nonambiguous compact form. - setup_xfail_format "DWARF 1" gdb_test "print g_C.a" ".* = 7" "print g_C.a" gdb_test "print g_C.c" ".* = 9" "print g_C.c" @@ -163,32 +161,26 @@ proc test_ptype_si {} { # Print class B as a type. - setup_xfail_format "DWARF 1" gdb_test "ptype B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype B" # Print class B as an explicit class. - setup_xfail_format "DWARF 1" gdb_test "ptype class B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype class B" # Print type of an object of type B. - setup_xfail_format "DWARF 1" gdb_test "ptype g_B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype g_B" # Print class C as a type. - setup_xfail_format "DWARF 1" gdb_test "ptype C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype C" # Print class C as an explicit class. - setup_xfail_format "DWARF 1" gdb_test "ptype class C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype class C" # Print type of an object of type g_C. - setup_xfail_format "DWARF 1" gdb_test "ptype g_C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype g_C" # gcc cygnus-2.3.3 (Q1) has this bug, but it was fixed as of @@ -243,12 +235,10 @@ proc test_print_si_classes {} { # Print all members of g_B. - setup_xfail_format "DWARF 1" gdb_test "print g_B" ".* = \{\<(class |)A\> = \{a = 3, x = 4\}, b = 5, x = 6\}" "print g_B" # Print all members of g_C. - setup_xfail_format "DWARF 1" gdb_test "print g_C" ".* = \{\<(class |)A\> = \{a = 7, x = 8\}, c = 9, x = 10\}" "print g_C" } @@ -266,9 +256,7 @@ proc test_print_anon_union {} { global ws global nl - setup_xfail_format "DWARF 1" gdb_test "print g_anon_union.a" ".* = 2" "print anonymous union member" - setup_xfail_format "DWARF 1" send_gdb "print g_anon_union\n" gdb_expect { -re ".* = \{one = 1, ( = |)\{a = 2, b = 2\}\}$nl$gdb_prompt $" { @@ -284,7 +272,6 @@ proc test_print_anon_union {} { fail "print variableof type anonymous union (timeout)" } } - setup_xfail_format "DWARF 1" send_gdb "ptype g_anon_union\n" gdb_expect { -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}public:${ws}int a;${ws}long int b;${ws}union \{\.\.\.\} & operator=\\(union \{\.\.\.\} &\\);${ws}\\\$_0 \\(union \{\.\.\.\} &\\);${ws}\\\$_0 \\(\\);${ws}\};${ws}class_with_anon_union & operator=\\(class_with_anon_union const &\\);${ws}class_with_anon_union\\(class_with_anon_union const &\\);${ws}class_with_anon_union\\(void\\);${ws}\}$nl$gdb_prompt $" { @@ -393,10 +380,8 @@ proc test_print_mi_members {} { gdb_test "print g_D.B::x" ".* = 14" "print g_D.B::x" - setup_xfail_format "DWARF 1" gdb_test "print g_D.C::c" ".* = 17" "print g_D.C::c" - setup_xfail_format "DWARF 1" gdb_test "print g_D.C::x" ".* = 18" "print g_D.C::x" gdb_test "print g_D.D::d" ".* = 19" "print g_D.D::d" @@ -447,10 +432,8 @@ proc test_print_mi_members {} { gdb_test "print g_E.B::x" ".* = 24" "print g_E.B::x" - setup_xfail_format "DWARF 1" gdb_test "print g_E.C::c" ".* = 27" "print g_E.C::c" - setup_xfail_format "DWARF 1" gdb_test "print g_E.C::x" ".* = 28" "print g_E.C::x" gdb_test "print g_E.D::d" ".* = 29" "print g_E.D::d" @@ -469,22 +452,16 @@ proc test_print_mi_members {} { proc test_ptype_mi {} { global nl - setup_xfail_format "DWARF 1" gdb_test "ptype D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype D" - setup_xfail_format "DWARF 1" gdb_test "ptype class D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype class D" - setup_xfail_format "DWARF 1" gdb_test "ptype g_D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype g_D" - setup_xfail_format "DWARF 1" gdb_test "ptype E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype E" - setup_xfail_format "DWARF 1" gdb_test "ptype class E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype class E" - setup_xfail_format "DWARF 1" gdb_test "ptype g_E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype g_E" } @@ -495,12 +472,10 @@ proc test_ptype_mi {} { proc test_print_mi_classes {} { # Print all members of g_D. - setup_xfail_format "DWARF 1" gdb_test "print g_D" ".* = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}" "print g_D" # Print all members of g_E. - setup_xfail_format "DWARF 1" gdb_test "print g_E" ".* = \{\<(class |)D\> = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}" "print g_E" } @@ -527,7 +502,6 @@ proc test_print_svi_members {} { # Print all members of g_vB. - setup_xfail_format "DWARF 1" send_gdb "print g_vB.vA::va\n" gdb_expect { -re ".* = 3$nl$gdb_prompt $" { pass "print g_vB.vA::va" } @@ -541,7 +515,6 @@ proc test_print_svi_members {} { timeout { fail "print g_vB.vA::va (timeout)" ; return } } - setup_xfail_format "DWARF 1" gdb_test "print g_vB.vA::vx" ".* = 4" "print g_vB.vA::vx" gdb_test "print g_vB.vB::vb" ".* = 5" "print g_vB.vB::vb" @@ -550,7 +523,6 @@ proc test_print_svi_members {} { # Print members of g_vB using compact form. - setup_xfail_format "DWARF 1" gdb_test "print g_vB.va" ".* = 3" "print g_vB.va" gdb_test "print g_vB.vb" ".* = 5" "print g_vB.vb" @@ -559,10 +531,8 @@ proc test_print_svi_members {} { # Print all members of g_vC. - setup_xfail_format "DWARF 1" gdb_test "print g_vC.vA::va" ".* = 7" "print g_vC.vA::va" - setup_xfail_format "DWARF 1" gdb_test "print g_vC.vA::vx" ".* = 8" "print g_vC.vA::vx" gdb_test "print g_vC.vC::vc" ".* = 9" "print g_vC.vC::vc" @@ -571,7 +541,6 @@ proc test_print_svi_members {} { # Print members of g_vC using compact form. - setup_xfail_format "DWARF 1" gdb_test "print g_vC.va" ".* = 7" "print g_vC.va" gdb_test "print g_vC.vc" ".* = 9" "print g_vC.vc" @@ -631,7 +600,6 @@ proc test_ptype_vi {} { timeout { fail "ptype g_vA (timeout)" ; return } } - setup_xfail_format "DWARF 1" send_gdb "ptype vB\n" gdb_expect { -re "ptype vB${nl}type = class vB : public virtual vA \{$nl private:${ws}vA \\*${vbptr}vA;$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" { @@ -644,7 +612,6 @@ proc test_ptype_vi {} { timeout { fail "ptype vB (timeout)" } } - setup_xfail_format "DWARF 1" send_gdb "ptype class vB\n" gdb_expect { -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" { @@ -657,7 +624,6 @@ proc test_ptype_vi {} { timeout { fail "ptype class vB (timeout)" } } - setup_xfail_format "DWARF 1" send_gdb "ptype g_vB\n" gdb_expect { -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" { @@ -670,7 +636,6 @@ proc test_ptype_vi {} { timeout { fail "ptype g_vB (timeout)" } } - setup_xfail_format "DWARF 1" send_gdb "ptype vC\n" gdb_expect { -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" { @@ -683,7 +648,6 @@ proc test_ptype_vi {} { timeout { fail "ptype vC (timeout)" } } - setup_xfail_format "DWARF 1" send_gdb "ptype class vC\n" gdb_expect { -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" { @@ -696,7 +660,6 @@ proc test_ptype_vi {} { timeout { fail "ptype class vC (timeout)" } } - setup_xfail_format "DWARF 1" send_gdb "ptype g_vC\n" gdb_expect { -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" { @@ -727,7 +690,6 @@ proc test_print_svi_classes {} { # Print all members of g_vB. - setup_xfail_format "DWARF 1" send_gdb "print g_vB\n" gdb_expect { -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, Virtual table at $hex\}$nl$gdb_prompt $" { @@ -754,7 +716,6 @@ proc test_print_svi_classes {} { # Print all members of g_vC. - setup_xfail_format "DWARF 1" send_gdb "print g_vC\n" gdb_expect { -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, Virtual table at $hex\}$nl$gdb_prompt $" { @@ -785,7 +746,6 @@ proc test_print_mvi_members {} { # Print all members of g_vD. - setup_xfail_format "DWARF 1" send_gdb "print g_vD.vA::va\n" gdb_expect { -re ".* = 19$nl$gdb_prompt $" { pass "print g_vD.vA::va" } @@ -799,19 +759,14 @@ proc test_print_mvi_members {} { timeout { fail "print g_vD.vA::va (timeout)" ; return } } - setup_xfail_format "DWARF 1" gdb_test "print g_vD.vA::vx" ".* = 20" "print g_vD.vA::vx" - setup_xfail_format "DWARF 1" gdb_test "print g_vD.vB::vb" ".* = 21" "print g_vD.vB::vb" - setup_xfail_format "DWARF 1" gdb_test "print g_vD.vB::vx" ".* = 22" "print g_vD.vB::vx" - setup_xfail_format "DWARF 1" gdb_test "print g_vD.vC::vc" ".* = 23" "print g_vD.vC::vc" - setup_xfail_format "DWARF 1" gdb_test "print g_vD.vC::vx" ".* = 24" "print g_vD.vC::vx" gdb_test "print g_vD.vD::vd" ".* = 25" "print g_vD.vD::vd" @@ -820,25 +775,18 @@ proc test_print_mvi_members {} { # Print all members of g_vE. - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vA::va" ".* = 0" "print g_vE.vA::va" - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vA::vx" ".* = 0" "print g_vE.vA::vx" - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vB::vb" ".* = 0" "print g_vE.vB::vb" - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vB::vx" ".* = 0" "print g_vE.vB::vx" - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vC::vc" ".* = 0" "print g_vE.vC::vc" - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vC::vx" ".* = 0" "print g_vE.vC::vx" - setup_xfail_format "DWARF 1" gdb_test "print g_vE.vD::vd" ".* = 0" "print g_vE.vD::vd" gdb_test "print g_vE.vD::vx" ".* = 0" "print g_vE.vD::vx" @@ -858,7 +806,6 @@ proc test_ptype_mvi {} { global nl global vbptr - setup_xfail_format "DWARF 1" send_gdb "ptype vD\n" gdb_expect { -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" { @@ -871,7 +818,6 @@ proc test_ptype_mvi {} { timeout { fail "(timeout) ptype vD" } } - setup_xfail_format "DWARF 1" send_gdb "ptype class vD\n" gdb_expect { -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" { @@ -884,7 +830,6 @@ proc test_ptype_mvi {} { timeout { fail "(timeout) ptype class vD" } } - setup_xfail_format "DWARF 1" send_gdb "ptype g_vD\n" gdb_expect { -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" { @@ -897,7 +842,6 @@ proc test_ptype_mvi {} { timeout { fail "(timeout) ptype g_vD" } } - setup_xfail_format "DWARF 1" send_gdb "ptype vE\n" gdb_expect { -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" { @@ -910,7 +854,6 @@ proc test_ptype_mvi {} { timeout { fail "(timeout) ptype vE" } } - setup_xfail_format "DWARF 1" send_gdb "ptype class vE\n" gdb_expect { -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" { @@ -923,7 +866,6 @@ proc test_ptype_mvi {} { timeout { fail "(timeout) ptype class vE" } } - setup_xfail_format "DWARF 1" send_gdb "ptype g_vE\n" gdb_expect { -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" { @@ -950,7 +892,6 @@ proc test_print_mvi_classes {} { # Print all members of g_vD. - setup_xfail_format "DWARF 1" send_gdb "print g_vD\n" gdb_expect { -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, Virtual table at $hex\}, \<class vC\> = \{vc = 23, vx = 24, Virtual table at $hex\}, vd = 25, vx = 26, Virtual table at $hex\}$nl$gdb_prompt $" { @@ -977,7 +918,6 @@ proc test_print_mvi_classes {} { # Print all members of g_vE. - setup_xfail_format "DWARF 1" send_gdb "print g_vE\n" gdb_expect { -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, Virtual table at $hex\}, \<class vC\> = \{vc = 0, vx = 0, Virtual table at $hex\}, vd = 0, vx = 0, Virtual table at $hex\}, ve = 27, vx = 28, Virtual table at $hex\}$nl$gdb_prompt $" { @@ -1022,8 +962,6 @@ proc do_tests {} { if { ![ runto_main] } { gdb_suppress_tests; - } else { - get_debug_format } test_ptype_si diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp index b0260be..bee78a9 100644 --- a/gdb/testsuite/gdb.c++/templates.exp +++ b/gdb/testsuite/gdb.c++/templates.exp @@ -1,4 +1,4 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002 +# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -61,6 +61,10 @@ proc test_ptype_of_templates {} { -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\((T5<int> const|const T5<int>) ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" { pass "ptype T5<int> (obsolescent gcc or gdb)" } + -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" { + # This also triggers gdb/1113... + kfail "gdb/1111" "ptype T5<int>" + } -re ".*$gdb_prompt $" { fail "ptype T5<int>" } @@ -83,6 +87,10 @@ proc test_ptype_of_templates {} { -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" { pass "ptype t5i (obsolescent gcc or gdb)" } + -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}void T5\\(int\\);${ws}void T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\(int\\);${ws}static void \\* operator new\\(unsigned\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" { + # This also triggers gdb/1113... + kfail "gdb/1111" "ptype T5<int>" + } -re ".*$gdb_prompt $" { fail "ptype t5i" } @@ -114,6 +122,12 @@ proc test_template_breakpoints {} { "canceled" \ "constructor breakpoint" } + -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5 at .*\[\r\n\]*.3. T5 at .*\[\r\n\]*> $" { + setup_kfail "gdb/1062" "*-*-*" + gdb_test "0" \ + "nonsense intended to insure that this test fails" \ + "constructor breakpoint" + } -re ".*\n> $" { gdb_test "0" \ "nonsense intended to insure that this test fails" \ @@ -125,9 +139,17 @@ proc test_template_breakpoints {} { # See CLLbs14792 if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792} - gdb_test "break T5<int>::~T5" \ - "Breakpoint.*at.* file .*${testfile}.cc, line.*" \ - "destructor breakpoint" + + gdb_test_multiple "break T5<int>::~T5" "destructor_breakpoint" { + -re "Breakpoint.*at.* file .*${testfile}.cc, line.*$gdb_prompt $" + { + pass "destructor breakpoint" + } + -re "the class `T5<int>' does not have destructor defined\r\nHint: try 'T5<int>::~T5<TAB> or 'T5<int>::~T5<ESC-\\?>\r\n\\(Note leading single quote.\\)\r\n$gdb_prompt $" + { + kfail "gdb/1112" "destructor breakpoint" + } + } gdb_test "break T5<int>::value" \ "Breakpoint.*at.* file .*${testfile}.cc, line.*" \ @@ -192,18 +214,7 @@ proc do_tests {} { return } - # Get the debug format for the compiled test case. If that - # format is DWARF 1 then just skip all the tests since none of - # them will pass. - - if [ runto_main] then { - get_debug_format - if [ setup_xfail_format "DWARF 1" ] then { - fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format" - return - } - clear_xfail "*-*-*" - } + runto_main test_ptype_of_templates test_template_breakpoints @@ -253,17 +264,30 @@ gdb_expect { # Template Foo<T> -setup_xfail hppa64-*-* CLLbs16092 -# g++ can't do the template instantiation in debug info trick, so we -# fail this because it's not a real type. -if {!$hp_aCC_compiler} { setup_xfail *-*-* } +# Neither stabs nor DWARF-2 contains type information about templates +# (as opposed to instantiations of templates), so in those +# circumstances we expect GDB to not find a symbol. HP has a debug +# format that contains more info, though, so it's also correct to +# print out template info. (This affects several subsequent tests as +# well.) + +# NOTE: carlton/2003-02-26: However, because of a bug in the way GDB +# handles nested types, we don't get this right in the DWARF-2 case. + send_gdb "ptype Foo\n" gdb_expect { - -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" { pass "ptype Foo" } - -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" } - -re "$gdb_prompt $" { fail "ptype Foo" } - timeout { fail "(timeout) ptype Foo" } + -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" { pass "ptype Foo" } + -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" } + -re "type = class Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/57" "ptype Foo" } + -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + pass "ptype Foo" } + -re "$gdb_prompt $" { fail "ptype Foo" } + timeout { fail "(timeout) ptype Foo" } } +# -re "type = class Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo(int, int);\r\n\\}\r\n$gdb_prompt $" # ptype Foo<int> @@ -295,24 +319,48 @@ gdb_expect { # print a function from Foo<volatile char *> +# This test is sensitive to whitespace matching, so we'll do it twice, +# varying the spacing, because of PR gdb/33. + send_gdb "print Foo<volatile char *>::foo\n" gdb_expect { - -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char \\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" } - -re "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" } - timeout { fail "(timeout) print Foo<volatile char *>::foo" } + -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" } + -re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $" + { + # This used to be a kfail gdb/33, but it shouldn't occur any more now. + fail "print Foo<volatile char *>::foo" + } + -re "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" } + timeout { fail "(timeout) print Foo<volatile char *>::foo" } +} + +send_gdb "print Foo<volatile char*>::foo\n" +gdb_expect { + -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" } + -re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $" + { + # This used to be a kfail gdb/33, but it shouldn't occur any more now. + fail "print Foo<volatile char *>::foo" + } + -re "$gdb_prompt $" { fail "print Foo<volatile char*>::foo" } + timeout { fail "(timeout) print Foo<volatile char*>::foo" } } # Template Bar<T, int> -setup_xfail hppa64-*-* CLLbs16092 # same as Foo for g++ -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Bar\n" gdb_expect { - -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" } - -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" } - -re "$gdb_prompt $" { fail "ptype Bar" } - timeout { fail "(timeout) ptype Bar" } + -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" } + -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" } + -re "ptype Bar\r\ntype = class Bar<int,33> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/57" "ptype Bar" } + -re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + pass "ptype Bar" } + -re "$gdb_prompt $" { fail "ptype Bar" } + timeout { fail "(timeout) ptype Bar" } } @@ -336,15 +384,19 @@ gdb_expect { # Template Baz<T, char> -setup_xfail hppa64-*-* CLLbs16092 # Same as Foo, for g++ -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Baz\n" gdb_expect { - -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" } - -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" } - -re "$gdb_prompt $" { fail "ptype Baz" } - timeout { fail "(timeout) ptype Baz" } + -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" } + -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" } + -re "type = class Baz<int,'s'> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/57" "ptype Baz" } + -re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + pass "ptype Baz" } + -re "$gdb_prompt $" { fail "ptype Baz" } + timeout { fail "(timeout) ptype Baz" } } @@ -368,13 +420,18 @@ gdb_expect { # Template Qux<T, int (*f)(int) > # Same as Foo for g++ -if {!$hp_aCC_compiler} {setup_xfail *-*-*} send_gdb "ptype Qux\n" gdb_expect { - -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" } - -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" } - -re "$gdb_prompt $" { fail "ptype Qux" } - timeout { fail "(timeout) ptype Qux" } + -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" } + -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" } + -re "type = class Qux<char,&string> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/57" "ptype Qux" } + -re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + pass "ptype Qux" } + -re "$gdb_prompt $" { fail "ptype Qux" } + timeout { fail "(timeout) ptype Qux" } } # pt Qux<int,&string> @@ -399,15 +456,19 @@ gdb_expect { # Template Spec<T1, T2> -setup_xfail hppa64-*-* CLLbs16092 # Same as Foo for g++ -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Spec\n" gdb_expect { - -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" } - -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" } - -re "$gdb_prompt $" { fail "ptype Spec" } - timeout { fail "(timeout) ptype Spec" } + -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" } + -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" } + -re "type = class Spec<int,char> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/57" "ptype Spec" } + -re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + pass "ptype Spec" } + -re "$gdb_prompt $" { fail "ptype Spec" } + timeout { fail "(timeout) ptype Spec" } } # pt Spec<char,0> @@ -441,7 +502,7 @@ gdb_expect { send_gdb "print Garply<Garply<char> >::garply\n" gdb_expect { - -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*, int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" } + -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*(| const), int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" } -re ".*$gdb_prompt $" { fail "print Garply<Garply<char> >::garply" } timeout { fail "print Garply<Garply<char> >::garply (timeout)" } } diff --git a/gdb/testsuite/gdb.c++/virtfunc.exp b/gdb/testsuite/gdb.c++/virtfunc.exp index 2741cf6..dbd575c 100644 --- a/gdb/testsuite/gdb.c++/virtfunc.exp +++ b/gdb/testsuite/gdb.c++/virtfunc.exp @@ -915,12 +915,11 @@ proc test_virtual_calls {} { # # -- chastain 2002-02-20 - if {$gcc_compiled} then { setup_xfail "*-*-*" } - send_gdb "print pEe->D::vg()\n" - setup_xfail "*-*-*" gdb_expect { -re ".* = 102$nl$gdb_prompt $" { pass "print pEe->D::vg()" } + -re "Attempt to take address of value not located in memory.\r\n$gdb_prompt $" + { kfail "gdb/1064" "print pEe->D::vg()" } -re ".*$gdb_prompt $" { fail "print pEe->D::vg()" } timeout { fail "print pEe->D::vg() (timeout)" } eof { fail "print pEe->D::vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return } @@ -937,18 +936,7 @@ proc do_tests {} { gdb_start; gdb_virtfunc_init; - # Get the debug format for the compiled test case. If that - # format is DWARF 1 then just skip all the tests since none of - # them will pass. - - if [ runto_main ] then { - get_debug_format - if [ setup_xfail_format "DWARF 1" ] then { - fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format" - return - } - clear_xfail "*-*-*" - } + runto_main test_ptype_of_classes diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog index 2e2a82e..d089462 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog +++ b/gdb/testsuite/gdb.mi/ChangeLog @@ -1,3 +1,7 @@ +2003-02-23 Stephane Carrez <stcarrez@nerim.fr> + + * mi-syn-frame.exp: Don't run this test when gdb,nosignals is set. + 2002-12-13 Jeff Johnston <jjohnstn@redhat.com> * mi-basics.exp: Change tests for -environment-directory. Also add diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp index 49f9772..44ce845 100644 --- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 2002, 2003 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 @@ -20,6 +20,11 @@ # Test MI output with synthetic frames on the stack (call dummies, # signal handlers). +if [target_info exists gdb,nosignals] { + verbose "Skipping mi-syn-frame.exp because of nosignals." + continue +} + load_lib mi-support.exp set MIFLAGS "-i=mi" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index dca41dc..d2b6fbd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1004,6 +1004,15 @@ proc skip_cplus_tests {} { if { [istarget "h8300-*-*"] } { return 1 } + + # The C++ IO streams are too large for HC11/HC12 and are thus not + # available. The gdb C++ tests use them and don't compile. + if { [istarget "m6811-*-*"] } { + return 1 + } + if { [istarget "m6812-*-*"] } { + return 1 + } return 0 } diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 41afd08..70c1b8b 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1,6 +1,6 @@ /* Tracing functionality for remote targets in custom GDB protocol - Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -22,7 +22,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "frame.h" #include "gdbtypes.h" #include "expression.h" @@ -38,6 +37,7 @@ #include "regcache.h" #include "completer.h" #include "gdb-events.h" +#include "block.h" #include "dictionary.h" #include "ax.h" @@ -281,12 +281,12 @@ set_traceframe_context (CORE_ADDR trace_pc) /* save func name as "$trace_func", a debugger variable visible to users */ if (traceframe_fun == NULL || - SYMBOL_NAME (traceframe_fun) == NULL) + DEPRECATED_SYMBOL_NAME (traceframe_fun) == NULL) set_internalvar (lookup_internalvar ("trace_func"), value_from_pointer (charstar, (LONGEST) 0)); else { - len = strlen (SYMBOL_NAME (traceframe_fun)); + len = strlen (DEPRECATED_SYMBOL_NAME (traceframe_fun)); func_range = create_range_type (func_range, builtin_type_int, 0, len - 1); func_string = create_array_type (func_string, @@ -294,7 +294,7 @@ set_traceframe_context (CORE_ADDR trace_pc) func_val = allocate_value (func_string); VALUE_TYPE (func_val) = func_string; memcpy (VALUE_CONTENTS_RAW (func_val), - SYMBOL_NAME (traceframe_fun), + DEPRECATED_SYMBOL_NAME (traceframe_fun), len); func_val->modifiable = 0; set_internalvar (lookup_internalvar ("trace_func"), func_val); @@ -961,14 +961,14 @@ validate_actionline (char **line, struct tracepoint *t) if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST) { warning ("constant %s (value %ld) will not be collected.", - SYMBOL_NAME (exp->elts[2].symbol), + DEPRECATED_SYMBOL_NAME (exp->elts[2].symbol), SYMBOL_VALUE (exp->elts[2].symbol)); return BADLINE; } else if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_OPTIMIZED_OUT) { warning ("%s is optimized away and cannot be collected.", - SYMBOL_NAME (exp->elts[2].symbol)); + DEPRECATED_SYMBOL_NAME (exp->elts[2].symbol)); return BADLINE; } } @@ -1188,11 +1188,11 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, { default: printf_filtered ("%s: don't know symbol class %d\n", - SYMBOL_NAME (sym), SYMBOL_CLASS (sym)); + DEPRECATED_SYMBOL_NAME (sym), SYMBOL_CLASS (sym)); break; case LOC_CONST: printf_filtered ("constant %s (value %ld) will not be collected.\n", - SYMBOL_NAME (sym), SYMBOL_VALUE (sym)); + DEPRECATED_SYMBOL_NAME (sym), SYMBOL_VALUE (sym)); break; case LOC_STATIC: offset = SYMBOL_VALUE_ADDRESS (sym); @@ -1202,7 +1202,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, sprintf_vma (tmp, offset); printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n", - SYMBOL_NAME (sym), len, tmp /* address */); + DEPRECATED_SYMBOL_NAME (sym), len, tmp /* address */); } add_memrange (collect, -1, offset, len); /* 0 == memory */ break; @@ -1210,7 +1210,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, case LOC_REGPARM: reg = SYMBOL_VALUE (sym); if (info_verbose) - printf_filtered ("LOC_REG[parm] %s: ", SYMBOL_NAME (sym)); + printf_filtered ("LOC_REG[parm] %s: ", DEPRECATED_SYMBOL_NAME (sym)); add_register (collect, reg); /* check for doubles stored in two registers */ /* FIXME: how about larger types stored in 3 or more regs? */ @@ -1221,7 +1221,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, case LOC_REF_ARG: printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n"); printf_filtered (" (will not collect %s)\n", - SYMBOL_NAME (sym)); + DEPRECATED_SYMBOL_NAME (sym)); break; case LOC_ARG: reg = frame_regno; @@ -1229,7 +1229,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, if (info_verbose) { printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", - SYMBOL_NAME (sym), len); + DEPRECATED_SYMBOL_NAME (sym), len); printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } @@ -1241,7 +1241,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, if (info_verbose) { printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset ", - SYMBOL_NAME (sym), len); + DEPRECATED_SYMBOL_NAME (sym), len); printf_vma (offset); printf_filtered (" from reg %d\n", reg); } @@ -1254,7 +1254,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, if (info_verbose) { printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", - SYMBOL_NAME (sym), len); + DEPRECATED_SYMBOL_NAME (sym), len); printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } @@ -1267,18 +1267,18 @@ collect_symbol (struct collection_list *collect, struct symbol *sym, if (info_verbose) { printf_filtered ("LOC_BASEREG %s: collect %ld bytes at offset ", - SYMBOL_NAME (sym), len); + DEPRECATED_SYMBOL_NAME (sym), len); printf_vma (offset); printf_filtered (" from basereg %d\n", reg); } add_memrange (collect, reg, offset, len); break; case LOC_UNRESOLVED: - printf_filtered ("Don't know LOC_UNRESOLVED %s\n", SYMBOL_NAME (sym)); + printf_filtered ("Don't know LOC_UNRESOLVED %s\n", DEPRECATED_SYMBOL_NAME (sym)); break; case LOC_OPTIMIZED_OUT: printf_filtered ("%s has been optimized out of existence.\n", - SYMBOL_NAME (sym)); + DEPRECATED_SYMBOL_NAME (sym)); break; } } @@ -1303,7 +1303,7 @@ add_local_symbols (struct collection_list *collect, CORE_ADDR pc, { default: warning ("don't know how to trace local symbol %s", - SYMBOL_NAME (sym)); + DEPRECATED_SYMBOL_NAME (sym)); case LOC_LOCAL: case LOC_STATIC: case LOC_REGISTER: @@ -2359,7 +2359,7 @@ scope_info (char *args, int from_tty) printf_filtered ("Scope for %s:\n", save_args); count++; - symname = SYMBOL_NAME (sym); + symname = DEPRECATED_SYMBOL_NAME (sym); if (symname == NULL || *symname == '\0') continue; /* probably botched, certainly useless */ @@ -2435,7 +2435,7 @@ scope_info (char *args, int from_tty) REGISTER_NAME (SYMBOL_BASEREG (sym))); break; case LOC_UNRESOLVED: - msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, NULL); + msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL); if (msym == NULL) printf_filtered ("Unresolved Static"); else diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 88ad5e7..c3e659d 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,25 @@ +2003-02-14 Andrew Cagney <ac131313@redhat.com> + + * tui.c (tui_enable, tui_disable): Don't modify tui_version. + (tui_is_window_visible, tui_get_command_dimension): Test + tui_active instead of tui_version. + * tuiData.h (tui_version): Delete declaration. + * tui-hooks.c (tui_init_hook, tui_event_loop): Delete function, + moved to "tui-interp.c". + (tui_exit, tui_command_loop): Ditto. + (_initialize_tui): Don't initialize init_ui_hook. Initialize + target_new_objfile_hook. + * tui-interp.c: New file. + +2003-02-12 Andrew Cagney <ac131313@redhat.com> + + * tuiIO.c (tui_prep_terminal): Add one notused parameter. + * tui.c (tui_rl_switch_mode): Add two notused parameters. + (tui_rl_change_windows, tui_rl_next_keymap): Ditto. + (tui_rl_delete_other_windows): Ditto. + (tui_rl_change_windows, tui_rl_delete_other_windows): Update + calls. + 2002-12-08 Elena Zannoni <ezannoni@redhat.com> Import of readline 4.3. diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index ff36d49..db6c3f6 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -69,8 +69,6 @@ int tui_target_has_run = 0; static void (* tui_target_new_objfile_chain) (struct objfile*); -static void tui_event_loop (void); -static void tui_command_loop (void); static void tui_new_objfile_hook (struct objfile* objfile) @@ -325,131 +323,12 @@ tui_remove_hooks (void) set_gdb_event_hooks (tui_old_event_hooks); } -/* Cleanup the tui before exiting. */ -static void -tui_exit (void) -{ - /* Disable the tui. Curses mode is left leaving the screen - in a clean state (see endwin()). */ - tui_disable (); -} - -/* Initialize all the necessary variables, start the event loop, - register readline, and stdin, start the loop. */ -static void -tui_command_loop (void) -{ - int length; - char *a_prompt; - char *gdb_prompt = get_prompt (); - - /* If we are using readline, set things up and display the first - prompt, otherwise just print the prompt. */ - if (async_command_editing_p) - { - /* Tell readline what the prompt to display is and what function it - will need to call after a whole line is read. This also displays - the first prompt. */ - length = strlen (PREFIX (0)) + strlen (gdb_prompt) + strlen (SUFFIX (0)) + 1; - a_prompt = (char *) xmalloc (length); - strcpy (a_prompt, PREFIX (0)); - strcat (a_prompt, gdb_prompt); - strcat (a_prompt, SUFFIX (0)); - rl_callback_handler_install (a_prompt, input_handler); - } - else - display_gdb_prompt (0); - - /* Now it's time to start the event loop. */ - tui_event_loop (); -} - -/* Start up the event loop. This is the entry point to the event loop - from the command loop. */ - -static void -tui_event_loop (void) -{ - /* Loop until there is nothing to do. This is the entry point to the - event loop engine. gdb_do_one_event, called via catch_errors() - will process one event for each invocation. It blocks waits for - an event and then processes it. >0 when an event is processed, 0 - when catch_errors() caught an error and <0 when there are no - longer any event sources registered. */ - while (1) - { - int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL); - if (result < 0) - break; - - /* Update gdb output according to TUI mode. Since catch_errors - preserves the uiout from changing, this must be done at top - level of event loop. */ - if (tui_active) - uiout = tui_out; - else - uiout = tui_old_uiout; - - if (result == 0) - { - /* FIXME: this should really be a call to a hook that is - interface specific, because interfaces can display the - prompt in their own way. */ - display_gdb_prompt (0); - /* This call looks bizarre, but it is required. If the user - entered a command that caused an error, - after_char_processing_hook won't be called from - rl_callback_read_char_wrapper. Using a cleanup there - won't work, since we want this function to be called - after a new prompt is printed. */ - if (after_char_processing_hook) - (*after_char_processing_hook) (); - /* Maybe better to set a flag to be checked somewhere as to - whether display the prompt or not. */ - } - } +void _initialize_tui_hooks (void); - /* We are done with the event loop. There are no more event sources - to listen to. So we exit GDB. */ - return; -} - -/* Initialize the tui by installing several gdb hooks, initializing - the tui IO and preparing the readline with the kind binding. */ -static void -tui_init_hook (char *argv0) +void +_initialize_tui_hooks (void) { - /* Don't enable the TUI if a specific interpreter is installed. */ - if (interpreter_p) - return; - - /* Install exit handler to leave the screen in a good shape. */ - atexit (tui_exit); - - initializeStaticData (); - /* Install the permanent hooks. */ tui_target_new_objfile_chain = target_new_objfile_hook; target_new_objfile_hook = tui_new_objfile_hook; - - tui_initialize_io (); - tui_initialize_readline (); - - /* Tell gdb to use the tui_command_loop as the main loop. */ - command_loop_hook = tui_command_loop; - - /* Decide in which mode to start using GDB (based on -tui). */ - if (tui_version) - { - tui_enable (); - } } - -/* Initialize the tui. */ -void -_initialize_tui (void) -{ - /* Setup initialization hook. */ - init_ui_hook = tui_init_hook; -} - diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index d5cde22..517cf46 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -102,7 +102,7 @@ static Keymap tui_readline_standard_keymap; /* TUI readline command. Switch the output mode between TUI/standard gdb. */ static int -tui_rl_switch_mode (void) +tui_rl_switch_mode (int notused1, int notused2) { if (tui_active) { @@ -138,10 +138,10 @@ tui_rl_switch_mode (void) a functionality close to the Emacs split-window command. We always show two windows (src+asm), (src+regs) or (asm+regs). */ static int -tui_rl_change_windows (void) +tui_rl_change_windows (int notused1, int notused2) { if (!tui_active) - tui_rl_switch_mode (); + tui_rl_switch_mode (0/*notused*/, 0/*notused*/); if (tui_active) { @@ -186,10 +186,10 @@ tui_rl_change_windows (void) /* TUI readline command. Delete the second TUI window to only show one. */ static int -tui_rl_delete_other_windows (void) +tui_rl_delete_other_windows (int notused1, int notused2) { if (!tui_active) - tui_rl_switch_mode (); + tui_rl_switch_mode (0/*notused*/, 0/*notused*/); if (tui_active) { @@ -255,7 +255,7 @@ tui_rl_command_mode (int count, int key) /* TUI readline command. Switch between TUI SingleKey mode and gdb readline editing. */ static int -tui_rl_next_keymap (void) +tui_rl_next_keymap (int notused1, int notused2) { tui_set_key_mode (tui_current_key_mode == tui_command_mode ? tui_single_key_mode : tui_command_mode); @@ -393,7 +393,6 @@ tui_enable (void) tui_setup_io (1); - tui_version = 1; tui_active = 1; if (deprecated_selected_frame) tuiShowFrameInfo (deprecated_selected_frame); @@ -435,7 +434,6 @@ tui_disable (void) /* Update gdb's knowledge of its terminal. */ target_terminal_save_ours (); - tui_version = 0; tui_active = 0; tui_update_gdb_sizes (); } @@ -563,7 +561,7 @@ tui_show_assembly (CORE_ADDR addr) int tui_is_window_visible (TuiWinType type) { - if (tui_version == 0) + if (tui_active == 0) return 0; if (winList[type] == 0) @@ -575,7 +573,7 @@ tui_is_window_visible (TuiWinType type) int tui_get_command_dimension (int *width, int *height) { - if (!tui_version || !m_winPtrNotNull (cmdWin)) + if (!tui_active || !m_winPtrNotNull (cmdWin)) { return 0; } diff --git a/gdb/tui/tuiData.h b/gdb/tui/tuiData.h index 8a4eb9f..6fcf875 100644 --- a/gdb/tui/tuiData.h +++ b/gdb/tui/tuiData.h @@ -328,7 +328,6 @@ TuiWinInfo, *TuiWinInfoPtr; /* Global Data */ extern TuiWinInfoPtr winList[MAX_MAJOR_WINDOWS]; -extern int tui_version; /* Macros */ #define srcWin winList[SRC_WIN] diff --git a/gdb/tui/tuiIO.c b/gdb/tui/tuiIO.c index b9b373c..f53cef3 100644 --- a/gdb/tui/tuiIO.c +++ b/gdb/tui/tuiIO.c @@ -262,7 +262,7 @@ tui_redisplay_readline (void) /* Readline callback to prepare the terminal. It is called once each time we enter readline. Terminal is already setup in curses mode. */ static void -tui_prep_terminal (void) +tui_prep_terminal (int notused1) { /* Save the prompt registered in readline to correctly display it. (we can't use gdb_prompt() due to secondary prompts and can't use diff --git a/gdb/typeprint.c b/gdb/typeprint.c index c094b9e..ab8bf67 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -67,7 +67,7 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream) fprintf_filtered (stream, "typedef "); type_print (type, "", stream, 0); if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0 - || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)) != 0) + || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), DEPRECATED_SYMBOL_NAME (new)) != 0) fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new)); break; #endif @@ -75,7 +75,7 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream) case language_m2: fprintf_filtered (stream, "TYPE "); if (!TYPE_NAME (SYMBOL_TYPE (new)) - || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)) != 0) + || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), DEPRECATED_SYMBOL_NAME (new)) != 0) fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new)); else fprintf_filtered (stream, "<builtin> = "); diff --git a/gdb/utils.c b/gdb/utils.c index eadd168..d0f2edd 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -2368,7 +2368,29 @@ strcmp_iw (const char *string1, const char *string2) If a list is sorted according to this function and if you want to find names in the list that match some fixed NAME according to strcmp_iw(LIST_ELT, NAME), then the place to start looking is right - where this function would put NAME. */ + where this function would put NAME. + + Here are some examples of why using strcmp to sort is a bad idea: + + Whitespace example: + + Say your partial symtab contains: "foo<char *>", "goo". Then, if + we try to do a search for "foo<char*>", strcmp will locate this + after "foo<char *>" and before "goo". Then lookup_partial_symbol + will start looking at strings beginning with "goo", and will never + see the correct match of "foo<char *>". + + Parenthesis example: + + In practice, this is less like to be an issue, but I'll give it a + shot. Let's assume that '$' is a legitimate character to occur in + symbols. (Which may well even be the case on some systems.) Then + say that the partial symbol table contains "foo$" and "foo(int)". + strcmp will put them in this order, since '$' < '('. Now, if the + user searches for "foo", then strcmp will sort "foo" before "foo$". + Then lookup_partial_symbol will notice that strcmp_iw("foo$", + "foo") is false, so it won't proceed to the actual match of + "foo(int)" with "foo". */ int strcmp_iw_ordered (const char *string1, const char *string2) @@ -2743,8 +2765,8 @@ gdb_realpath (const char *filename) if (rp == NULL) rp = filename; return xstrdup (rp); - } # endif + } #endif /* HAVE_REALPATH */ /* Method 2: The host system (i.e., GNU) has the function diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 3970145..0894a8f 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1232,9 +1232,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE); set_gdbarch_register_byte (gdbarch, v850_register_byte); set_gdbarch_register_raw_size (gdbarch, v850_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, v850_reg_size); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, v850_reg_size); set_gdbarch_register_virtual_size (gdbarch, v850_register_raw_size); - set_gdbarch_max_register_virtual_size (gdbarch, v850_reg_size); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, v850_reg_size); set_gdbarch_register_virtual_type (gdbarch, v850_reg_virtual_type); set_gdbarch_read_fp (gdbarch, v850_target_read_fp); @@ -1242,8 +1242,8 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* * Frame Info */ - set_gdbarch_init_extra_frame_info (gdbarch, v850_init_extra_frame_info); - set_gdbarch_frame_init_saved_regs (gdbarch, v850_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, v850_frame_init_saved_regs); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, v850_init_extra_frame_info); set_gdbarch_frame_chain (gdbarch, v850_frame_chain); set_gdbarch_saved_pc_after_call (gdbarch, v850_saved_pc_after_call); set_gdbarch_frame_saved_pc (gdbarch, v850_frame_saved_pc); @@ -1268,7 +1268,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, v850_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value); set_gdbarch_push_arguments (gdbarch, v850_push_arguments); diff --git a/gdb/valops.c b/gdb/valops.c index d003325..36408ef 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -22,7 +22,6 @@ #include "defs.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "value.h" #include "frame.h" @@ -34,6 +33,7 @@ #include "gdbcmd.h" #include "regcache.h" #include "cp-abi.h" +#include "block.h" #include "dictionary.h" #include <errno.h> @@ -1346,10 +1346,34 @@ hand_function_call (struct value *function, int nargs, struct value **args) inf_status = save_inferior_status (1); inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status); - /* PUSH_DUMMY_FRAME is responsible for saving the inferior registers - (and POP_FRAME for restoring them). (At least on most machines) - they are saved on the stack in the inferior. */ - PUSH_DUMMY_FRAME; + if (DEPRECATED_PUSH_DUMMY_FRAME_P ()) + { + /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the + inferior registers (and POP_FRAME for restoring them). (At + least on most machines) they are saved on the stack in the + inferior. */ + DEPRECATED_PUSH_DUMMY_FRAME; + } + else + { + /* FIXME: cagney/2003-02-26: Step zero of this little tinker is + to extract the generic dummy frame code from the architecture + vector. Hence this direct call. + + A follow-on change is to modify this interface so that it takes + thread OR frame OR tpid as a parameter, and returns a dummy + frame handle. The handle can then be used further down as a + parameter SAVE_DUMMY_FRAME_TOS. Hmm, thinking about it, since + everything is ment to be using generic dummy frames, why not + even use some of the dummy frame code to here - do a regcache + dup and then pass the duped regcache, along with all the other + stuff, at one single point. + + In fact, you can even save the structure's return address in the + dummy frame and fix one of those nasty lost struct return edge + conditions. */ + generic_push_dummy_frame (); + } old_sp = read_sp (); diff --git a/gdb/value.h b/gdb/value.h index 636f99c..928f940 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -24,6 +24,7 @@ #define VALUE_H 1 struct regcache; +struct block; #include "doublest.h" diff --git a/gdb/values.c b/gdb/values.c index f2b01ec..bc472e3 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -24,7 +24,6 @@ #include "defs.h" #include "gdb_string.h" #include "symtab.h" -#include "block.h" #include "gdbtypes.h" #include "value.h" #include "gdbcore.h" @@ -37,6 +36,7 @@ #include "doublest.h" #include "gdb_assert.h" #include "regcache.h" +#include "block.h" /* Prototypes for exported functions. */ diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 52438d5..ab968b6 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -46,14 +46,13 @@ static gdbarch_frame_chain_ftype vax_frame_chain; static gdbarch_frame_saved_pc_ftype vax_frame_saved_pc; static gdbarch_frame_args_address_ftype vax_frame_args_address; static gdbarch_frame_locals_address_ftype vax_frame_locals_address; -static gdbarch_frame_init_saved_regs_ftype vax_frame_init_saved_regs; static gdbarch_store_struct_return_ftype vax_store_struct_return; static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype vax_extract_struct_value_address; -static gdbarch_push_dummy_frame_ftype vax_push_dummy_frame; +static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame; static gdbarch_pop_frame_ftype vax_pop_frame; static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy; @@ -636,9 +635,9 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES); set_gdbarch_register_byte (gdbarch, vax_register_byte); set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE); set_gdbarch_register_virtual_size (gdbarch, vax_register_virtual_size); - set_gdbarch_max_register_virtual_size (gdbarch, + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, VAX_MAX_REGISTER_VIRTUAL_SIZE); set_gdbarch_register_virtual_type (gdbarch, vax_register_virtual_type); @@ -656,7 +655,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address); set_gdbarch_frame_locals_address (gdbarch, vax_frame_locals_address); - set_gdbarch_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs); set_gdbarch_frame_args_skip (gdbarch, 4); @@ -669,7 +668,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_struct_value_address (gdbarch, vax_extract_struct_value_address); /* Call dummy info */ - set_gdbarch_push_dummy_frame (gdbarch, vax_push_dummy_frame); + set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame); set_gdbarch_pop_frame (gdbarch, vax_pop_frame); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_p (gdbarch, 1); diff --git a/gdb/version.in b/gdb/version.in index 141d9dd..8a8ed14 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-02-07-cvs +2003-03-05-cvs diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 350a995..72e8c3f 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -602,8 +602,8 @@ register_loaded_dll (const char *name, DWORD load_addr) so = (struct so_stuff *) xmalloc (sizeof (struct so_stuff) + strlen (ppath) + 8 + 1); so->loaded = 0; so->load_addr = load_addr; - if (!VirtualQueryEx (current_process_handle, (void *) load_addr, &m, - sizeof (m))) + if (VirtualQueryEx (current_process_handle, (void *) load_addr, &m, + sizeof (m))) so->end_addr = (DWORD) m.AllocationBase + m.RegionSize; else so->end_addr = load_addr + 0x2000; /* completely arbitrary */ @@ -635,21 +635,16 @@ get_image_name (HANDLE h, void *address, int unicode) if (address == NULL) return NULL; - ReadProcessMemory (h, address, &address_ptr, sizeof (address_ptr), &done); - /* See if we could read the address of a string, and that the address isn't null. */ - - if (done != sizeof (address_ptr) || !address_ptr) + if (!ReadProcessMemory (h, address, &address_ptr, sizeof (address_ptr), &done) + || done != sizeof (address_ptr) || !address_ptr) return NULL; /* Find the length of the string */ - do - { - ReadProcessMemory (h, address_ptr + len * size, &b, size, &done); - len++; - } - while ((b[0] != 0 || b[size - 1] != 0) && done == size); + while (ReadProcessMemory (h, address_ptr + len++ * size, &b, size, &done) + && (b[0] != 0 || b[size - 1] != 0) && done == size) + continue; if (!unicode) ReadProcessMemory (h, address_ptr, buf, len, &done); @@ -949,7 +944,7 @@ display_selector (HANDLE thread, DWORD sel) + info.BaseLow; limit = (info.HighWord.Bits.LimitHi << 16) + info.LimitLow; if (info.HighWord.Bits.Granularity) - limit = (limit << 12) | 0xfff; + limit = (limit << 12) | 0xfff; printf_filtered ("base=0x%08x limit=0x%08x", base, limit); if (info.HighWord.Bits.Default_Big) puts_filtered(" 32-bit "); @@ -1571,7 +1566,7 @@ child_attach (char *args, int from_tty) ok = DebugActiveProcess (pid); if (!ok) - error ("Can't attach to process."); + error ("Can't attach to process."); } if (has_detach_ability ()) @@ -1863,21 +1858,23 @@ child_xfer_memory (CORE_ADDR memaddr, char *our, int len, int write, struct mem_attrib *mem, struct target_ops *target) { - DWORD done; + DWORD done = 0; if (write) { DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08lx\n", len, (DWORD) memaddr)); - WriteProcessMemory (current_process_handle, (LPVOID) memaddr, our, - len, &done); + if (!WriteProcessMemory (current_process_handle, (LPVOID) memaddr, our, + len, &done)) + done = 0; FlushInstructionCache (current_process_handle, (LPCVOID) memaddr, len); } else { DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08lx\n", len, (DWORD) memaddr)); - ReadProcessMemory (current_process_handle, (LPCVOID) memaddr, our, len, - &done); + if (!ReadProcessMemory (current_process_handle, (LPCVOID) memaddr, our, + len, &done)) + done = 0; } return done; } @@ -1964,16 +1961,16 @@ child_resume (ptid_t ptid, int step, enum target_signal sig) if (th->context.ContextFlags) { - if (debug_registers_changed) - { - th->context.Dr0 = dr[0]; - th->context.Dr1 = dr[1]; - th->context.Dr2 = dr[2]; - th->context.Dr3 = dr[3]; - /* th->context.Dr6 = dr[6]; - FIXME: should we set dr6 also ?? */ - th->context.Dr7 = dr[7]; - } + if (debug_registers_changed) + { + th->context.Dr0 = dr[0]; + th->context.Dr1 = dr[1]; + th->context.Dr2 = dr[2]; + th->context.Dr3 = dr[3]; + /* th->context.Dr6 = dr[6]; + FIXME: should we set dr6 also ?? */ + th->context.Dr7 = dr[7]; + } CHECK (SetThreadContext (th->h, &th->context)); th->context.ContextFlags = 0; } diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c index 8676176..044236c 100644 --- a/gdb/x86-64-linux-nat.c +++ b/gdb/x86-64-linux-nat.c @@ -158,7 +158,7 @@ fill_gregset (elf_gregset_t * gregsetp, int regno) for (i = 0; i < x86_64_num_gregs; i++) if ((regno == -1 || regno == i)) - deprecated_read_register_gen (i, (char *) (regp + x86_64_regmap[i])); + regcache_collect (i, (char *) (regp + x86_64_regmap[i])); } /* Fetch all general-purpose registers from process/thread TID and diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 4ec9279..5ba1da2 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -560,7 +560,8 @@ x86_64_use_struct_convention (int gcc_p, struct type *value_type) into VALBUF. */ void -x86_64_extract_return_value (struct type *type, char *regbuf, char *valbuf) +x86_64_extract_return_value (struct type *type, struct regcache *regcache, + void *valbuf) { enum x86_64_reg_class class[MAX_CLASSES]; int n = classify_argument (type, class, 0); @@ -577,7 +578,7 @@ x86_64_extract_return_value (struct type *type, char *regbuf, char *valbuf) needed_intregs > RET_INT_REGS || needed_sseregs > RET_SSE_REGS) { /* memory class */ CORE_ADDR addr; - memcpy (&addr, regbuf, REGISTER_RAW_SIZE (RAX_REGNUM)); + regcache_cooked_read (regcache, RAX_REGNUM, &addr); read_memory (addr, valbuf, TYPE_LENGTH (type)); return; } @@ -591,41 +592,40 @@ x86_64_extract_return_value (struct type *type, char *regbuf, char *valbuf) case X86_64_NO_CLASS: break; case X86_64_INTEGER_CLASS: - memcpy (valbuf + offset, - regbuf + REGISTER_BYTE (ret_int_r[(intreg + 1) / 2]), - 8); + regcache_cooked_read (regcache, ret_int_r[(intreg + 1) / 2], + (char *) valbuf + offset); offset += 8; intreg += 2; break; case X86_64_INTEGERSI_CLASS: - memcpy (valbuf + offset, - regbuf + REGISTER_BYTE (ret_int_r[intreg / 2]), 4); + regcache_cooked_read_part (regcache, ret_int_r[intreg / 2], + 0, 4, (char *) valbuf + offset); offset += 8; intreg++; break; case X86_64_SSEDF_CLASS: case X86_64_SSESF_CLASS: case X86_64_SSE_CLASS: - memcpy (valbuf + offset, - regbuf + REGISTER_BYTE (ret_sse_r[(ssereg + 1) / 2]), - 8); + regcache_cooked_read_part (regcache, + ret_sse_r[(ssereg + 1) / 2], 0, 8, + (char *) valbuf + offset); offset += 8; ssereg += 2; break; case X86_64_SSEUP_CLASS: - memcpy (valbuf + offset + 8, - regbuf + REGISTER_BYTE (ret_sse_r[ssereg / 2]), 8); + regcache_cooked_read_part (regcache, ret_sse_r[ssereg / 2], + 0, 8, (char *) valbuf + offset); offset += 8; ssereg++; break; case X86_64_X87_CLASS: - memcpy (valbuf + offset, regbuf + REGISTER_BYTE (FP0_REGNUM), - 8); + regcache_cooked_read_part (regcache, FP0_REGNUM, + 0, 8, (char *) valbuf + offset); offset += 8; break; case X86_64_X87UP_CLASS: - memcpy (valbuf + offset, - regbuf + REGISTER_BYTE (FP0_REGNUM) + 8, 8); + regcache_cooked_read_part (regcache, FP0_REGNUM, + 8, 2, (char *) valbuf + offset); offset += 8; break; case X86_64_MEMORY_CLASS: @@ -750,7 +750,8 @@ x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Write into the appropriate registers a function return value stored in VALBUF of type TYPE, given in virtual format. */ void -x86_64_store_return_value (struct type *type, char *valbuf) +x86_64_store_return_value (struct type *type, struct regcache *regcache, + const void *valbuf) { int len = TYPE_LENGTH (type); @@ -761,8 +762,7 @@ x86_64_store_return_value (struct type *type, char *valbuf) && TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext) { /* Copy straight over. */ - deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), valbuf, - FPU_REG_RAW_SIZE); + regcache_cooked_write (regcache, FP0_REGNUM, valbuf); } else { @@ -775,8 +775,8 @@ x86_64_store_return_value (struct type *type, char *valbuf) it is the best we can do. */ val = extract_floating (valbuf, TYPE_LENGTH (type)); floatformat_from_doublest (&floatformat_i387_ext, &val, buf); - deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf, - FPU_REG_RAW_SIZE); + regcache_cooked_write_part (regcache, FP0_REGNUM, + 0, FPU_REG_RAW_SIZE, buf); } } else @@ -785,13 +785,13 @@ x86_64_store_return_value (struct type *type, char *valbuf) int high_size = REGISTER_RAW_SIZE (1); if (len <= low_size) - deprecated_write_register_bytes (REGISTER_BYTE (0), valbuf, len); + regcache_cooked_write_part (regcache, 0, 0, len, valbuf); else if (len <= (low_size + high_size)) { - deprecated_write_register_bytes (REGISTER_BYTE (0), valbuf, - low_size); - deprecated_write_register_bytes (REGISTER_BYTE (1), - valbuf + low_size, len - low_size); + regcache_cooked_write_part (regcache, 0, 0, low_size, valbuf); + regcache_cooked_write_part (regcache, 1, 0, + len - low_size, + (const char *) valbuf + low_size); } else internal_error (__FILE__, __LINE__, @@ -980,23 +980,18 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* FIXME: kettenis/20021026: Should we set parm_boundary to 64 here? */ set_gdbarch_read_fp (gdbarch, cfi_read_fp); - /* FIXME: kettenis/20021026: Should be undeprecated. */ - set_gdbarch_extract_return_value (gdbarch, legacy_extract_return_value); - set_gdbarch_deprecated_extract_return_value (gdbarch, - x86_64_extract_return_value); + set_gdbarch_extract_return_value (gdbarch, x86_64_extract_return_value); + set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments); set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address); set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame); set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return); - /* FIXME: kettenis/20021026: Should be undeprecated. */ - set_gdbarch_store_return_value (gdbarch, legacy_store_return_value); - set_gdbarch_deprecated_store_return_value (gdbarch, - x86_64_store_return_value); + set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value); /* Override, since this is handled by x86_64_extract_return_value. */ set_gdbarch_extract_struct_value_address (gdbarch, NULL); set_gdbarch_use_struct_convention (gdbarch, x86_64_use_struct_convention); - set_gdbarch_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs); + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, x86_64_frame_init_saved_regs); set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue); set_gdbarch_frame_chain (gdbarch, x86_64_linux_frame_chain); @@ -1016,7 +1011,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info); /* Initialization of per-frame CFI. */ - set_gdbarch_init_extra_frame_info (gdbarch, cfi_init_extra_frame_info); + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, cfi_init_extra_frame_info); /* Frame PC initialization is handled by using CFI. */ set_gdbarch_deprecated_init_frame_pc (gdbarch, x86_64_init_frame_pc); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 5a2fc55..e7ccb43 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1478,7 +1478,7 @@ process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile) will be patched with the type from its stab entry later on in patch_block_stabs (), unless the file was compiled without -g. */ - SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced); + DEPRECATED_SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced); SYMBOL_TYPE (sym) = func_symbol_type; SYMBOL_CLASS (sym) = LOC_BLOCK; diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 3ecfd3c..2bbd402 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -1045,17 +1045,17 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE); set_gdbarch_register_byte (gdbarch, xstormy16_register_byte); set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size); - set_gdbarch_max_register_raw_size (gdbarch, xstormy16_pc_size); + set_gdbarch_deprecated_max_register_raw_size (gdbarch, xstormy16_pc_size); set_gdbarch_register_virtual_size (gdbarch, xstormy16_register_raw_size); - set_gdbarch_max_register_virtual_size (gdbarch, 4); + set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4); set_gdbarch_register_virtual_type (gdbarch, xstormy16_reg_virtual_type); /* * Frame Info */ - set_gdbarch_init_extra_frame_info (gdbarch, + set_gdbarch_deprecated_init_extra_frame_info (gdbarch, xstormy16_init_extra_frame_info); - set_gdbarch_frame_init_saved_regs (gdbarch, + set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, xstormy16_frame_init_saved_regs); set_gdbarch_frame_chain (gdbarch, xstormy16_frame_chain); set_gdbarch_get_saved_register (gdbarch, xstormy16_get_saved_register); @@ -1086,7 +1086,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value); set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments); diff --git a/include/ChangeLog b/include/ChangeLog index 829d187..c98e61e 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,15 @@ +2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * libiberty.h: Document return value of physmem routines. + +2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * libiberty.h (physmem_total, physmem_available): Prototype. + +2003-02-20 Daniel Jacobowitz <drow@mvista.com> + + * libiberty.h (lrealpath): Add declaration. + 2003-01-31 Grant Grundler <grundler@dsl2.external.hp.com> * hppa.h (ldwa, ldda): Add ordered opcodes. diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 88e8c96..e87cdd2 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,24 @@ +Mon Mar 3 20:35:58 2003 J"orn Rennecke <joern.rennecke@superh.com> + + * sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E, + and SH2E & SH4 merge to SH4, not SH2E. + +2003-02-21 Ian Wienand <ianw@gelato.unsw.edu.au> + + * ia64.h (SHT_IA_64_LOPSREG, SHT_IA_64_HIPSREG, + SHT_IA_64_PRIORITY_INIT): Define. + +2003-02-18 Alan Modra <amodra@bigpond.net.au> + + * ppc64.h (IS_PPC64_TLS_RELOC): Rename from IS_TLS_RELOC. + + * ppc.h: Replace DTPMOD64, TPREL64, DTPREL64 with DTPMOD32 etc. + (IS_PPC_TLS_RELOC): Define. + +2003-02-10 Nick Clifton <nickc@redhat.com> + + * arm.h (EF_ARM_MAVERICK_FLOAT): Define. + 2003-02-05 Alan Modra <amodra@bigpond.net.au> * ppc.h: Add TLS relocs. Format. diff --git a/include/elf/arm.h b/include/elf/arm.h index 269a225..5347017 100644 --- a/include/elf/arm.h +++ b/include/elf/arm.h @@ -34,6 +34,7 @@ #define EF_ARM_OLD_ABI 0x100 #define EF_ARM_SOFT_FLOAT 0x200 #define EF_ARM_VFP_FLOAT 0x400 +#define EF_ARM_MAVERICK_FLOAT 0x800 /* Other constants defined in the ARM ELF spec. version B-01. */ #define EF_ARM_SYMSARESORTED 0x04 /* NB conflicts with EF_INTERWORK */ diff --git a/include/elf/ia64.h b/include/elf/ia64.h index 310a7f7..06dfa60 100644 --- a/include/elf/ia64.h +++ b/include/elf/ia64.h @@ -1,45 +1,44 @@ /* IA-64 ELF support for BFD. - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2003 Free Software Foundation, Inc. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> -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. - -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. */ + 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. */ #ifndef _ELF_IA64_H #define _ELF_IA64_H /* Bits in the e_flags field of the Elf64_Ehdr: */ -#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ -#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ +#define EF_IA_64_MASKOS 0x0000000f /* OS-specific flags. */ +#define EF_IA_64_ARCH 0xff000000 /* Arch. version mask. */ /* ??? These four definitions are not part of the SVR4 ABI. They were present in David's initial code drop, so it is probable that they are used by HP/UX. */ -#define EF_IA_64_TRAPNIL (1 << 0) /* trap NIL pointer dereferences */ -#define EF_IA_64_EXT (1 << 2) /* program uses arch. extensions */ -#define EF_IA_64_BE (1 << 3) /* PSR BE bit set (big-endian) */ -#define EFA_IA_64_EAS2_3 0x23000000 /* ia64 EAS 2.3 */ +#define EF_IA_64_TRAPNIL (1 << 0) /* Trap NIL pointer dereferences. */ +#define EF_IA_64_EXT (1 << 2) /* Program uses arch. extensions. */ +#define EF_IA_64_BE (1 << 3) /* PSR BE bit set (big-endian). */ +#define EFA_IA_64_EAS2_3 0x23000000 /* IA64 EAS 2.3. */ -#define EF_IA_64_ABI64 (1 << 4) /* 64-bit ABI */ +#define EF_IA_64_ABI64 (1 << 4) /* 64-bit ABI. */ /* Not used yet. */ #define EF_IA_64_REDUCEDFP (1 << 5) /* Only FP6-FP11 used. */ -#define EF_IA_64_CONS_GP (1 << 6) /* gp as program wide constant. */ -#define EF_IA_64_NOFUNCDESC_CONS_GP (1 << 7) /* And no function descriptors. */ +#define EF_IA_64_CONS_GP (1 << 6) /* gp as program wide constant. */ +#define EF_IA_64_NOFUNCDESC_CONS_GP (1 << 7) /* And no function descriptors. */ /* Not used yet. */ #define EF_IA_64_ABSOLUTE (1 << 8) /* Load at absolute addresses. */ @@ -54,13 +53,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Bits in the sh_flags field of Elf64_Shdr: */ -#define SHF_IA_64_SHORT 0x10000000 /* section near gp */ -#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ +#define SHF_IA_64_SHORT 0x10000000 /* Section near gp. */ +#define SHF_IA_64_NORECOV 0x20000000 /* Spec insns w/o recovery. */ /* Possible values for sh_type in Elf64_Shdr: */ -#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ -#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ +#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* Extension bits. */ +#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* Unwind bits. */ +#define SHT_IA_64_LOPSREG (SHT_LOPROC + 0x8000000) +/* ABI says (SHT_LOPROC + 0xfffffff) but I think it's a typo -- this makes sense. */ +#define SHT_IA_64_HIPSREG (SHT_LOPROC + 0x8ffffff) +#define SHT_IA_64_PRIORITY_INIT (SHT_LOPROC + 0x9000000) /* SHT_IA_64_HP_OPT_ANOT is only generated by HPUX compilers for its optimization annotation section. GCC does not generate it but we @@ -74,8 +77,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Possible values for p_type in Elf64_Phdr: */ -#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ -#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ +#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* Arch extension bits, */ +#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* IA64 unwind bits. */ /* HP-UX specific values for p_type in Elf64_Phdr. These values are currently just used to make @@ -92,10 +95,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This section only used by HP-UX, The HP linker gives weak symbols precedence over regular common symbols. We want common to override weak. Using this common instead of SHN_COMMON does that. */ - #define SHN_IA_64_ANSI_COMMON 0xFF00 -/* ia64-specific relocation types: */ +/* IA64-specific relocation types: */ /* Relocs apply to specific instructions within a bundle. The least significant 2 bits of the address indicate which instruction in the diff --git a/include/elf/ppc.h b/include/elf/ppc.h index 21c6743..52bcc1e 100644 --- a/include/elf/ppc.h +++ b/include/elf/ppc.h @@ -73,17 +73,17 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) /* Relocs added to support TLS. */ RELOC_NUMBER (R_PPC_TLS, 67) - RELOC_NUMBER (R_PPC_DTPMOD64, 68) + RELOC_NUMBER (R_PPC_DTPMOD32, 68) RELOC_NUMBER (R_PPC_TPREL16, 69) RELOC_NUMBER (R_PPC_TPREL16_LO, 70) RELOC_NUMBER (R_PPC_TPREL16_HI, 71) RELOC_NUMBER (R_PPC_TPREL16_HA, 72) - RELOC_NUMBER (R_PPC_TPREL64, 73) + RELOC_NUMBER (R_PPC_TPREL32, 73) RELOC_NUMBER (R_PPC_DTPREL16, 74) RELOC_NUMBER (R_PPC_DTPREL16_LO, 75) RELOC_NUMBER (R_PPC_DTPREL16_HI, 76) RELOC_NUMBER (R_PPC_DTPREL16_HA, 77) - RELOC_NUMBER (R_PPC_DTPREL64, 78) + RELOC_NUMBER (R_PPC_DTPREL32, 78) RELOC_NUMBER (R_PPC_GOT_TLSGD16, 79) RELOC_NUMBER (R_PPC_GOT_TLSGD16_LO, 80) RELOC_NUMBER (R_PPC_GOT_TLSGD16_HI, 81) @@ -130,6 +130,8 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) END_RELOC_NUMBERS (R_PPC_max) +#define IS_PPC_TLS_RELOC(R) \ + ((R) >= R_PPC_TLS && (R) <= R_PPC_GOT_DTPREL16_HA) /* Processor specific flags for the ELF header e_flags field. */ diff --git a/include/elf/ppc64.h b/include/elf/ppc64.h index 8b80187..ee2b0ea 100644 --- a/include/elf/ppc64.h +++ b/include/elf/ppc64.h @@ -143,7 +143,7 @@ START_RELOC_NUMBERS (elf_ppc64_reloc_type) END_RELOC_NUMBERS (R_PPC64_max) -#define IS_TLS_RELOC(R) \ +#define IS_PPC64_TLS_RELOC(R) \ ((R) >= R_PPC64_TLS && (R) <= R_PPC64_DTPREL16_HIGHESTA) /* Specify the start of the .glink section. */ diff --git a/include/elf/sh.h b/include/elf/sh.h index 41bf0bf..00a5f2a 100644 --- a/include/elf/sh.h +++ b/include/elf/sh.h @@ -56,7 +56,8 @@ : (((mach1) == EF_SH3E && (mach2) == EF_SH_UNKNOWN) \ || ((mach2) == EF_SH3E && (mach1) == EF_SH_UNKNOWN)) \ ? EF_SH4 \ - : ((mach1) > (mach2) ? (mach1) : (mach2))) + : (((mach1) == EF_SH2E ? 7 : (mach1)) > ((mach2) == EF_SH2E ? 7 : (mach2)) \ + ? (mach1) : (mach2))) /* Flags for the st_other symbol field. Keep away from the STV_ visibility flags (bit 0..1). */ diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index b36341d..f60f7b1 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,3 +1,17 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * remote-sim.h (sim_open, sim_load, sim_create_inferior): Rename + _bfd to bfd. + +2003-02-20 Andrew Cagney <ac131313@redhat.com> + + * remote-sim.h (SIM_RC): Delete unused SIM_RC_UNKNOWN_BREAKPOINT, + SIM_RC_INSUFFICIENT_RESOURCES and SIM_RC_DUPLICATE_BREAKPOINT. + (sim_set_breakpoint, sim_clear_breakpoint): Delete declarations. + (sim_clear_all_breakpoints, sim_enable_breakpoint): Ditto. + (sim_enable_all_breakpoints, sim_disable_breakpoint): Ditto. + (sim_disable_all_breakpoints): Ditto. + 2002-12-26 Kazu Hirata <kazu@cs.umass.edu> * sim-h8300.h: Remove ^M. diff --git a/include/gdb/remote-sim.h b/include/gdb/remote-sim.h index 14d90b4..a49ba1a 100644 --- a/include/gdb/remote-sim.h +++ b/include/gdb/remote-sim.h @@ -58,16 +58,13 @@ typedef enum { typedef enum { SIM_RC_FAIL = 0, - SIM_RC_OK = 1, - SIM_RC_UNKNOWN_BREAKPOINT = 2, - SIM_RC_INSUFFICIENT_RESOURCES = 3, - SIM_RC_DUPLICATE_BREAKPOINT = 4 + SIM_RC_OK = 1 } SIM_RC; /* The bfd struct, as an opaque type. */ -struct _bfd; +struct bfd; /* Main simulator entry points. */ @@ -108,7 +105,7 @@ struct _bfd; sim_create_inferior. FIXME: What should the state of the simulator be? */ -SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct _bfd *abfd, char **argv)); +SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, char **argv)); /* Destory a simulator instance. @@ -145,7 +142,7 @@ void sim_close PARAMS ((SIM_DESC sd, int quitting)); Such manipulation should probably (?) occure in sim_create_inferior. */ -SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tty)); +SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty)); /* Prepare to run the simulated program. @@ -165,7 +162,7 @@ SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tt address space (according to the applicable ABI) and the program counter and stack pointer set accordingly. */ -SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct _bfd *abfd, char **argv, char **env)); +SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct bfd *abfd, char **argv, char **env)); /* Fetch LENGTH bytes of the simulated program's memory. Start fetch @@ -278,19 +275,6 @@ void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc)); void sim_do_command PARAMS ((SIM_DESC sd, char *cmd)); -/* Call these functions to set and clear breakpoints at ADDR. */ - -SIM_RC sim_set_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_clear_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_clear_all_breakpoints PARAMS ((SIM_DESC sd)); - -/* These functions are used to enable and disable breakpoints. */ - -SIM_RC sim_enable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_disable_breakpoint PARAMS ((SIM_DESC sd, SIM_ADDR addr)); -SIM_RC sim_enable_all_breakpoints PARAMS ((SIM_DESC sd)); -SIM_RC sim_disable_all_breakpoints PARAMS ((SIM_DESC sd)); - #ifdef __cplusplus } #endif diff --git a/include/libiberty.h b/include/libiberty.h index f9916c5..676ceab 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -85,6 +85,10 @@ extern char *basename (); extern const char *lbasename PARAMS ((const char *)); +/* A well-defined realpath () that is always compiled in. */ + +extern char *lrealpath PARAMS ((const char *)); + /* Concatenate an arbitrary number of strings. You must pass NULL as the last argument of this function, to terminate the list of strings. Allocates memory using xmalloc. */ @@ -242,6 +246,10 @@ extern char *xstrdup PARAMS ((const char *)) ATTRIBUTE_MALLOC; extern PTR xmemdup PARAMS ((const PTR, size_t, size_t)) ATTRIBUTE_MALLOC; +/* Physical memory routines. Return values are in BYTES. */ +extern double physmem_total PARAMS ((void)); +extern double physmem_available PARAMS ((void)); + /* hex character manipulation routines */ #define _hex_array_size 256 diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index c7c4484..f04439c 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,7 @@ +2003-02-21 Noida D.Venkatasubramanian <dvenkat@noida.hcltech.com> + + * h8300.h (ldmac, stmac): Replace MACREG with MS32 and MD32. + 2003-01-23 Alan Modra <amodra@bigpond.net.au> * m68hc11.h (cpu6812s): Define. diff --git a/include/opcode/h8300.h b/include/opcode/h8300.h index 4141c57..034c7bc 100644 --- a/include/opcode/h8300.h +++ b/include/opcode/h8300.h @@ -1,5 +1,5 @@ /* Opcode table for the H8/300 - Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000, 2002 + Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com>. @@ -48,7 +48,7 @@ typedef int op_type; #define L_32 0x04 #define L_P 0x08 #define L_24 0x10 -#define MEMRELAX 0x20 /* move insn which may relax */ +#define MEMRELAX 0x20 /* Move insn which may relax. */ #define SRC 0x40 #define DST 0x80 @@ -66,10 +66,10 @@ typedef int op_type; #define DBIT 0x80000 #define DISPREG 0x100000 #define IGNORE 0x200000 -#define E 0x400000 /* FIXME: end of nibble sequence? */ +#define E 0x400000 /* FIXME: end of nibble sequence? */ #define L_2 0x800000 -#define B30 0x1000000 /* bit 3 must be low */ -#define B31 0x2000000 /* bit 3 must be high */ +#define B30 0x1000000 /* Bit 3 must be low. */ +#define B31 0x2000000 /* Bit 3 must be high. */ #define CCR 0x4000000 #define ABS 0x8000000 #define ABSJMP 0x10000000 @@ -77,54 +77,57 @@ typedef int op_type; #define PCREL 0x40000000 #define MEMIND 0x80000000 -#define IMM3 IMM|L_3 -#define IMM2 IMM|L_2 +#define IMM3 IMM | L_3 +#define IMM2 IMM | L_2 -#define SIZE (L_2|L_3|L_8|L_16|L_32|L_P|L_24) -#define MODE (REG|IMM|DISP|IND|INC|DEC|CCR|ABS|MEMIND|EXR) +#define SIZE (L_2 | L_3 | L_8 | L_16 | L_32 | L_P | L_24) +#define MODE (REG | IMM | DISP | IND | INC | DEC | CCR | ABS | MEMIND | EXR) -#define RD8 (DST|L_8|REG) -#define RD16 (DST|L_16|REG) -#define RD32 (DST|L_32|REG) -#define RS8 (SRC|L_8|REG) -#define RS16 (SRC|L_16|REG) -#define RS32 (SRC|L_32|REG) +#define RD8 (DST | L_8 | REG) +#define RD16 (DST | L_16 | REG) +#define RD32 (DST | L_32 | REG) +#define RS8 (SRC | L_8 | REG) +#define RS16 (SRC | L_16 | REG) +#define RS32 (SRC | L_32 | REG) -#define RSP (SRC|L_P|REG) -#define RDP (DST|L_P|REG) +#define RSP (SRC | L_P | REG) +#define RDP (DST | L_P | REG) -#define IMM8 (IMM|SRC|L_8) -#define IMM16 (IMM|SRC|L_16) -#define IMM32 (IMM|SRC|L_32) +#define IMM8 (IMM | SRC | L_8) +#define IMM16 (IMM | SRC | L_16) +#define IMM32 (IMM | SRC | L_32) -#define ABS8SRC (SRC|ABS|L_8|ABS8MEM) -#define ABS8DST (DST|ABS|L_8|ABS8MEM) +#define ABS8SRC (SRC | ABS | L_8 | ABS8MEM) +#define ABS8DST (DST | ABS | L_8 | ABS8MEM) -#define DISP8 (PCREL|L_8) -#define DISP16 (PCREL|L_16) +#define DISP8 (PCREL | L_8) +#define DISP16 (PCREL | L_16) -#define DISP8SRC (DISP|L_8|SRC) -#define DISP16SRC (DISP|L_16|SRC) +#define DISP8SRC (DISP | L_8 | SRC) +#define DISP16SRC (DISP | L_16 | SRC) -#define DISP8DST (DISP|L_8|DST) -#define DISP16DST (DISP|L_16|DST) +#define DISP8DST (DISP | L_8 | DST) +#define DISP16DST (DISP | L_16 | DST) -#define ABS16SRC (SRC|ABS|L_16) -#define ABS16DST (DST|ABS|L_16) -#define ABS24SRC (SRC|ABS|L_24) -#define ABS24DST (DST|ABS|L_24) -#define ABS32SRC (SRC|ABS|L_32) -#define ABS32DST (DST|ABS|L_32) +#define ABS16SRC (SRC | ABS | L_16) +#define ABS16DST (DST | ABS | L_16) +#define ABS24SRC (SRC | ABS | L_24) +#define ABS24DST (DST | ABS | L_24) +#define ABS32SRC (SRC | ABS | L_32) +#define ABS32DST (DST | ABS | L_32) -#define RDDEC (DST|DEC) -#define RSINC (SRC|INC) -#define RDINC (DST|INC) +#define RDDEC (DST | DEC) +#define RSINC (SRC | INC) +#define RDINC (DST | INC) -#define RDIND (DST|IND) -#define RSIND (SRC|IND) +#define RDIND (DST | IND) +#define RSIND (SRC | IND) + +#define MS32 (SRC | L_32 | MACREG) +#define MD32 (DST | L_32 | MACREG) #if 1 -#define OR8 RS8 /* ??? OR as in One Register? */ +#define OR8 RS8 /* ??? OR as in One Register? */ #define OR16 RS16 #define OR32 RS32 #else @@ -211,7 +214,7 @@ struct h8_opcode #define PREFIXLDC 0x0,0x1,0x4,0x0 -#define O(op, size) (op*4+size) +#define O(op, size) (op * 4 + size) #define O_RECOMPILE 0 #define O_ADD 1 @@ -316,7 +319,6 @@ struct h8_opcode #define SL 2 #define SN 3 - /* FIXME: Lots of insns have "E, 0, 0, 0, 0" in the nibble code sequences. Methinks the zeroes aren't necessary. Once confirmed, nuke 'em. */ @@ -596,8 +598,8 @@ const struct h8_opcode h8_opcodes[] = NEW_SOP(O(O_CLRMAC,SN),1,2,"clrmac"),{{E, 0, 0}},{{0x0,0x1,0xa,0x0,E}} EOP, NEW_SOP(O(O_MAC,SL),1,2,"mac"),{{RSINC,RDINC,E}},{{0x0,0x1,0x6,0x0,0x6,0xd,B30|RSINC,B30|RDINC,E}} EOP, - NEW_SOP(O(O_LDMAC,SL),1,2,"ldmac"),{{RS32,MACREG,E}},{{0x0,0x3,MACREG,RS32,E}} EOP, - NEW_SOP(O(O_STMAC,SL),1,2,"stmac"),{{MACREG,RD32,E}},{{0x0,0x2,MACREG,RD32,E}} EOP, + NEW_SOP(O(O_LDMAC,SL),1,2,"ldmac"),{{RS32,MD32,E}},{{0x0,0x3,MD32,RS32,E}} EOP, + NEW_SOP(O(O_STMAC,SL),1,2,"stmac"),{{MS32,RD32,E}},{{0x0,0x2,MS32,RD32,E}} EOP, NEW_SOP(O(O_LDM,SL),0,6,"ldm.l"),{{RSINC, RS32, E}},{{ 0x0,0x1,IGNORE,0x0,0x6,0xD,0x7,IGNORE,E}}EOP, NEW_SOP(O(O_STM,SL),0,6,"stm.l"),{{RS32, RDDEC, E}},{{0x0,0x1,IGNORE,0x0,0x6,0xD,0xF,IGNORE,E}}EOP, {0, 0, 0, NULL, {{0,0,0}}, {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}} diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 57acfc0..b3e904f 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,112 @@ +2003-03-03 Mark Mitchell <mark@codesourcery.com> + + * cplus-dem.c: Add license exception to copyright notice. + +2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * physmem.c: Formatting changes from upstream. + +2003-02-24 Danny Smith <dannysmith@users.source.forge.net> + + * physmem.c (physmem_total): Add _WIN32 support. + (physmem_available): Likewise. + +2003-02-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + + * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Test for + GSI_PHYSMEM. + (physmem_available) [HAVE_TABLE]: Test for TBL_VMSTATS. + +2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * configure.in: Check for sys/systemcfg.h and + _system_configuration. + * physmem.c: Add support for AIX. Tweek formatting as per + upstream coreutils beta. + +2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + Richard Earnshaw <rearnsha@arm.com> + Geoffrey Keating <geoffk@apple.com> + + * configure.in: Check for sys/sysctl.h and sysctl. + * physmem.c: Add support for *bsd and darwin. + * Makefile.in: Generate depedency for physmem.o. + +2003-02-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + + * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Use getsysinfo on + Tru64 UNIX. + (physmem_available) [HAVE_TABLE && HAVE_SYS_TABLE_H]: Use table on + Tru64 UNIX. + + * configure.in (AC_CHECK_HEADERS): Check for sys/sysinfo.h, + machine/hal_sysinfo.h, sys/table.h. + (checkfuncs, AC_CHECKFUNCS): Check for getsysinfo, table. + * configure, config.in: Regenerate. + +2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * physmem.c (physmem_total, physmem_available): De-ANSI-fy. + * configure.in (AC_CHECK_FUNCS): Add pstat_getstatic and + pstat_getdynamic. + +2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * Makefile.in (CFILES): Add physmem.c. + (REQUIRED_OFILES): Add physmem.o. + * configure.in: Check for sys/pstat.h. + (checkfuncs): Add pstat_getstatic and pstat_getdynamic. + * physmem.c: New file, copied from textutils. + + * config.in, configure: Regenerated. + +2003-02-20 Daniel Jacobowitz <drow@mvista.com> + + * Makefile.in (CFILES): Add lrealpath.c. + (REQUIRED_OFILES): Add lrealpath.o. + (lrealpath.o): Add rule. + * aclocal.m4 (libiberty_NEED_DECLARATION): Add. + * configure.in: Add realpath and canonicalize_file_name to + checkfuncs and AC_CHECK_FUNCS. Use libiberty_NEED_DECLARATION + for canonicalize_file_name. + * lrealpath.c: New file. + * make-relative-prefix.c: Update documentation. + (make_relative_prefix): Simplify. Use lbasename and lrealpath. + * config.in: Regenerated. + * configure: Regenerated. + * functions.texi: Regenerated. + +2003-02-20 jmc <jmc@prioris.mini.pw.edu.pl> + + * cplus_dem.c: Fix typo: intializes -> initializes. + +2003-02-20 Alexandre Oliva <aoliva@redhat.com> + + * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to + config.status. + * configure: Rebuilt. + +2003-02-13 Daniel Jacobowitz <drow@mvista.com> + + Fix PR c++/7612. + * cplus-dem.c (demangle_signature): Call string_delete. + Remove extra string_init. + (demangle_arm_hp_template): Call string_delete instead of + string_clear. Add missing string_delete call. + (demangle_qualified): Add missing string_delete call. + (do_type): Remove unused variable btype. Add missing string_delete + call. Call string_delete instead of string_clear. + (demangle_fund_type): Move variable btype inside of the switch + statement. Add missing string_delete call. + (do_arg): Call string_delete instead of string_clear. Remove extra + string_init. + (demangle_nested_args): Free work->previous_argument. + +2003-02-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * acconfig.h: New file. Add uintptr_t. + * config.in: Regenerated. + 2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk> * libiberty.texi: Update to GFDL 1.2. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 761c674..0641796 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -137,6 +137,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \ hashtab.c hex.c \ index.c insque.c \ lbasename.c \ + lrealpath.c \ make-relative-prefix.c \ make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \ memset.c mkstemps.c \ @@ -144,7 +145,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \ partition.c \ pex-djgpp.c pex-mpw.c pex-msdos.c pex-os2.c \ pex-unix.c pex-win32.c \ - putenv.c \ + physmem.c putenv.c \ random.c regex.c rename.c rindex.c \ safe-ctype.c setenv.c sigsetmask.c sort.c spaces.c \ splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \ @@ -165,10 +166,11 @@ REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o md5.o \ getopt.o getopt1.o getpwd.o getruntime.o \ hashtab.o hex.o \ lbasename.o \ + lrealpath.o \ make-relative-prefix.o \ make-temp-file.o \ objalloc.o obstack.o \ - partition.o @pexecute@ \ + partition.o physmem.o @pexecute@ \ safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \ strsignal.o \ ternary.o \ @@ -443,6 +445,7 @@ hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \ hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h +lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h @@ -463,6 +466,7 @@ pex-msdos.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ pex-os2.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h pex-unix.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h pex-win32.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +physmem.o: config.h $(INCDIR)/libiberty.h putenv.o: config.h $(INCDIR)/ansidecl.h random.o: $(INCDIR)/ansidecl.h regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 index 103e246..6c5dc6a 100644 --- a/libiberty/aclocal.m4 +++ b/libiberty/aclocal.m4 @@ -87,6 +87,35 @@ then AC_DEFINE(NEED_DECLARATION_ERRNO, 1, fi ]) +dnl See whether we need a declaration for a function. +AC_DEFUN(libiberty_NEED_DECLARATION, +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_CACHE_VAL(libiberty_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include "confdefs.h" +#include <stdio.h> +#ifdef HAVE_STRING_H +#include <string.h> +#else +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif], +[char *(*pfn) = (char *(*)) $1], +libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)]) +AC_MSG_RESULT($libiberty_cv_decl_needed_$1) +if test $libiberty_cv_decl_needed_$1 = yes; then + AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, + [Define if $1 is not declared in system header files.]) +fi +])dnl + # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We # are probably using a cross compiler, which will not be able to fully diff --git a/libiberty/config.in b/libiberty/config.in index e06bbce..f0e1746 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -1,4 +1,4 @@ -/* config.in. Generated automatically from configure.in by autoheader 2.13. */ +/* config.in. Generated automatically from configure.in by autoheader. */ /* Define to empty if the keyword does not work. */ #undef const @@ -15,6 +15,9 @@ /* Define as __inline if that's what the C compiler calls it. */ #undef inline +/* Define if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + /* Define to `int' if <sys/types.h> doesn't define. */ #undef pid_t @@ -30,6 +33,9 @@ /* Define vfork as fork if vfork does not work. */ #undef vfork +/* Define to `unsigned long' if <sys/types.h> doesn't define. */ +#undef uintptr_t + /* Define if you have the _doprnt function. */ #undef HAVE__DOPRNT @@ -57,6 +63,9 @@ /* Define if you have the calloc function. */ #undef HAVE_CALLOC +/* Define if you have the canonicalize_file_name function. */ +#undef HAVE_CANONICALIZE_FILE_NAME + /* Define if you have the clock function. */ #undef HAVE_CLOCK @@ -72,6 +81,9 @@ /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE +/* Define if you have the getsysinfo function. */ +#undef HAVE_GETSYSINFO + /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY @@ -105,12 +117,21 @@ /* Define if you have the psignal function. */ #undef HAVE_PSIGNAL +/* Define if you have the pstat_getdynamic function. */ +#undef HAVE_PSTAT_GETDYNAMIC + +/* Define if you have the pstat_getstatic function. */ +#undef HAVE_PSTAT_GETSTATIC + /* Define if you have the putenv function. */ #undef HAVE_PUTENV /* Define if you have the random function. */ #undef HAVE_RANDOM +/* Define if you have the realpath function. */ +#undef HAVE_REALPATH + /* Define if you have the rename function. */ #undef HAVE_RENAME @@ -162,6 +183,15 @@ /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF +/* Define if you have the sysctl function. */ +#undef HAVE_SYSCTL + +/* Define if you have the sysmp function. */ +#undef HAVE_SYSMP + +/* Define if you have the table function. */ +#undef HAVE_TABLE + /* Define if you have the times function. */ #undef HAVE_TIMES @@ -192,6 +222,9 @@ /* Define if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H +/* Define if you have the <machine/hal_sysinfo.h> header file. */ +#undef HAVE_MACHINE_HAL_SYSINFO_H + /* Define if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -210,12 +243,30 @@ /* Define if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H +/* Define if you have the <sys/pstat.h> header file. */ +#undef HAVE_SYS_PSTAT_H + /* Define if you have the <sys/resource.h> header file. */ #undef HAVE_SYS_RESOURCE_H /* Define if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H +/* Define if you have the <sys/sysctl.h> header file. */ +#undef HAVE_SYS_SYSCTL_H + +/* Define if you have the <sys/sysinfo.h> header file. */ +#undef HAVE_SYS_SYSINFO_H + +/* Define if you have the <sys/sysmp.h> header file. */ +#undef HAVE_SYS_SYSMP_H + +/* Define if you have the <sys/systemcfg.h> header file. */ +#undef HAVE_SYS_SYSTEMCFG_H + +/* Define if you have the <sys/table.h> header file. */ +#undef HAVE_SYS_TABLE_H + /* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H @@ -240,6 +291,9 @@ /* Define if you have the sys_siglist variable. */ #undef HAVE_SYS_SIGLIST +/* Define if you have the _system_configuration variable. */ +#undef HAVE__SYSTEM_CONFIGURATION + /* 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. */ @@ -252,3 +306,6 @@ STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION +/* Define if canonicalize_file_name is not declared in system header files. */ +#undef NEED_DECLARATION_CANONICALIZE_FILE_NAME + diff --git a/libiberty/configure b/libiberty/configure index 86037ae..3f46ebf 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1356,7 +1356,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h +for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1735,9 +1735,11 @@ funcs="$funcs waitpid" # Also in the old function.def file: alloca, vfork, getopt. -vars="sys_errlist sys_nerr sys_siglist" +vars="sys_errlist sys_nerr sys_siglist _system_configuration" checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" +checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" +checkfuncs="$checkfuncs getsysinfo table sysctl" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. @@ -1745,12 +1747,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1749: checking for $ac_func" >&5 +echo "configure:1751: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1754 "configure" +#line 1756 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1773,7 +1775,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1800,12 +1802,12 @@ done for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1804: checking for $ac_func" >&5 +echo "configure:1806: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1809 "configure" +#line 1811 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1828,7 +1830,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1855,12 +1857,12 @@ done for ac_func in memmove memset putenv random rename rindex sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1859: checking for $ac_func" >&5 +echo "configure:1861: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1864 "configure" +#line 1866 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1883,7 +1885,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1910,12 +1912,12 @@ done for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1914: checking for $ac_func" >&5 +echo "configure:1916: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1919 "configure" +#line 1921 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1938,7 +1940,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1965,12 +1967,12 @@ done for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1969: checking for $ac_func" >&5 +echo "configure:1971: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1974 "configure" +#line 1976 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1993,7 +1995,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2020,12 +2022,12 @@ done for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2024: checking for $ac_func" >&5 +echo "configure:2026: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2029 "configure" +#line 2031 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2048,7 +2050,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2075,12 +2077,12 @@ done for ac_func in sysconf times sbrk gettimeofday ffs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2079: checking for $ac_func" >&5 +echo "configure:2081: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2084 "configure" +#line 2086 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2103,7 +2105,117 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2136: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2141 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { + +/* 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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + for ac_func in realpath canonicalize_file_name +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2191: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2196 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { + +/* 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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2139,6 +2251,10 @@ EOF #define HAVE_SYS_SIGLIST 1 EOF + cat >> confdefs.h <<\EOF +#define HAVE__SYSTEM_CONFIGURATION 1 +EOF + fi # For each of these functions, if the host does not provide the @@ -2333,7 +2449,7 @@ if test -z "${setobjs}"; then # We haven't set the list of objects yet. Use the standard autoconf # tests. This will only work if the compiler works. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2337: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2453: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2344,12 +2460,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2348 "configure" +#line 2464 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2469: \"$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 @@ -2375,19 +2491,19 @@ 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:2379: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2495: 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 for ac_func in $funcs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2386: checking for $ac_func" >&5 +echo "configure:2502: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2391 "configure" +#line 2507 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2410,7 +2526,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2437,12 +2553,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2441: checking whether alloca needs Cray hooks" >&5 +echo "configure:2557: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2446 "configure" +#line 2562 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2467,12 +2583,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2471: checking for $ac_func" >&5 +echo "configure:2587: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2476 "configure" +#line 2592 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2495,7 +2611,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2521,7 +2637,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2525: checking stack direction for C alloca" >&5 +echo "configure:2641: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2529,7 +2645,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2533 "configure" +#line 2649 "configure" #include "confdefs.h" find_stack_direction () { @@ -2548,7 +2664,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2570,17 +2686,17 @@ EOF ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2574: checking for vfork.h" >&5 +echo "configure:2690: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2579 "configure" +#line 2695 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2605,18 +2721,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2609: checking for working vfork" >&5 +echo "configure:2725: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2615: checking for vfork" >&5 +echo "configure:2731: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2620 "configure" +#line 2736 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -2639,7 +2755,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2661,7 +2777,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 2665 "configure" +#line 2781 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -2756,7 +2872,7 @@ main() { } } EOF -if { (eval echo configure:2760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2788,12 +2904,12 @@ fi for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2792: checking for $ac_func" >&5 +echo "configure:2908: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2797 "configure" +#line 2913 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2816,7 +2932,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2846,12 +2962,12 @@ done for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2850: checking for $ac_func" >&5 +echo "configure:2966: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2855 "configure" +#line 2971 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2874,7 +2990,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2902,19 +3018,19 @@ done for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2906: checking for $v" >&5 +echo "configure:3022: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2911 "configure" +#line 3027 "configure" #include "confdefs.h" int *p; int main() { extern int $v []; p = $v; ; return 0; } EOF -if { (eval echo configure:2918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2940,12 +3056,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2944: checking for $ac_func" >&5 +echo "configure:3060: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2949 "configure" +#line 3065 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2968,7 +3084,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2992,6 +3108,54 @@ else fi done + echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 +echo "configure:3113: checking whether canonicalize_file_name must be declared" >&5 +if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3118 "configure" +#include "confdefs.h" + +#include "confdefs.h" +#include <stdio.h> +#ifdef HAVE_STRING_H +#include <string.h> +#else +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +int main() { +char *(*pfn) = (char *(*)) canonicalize_file_name +; return 0; } +EOF +if { (eval echo configure:3140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + libiberty_cv_decl_needed_canonicalize_file_name=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + libiberty_cv_decl_needed_canonicalize_file_name=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$libiberty_cv_decl_needed_canonicalize_file_name" 1>&6 +if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1 +EOF + +fi + fi # Figure out which version of pexecute to use. @@ -3004,21 +3168,21 @@ case "${host}" in esac -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h +for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3012: checking for $ac_hdr" >&5 +echo "configure:3176: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3017 "configure" +#line 3181 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3047,12 +3211,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3051: checking for $ac_func" >&5 +echo "configure:3215: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3056 "configure" +#line 3220 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3075,7 +3239,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3100,7 +3264,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3104: checking for working mmap" >&5 +echo "configure:3268: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3108,7 +3272,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3112 "configure" +#line 3276 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3136,24 +3300,11 @@ else #include <fcntl.h> #include <sys/mman.h> -#if HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif - -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif - -#if HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif - -#if HAVE_UNISTD_H -# include <unistd.h> -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3261,7 +3412,7 @@ main() } EOF -if { (eval echo configure:3265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3285,7 +3436,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3289: checking for working strncmp" >&5 +echo "configure:3440: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3293,7 +3444,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <<EOF -#line 3297 "configure" +#line 3448 "configure" #include "confdefs.h" /* Test by Jim Wilson and Kaveh Ghazi. @@ -3357,7 +3508,7 @@ main () } EOF -if { (eval echo configure:3361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else @@ -3772,6 +3923,7 @@ with_build_subdir=${with_build_subdir} with_multisubdir=${with_multisubdir} ac_configure_args="--enable-multilib ${ac_configure_args}" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" libiberty_topdir=${libiberty_topdir} EOF diff --git a/libiberty/configure.in b/libiberty/configure.in index 1329f13..5b38660 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -142,7 +142,7 @@ AC_SUBST_FILE(host_makefile_frag) # It's OK to check for header files. Although the compiler may not be # able to link anything, it had better be able to at least compile # something. -AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h) +AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h) AC_HEADER_SYS_WAIT AC_HEADER_TIME @@ -204,9 +204,11 @@ funcs="$funcs waitpid" # Also in the old function.def file: alloca, vfork, getopt. -vars="sys_errlist sys_nerr sys_siglist" +vars="sys_errlist sys_nerr sys_siglist _system_configuration" checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" +checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" +checkfuncs="$checkfuncs getsysinfo table sysctl" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. @@ -218,9 +220,12 @@ if test "x" = "y"; then AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs) + AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl) + AC_CHECK_FUNCS(realpath canonicalize_file_name) AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) + AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.]) fi # For each of these functions, if the host does not provide the @@ -424,6 +429,7 @@ if test -z "${setobjs}"; then fi done AC_CHECK_FUNCS($checkfuncs) + libiberty_NEED_DECLARATION(canonicalize_file_name) fi # Figure out which version of pexecute to use. @@ -466,5 +472,6 @@ with_build_subdir=${with_build_subdir} with_multisubdir=${with_multisubdir} ac_configure_args="--enable-multilib ${ac_configure_args}" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" libiberty_topdir=${libiberty_topdir} ) diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index f42d618..af35bc1 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -11,6 +11,15 @@ modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +In addition to the permissions in the GNU Library General Public +License, the Free Software Foundation gives you unlimited permission +to link the compiled version of this file into combinations with other +programs, and to distribute those combinations without any restriction +coming from the use of this file. (The Library Public License +restrictions do apply in other respects; for example, they cover +modification of the file, and distribution when not linked into a +combined executable.) + Libiberty 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 @@ -1064,7 +1073,7 @@ ada_demangle (mangled, option) /* This function performs most of what cplus_demangle use to do, but to be able to demangle a name with a B, K or n code, we need to have a longer term memory of what types have been seen. The original - now intializes and cleans up the squangle code info, while internal + now initializes and cleans up the squangle code info, while internal calls go directly to this routine to avoid resetting that info. */ static char * @@ -1429,6 +1438,7 @@ demangle_signature (work, mangled, declp) { string_append (&s, SCOPE_STRING (work)); string_prepends (declp, &s); + string_delete (&s); } oldmangled = NULL; expect_func = 1; @@ -1508,7 +1518,6 @@ demangle_signature (work, mangled, declp) { /* Read the return type. */ string return_type; - string_init (&return_type); (*mangled)++; success = do_type (work, mangled, &return_type); @@ -2321,7 +2330,7 @@ demangle_arm_hp_template (work, mangled, n, declp) string_append (declp, "<"); while (1) { - string_clear (&arg); + string_delete (&arg); switch (**mangled) { case 'T': @@ -2378,7 +2387,7 @@ demangle_arm_hp_template (work, mangled, n, declp) string_append (declp, "<"); /* should do error checking here */ while (args < e) { - string_clear (&arg); + string_delete (&arg); /* Check for type or literal here */ switch (*args) @@ -2393,6 +2402,7 @@ demangle_arm_hp_template (work, mangled, n, declp) goto cfront_template_args_done; string_append (&arg, "("); string_appends (&arg, &type_str); + string_delete (&type_str); string_append (&arg, ")"); if (*args != 'L') goto cfront_template_args_done; @@ -3350,6 +3360,7 @@ demangle_qualified (work, mangled, result, isfuncname, append) } else { + string_delete (&last_name); success = do_type (work, mangled, &last_name); if (!success) break; @@ -3492,10 +3503,8 @@ do_type (work, mangled, result) string decl; const char *remembered_type; int type_quals; - string btype; type_kind_t tk = tk_none; - string_init (&btype); string_init (&decl); string_init (result); @@ -3613,6 +3622,7 @@ do_type (work, mangled, result) string temp; do_type (work, mangled, &temp); string_prepends (&decl, &temp); + string_delete (&temp); } else if (**mangled == 't') { @@ -3623,7 +3633,7 @@ do_type (work, mangled, result) if (success) { string_prependn (&decl, temp.b, temp.p - temp.b); - string_clear (&temp); + string_delete (&temp); } else break; @@ -3803,11 +3813,8 @@ demangle_fund_type (work, mangled, result) int success = 1; char buf[10]; unsigned int dec = 0; - string btype; type_kind_t tk = tk_integral; - string_init (&btype); - /* First pick off any type qualifiers. There can be more than one. */ while (!done) @@ -3979,8 +3986,11 @@ demangle_fund_type (work, mangled, result) } case 't': { + string btype; + string_init (&btype); success = demangle_template (work, mangled, &btype, 0, 1, 1); string_appends (result, &btype); + string_delete (&btype); break; } default: @@ -4182,12 +4192,9 @@ do_arg (work, mangled, result) do not want to add additional types to the back-referenceable type vector when processing a repeated type. */ if (work->previous_argument) - string_clear (work->previous_argument); + string_delete (work->previous_argument); else - { - work->previous_argument = (string*) xmalloc (sizeof (string)); - string_init (work->previous_argument); - } + work->previous_argument = (string*) xmalloc (sizeof (string)); if (!do_type (work, mangled, work->previous_argument)) return 0; @@ -4551,7 +4558,10 @@ demangle_nested_args (work, mangled, declp) /* Restore the previous_argument field. */ if (work->previous_argument) - string_delete (work->previous_argument); + { + string_delete (work->previous_argument); + free ((char *) work->previous_argument); + } work->previous_argument = saved_previous_argument; --work->forgetting_types; work->nrepeats = saved_nrepeats; diff --git a/libiberty/functions.texi b/libiberty/functions.texi index 18b2480..2c7b9e1 100644 --- a/libiberty/functions.texi +++ b/libiberty/functions.texi @@ -392,19 +392,38 @@ and a path ending in @code{/} returns the empty string after it. @end deftypefn -@c make-relative-prefix.c:24 -@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix}) +@c lrealpath.c:25 +@deftypefn Replacement {const char*} lrealpath (const char *@var{name}) + +Given a pointer to a string containing a pathname, returns a canonical +version of the filename. Symlinks will be resolved, and ``.'' and ``..'' +components will be simplified. The returned value will be allocated using +@code{xmalloc} or @code{malloc}. -Given three strings @var{progname}, @var{bin_prefix}, @var{prefix}, return a string -that gets to @var{prefix} starting with the directory portion of @var{progname} and -a relative pathname of the difference between @var{bin_prefix} and @var{prefix}. +@end deftypefn -For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, @var{prefix} -is @code{/alpha/beta/gamma/omega/}, and @var{progname} is @code{/red/green/blue/gcc}, -then this function will return @code{/red/green/blue/../../omega/}. +@c make-relative-prefix.c:24 +@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix}) -The return value is normally allocated via @code{malloc}. If no relative prefix -can be found, return @code{NULL}. +Given three paths @var{progname}, @var{bin_prefix}, @var{prefix}, +return the path that is in the same position relative to +@var{progname}'s directory as @var{prefix} is relative to +@var{bin_prefix}. That is, a string starting with the directory +portion of @var{progname}, followed by a relative pathname of the +difference between @var{bin_prefix} and @var{prefix}. + +If @var{progname} does not contain any directory separators, +@code{make_relative_prefix} will search @env{PATH} to find a program +named @var{progname}. Also, if @var{progname} is a symbolic link, +the symbolic link will be resolved. + +For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, +@var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is +@code{/red/green/blue/gcc}, then this function will return +@code{/red/green/blue/../../omega/}. + +The return value is normally allocated via @code{malloc}. If no +relative prefix can be found, return @code{NULL}. @end deftypefn diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c index c208cdc..dc4f8d5 100644 --- a/libiberty/make-relative-prefix.c +++ b/libiberty/make-relative-prefix.c @@ -23,16 +23,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA @deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix}) -Given three strings @var{progname}, @var{bin_prefix}, @var{prefix}, return a string -that gets to @var{prefix} starting with the directory portion of @var{progname} and -a relative pathname of the difference between @var{bin_prefix} and @var{prefix}. - -For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, @var{prefix} -is @code{/alpha/beta/gamma/omega/}, and @var{progname} is @code{/red/green/blue/gcc}, -then this function will return @code{/red/green/blue/../../omega/}. - -The return value is normally allocated via @code{malloc}. If no relative prefix -can be found, return @code{NULL}. +Given three paths @var{progname}, @var{bin_prefix}, @var{prefix}, +return the path that is in the same position relative to +@var{progname}'s directory as @var{prefix} is relative to +@var{bin_prefix}. That is, a string starting with the directory +portion of @var{progname}, followed by a relative pathname of the +difference between @var{bin_prefix} and @var{prefix}. + +If @var{progname} does not contain any directory separators, +@code{make_relative_prefix} will search @env{PATH} to find a program +named @var{progname}. Also, if @var{progname} is a symbolic link, +the symbolic link will be resolved. + +For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, +@var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is +@code{/red/green/blue/gcc}, then this function will return +@code{/red/green/blue/../../omega/}. + +The return value is normally allocated via @code{malloc}. If no +relative prefix can be found, return @code{NULL}. @end deftypefn @@ -223,19 +232,14 @@ make_relative_prefix (progname, bin_prefix, prefix) int prog_num, bin_num, prefix_num; int i, n, common; int needed_len; - char *ret, *ptr; + char *ret, *ptr, *full_progname = NULL; if (progname == NULL || bin_prefix == NULL || prefix == NULL) return NULL; - prog_dirs = split_directories (progname, &prog_num); - bin_dirs = split_directories (bin_prefix, &bin_num); - if (bin_dirs == NULL || prog_dirs == NULL) - return NULL; - /* If there is no full pathname, try to find the program by checking in each of the directories specified in the PATH environment variable. */ - if (prog_num == 1) + if (lbasename (progname) == progname) { char *temp; @@ -278,14 +282,7 @@ make_relative_prefix (progname, bin_prefix, prefix) #endif ) { - free_split_directories (prog_dirs); progname = nstore; - prog_dirs = split_directories (progname, &prog_num); - if (prog_dirs == NULL) - { - free_split_directories (bin_dirs); - return NULL; - } break; } @@ -299,6 +296,16 @@ make_relative_prefix (progname, bin_prefix, prefix) } } + full_progname = lrealpath (progname); + if (full_progname == NULL) + return NULL; + + prog_dirs = split_directories (full_progname, &prog_num); + bin_dirs = split_directories (bin_prefix, &bin_num); + free (full_progname); + if (bin_dirs == NULL || prog_dirs == NULL) + return NULL; + /* Remove the program name from comparison of directory names. */ prog_num--; @@ -144,6 +144,19 @@ case $host in # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); 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" @@ -155,6 +168,7 @@ case $host in LD="${LD-ld} -64" ;; esac + fi fi rm -rf conftest* ;; diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh index bdc67f9..9059b1a 100644 --- a/ltcf-cxx.sh +++ b/ltcf-cxx.sh @@ -2,7 +2,7 @@ # ltcf-cxx.sh - Create a C++ compiler specific configuration # -# Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # Original C++ support by:Gary V. Vaughan <gvv@techie.com> @@ -68,11 +68,16 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev # Set up default GNU C++ configuration # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if eval "`$CC -print-prog-name=ld` --version 2>&1" | \ - egrep 'GNU ld' > /dev/null; then - with_gnu_ld=yes - + # archiving commands below assume that GNU ld is being used. The + # assumption here is that the linker is going to be the same as that + # used by the C compiler. For the purposes of GCC, this is ok, but + # if someone uses g++ along with a non-GNU C compiler that doesn't + # use GNU ld, we may lose. This is ok for the toolchain tree, since + # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava, + # anyway, and those use both gcc and g++, so the settings are bound + # to be the same. + + if test "$with_gnu_ld" = yes; then archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' @@ -92,7 +97,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev whole_archive_flag_spec= fi else - with_gnu_ld=no wlarc= # A generic and very simple default shared library creation @@ -110,7 +114,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev else with_gcc=no - with_gnu_ld=no wlarc= fi @@ -323,7 +326,7 @@ case $host_os in if test "$with_gnu_ld" = no; then archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else - archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' fi fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -610,9 +613,9 @@ case $host_os in if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then no_undefined_flag=' ${wl}-z ${wl}defs' if $CC --version | egrep -v '^2\.7' > /dev/null; then - archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -621,9 +624,9 @@ case $host_os in else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when diff --git a/ltcf-gcj.sh b/ltcf-gcj.sh index d33278a..2d70497 100644 --- a/ltcf-gcj.sh +++ b/ltcf-gcj.sh @@ -2,7 +2,7 @@ # ltcf-gcj.sh - Create a GCJ compiler specific configuration # -# Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # Original GCJ support by: @@ -492,9 +492,9 @@ else solaris*) no_undefined_flag=' ${wl}-z ${wl}defs' - archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' + archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -1186,6 +1186,11 @@ hpux9* | hpux10* | hpux11*) ;; irix5* | irix6*) + if test "$with_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi version_type=irix need_lib_prefix=no need_version=no @@ -1197,9 +1202,12 @@ irix5* | irix6*) ;; *) case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *-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 ;; diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 78a8842..42cf257 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,23 @@ +2003-02-25 Alan Modra <amodra@bigpond.net.au> + + * hppa-dis.c: Formatting. + +2003-02-25 Matthew Wilcox <willy@debian.org> + + * hppa-dis.c (print_insn_hppa): Implement fcnv instruction modifiers. + + * hppa-dis.c (print_insn_hppa <2 bit space register>): Do not print + the space register when the value is zero. + +2003-02-23 Elias Athanasopoulos <elathan@phys.uoa.gr> + + * mips-dis.c (print_mips_disassembler_options): Make 'i' unsigned, + use ARRAY_SIZE in loops. + +2003-02-12 Dave Brolley <brolley@redhat.com> + + * fr30-desc.c: Regenerate. + 2003-02-06 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> * i386-dis.c (dq_mode, Edq): Define. diff --git a/opcodes/fr30-desc.c b/opcodes/fr30-desc.c index a404f9b..a263da7 100644 --- a/opcodes/fr30-desc.c +++ b/opcodes/fr30-desc.c @@ -325,6 +325,7 @@ const CGEN_IFLD fr30_cgen_ifld_table[] = { FR30_F_I8, "f-i8", 0, 16, 4, 8, { 0, { (1<<MACH_BASE) } } }, { FR30_F_I20_4, "f-i20-4", 0, 16, 8, 4, { 0, { (1<<MACH_BASE) } } }, { FR30_F_I20_16, "f-i20-16", 16, 16, 0, 16, { 0, { (1<<MACH_BASE) } } }, + { FR30_F_I20, "f-i20", 0, 0, 0, 0,{ 0|A(VIRTUAL), { (1<<MACH_BASE) } } }, { FR30_F_I32, "f-i32", 16, 32, 0, 32, { 0|A(SIGN_OPT), { (1<<MACH_BASE) } } }, { FR30_F_UDISP6, "f-udisp6", 0, 16, 8, 4, { 0, { (1<<MACH_BASE) } } }, { FR30_F_DISP8, "f-disp8", 0, 16, 4, 8, { 0, { (1<<MACH_BASE) } } }, @@ -357,8 +358,8 @@ const CGEN_MAYBE_MULTI_IFLD FR30_F_I20_MULTI_IFIELD []; const CGEN_MAYBE_MULTI_IFLD FR30_F_I20_MULTI_IFIELD [] = { - { 0, { (const PTR) &fr30_cgen_ifld_table[23] } }, - { 0, { (const PTR) &fr30_cgen_ifld_table[24] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I20_4] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I20_16] } }, { 0, { (const PTR) 0 } } }; @@ -379,39 +380,39 @@ const CGEN_OPERAND fr30_cgen_operand_table[] = { /* pc: program counter */ { "pc", FR30_OPERAND_PC, HW_H_PC, 0, 0, - { 0, { (const PTR) &fr30_cgen_ifld_table[0] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_NIL] } }, { 0|A(SEM_ONLY), { (1<<MACH_BASE) } } }, /* Ri: destination register */ { "Ri", FR30_OPERAND_RI, HW_H_GR, 12, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[10] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RI] } }, { 0, { (1<<MACH_BASE) } } }, /* Rj: source register */ { "Rj", FR30_OPERAND_RJ, HW_H_GR, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[9] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RJ] } }, { 0, { (1<<MACH_BASE) } } }, /* Ric: target register coproc insn */ { "Ric", FR30_OPERAND_RIC, HW_H_GR, 12, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[14] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RIC] } }, { 0, { (1<<MACH_BASE) } } }, /* Rjc: source register coproc insn */ { "Rjc", FR30_OPERAND_RJC, HW_H_GR, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[13] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RJC] } }, { 0, { (1<<MACH_BASE) } } }, /* CRi: coprocessor register */ { "CRi", FR30_OPERAND_CRI, HW_H_CR, 12, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[16] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CRI] } }, { 0, { (1<<MACH_BASE) } } }, /* CRj: coprocessor register */ { "CRj", FR30_OPERAND_CRJ, HW_H_CR, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[15] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CRJ] } }, { 0, { (1<<MACH_BASE) } } }, /* Rs1: dedicated register */ { "Rs1", FR30_OPERAND_RS1, HW_H_DR, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[11] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RS1] } }, { 0, { (1<<MACH_BASE) } } }, /* Rs2: dedicated register */ { "Rs2", FR30_OPERAND_RS2, HW_H_DR, 12, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[12] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RS2] } }, { 0, { (1<<MACH_BASE) } } }, /* R13: General Register 13 */ { "R13", FR30_OPERAND_R13, HW_H_R13, 0, 0, @@ -431,51 +432,51 @@ const CGEN_OPERAND fr30_cgen_operand_table[] = { 0, { (1<<MACH_BASE) } } }, /* u4: 4 bit unsigned immediate */ { "u4", FR30_OPERAND_U4, HW_H_UINT, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[17] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U4] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* u4c: 4 bit unsigned immediate */ { "u4c", FR30_OPERAND_U4C, HW_H_UINT, 12, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[18] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U4C] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* u8: 8 bit unsigned immediate */ { "u8", FR30_OPERAND_U8, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[21] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U8] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* i8: 8 bit unsigned immediate */ { "i8", FR30_OPERAND_I8, HW_H_UINT, 4, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[22] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I8] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* udisp6: 6 bit unsigned immediate */ { "udisp6", FR30_OPERAND_UDISP6, HW_H_UINT, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[26] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_UDISP6] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* disp8: 8 bit signed immediate */ { "disp8", FR30_OPERAND_DISP8, HW_H_SINT, 4, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[27] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP8] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* disp9: 9 bit signed immediate */ { "disp9", FR30_OPERAND_DISP9, HW_H_SINT, 4, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[28] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP9] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* disp10: 10 bit signed immediate */ { "disp10", FR30_OPERAND_DISP10, HW_H_SINT, 4, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[29] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP10] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* s10: 10 bit signed immediate */ { "s10", FR30_OPERAND_S10, HW_H_SINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[30] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_S10] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* u10: 10 bit unsigned immediate */ { "u10", FR30_OPERAND_U10, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[31] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U10] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* i32: 32 bit immediate */ { "i32", FR30_OPERAND_I32, HW_H_UINT, 0, 32, - { 0, { (const PTR) &fr30_cgen_ifld_table[25] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I32] } }, { 0|A(HASH_PREFIX)|A(SIGN_OPT), { (1<<MACH_BASE) } } }, /* m4: 4 bit negative immediate */ { "m4", FR30_OPERAND_M4, HW_H_SINT, 8, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[20] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_M4] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* i20: 20 bit immediate */ { "i20", FR30_OPERAND_I20, HW_H_UINT, 0, 20, @@ -483,47 +484,47 @@ const CGEN_OPERAND fr30_cgen_operand_table[] = { 0|A(HASH_PREFIX)|A(VIRTUAL), { (1<<MACH_BASE) } } }, /* dir8: 8 bit direct address */ { "dir8", FR30_OPERAND_DIR8, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[33] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR8] } }, { 0, { (1<<MACH_BASE) } } }, /* dir9: 9 bit direct address */ { "dir9", FR30_OPERAND_DIR9, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[34] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR9] } }, { 0, { (1<<MACH_BASE) } } }, /* dir10: 10 bit direct address */ { "dir10", FR30_OPERAND_DIR10, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[35] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR10] } }, { 0, { (1<<MACH_BASE) } } }, /* label9: 9 bit pc relative address */ { "label9", FR30_OPERAND_LABEL9, HW_H_IADDR, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[32] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REL9] } }, { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } }, /* label12: 12 bit pc relative address */ { "label12", FR30_OPERAND_LABEL12, HW_H_IADDR, 5, 11, - { 0, { (const PTR) &fr30_cgen_ifld_table[36] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REL12] } }, { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } }, /* reglist_low_ld: 8 bit low register mask for ldm */ { "reglist_low_ld", FR30_OPERAND_REGLIST_LOW_LD, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[40] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_LOW_LD] } }, { 0, { (1<<MACH_BASE) } } }, /* reglist_hi_ld: 8 bit high register mask for ldm */ { "reglist_hi_ld", FR30_OPERAND_REGLIST_HI_LD, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[39] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_HI_LD] } }, { 0, { (1<<MACH_BASE) } } }, /* reglist_low_st: 8 bit low register mask for stm */ { "reglist_low_st", FR30_OPERAND_REGLIST_LOW_ST, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[38] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_LOW_ST] } }, { 0, { (1<<MACH_BASE) } } }, /* reglist_hi_st: 8 bit high register mask for stm */ { "reglist_hi_st", FR30_OPERAND_REGLIST_HI_ST, HW_H_UINT, 8, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[37] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_HI_ST] } }, { 0, { (1<<MACH_BASE) } } }, /* cc: condition codes */ { "cc", FR30_OPERAND_CC, HW_H_UINT, 4, 4, - { 0, { (const PTR) &fr30_cgen_ifld_table[7] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CC] } }, { 0, { (1<<MACH_BASE) } } }, /* ccc: coprocessor calc */ { "ccc", FR30_OPERAND_CCC, HW_H_UINT, 0, 8, - { 0, { (const PTR) &fr30_cgen_ifld_table[8] } }, + { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CCC] } }, { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } }, /* nbit: negative bit */ { "nbit", FR30_OPERAND_NBIT, HW_H_NBIT, 0, 0, diff --git a/opcodes/hppa-dis.c b/opcodes/hppa-dis.c index d9ab9dd..5f33297 100644 --- a/opcodes/hppa-dis.c +++ b/opcodes/hppa-dis.c @@ -1,5 +1,5 @@ /* Disassembler for the PA-RISC. Somewhat derived from sparc-pinsn.c. - Copyright 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001 + Copyright 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by the Center for Software Science at the @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Integer register names, indexed by the numbers which appear in the opcodes. */ -static const char *const reg_names[] = +static const char *const reg_names[] = {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "dp", "ret0", "ret1", @@ -34,10 +34,10 @@ static const char *const reg_names[] = /* Floating point register names, indexed by the numbers which appear in the opcodes. */ -static const char *const fp_reg_names[] = - {"fpsr", "fpe2", "fpe4", "fpe6", - "fr4", "fr5", "fr6", "fr7", "fr8", - "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", +static const char *const fp_reg_names[] = + {"fpsr", "fpe2", "fpe4", "fpe6", + "fr4", "fr5", "fr6", "fr7", "fr8", + "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"}; @@ -123,6 +123,8 @@ static const char *const short_bytes_compl_names[] = { "", ",b,m", ",e", ",e,m" }; static const char *const float_format_names[] = {",sgl", ",dbl", "", ",quad"}; +static const char *const fcnv_fixed_names[] = {",w", ",dw", "", ",qw"}; +static const char *const fcnv_ufixed_names[] = {",uw", ",udw", "", ",uqw"}; static const char *const float_comp_names[] = { ",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>", @@ -136,7 +138,7 @@ static const char *const saturation_names[] = {",us", ",ss", 0, ""}; static const char *const read_write_names[] = {",r", ",w"}; static const char *const add_compl_names[] = { 0, "", ",l", ",tsv" }; -/* For a bunch of different instructions form an index into a +/* For a bunch of different instructions form an index into a completer name table. */ #define GET_COMPL(insn) (GET_FIELD (insn, 26, 26) | \ GET_FIELD (insn, 18, 18) << 1) @@ -194,8 +196,8 @@ fput_fp_reg_r (reg, info) if (reg < 4) (*info->fprintf_func) (info->stream, "fpe%d", reg * 2 + 1); else - (*info->fprintf_func) (info->stream, "%sR", reg ? fp_reg_names[reg] - : "fr0"); + (*info->fprintf_func) (info->stream, "%sR", + reg ? fp_reg_names[reg] : "fr0"); } static void @@ -336,8 +338,8 @@ extract_12 (word) unsigned word; { return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - (word & 0x1) << 11, 12) << 2; + GET_FIELD (word, 29, 29) << 10 | + (word & 0x1) << 11, 12) << 2; } /* Extract a 17 bit constant from branch instructions, returning the @@ -348,9 +350,9 @@ extract_17 (word) unsigned word; { return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - GET_FIELD (word, 11, 15) << 11 | - (word & 0x1) << 16, 17) << 2; + GET_FIELD (word, 29, 29) << 10 | + GET_FIELD (word, 11, 15) << 11 | + (word & 0x1) << 16, 17) << 2; } static int @@ -358,10 +360,10 @@ extract_22 (word) unsigned word; { return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - GET_FIELD (word, 11, 15) << 11 | - GET_FIELD (word, 6, 10) << 16 | - (word & 0x1) << 21, 22) << 2; + GET_FIELD (word, 29, 29) << 10 | + GET_FIELD (word, 11, 15) << 11 | + GET_FIELD (word, 6, 10) << 16 | + (word & 0x1) << 21, 22) << 2; } /* Print one instruction. */ @@ -397,7 +399,7 @@ print_insn_hppa (memaddr, info) #endif (*info->fprintf_func) (info->stream, "%s", opcode->name); - if (!strchr ("cfCY?-+nHNZFIuv", opcode->args[0])) + if (!strchr ("cfCY?-+nHNZFIuv{", opcode->args[0])) (*info->fprintf_func) (info->stream, " "); for (s = opcode->args; *s != '\0'; ++s) { @@ -417,7 +419,7 @@ print_insn_hppa (memaddr, info) fput_reg (GET_FIELD (insn, 27, 31), info); break; - /* Handle floating point registers. */ + /* Handle floating point registers. */ case 'f': switch (*++s) { @@ -437,21 +439,19 @@ print_insn_hppa (memaddr, info) fput_fp_reg (GET_FIELD (insn, 6, 10), info); break; - /* 'fA' will not generate a space before the regsiter - name. Normally that is fine. Except that it - causes problems with xmpyu which has no FP format - completer. */ + /* 'fA' will not generate a space before the regsiter + name. Normally that is fine. Except that it + causes problems with xmpyu which has no FP format + completer. */ case 'X': fputs_filtered (" ", info); - - /* FALLTHRU */ + /* FALLTHRU */ case 'A': if (GET_FIELD (insn, 24, 24)) fput_fp_reg_r (GET_FIELD (insn, 6, 10), info); else fput_fp_reg (GET_FIELD (insn, 6, 10), info); - break; case 'b': if (GET_FIELD (insn, 25, 25)) @@ -516,14 +516,13 @@ print_insn_hppa (memaddr, info) break; } - /* 'fe' will not generate a space before the register - name. Normally that is fine. Except that it - causes problems with fstw fe,y(b) which has no FP - format completer. */ + /* 'fe' will not generate a space before the register + name. Normally that is fine. Except that it + causes problems with fstw fe,y(b) which has no FP + format completer. */ case 'E': fputs_filtered (" ", info); - - /* FALLTHRU */ + /* FALLTHRU */ case 'e': if (GET_FIELD (insn, 30, 30)) @@ -541,41 +540,52 @@ print_insn_hppa (memaddr, info) fput_const (extract_5_load (insn), info); break; case 's': - (*info->fprintf_func) (info->stream, - "sr%d", GET_FIELD (insn, 16, 17)); + { + int space = GET_FIELD (insn, 16, 17); + /* Zero means implicit addressing, not use of sr0. */ + if (space != 0) + (*info->fprintf_func) (info->stream, "sr%d", space); + } break; case 'S': - (*info->fprintf_func) (info->stream, "sr%d", extract_3 (insn)); + (*info->fprintf_func) (info->stream, "sr%d", + extract_3 (insn)); break; - /* Handle completers. */ + /* Handle completers. */ case 'c': switch (*++s) { case 'x': - (*info->fprintf_func) (info->stream, "%s", - index_compl_names[GET_COMPL (insn)]); + (*info->fprintf_func) + (info->stream, "%s", + index_compl_names[GET_COMPL (insn)]); break; case 'X': - (*info->fprintf_func) (info->stream, "%s ", - index_compl_names[GET_COMPL (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + index_compl_names[GET_COMPL (insn)]); break; case 'm': - (*info->fprintf_func) (info->stream, "%s", - short_ldst_compl_names[GET_COMPL (insn)]); + (*info->fprintf_func) + (info->stream, "%s", + short_ldst_compl_names[GET_COMPL (insn)]); break; case 'M': - (*info->fprintf_func) (info->stream, "%s ", - short_ldst_compl_names[GET_COMPL (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + short_ldst_compl_names[GET_COMPL (insn)]); break; case 'A': - (*info->fprintf_func) (info->stream, "%s ", - short_bytes_compl_names[GET_COMPL (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + short_bytes_compl_names[GET_COMPL (insn)]); break; case 's': - (*info->fprintf_func) (info->stream, "%s", - short_bytes_compl_names[GET_COMPL (insn)]); + (*info->fprintf_func) + (info->stream, "%s", + short_bytes_compl_names[GET_COMPL (insn)]); break; case 'c': case 'C': @@ -618,8 +628,9 @@ print_insn_hppa (memaddr, info) (*info->fprintf_func) (info->stream, ",l"); break; case 'w': - (*info->fprintf_func) (info->stream, "%s ", - read_write_names[GET_FIELD (insn, 25, 25)]); + (*info->fprintf_func) + (info->stream, "%s ", + read_write_names[GET_FIELD (insn, 25, 25)]); break; case 'W': (*info->fprintf_func) (info->stream, ",w"); @@ -644,18 +655,18 @@ print_insn_hppa (memaddr, info) break; case 'a': (*info->fprintf_func) - (info->stream, "%s", add_compl_names[GET_FIELD - (insn, 20, 21)]); + (info->stream, "%s", + add_compl_names[GET_FIELD (insn, 20, 21)]); break; case 'Y': (*info->fprintf_func) - (info->stream, ",dc%s", add_compl_names[GET_FIELD - (insn, 20, 21)]); + (info->stream, ",dc%s", + add_compl_names[GET_FIELD (insn, 20, 21)]); break; case 'y': (*info->fprintf_func) - (info->stream, ",c%s", add_compl_names[GET_FIELD - (insn, 20, 21)]); + (info->stream, ",c%s", + add_compl_names[GET_FIELD (insn, 20, 21)]); break; case 'v': if (GET_FIELD (insn, 20, 20)) @@ -684,28 +695,28 @@ print_insn_hppa (memaddr, info) /* EXTRD/W has a following condition. */ if (*(s + 1) == '?') (*info->fprintf_func) - (info->stream, "%s", signed_unsigned_names[GET_FIELD - (insn, 21, 21)]); + (info->stream, "%s", + signed_unsigned_names[GET_FIELD (insn, 21, 21)]); else (*info->fprintf_func) - (info->stream, "%s ", signed_unsigned_names[GET_FIELD - (insn, 21, 21)]); + (info->stream, "%s ", + signed_unsigned_names[GET_FIELD (insn, 21, 21)]); break; case 'h': (*info->fprintf_func) - (info->stream, "%s", mix_half_names[GET_FIELD - (insn, 17, 17)]); + (info->stream, "%s", + mix_half_names[GET_FIELD (insn, 17, 17)]); break; case 'H': (*info->fprintf_func) - (info->stream, "%s ", saturation_names[GET_FIELD - (insn, 24, 25)]); + (info->stream, "%s ", + saturation_names[GET_FIELD (insn, 24, 25)]); break; case '*': (*info->fprintf_func) - (info->stream, ",%d%d%d%d ", - GET_FIELD (insn, 17, 18), GET_FIELD (insn, 20, 21), - GET_FIELD (insn, 22, 23), GET_FIELD (insn, 24, 25)); + (info->stream, ",%d%d%d%d ", + GET_FIELD (insn, 17, 18), GET_FIELD (insn, 20, 21), + GET_FIELD (insn, 22, 23), GET_FIELD (insn, 24, 25)); break; case 'q': @@ -766,85 +777,101 @@ print_insn_hppa (memaddr, info) } break; - /* Handle conditions. */ + /* Handle conditions. */ case '?': { s++; switch (*s) { case 'f': - (*info->fprintf_func) (info->stream, "%s ", - float_comp_names[GET_FIELD - (insn, 27, 31)]); + (*info->fprintf_func) + (info->stream, "%s ", + float_comp_names[GET_FIELD (insn, 27, 31)]); break; - /* these four conditions are for the set of instructions + /* these four conditions are for the set of instructions which distinguish true/false conditions by opcode rather than by the 'f' bit (sigh): comb, comib, addb, addib */ case 't': - fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18)], - info); + fputs_filtered + (compare_cond_names[GET_FIELD (insn, 16, 18)], info); break; case 'n': - fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18) - + GET_FIELD (insn, 4, 4) * 8], info); + fputs_filtered + (compare_cond_names[GET_FIELD (insn, 16, 18) + + GET_FIELD (insn, 4, 4) * 8], + info); break; case 'N': - fputs_filtered (compare_cond_64_names[GET_FIELD (insn, 16, 18) - + GET_FIELD (insn, 2, 2) * 8], info); + fputs_filtered + (compare_cond_64_names[GET_FIELD (insn, 16, 18) + + GET_FIELD (insn, 2, 2) * 8], + info); break; case 'Q': - fputs_filtered (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)], - info); + fputs_filtered + (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)], + info); break; case '@': - fputs_filtered (add_cond_names[GET_FIELD (insn, 16, 18) - + GET_FIELD (insn, 4, 4) * 8], info); + fputs_filtered + (add_cond_names[GET_FIELD (insn, 16, 18) + + GET_FIELD (insn, 4, 4) * 8], + info); break; case 's': - (*info->fprintf_func) (info->stream, "%s ", - compare_cond_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + compare_cond_names[GET_COND (insn)]); break; case 'S': - (*info->fprintf_func) (info->stream, "%s ", - compare_cond_64_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + compare_cond_64_names[GET_COND (insn)]); break; case 'a': - (*info->fprintf_func) (info->stream, "%s ", - add_cond_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + add_cond_names[GET_COND (insn)]); break; case 'A': - (*info->fprintf_func) (info->stream, "%s ", - add_cond_64_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + add_cond_64_names[GET_COND (insn)]); break; case 'd': - (*info->fprintf_func) (info->stream, "%s", - add_cond_names[GET_FIELD (insn, 16, 18)]); + (*info->fprintf_func) + (info->stream, "%s", + add_cond_names[GET_FIELD (insn, 16, 18)]); break; case 'W': - (*info->fprintf_func) + (*info->fprintf_func) (info->stream, "%s", - wide_add_cond_names[GET_FIELD (insn, 16, 18) + - GET_FIELD (insn, 4, 4) * 8]); + wide_add_cond_names[GET_FIELD (insn, 16, 18) + + GET_FIELD (insn, 4, 4) * 8]); break; case 'l': - (*info->fprintf_func) (info->stream, "%s ", - logical_cond_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + logical_cond_names[GET_COND (insn)]); break; case 'L': - (*info->fprintf_func) (info->stream, "%s ", - logical_cond_64_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + logical_cond_64_names[GET_COND (insn)]); break; case 'u': - (*info->fprintf_func) (info->stream, "%s ", - unit_cond_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + unit_cond_names[GET_COND (insn)]); break; case 'U': - (*info->fprintf_func) (info->stream, "%s ", - unit_cond_64_names[GET_COND (insn)]); + (*info->fprintf_func) + (info->stream, "%s ", + unit_cond_64_names[GET_COND (insn)]); break; case 'y': case 'x': @@ -859,8 +886,9 @@ print_insn_hppa (memaddr, info) (*info->fprintf_func) (info->stream, " "); break; case 'X': - (*info->fprintf_func) (info->stream, "%s ", - shift_cond_64_names[GET_FIELD (insn, 16, 18)]); + (*info->fprintf_func) + (info->stream, "%s ", + shift_cond_64_names[GET_FIELD (insn, 16, 18)]); break; case 'B': (*info->fprintf_func) @@ -921,14 +949,13 @@ print_insn_hppa (memaddr, info) (*info->fprintf_func) (info->stream, " "); break; case 'w': - (*info->print_address_func) (memaddr + 8 + extract_12 (insn), - info); + (*info->print_address_func) + (memaddr + 8 + extract_12 (insn), info); break; case 'W': /* 17 bit PC-relative branch. */ - (*info->print_address_func) ((memaddr + 8 - + extract_17 (insn)), - info); + (*info->print_address_func) + ((memaddr + 8 + extract_17 (insn)), info); break; case 'z': /* 17 bit displacement. This is an offset from a register @@ -946,25 +973,25 @@ print_insn_hppa (memaddr, info) /* be,l %sr0,%r31 implicit output. */ (*info->fprintf_func) (info->stream, "%%sr0,%%r31"); break; - + case '@': (*info->fprintf_func) (info->stream, "0"); break; case '.': (*info->fprintf_func) (info->stream, "%d", - GET_FIELD (insn, 24, 25)); + GET_FIELD (insn, 24, 25)); break; case '*': (*info->fprintf_func) (info->stream, "%d", - GET_FIELD (insn, 22, 25)); + GET_FIELD (insn, 22, 25)); break; case '!': (*info->fprintf_func) (info->stream, "%%sar"); break; case 'p': (*info->fprintf_func) (info->stream, "%d", - 31 - GET_FIELD (insn, 22, 26)); + 31 - GET_FIELD (insn, 22, 26)); break; case '~': { @@ -976,7 +1003,7 @@ print_insn_hppa (memaddr, info) } case 'P': (*info->fprintf_func) (info->stream, "%d", - GET_FIELD (insn, 22, 26)); + GET_FIELD (insn, 22, 26)); break; case 'q': { @@ -988,7 +1015,7 @@ print_insn_hppa (memaddr, info) } case 'T': (*info->fprintf_func) (info->stream, "%d", - 32 - GET_FIELD (insn, 27, 31)); + 32 - GET_FIELD (insn, 27, 31)); break; case '%': { @@ -1016,7 +1043,8 @@ print_insn_hppa (memaddr, info) fput_const (GET_FIELD (insn, 6, 31), info); break; case 'v': - (*info->fprintf_func) (info->stream, ",%d", GET_FIELD (insn, 23, 25)); + (*info->fprintf_func) (info->stream, ",%d", + GET_FIELD (insn, 23, 25)); break; case 'O': fput_const ((GET_FIELD (insn, 6,20) << 5 | @@ -1038,47 +1066,48 @@ print_insn_hppa (memaddr, info) GET_FIELD (insn, 27, 31)), info); break; case 'u': - (*info->fprintf_func) (info->stream, ",%d", GET_FIELD (insn, 23, 25)); + (*info->fprintf_func) (info->stream, ",%d", + GET_FIELD (insn, 23, 25)); break; case 'F': /* if no destination completer and not before a completer for fcmp, need a space here */ if (s[1] == 'G' || s[1] == '?') - fputs_filtered (float_format_names[GET_FIELD (insn, 19, 20)], - info); + fputs_filtered + (float_format_names[GET_FIELD (insn, 19, 20)], info); else - (*info->fprintf_func) (info->stream, "%s ", - float_format_names[GET_FIELD - (insn, 19, 20)]); + (*info->fprintf_func) + (info->stream, "%s ", + float_format_names[GET_FIELD (insn, 19, 20)]); break; case 'G': - (*info->fprintf_func) (info->stream, "%s ", - float_format_names[GET_FIELD (insn, - 17, 18)]); + (*info->fprintf_func) + (info->stream, "%s ", + float_format_names[GET_FIELD (insn, 17, 18)]); break; case 'H': if (GET_FIELD (insn, 26, 26) == 1) (*info->fprintf_func) (info->stream, "%s ", - float_format_names[0]); + float_format_names[0]); else (*info->fprintf_func) (info->stream, "%s ", - float_format_names[1]); + float_format_names[1]); break; case 'I': /* if no destination completer and not before a completer for fcmp, need a space here */ if (s[1] == '?') - fputs_filtered (float_format_names[GET_FIELD (insn, 20, 20)], - info); + fputs_filtered + (float_format_names[GET_FIELD (insn, 20, 20)], info); else - (*info->fprintf_func) (info->stream, "%s ", - float_format_names[GET_FIELD - (insn, 20, 20)]); + (*info->fprintf_func) + (info->stream, "%s ", + float_format_names[GET_FIELD (insn, 20, 20)]); break; - case 'J': - fput_const (extract_14 (insn), info); - break; + case 'J': + fput_const (extract_14 (insn), info); + break; case '#': { @@ -1095,7 +1124,7 @@ print_insn_hppa (memaddr, info) fput_const (disp, info); break; } - case 'K': + case 'K': case 'd': { int sign = GET_FIELD (insn, 31, 31); @@ -1131,11 +1160,33 @@ print_insn_hppa (memaddr, info) break; } - /* ?!? FIXME */ case '_': + break; /* Dealt with by '{' */ + case '{': - fputs_filtered ("Disassembler botch.\n", info); - break; + { + int sub = GET_FIELD (insn, 14, 16); + int df = GET_FIELD (insn, 17, 18); + int sf = GET_FIELD (insn, 19, 20); + const char * const * source = float_format_names; + const char * const * dest = float_format_names; + char *t = ""; + if (sub == 4) + { + fputs_filtered (",UND ", info); + break; + } + if ((sub & 3) == 3) + t = ",t"; + if ((sub & 3) == 1) + source = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names; + if (sub & 2) + dest = sub & 4 ? fcnv_ufixed_names : fcnv_fixed_names; + + (*info->fprintf_func) (info->stream, "%s%s%s ", + t, source[sf], dest[df]); + break; + } case 'm': { @@ -1181,9 +1232,8 @@ print_insn_hppa (memaddr, info) } case 'X': - (*info->print_address_func) ((memaddr + 8 - + extract_22 (insn)), - info); + (*info->print_address_func) + (memaddr + 8 + extract_22 (insn), info); break; case 'L': fputs_filtered (",%r2", info); diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c index 176ffeb..1ed436a 100644 --- a/opcodes/mips-dis.c +++ b/opcodes/mips-dis.c @@ -1758,7 +1758,7 @@ void print_mips_disassembler_options (stream) FILE *stream; { - int i; + unsigned int i; fprintf (stream, _("\n\ The following MIPS specific disassembler options are supported for use\n\ @@ -1793,14 +1793,14 @@ with the -M switch (multiple options should be separated by commas):\n")); fprintf (stream, _("\n\ For the options above, the following values are supported for \"ABI\":\n\ ")); - for (i = 0; mips_abi_choices[i].name != NULL; i++) + for (i = 0; i < ARRAY_SIZE (mips_abi_choices); i++) fprintf (stream, " %s", mips_abi_choices[i].name); fprintf (stream, _("\n")); fprintf (stream, _("\n\ For the options above, The following values are supported for \"ARCH\":\n\ ")); - for (i = 0; mips_arch_choices[i].name != NULL; i++) + for (i = 0; i < ARRAY_SIZE (mips_arch_choices); i++) if (*mips_arch_choices[i].name != '\0') fprintf (stream, " %s", mips_arch_choices[i].name); fprintf (stream, _("\n")); diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb index 7323018..40eef93 100644 --- a/readline/ChangeLog.gdb +++ b/readline/ChangeLog.gdb @@ -1,3 +1,18 @@ +2003-03-03 Joel Brobecker <brobecker@gnat.com> + + * aclocal.m4: Add check for mbrtowc. + * config.h.in: Regenerate. + * configure: Regenerate. + * rlmbutil.h: Disable multi-byte if mbrtowc is not defined. + +2003-03-03 Kris Warkentin <kewarken@qnx.com> + + * aclocal.m4: Cause wcwidth check to substitute + HAVE_WCWIDTH for building. + * Makefile.in: Add wcwidth object to lib if required. + * shlib/Makefile.in: Likewise. + * configure: Regenerate. + 2003-01-09 Michael Chastain <mec@shout.net> From Chet Ramey, <chet@po.cwru.edu>, the readline maintainer: diff --git a/readline/Makefile.in b/readline/Makefile.in index 720fb39..f039ec6 100644 --- a/readline/Makefile.in +++ b/readline/Makefile.in @@ -86,6 +86,8 @@ GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@ LIBRARY_NAME = libreadline.a STATIC_LIBS = libreadline.a libhistory.a +WCWIDTH_OBJ = @WCWIDTH_OBJ@ + # The C code source files for this library. CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \ $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \ @@ -98,7 +100,7 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \ $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \ $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \ $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \ - $(srcdir)/mbutil.c + $(srcdir)/mbutil.c $(srcdir)/support/wcwidth.c # The header files for this library. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \ @@ -111,7 +113,8 @@ TILDEOBJ = tilde.o OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \ rltty.o complete.o bind.o isearch.o display.o signals.o \ util.o kill.o undo.o macro.o input.o callback.o terminal.o \ - text.o nls.o misc.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ) + text.o nls.o misc.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ) \ + $(WCWIDTH_OBJ) # The texinfo files which document this library. DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo @@ -147,6 +150,10 @@ libhistory.a: $(HISTOBJ) xmalloc.o $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o -test -n "$(RANLIB)" && $(RANLIB) $@ +wcwidth.o: $(srcdir)/support/wcwidth.c + $(RM) $@ + $(CC) $(CCFLAGS) -c $(srcdir)/support/wcwidth.c + # Since tilde.c is shared between readline and bash, make sure we compile # it with the right flags when it's built as part of readline tilde.o: tilde.c diff --git a/readline/aclocal.m4 b/readline/aclocal.m4 index d1ad025..bc43d8d 100644 --- a/readline/aclocal.m4 +++ b/readline/aclocal.m4 @@ -1652,8 +1652,15 @@ AC_CHECK_HEADERS(wctype.h) AC_CHECK_HEADERS(wchar.h) AC_CHECK_HEADERS(langinfo.h) +AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC)) AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) -AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH)) +AC_CHECK_FUNC(wcwidth, have_wcwidth=yes) +if test "$have_wcwidth" = yes; then + AC_DEFINE(HAVE_WCWIDTH) + AC_SUBST(WCWIDTH_OBJ,) +else + AC_SUBST(WCWIDTH_OBJ,wcwidth.o) +fi AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t, [AC_TRY_RUN([ diff --git a/readline/config.h.in b/readline/config.h.in index c53c2a1..62883d3 100644 --- a/readline/config.h.in +++ b/readline/config.h.in @@ -31,6 +31,9 @@ /* Define if you have the lstat function. */ #undef HAVE_LSTAT +/* Define if you have the mbrtowc function. */ +#undef HAVE_MBRTOWC + /* Define if you have the mbsrtowcs function. */ #undef HAVE_MBSRTOWCS diff --git a/readline/configure b/readline/configure index 92c7676..b5c2e8d 100755 --- a/readline/configure +++ b/readline/configure @@ -1,15 +1,84 @@ #! /bin/sh -# From configure.in for Readline 4.3, version 2.45, from autoconf version 2.52. +# From configure.in for Readline 4.3, version 2.45, from autoconf version AC_ACVERSION. # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52 for readline 4.3. +# Generated by GNU Autoconf 2.57 for readline 4.3. # # Report bugs to <bug-readline@gnu.org>. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # 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. ## +## --------------------- ## +# 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 + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/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 -n "`(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' @@ -17,22 +86,113 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +# 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 -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -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 -# Name of the executable. -as_me=`echo "$0" |sed 's,.*[\\/],,'` + ;; + 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 @@ -58,24 +218,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file -as_executable_p="test -f" - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: else - as_unset=false + as_mkdir_p=false fi -# NLS nuisances. -$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } -$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } -$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } -$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } -$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } -$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } -$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } -$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + # IFS # We need space, tab and new line, in precisely that order. @@ -84,7 +240,8 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } +$as_unset CDPATH + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, @@ -97,9 +254,11 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local +ac_config_libobj_dir=. cross_compiling=no subdirs= -MFLAGS= MAKEFLAGS= +MFLAGS= +MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. @@ -107,6 +266,13 @@ SHELL=${CONFIG_SHELL-/bin/sh} # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} +# Identity of this package. +PACKAGE_NAME='readline' +PACKAGE_TARNAME='readline' +PACKAGE_VERSION='4.3' +PACKAGE_STRING='readline 4.3' +PACKAGE_BUGREPORT='bug-readline@gnu.org' + ac_unique_file="readline.h" # Factoring default headers for most tests. ac_includes_default="\ @@ -145,6 +311,9 @@ ac_includes_default="\ # include <unistd.h> #endif" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CROSS_COMPILING_FLAG CC_FOR_BUILD INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AR RANLIB ac_ct_RANLIB MAKE_SHELL WCWIDTH_OBJ SHOBJ_CC SHOBJ_CFLAGS SHOBJ_LD SHOBJ_LDFLAGS SHOBJ_XLDFLAGS SHOBJ_LIBS SHOBJ_STATUS SHLIB_STATUS SHLIB_XLDFLAGS SHLIB_LIBSUFF SHLIB_LIBVERSION SHLIB_LIBS SHLIB_MAJOR SHLIB_MINOR STATIC_TARGET SHARED_TARGET STATIC_INSTALL_TARGET SHARED_INSTALL_TARGET BUILD_DIR LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS ARFLAGS LIBVERSION TERMCAP_LIB LIBOBJS LTLIBOBJS' +ac_subst_files='' + # Initialize some variables set by options. ac_init_help= ac_init_version=false @@ -183,13 +352,6 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Identity of this package. -PACKAGE_NAME='readline' -PACKAGE_TARNAME='readline' -PACKAGE_VERSION='4.3' -PACKAGE_STRING='readline 4.3' -PACKAGE_BUGREPORT='bug-readline@gnu.org' - ac_prev= for ac_option do @@ -322,7 +484,7 @@ do 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 \ @@ -501,7 +663,7 @@ do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done @@ -513,18 +675,19 @@ do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # 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: should be removed in autoconf 3.0. +# FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe @@ -540,13 +703,23 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null + # 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=.. @@ -556,13 +729,16 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else - { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi +(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 @@ -603,7 +779,7 @@ ac_cv_env_CPP_value=$CPP 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 <<EOF + cat <<_ACEOF \`configure' configures readline 4.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -624,9 +800,9 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -EOF +_ACEOF - cat <<EOF + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -653,21 +829,21 @@ Fine tuning of the installation directories: --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] -EOF +_ACEOF - cat <<\EOF + cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] - --host=HOST build programs to run on HOST [BUILD] -EOF + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of readline 4.3:";; esac - cat <<\EOF + cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) @@ -693,40 +869,60 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to <bug-readline@gnu.org>. -EOF +_ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` - for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue - cd $ac_subdir - # A "../" for each directory in /$ac_subdir. - ac_dots=`echo $ac_subdir | - sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` - - case $srcdir in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_subdir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; - esac + 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 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure.gnu; then + if test -f $ac_srcdir/configure.gnu; then echo - $SHELL $ac_sub_srcdir/configure.gnu --help=recursive - elif test -f $ac_sub_srcdir/configure; then + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then echo - $SHELL $ac_sub_srcdir/configure --help=recursive - elif test -f $ac_sub_srcdir/configure.ac || - test -f $ac_sub_srcdir/configure.in; then + $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_subdir" >&2 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done @@ -734,33 +930,33 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then - cat <<\EOF + cat <<\_ACEOF readline configure 4.3 -generated by GNU Autoconf 2.52 +generated by GNU Autoconf 2.57 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -EOF +_ACEOF exit 0 fi exec 5>config.log -cat >&5 <<EOF +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 readline $as_me 4.3, which was -generated by GNU Autoconf 2.52. Invocation command line was +generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ -EOF +_ACEOF { cat <<_ASUNAME -## ---------- ## -## Platform. ## -## ---------- ## +## --------- ## +## Platform. ## +## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` @@ -779,51 +975,96 @@ hostinfo = `(hostinfo) 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` -PATH = $PATH - _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 <<EOF -## ------------ ## -## Core tests. ## -## ------------ ## +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF -EOF # 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= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 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_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" - ac_sep=" " ;; - esac - # Get rid of the leading space. + 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 >&5 - echo "## ----------------- ##" >&5 - echo "## Cache variables. ##" >&5 - echo "## ----------------- ##" >&5 - echo >&5 - # The following way of writing the cache mishandles newlines in values, + { + 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 @@ -837,21 +1078,53 @@ trap 'exit_status=$? "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; -} >&5 - sed "/^$/d" confdefs.h >conftest.log - if test -s conftest.log; then - echo >&5 - echo "## ------------ ##" >&5 - echo "## confdefs.h. ##" >&5 - echo "## ------------ ##" >&5 - echo >&5 - cat conftest.log >&5 - fi - (echo; echo) >&5 - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" >&5 - echo "$as_me: exit $exit_status" >&5 - rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && +} + 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.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do @@ -864,6 +1137,33 @@ 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 @@ -875,9 +1175,9 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - { echo "$as_me:879: loading site script $ac_site_file" >&5 + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} - cat "$ac_site_file" >&5 + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done @@ -886,7 +1186,7 @@ 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:890: loading cache $cache_file" >&5 + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -894,7 +1194,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:898: creating cache $cache_file" >&5 + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -910,42 +1210,42 @@ for ac_var in `(set) 2>&1 | eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:914: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { 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:918: error: \`$ac_var' was not set in the previous run" >&5 + { 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:924: error: \`$ac_var' has changed since the previous run:" >&5 + { 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:926: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:928: current value: $ac_new_val" >&5 + { 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. It doesn't matter if - # we pass some twice (in addition to the command line arguments). + # 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_configure_args="$ac_configure_args '$ac_arg'" - ;; - *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" - ;; + 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:947: error: changes in the environment can compromise the build" >&5 + { 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:949: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { 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 @@ -956,28 +1256,38 @@ 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 -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 -echo "#! $SHELL" >conftest.sh -echo "exit 0" >>conftest.sh -chmod +x conftest.sh -if { (echo "$as_me:969: PATH=\".;.\"; conftest.sh") >&5 - (PATH=".;."; conftest.sh) 2>&5 - ac_status=$? - echo "$as_me:972: \$? = $ac_status" >&5 - (exit $ac_status); }; then - ac_path_separator=';' -else - ac_path_separator=: -fi -PATH_SEPARATOR="$ac_path_separator" -rm -f conftest.sh -ac_config_headers="$ac_config_headers config.h" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" + LIBVERSION=4.3 @@ -998,7 +1308,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1002: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { 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 @@ -1008,11 +1318,11 @@ 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:1012: error: cannot run $ac_config_sub" >&5 + { { 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:1016: checking build system type" >&5 +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 @@ -1021,23 +1331,24 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1025: error: cannot guess build type; you must specify one" >&5 + { { 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:1029: error: $ac_config_sub $ac_cv_build_alias failed." >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { { 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:1034: result: $ac_cv_build" >&5 +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/'` -echo "$as_me:1041: checking host system type" >&5 + +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 @@ -1046,20 +1357,23 @@ else 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:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { 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:1055: result: $ac_cv_host" >&5 +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/'` + + opt_curses=no + # Check whether --with-curses or --without-curses was given. if test "${with_curses+set}" = set; then withval="$with_curses" @@ -1086,16 +1400,16 @@ echo "" # We want these before the checks, so the checks can modify their values. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 -echo "$as_me:1095: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.make <<\EOF + cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' -EOF + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then @@ -1106,11 +1420,11 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:1115: result: yes" >&5 + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:1119: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -1123,7 +1437,7 @@ 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:1132: checking for $ac_word" >&5 +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 @@ -1131,25 +1445,28 @@ else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CC="${ac_tool_prefix}gcc" -echo "$as_me:1147: found $ac_dir/$ac_word" >&5 -break +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 if test -n "$CC"; then - echo "$as_me:1155: result: $CC" >&5 + echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1158: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1158,7 +1475,7 @@ 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:1167: checking for $ac_word" >&5 +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 @@ -1166,25 +1483,28 @@ else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="gcc" -echo "$as_me:1182: found $ac_dir/$ac_word" >&5 -break +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:1190: result: $ac_ct_CC" >&5 + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1193: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1197,7 +1517,7 @@ if test -z "$CC"; then 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:1206: checking for $ac_word" >&5 +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 @@ -1205,25 +1525,28 @@ else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CC="${ac_tool_prefix}cc" -echo "$as_me:1221: found $ac_dir/$ac_word" >&5 -break +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:1229: result: $CC" >&5 + echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1232: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1232,7 +1555,7 @@ 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:1241: checking for $ac_word" >&5 +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 @@ -1240,25 +1563,28 @@ else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="cc" -echo "$as_me:1256: found $ac_dir/$ac_word" >&5 -break +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:1264: result: $ac_ct_CC" >&5 + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1267: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1271,7 +1597,7 @@ 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:1280: checking for $ac_word" >&5 +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 @@ -1280,19 +1606,22 @@ else ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue -fi -ac_cv_prog_CC="cc" -echo "$as_me:1300: found $ac_dir/$ac_word" >&5 -break +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 @@ -1304,19 +1633,17 @@ if test $ac_prog_rejected = yes; then # 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" ${1+"$@"} - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1322: result: $CC" >&5 + echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1325: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1327,7 +1654,7 @@ if test -z "$CC"; then 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:1336: checking for $ac_word" >&5 +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 @@ -1335,25 +1662,28 @@ else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -echo "$as_me:1351: found $ac_dir/$ac_word" >&5 -break +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 if test -n "$CC"; then - echo "$as_me:1359: result: $CC" >&5 + echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1362: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1366,7 +1696,7 @@ if test -z "$CC"; then 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:1375: checking for $ac_word" >&5 +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 @@ -1374,25 +1704,28 @@ else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="$ac_prog" -echo "$as_me:1390: found $ac_dir/$ac_word" >&5 -break +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 +done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1398: result: $ac_ct_CC" >&5 + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1401: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1404,33 +1737,40 @@ fi fi -test -z "$CC" && { { echo "$as_me:1413: error: no acceptable cc found in \$PATH" >&5 -echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + +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:1418:" \ +echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1421: \"$ac_compiler --version </dev/null >&5\"") >&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? - echo "$as_me:1424: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1426: \"$ac_compiler -v </dev/null >&5\"") >&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? - echo "$as_me:1429: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1431: \"$ac_compiler -V </dev/null >&5\"") >&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? - echo "$as_me:1434: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1438 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () @@ -1441,100 +1781,120 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +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:1454: checking for C compiler default output" >&5 +echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:1457: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1460: \$? = $ac_status" >&5 + 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. -for ac_file in `ls a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do + +# 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 | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; - a.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 --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$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 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1483: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} +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:1489: result: $ac_file" >&5 +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:1494: checking whether the C compiler works" >&5 +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:1500: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1503: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1510: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 + { { 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'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi -echo "$as_me:1518: result: yes" >&5 +echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +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:1525: checking whether we are cross compiling" >&5 +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:1527: result: $cross_compiling" >&5 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1530: checking for executable suffix" >&5 -echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1532: \"$ac_link\"") >&5 +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:1535: \$? = $ac_status" >&5 + 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -1542,26 +1902,32 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1551: error: cannot compute EXEEXT: cannot compile and link" >&5 -echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&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:1557: result: $ac_cv_exeext" >&5 +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:1563: checking for object suffix" >&5 -echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +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 -#line 1569 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () @@ -1572,40 +1938,47 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1581: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1584: \$? = $ac_status" >&5 + 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 ) ;; + *.$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 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1596: error: cannot compute OBJEXT: cannot compile" >&5 -echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} +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:1603: result: $ac_cv_objext" >&5 +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:1607: checking whether we are using the GNU C compiler" >&5 +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 -#line 1613 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () @@ -1619,41 +1992,46 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1628: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1631: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1634: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1637: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1649: result: $ac_cv_c_compiler_gnu" >&5 +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:1655: checking whether $CC accepts -g" >&5 +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 cat >conftest.$ac_ext <<_ACEOF -#line 1661 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () @@ -1664,26 +2042,27 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1673: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1676: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1679: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1682: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1692: result: $ac_cv_prog_cc_g" >&5 +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 @@ -1700,6 +2079,102 @@ else CFLAGS= fi fi +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_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* 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; +} +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>&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.$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 @@ -1710,16 +2185,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1719: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1722: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1725: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1728: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -1731,8 +2206,12 @@ if { (eval echo "$as_me:1719: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 1740 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> $ac_declaration int @@ -1744,27 +2223,32 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1753: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1756: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1759: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1762: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 1772 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration int main () @@ -1775,21 +2259,22 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1787: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1790: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1793: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -1802,7 +2287,8 @@ fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -1811,12 +2297,13 @@ 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=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:1825: checking how to run the C preprocessor" >&5 +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 @@ -1834,21 +2321,31 @@ 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 <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> 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 -#line 1846 "configure" -#include "confdefs.h" -#include <assert.h> +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif Syntax error _ACEOF -if { (eval echo "$as_me:1851: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:1857: \$? = $ac_status" >&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 @@ -1862,7 +2359,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -1871,17 +2369,21 @@ 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 -#line 1880 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if { (eval echo "$as_me:1884: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:1890: \$? = $ac_status" >&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 @@ -1896,7 +2398,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -1918,28 +2421,38 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:1927: result: $CPP" >&5 +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 <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> 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 -#line 1937 "configure" -#include "confdefs.h" -#include <assert.h> +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif Syntax error _ACEOF -if { (eval echo "$as_me:1942: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:1948: \$? = $ac_status" >&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 @@ -1953,7 +2466,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -1962,17 +2476,21 @@ 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 -#line 1971 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if { (eval echo "$as_me:1975: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:1981: \$? = $ac_status" >&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 @@ -1987,7 +2505,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2000,8 +2519,10 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2009: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { 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 @@ -2011,23 +2532,309 @@ 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:2020: checking for minix/config.h" >&5 + +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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +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); } && + { 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.$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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <string.h> + +_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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> + +_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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ctype.h> +#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.* *.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 +#line $LINENO "configure" +/* 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>&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.$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 + + +if test "${ac_cv_header_minix_config_h+set}" = set; then + echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line 2026 "configure" -#include "confdefs.h" + # Is the header compilable? +echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include <minix/config.h> _ACEOF -if { (eval echo "$as_me:2030: \"$ac_cpp conftest.$ac_ext\"") >&5 +rm -f conftest.$ac_objext +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); } && + { 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.$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 minix/config.h presence" >&5 +echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <minix/config.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2036: \$? = $ac_status" >&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 @@ -2038,38 +2845,88 @@ else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then - ac_cv_header_minix_config_h=yes + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_minix_config_h=no +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 in + yes:no ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 +if test "${ac_cv_header_minix_config_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc fi -echo "$as_me:2055: result: $ac_cv_header_minix_config_h" >&5 +echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 + +fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi + if test "$MINIX" = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 -EOF +_ACEOF + -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 -EOF +_ACEOF -cat >>confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define _MINIX 1 -EOF +_ACEOF fi + + if test "x$cross_compiling" = "xyes"; then case "${host}" in *-cygwin*) @@ -2092,6 +2949,7 @@ else CROSS_COMPILING_FLAG= fi + if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' @@ -2100,46 +2958,57 @@ if test -z "$CC_FOR_BUILD"; then fi fi + + # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:2113: checking whether $CC needs -traditional" >&5 + echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line 2120 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sgtty.h> Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* + if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line 2135 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <termio.h> Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi -echo "$as_me:2148: result: $ac_cv_prog_gcc_traditional" >&5 +echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" @@ -2158,43 +3027,48 @@ fi # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:2167: checking for a BSD compatible install" >&5 -echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +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 test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_IFS=$IFS; IFS=$ac_path_separator - for ac_dir in $PATH; do - IFS=$ac_save_IFS - # Account for people who put trailing slashes in PATH elements. - case $ac_dir/ in - / | ./ | .// | /cC/* \ - | /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 $as_executable_p "$ac_dir/$ac_prog"; then - if test $ac_prog = install && - grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$ac_dir/$ac_prog" >/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 - fi - fi + 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/* | \ + /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 "$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="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done - ;; - esac - done + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then @@ -2207,7 +3081,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:2216: result: $INSTALL" >&5 +echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2220,7 +3094,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:2229: checking for $ac_word" >&5 +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 @@ -2228,15 +3102,18 @@ else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_AR="" -echo "$as_me:2244: found $ac_dir/$ac_word" >&5 -break +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="" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" @@ -2244,10 +3121,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:2253: result: $AR" >&5 + echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:2256: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2255,7 +3132,7 @@ test -n "$ARFLAGS" || ARFLAGS="cr" 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:2264: checking for $ac_word" >&5 +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 @@ -2263,25 +3140,28 @@ else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -echo "$as_me:2279: found $ac_dir/$ac_word" >&5 -break +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:2287: result: $RANLIB" >&5 + echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else - echo "$as_me:2290: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2290,7 +3170,7 @@ 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:2299: checking for $ac_word" >&5 +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 @@ -2298,15 +3178,18 @@ else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_RANLIB="ranlib" -echo "$as_me:2314: found $ac_dir/$ac_word" >&5 -break +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=":" @@ -2314,10 +3197,10 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:2323: result: $ac_ct_RANLIB" >&5 + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$as_me:2326: result: no" >&5 + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2326,107 +3209,22 @@ else RANLIB="$ac_cv_prog_RANLIB" fi -MAKE_SHELL=/bin/sh -echo "$as_me:2337: 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_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line 2345 "configure" -#include "confdefs.h" -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* 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; -} -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:2394: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2397: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2400: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2403: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi +MAKE_SHELL=/bin/sh -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:2420: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:2423: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac -echo "$as_me:2428: checking for an ANSI C-conforming const" >&5 +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 -#line 2434 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int main () @@ -2483,289 +3281,123 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2492: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2495: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2498: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2501: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2511: result: $ac_cv_c_const" >&5 +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 <<\EOF +cat >>confdefs.h <<\_ACEOF #define const -EOF +_ACEOF fi -echo "$as_me:2521: checking for function prototypes" >&5 +echo "$as_me:$LINENO: checking for function prototypes" >&5 echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 if test "$ac_cv_prog_cc_stdc" != no; then - echo "$as_me:2524: result: yes" >&5 + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 -EOF - -else - echo "$as_me:2532: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -echo "$as_me:2536: 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 -#line 2542 "configure" -#include "confdefs.h" -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - _ACEOF -if { (eval echo "$as_me:2550: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:2556: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no -fi -rm -f conftest.err 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 -#line 2578 "configure" -#include "confdefs.h" -#include <string.h> +cat >>confdefs.h <<\_ACEOF +#define __PROTOTYPES 1 _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 -#line 2596 "configure" -#include "confdefs.h" -#include <stdlib.h> - -_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 -#line 2617 "configure" -#include "confdefs.h" -#include <ctype.h> -#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:2643: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:2646: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:2648: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2651: \$? = $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 -cat conftest.$ac_ext >&5 -ac_cv_header_stdc=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:2664: 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 <<\EOF -#define STDC_HEADERS 1 -EOF - -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:2680: 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 -#line 2686 "configure" -#include "confdefs.h" -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2692: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2695: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2698: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2701: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo "$as_me:2711: 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 <<EOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -EOF -fi -done -echo "$as_me:2721: checking whether char is unsigned" >&5 +echo "$as_me:$LINENO: checking whether char is unsigned" >&5 echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6 if test "${ac_cv_c_char_unsigned+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2727 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default int main () { -int _array_ [1 - 2 * !(((char) -1) < 0)] +static int test_array [1 - 2 * !(((char) -1) < 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2739: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2742: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2745: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2748: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_char_unsigned=no else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_char_unsigned=yes fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2758: result: $ac_cv_c_char_unsigned" >&5 +echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 -EOF +_ACEOF fi -echo "$as_me:2767: checking return type of signal handlers" >&5 + +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2773 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <signal.h> #ifdef signal @@ -2786,40 +3418,47 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2795: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2798: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2801: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2804: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2814: result: $ac_cv_type_signal" >&5 +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 -cat >>confdefs.h <<EOF +cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal -EOF +_ACEOF + -echo "$as_me:2821: checking for size_t" >&5 + +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 -#line 2827 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default int main () @@ -2833,45 +3472,50 @@ if (sizeof (size_t)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2842: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2845: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2848: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2851: \$? = $ac_status" >&5 + 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 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2861: result: $ac_cv_type_size_t" >&5 +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 <<EOF +cat >>confdefs.h <<_ACEOF #define size_t unsigned -EOF +_ACEOF fi -echo "$as_me:2873: checking for ssize_t" >&5 +echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2879 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default int main () @@ -2885,45 +3529,51 @@ if (sizeof (ssize_t)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2894: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2897: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2900: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2903: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_ssize_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2913: result: $ac_cv_type_ssize_t" >&5 +echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 if test $ac_cv_type_ssize_t = yes; then : else -cat >>confdefs.h <<EOF +cat >>confdefs.h <<_ACEOF #define ssize_t int -EOF +_ACEOF fi -echo "$as_me:2925: checking whether stat file-mode macros are broken" >&5 + +echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2931 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> @@ -2953,7 +3603,7 @@ You lose. _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "You lose" >/dev/null 2>&1; then + $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no @@ -2961,27 +3611,36 @@ fi rm -f conftest* fi -echo "$as_me:2970: result: $ac_cv_header_stat_broken" >&5 +echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 -EOF +_ACEOF fi + + + + + ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:2983: checking for $ac_hdr that defines DIR" >&5 +echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 -#line 2989 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <$ac_hdr> @@ -2995,31 +3654,32 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3004: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3007: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3010: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3013: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3023: result: `eval echo '${'$as_ac_Header'}'`" >&5 +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 <<EOF + cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -EOF +_ACEOF ac_header_dirent=$ac_hdr; break fi @@ -3027,16 +3687,20 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - echo "$as_me:3036: checking for opendir in -ldir" >&5 -echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 -if test "${ac_cv_lib_dir_opendir+set}" = set; then + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldir $LIBS" + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF -#line 3044 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* 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 @@ -3054,43 +3718,96 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3063: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3066: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3069: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3072: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_dir_opendir=yes + ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_dir_opendir=no +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='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_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -echo "$as_me:3083: result: $ac_cv_lib_dir_opendir" >&5 -echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 -if test $ac_cv_lib_dir_opendir = yes; then - LIBS="$LIBS -ldir" +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + fi else - echo "$as_me:3090: checking for opendir in -lx" >&5 -echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 -if test "${ac_cv_lib_x_opendir+set}" = set; then + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lx $LIBS" + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF -#line 3098 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* 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 @@ -3108,105 +3825,182 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3117: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3120: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3123: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3126: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_x_opendir=yes + ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_x_opendir=no +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='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_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done fi -echo "$as_me:3137: result: $ac_cv_lib_x_opendir" >&5 -echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 -if test $ac_cv_lib_x_opendir = yes; then - LIBS="$LIBS -lx" +LIBS=$ac_func_search_save_LIBS fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi +fi + + + + + + + + + + + + + + for ac_func in lstat memmove putenv select setenv setlocale \ strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:3149: checking for $ac_func" >&5 +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 -#line 3155 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif /* 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 (); -char (*f) (); - -int -main () -{ /* 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 -f = $ac_func; +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:3186: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3189: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3192: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3195: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3205: result: `eval echo '${'$as_ac_var'}'`" >&5 +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 <<EOF + cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -EOF +_ACEOF fi done -echo "$as_me:3215: checking for working strcoll" >&5 + +echo "$as_me:$LINENO: checking for working strcoll" >&5 echo $ECHO_N "checking for working strcoll... $ECHO_C" >&6 if test "${ac_cv_func_strcoll_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3215,8 +4009,12 @@ else ac_cv_func_strcoll_works=no else cat >conftest.$ac_ext <<_ACEOF -#line 3224 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default int main () @@ -3229,58 +4027,125 @@ exit (strcoll ("abc", "def") >= 0 || } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3238: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3241: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3243: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3246: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strcoll_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) ac_cv_func_strcoll_works=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:3258: result: $ac_cv_func_strcoll_works" >&5 +echo "$as_me:$LINENO: result: $ac_cv_func_strcoll_works" >&5 echo "${ECHO_T}$ac_cv_func_strcoll_works" >&6 if test $ac_cv_func_strcoll_works = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_STRCOLL 1 -EOF +_ACEOF fi + + + + + + + + + + + + + + + + + + for ac_header in unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \ termcap.h termios.h termio.h sys/file.h locale.h memory.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:3273: checking for $ac_header" >&5 +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 - cat >conftest.$ac_ext <<_ACEOF -#line 3279 "configure" -#include "confdefs.h" + # 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 +#line $LINENO "configure" +/* 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>&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.$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 +#line $LINENO "configure" +/* 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:3283: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3289: \$? = $ac_status" >&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 @@ -3291,33 +4156,85 @@ else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +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 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 preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + 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: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_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:3308: result: `eval echo '${'$as_ac_Header'}'`" >&5 +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 <<EOF + cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -EOF +_ACEOF fi + done -echo "$as_me:3318: checking for type of signal functions" >&5 + + +echo "$as_me:$LINENO: checking for type of signal functions" >&5 echo $ECHO_N "checking for type of signal functions... $ECHO_C" >&6 if test "${bash_cv_signal_vintage+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3325 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <signal.h> int main () @@ -3334,25 +4251,30 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3343: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3346: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3349: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3352: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_signal_vintage=posix else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line 3360 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <signal.h> int main () @@ -3366,25 +4288,30 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3375: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3378: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3381: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3384: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_signal_vintage=4.2bsd else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line 3392 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <signal.h> RETSIGTYPE foo() { } @@ -3401,21 +4328,22 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3410: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3413: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3416: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3419: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_signal_vintage=svr3 else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_signal_vintage=v7 fi @@ -3429,39 +4357,45 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3438: result: $bash_cv_signal_vintage" >&5 +echo "$as_me:$LINENO: result: $bash_cv_signal_vintage" >&5 echo "${ECHO_T}$bash_cv_signal_vintage" >&6 if test "$bash_cv_signal_vintage" = posix; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_SIGNALS 1 -EOF +_ACEOF elif test "$bash_cv_signal_vintage" = "4.2bsd"; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_BSD_SIGNALS 1 -EOF +_ACEOF elif test "$bash_cv_signal_vintage" = svr3; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_USG_SIGHOLD 1 -EOF +_ACEOF fi -echo "$as_me:3457: checking if signal handlers must be reinstalled when invoked" >&5 + + +echo "$as_me:$LINENO: checking if signal handlers must be reinstalled when invoked" >&5 echo $ECHO_N "checking if signal handlers must be reinstalled when invoked... $ECHO_C" >&6 if test "${bash_cv_must_reinstall_sighandlers+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { echo "$as_me:3463: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&5 + { echo "$as_me:$LINENO: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&5 echo "$as_me: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&2;} bash_cv_must_reinstall_sighandlers=no else cat >conftest.$ac_ext <<_ACEOF -#line 3469 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <signal.h> #ifdef HAVE_UNISTD_H @@ -3508,50 +4442,58 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3517: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3520: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3522: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3525: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_must_reinstall_sighandlers=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) bash_cv_must_reinstall_sighandlers=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:3538: result: $bash_cv_must_reinstall_sighandlers" >&5 +echo "$as_me:$LINENO: result: $bash_cv_must_reinstall_sighandlers" >&5 echo "${ECHO_T}$bash_cv_must_reinstall_sighandlers" >&6 if test $bash_cv_must_reinstall_sighandlers = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define MUST_REINSTALL_SIGHANDLERS 1 -EOF +_ACEOF fi -echo "$as_me:3547: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 + + +echo "$as_me:$LINENO: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 echo $ECHO_N "checking for presence of POSIX-style sigsetjmp/siglongjmp... $ECHO_C" >&6 if test "${bash_cv_func_sigsetjmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { echo "$as_me:3553: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" >&5 + { echo "$as_me:$LINENO: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" >&5 echo "$as_me: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" >&2;} bash_cv_func_sigsetjmp=missing else cat >conftest.$ac_ext <<_ACEOF -#line 3559 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -3592,44 +4534,50 @@ exit(1); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3601: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3604: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3606: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3609: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_func_sigsetjmp=present else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) bash_cv_func_sigsetjmp=missing fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:3622: result: $bash_cv_func_sigsetjmp" >&5 +echo "$as_me:$LINENO: result: $bash_cv_func_sigsetjmp" >&5 echo "${ECHO_T}$bash_cv_func_sigsetjmp" >&6 if test $bash_cv_func_sigsetjmp = present; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_SIGSETJMP 1 -EOF +_ACEOF fi -echo "$as_me:3631: checking for lstat" >&5 +echo "$as_me:$LINENO: checking for lstat" >&5 echo $ECHO_N "checking for lstat... $ECHO_C" >&6 if test "${bash_cv_func_lstat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3637 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> @@ -3643,48 +4591,54 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3652: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3655: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3658: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3661: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_func_lstat=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_func_lstat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3671: result: $bash_cv_func_lstat" >&5 +echo "$as_me:$LINENO: result: $bash_cv_func_lstat" >&5 echo "${ECHO_T}$bash_cv_func_lstat" >&6 if test $bash_cv_func_lstat = yes; then - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define HAVE_LSTAT 1 -EOF +_ACEOF fi -echo "$as_me:3680: checking whether or not strcoll and strcmp differ" >&5 + +echo "$as_me:$LINENO: checking whether or not strcoll and strcmp differ" >&5 echo $ECHO_N "checking whether or not strcoll and strcmp differ... $ECHO_C" >&6 if test "${bash_cv_func_strcoll_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { echo "$as_me:3686: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&5 + { echo "$as_me:$LINENO: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&5 echo "$as_me: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&2;} bash_cv_func_strcoll_broken=no else cat >conftest.$ac_ext <<_ACEOF -#line 3692 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdio.h> #if defined (HAVE_LOCALE_H) @@ -3723,44 +4677,51 @@ char *v[]; _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3732: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3735: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3737: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3740: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_func_strcoll_broken=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) bash_cv_func_strcoll_broken=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:3753: result: $bash_cv_func_strcoll_broken" >&5 +echo "$as_me:$LINENO: result: $bash_cv_func_strcoll_broken" >&5 echo "${ECHO_T}$bash_cv_func_strcoll_broken" >&6 if test $bash_cv_func_strcoll_broken = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define STRCOLL_BROKEN 1 -EOF +_ACEOF fi -echo "$as_me:3762: checking whether getpw functions are declared in pwd.h" >&5 + +echo "$as_me:$LINENO: checking whether getpw functions are declared in pwd.h" >&5 echo $ECHO_N "checking whether getpw functions are declared in pwd.h... $ECHO_C" >&6 if test "${bash_cv_getpw_declared+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3768 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #ifdef HAVE_UNISTD_H @@ -3770,7 +4731,7 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "getpwuid" >/dev/null 2>&1; then + $EGREP "getpwuid" >/dev/null 2>&1; then bash_cv_getpw_declared=yes else bash_cv_getpw_declared=no @@ -3779,67 +4740,28 @@ rm -f conftest* fi -echo "$as_me:3788: result: $bash_cv_getpw_declared" >&5 +echo "$as_me:$LINENO: result: $bash_cv_getpw_declared" >&5 echo "${ECHO_T}$bash_cv_getpw_declared" >&6 if test $bash_cv_getpw_declared = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define HAVE_GETPW_DECLS 1 -EOF +_ACEOF fi -echo "$as_me:3797: checking POSIX termios" >&5 -echo $ECHO_N "checking POSIX termios... $ECHO_C" >&6 -if test "${ac_cv_sys_posix_termios+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 3803 "configure" -#include "confdefs.h" -#include <sys/types.h> -#include <unistd.h> -#include <termios.h> -int -main () -{ -/* SunOS 4.0.3 has termios.h but not the library calls. */ - tcgetattr(0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3818: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:3821: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3824: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3827: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_posix_termios=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_sys_posix_termios=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:3837: result: $ac_cv_sys_posix_termios" >&5 -echo "${ECHO_T}$ac_cv_sys_posix_termios" >&6 -if test $ac_cv_sys_posix_termios = yes; then - echo "$as_me:3841: checking whether termios.h defines TIOCGWINSZ" >&5 +echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether termios.h defines TIOCGWINSZ... $ECHO_C" >&6 if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3847 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <termios.h> #ifdef TIOCGWINSZ @@ -3848,7 +4770,7 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_termios_h=yes else ac_cv_sys_tiocgwinsz_in_termios_h=no @@ -3856,19 +4778,22 @@ fi rm -f conftest* fi -echo "$as_me:3865: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 +echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_termios_h" >&6 -fi if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then - echo "$as_me:3870: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 + echo "$as_me:$LINENO: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether sys/ioctl.h defines TIOCGWINSZ... $ECHO_C" >&6 if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3876 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/ioctl.h> #ifdef TIOCGWINSZ @@ -3877,7 +4802,7 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no @@ -3885,26 +4810,31 @@ fi rm -f conftest* fi -echo "$as_me:3894: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 +echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6 if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define GWINSZ_IN_SYS_IOCTL 1 -EOF +_ACEOF fi fi -echo "$as_me:3906: checking whether signal handlers are of type void" >&5 + +echo "$as_me:$LINENO: checking whether signal handlers are of type void" >&5 echo $ECHO_N "checking whether signal handlers are of type void... $ECHO_C" >&6 if test "${bash_cv_void_sighandler+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3912 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <signal.h> #ifdef signal @@ -3923,42 +4853,47 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3932: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3935: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3938: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3941: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_void_sighandler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_void_sighandler=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3951: result: $bash_cv_void_sighandler" >&5 +echo "$as_me:$LINENO: result: $bash_cv_void_sighandler" >&5 echo "${ECHO_T}$bash_cv_void_sighandler" >&6 if test $bash_cv_void_sighandler = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define VOID_SIGHANDLER 1 -EOF +_ACEOF fi -echo "$as_me:3960: checking for TIOCSTAT in sys/ioctl.h" >&5 +echo "$as_me:$LINENO: checking for TIOCSTAT in sys/ioctl.h" >&5 echo $ECHO_N "checking for TIOCSTAT in sys/ioctl.h... $ECHO_C" >&6 if test "${bash_cv_tiocstat_in_ioctl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3966 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/ioctl.h> int @@ -3970,43 +4905,48 @@ int x = TIOCSTAT; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3979: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3982: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3985: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3988: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_tiocstat_in_ioctl=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_tiocstat_in_ioctl=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3999: result: $bash_cv_tiocstat_in_ioctl" >&5 +echo "$as_me:$LINENO: result: $bash_cv_tiocstat_in_ioctl" >&5 echo "${ECHO_T}$bash_cv_tiocstat_in_ioctl" >&6 if test $bash_cv_tiocstat_in_ioctl = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define TIOCSTAT_IN_SYS_IOCTL 1 -EOF +_ACEOF fi -echo "$as_me:4008: checking for FIONREAD in sys/ioctl.h" >&5 +echo "$as_me:$LINENO: checking for FIONREAD in sys/ioctl.h" >&5 echo $ECHO_N "checking for FIONREAD in sys/ioctl.h... $ECHO_C" >&6 if test "${bash_cv_fionread_in_ioctl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4014 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/ioctl.h> int @@ -4018,43 +4958,48 @@ int x = FIONREAD; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4027: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4030: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4033: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4036: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_fionread_in_ioctl=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_fionread_in_ioctl=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4047: result: $bash_cv_fionread_in_ioctl" >&5 +echo "$as_me:$LINENO: result: $bash_cv_fionread_in_ioctl" >&5 echo "${ECHO_T}$bash_cv_fionread_in_ioctl" >&6 if test $bash_cv_fionread_in_ioctl = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define FIONREAD_IN_SYS_IOCTL 1 -EOF +_ACEOF fi -echo "$as_me:4056: checking for speed_t in sys/types.h" >&5 +echo "$as_me:$LINENO: checking for speed_t in sys/types.h" >&5 echo $ECHO_N "checking for speed_t in sys/types.h... $ECHO_C" >&6 if test "${bash_cv_speed_t_in_sys_types+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4062 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> int main () @@ -4065,43 +5010,48 @@ speed_t x; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4074: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4077: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4080: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4083: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_speed_t_in_sys_types=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_speed_t_in_sys_types=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4094: result: $bash_cv_speed_t_in_sys_types" >&5 +echo "$as_me:$LINENO: result: $bash_cv_speed_t_in_sys_types" >&5 echo "${ECHO_T}$bash_cv_speed_t_in_sys_types" >&6 if test $bash_cv_speed_t_in_sys_types = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define SPEED_T_IN_SYS_TYPES 1 -EOF +_ACEOF fi -echo "$as_me:4103: checking for struct winsize in sys/ioctl.h and termios.h" >&5 +echo "$as_me:$LINENO: checking for struct winsize in sys/ioctl.h and termios.h" >&5 echo $ECHO_N "checking for struct winsize in sys/ioctl.h and termios.h... $ECHO_C" >&6 if test "${bash_cv_struct_winsize_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4109 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/ioctl.h> int @@ -4113,24 +5063,29 @@ struct winsize x; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4122: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4125: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4128: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4131: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_struct_winsize_header=ioctl_h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF -#line 4138 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <termios.h> int @@ -4142,21 +5097,22 @@ struct winsize x; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4151: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4154: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4157: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4160: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_struct_winsize_header=termios_h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_struct_winsize_header=other fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4166,32 +5122,37 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test $bash_cv_struct_winsize_header = ioctl_h; then - echo "$as_me:4175: result: sys/ioctl.h" >&5 + echo "$as_me:$LINENO: result: sys/ioctl.h" >&5 echo "${ECHO_T}sys/ioctl.h" >&6 - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define STRUCT_WINSIZE_IN_SYS_IOCTL 1 -EOF +_ACEOF elif test $bash_cv_struct_winsize_header = termios_h; then - echo "$as_me:4182: result: termios.h" >&5 + echo "$as_me:$LINENO: result: termios.h" >&5 echo "${ECHO_T}termios.h" >&6 - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define STRUCT_WINSIZE_IN_TERMIOS 1 -EOF +_ACEOF else - echo "$as_me:4189: result: not found" >&5 + echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6 fi -echo "$as_me:4193: checking if struct dirent has a d_ino member" >&5 + +echo "$as_me:$LINENO: checking if struct dirent has a d_ino member" >&5 echo $ECHO_N "checking if struct dirent has a d_ino member... $ECHO_C" >&6 if test "${bash_cv_dirent_has_dino+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4199 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdio.h> #include <sys/types.h> @@ -4224,43 +5185,49 @@ struct dirent d; int z; z = d.d_ino; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4233: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4236: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4239: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4242: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_dirent_has_dino=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_dirent_has_dino=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4253: result: $bash_cv_dirent_has_dino" >&5 +echo "$as_me:$LINENO: result: $bash_cv_dirent_has_dino" >&5 echo "${ECHO_T}$bash_cv_dirent_has_dino" >&6 if test $bash_cv_dirent_has_dino = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define STRUCT_DIRENT_HAS_D_INO 1 -EOF +_ACEOF fi -echo "$as_me:4262: checking if struct dirent has a d_fileno member" >&5 + +echo "$as_me:$LINENO: checking if struct dirent has a d_fileno member" >&5 echo $ECHO_N "checking if struct dirent has a d_fileno member... $ECHO_C" >&6 if test "${bash_cv_dirent_has_d_fileno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4268 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdio.h> #include <sys/types.h> @@ -4293,35 +5260,37 @@ struct dirent d; int z; z = d.d_fileno; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4302: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4305: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4308: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4311: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_dirent_has_d_fileno=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_dirent_has_d_fileno=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4322: result: $bash_cv_dirent_has_d_fileno" >&5 +echo "$as_me:$LINENO: result: $bash_cv_dirent_has_d_fileno" >&5 echo "${ECHO_T}$bash_cv_dirent_has_d_fileno" >&6 if test $bash_cv_dirent_has_d_fileno = yes; then -cat >>confdefs.h <<\EOF +cat >>confdefs.h <<\_ACEOF #define STRUCT_DIRENT_HAS_D_FILENO 1 -EOF +_ACEOF fi + case "$host_os" in aix*) prefer_curses=yes ;; esac @@ -4329,14 +5298,14 @@ esac if test "X$bash_cv_termcap_lib" = "X"; then _bash_needmsg=yes else -echo "$as_me:4338: checking which library has the termcap functions" >&5 +echo "$as_me:$LINENO: checking which library has the termcap functions" >&5 echo $ECHO_N "checking which library has the termcap functions... $ECHO_C" >&6 _bash_needmsg= fi if test "${bash_cv_termcap_lib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me:4345: checking for tgetent in -ltermcap" >&5 + echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6 if test "${ac_cv_lib_termcap_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4344,8 +5313,12 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ltermcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4353 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* 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 @@ -4363,32 +5336,33 @@ tgetent (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4372: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4375: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4378: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4381: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_termcap_tgetent=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_termcap_tgetent=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4392: result: $ac_cv_lib_termcap_tgetent" >&5 +echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6 if test $ac_cv_lib_termcap_tgetent = yes; then bash_cv_termcap_lib=libtermcap else - echo "$as_me:4397: checking for tgetent in -ltinfo" >&5 + echo "$as_me:$LINENO: checking for tgetent in -ltinfo" >&5 echo $ECHO_N "checking for tgetent in -ltinfo... $ECHO_C" >&6 if test "${ac_cv_lib_tinfo_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4396,8 +5370,12 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4405 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* 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 @@ -4415,32 +5393,33 @@ tgetent (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4424: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4427: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4430: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4433: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_tinfo_tgetent=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_tinfo_tgetent=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4444: result: $ac_cv_lib_tinfo_tgetent" >&5 +echo "$as_me:$LINENO: result: $ac_cv_lib_tinfo_tgetent" >&5 echo "${ECHO_T}$ac_cv_lib_tinfo_tgetent" >&6 if test $ac_cv_lib_tinfo_tgetent = yes; then bash_cv_termcap_lib=libtinfo else - echo "$as_me:4449: checking for tgetent in -lcurses" >&5 + echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6 if test "${ac_cv_lib_curses_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4448,8 +5427,12 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4457 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* 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 @@ -4467,32 +5450,33 @@ tgetent (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4476: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4479: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4482: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4485: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_curses_tgetent=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_curses_tgetent=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4496: result: $ac_cv_lib_curses_tgetent" >&5 +echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6 if test $ac_cv_lib_curses_tgetent = yes; then bash_cv_termcap_lib=libcurses else - echo "$as_me:4501: checking for tgetent in -lncurses" >&5 + echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5 echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6 if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4500,8 +5484,12 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4509 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* 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 @@ -4519,27 +5507,28 @@ tgetent (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4528: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4531: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4534: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4537: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ncurses_tgetent=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_ncurses_tgetent=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4548: result: $ac_cv_lib_ncurses_tgetent" >&5 +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5 echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6 if test $ac_cv_lib_ncurses_tgetent = yes; then bash_cv_termcap_lib=libncurses @@ -4556,10 +5545,10 @@ fi fi if test "X$_bash_needmsg" = "Xyes"; then -echo "$as_me:4565: checking which library has the termcap functions" >&5 +echo "$as_me:$LINENO: checking which library has the termcap functions" >&5 echo $ECHO_N "checking which library has the termcap functions... $ECHO_C" >&6 fi -echo "$as_me:4568: result: using $bash_cv_termcap_lib" >&5 +echo "$as_me:$LINENO: result: using $bash_cv_termcap_lib" >&5 echo "${ECHO_T}using $bash_cv_termcap_lib" >&6 if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then LDFLAGS="$LDFLAGS -L./lib/termcap" @@ -4587,26 +5576,75 @@ if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then fi fi + + for ac_header in wctype.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:4599: checking for $ac_header" >&5 +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 - cat >conftest.$ac_ext <<_ACEOF -#line 4605 "configure" -#include "confdefs.h" + # 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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include <$ac_header> _ACEOF -if { (eval echo "$as_me:4609: \"$ac_cpp conftest.$ac_ext\"") >&5 +rm -f conftest.$ac_objext +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); } && + { 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.$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 +#line $LINENO "configure" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4615: \$? = $ac_status" >&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 @@ -4617,44 +5655,138 @@ else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +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 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 preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + 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: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_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:4634: result: `eval echo '${'$as_ac_Header'}'`" >&5 +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 <<EOF + cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -EOF +_ACEOF fi + done + for ac_header in wchar.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:4647: checking for $ac_header" >&5 +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 - cat >conftest.$ac_ext <<_ACEOF -#line 4653 "configure" -#include "confdefs.h" + # 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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include <$ac_header> _ACEOF -if { (eval echo "$as_me:4657: \"$ac_cpp conftest.$ac_ext\"") >&5 +rm -f conftest.$ac_objext +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); } && + { 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.$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 +#line $LINENO "configure" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4663: \$? = $ac_status" >&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 @@ -4665,44 +5797,138 @@ else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +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 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 preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + 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: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_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:4682: result: `eval echo '${'$as_ac_Header'}'`" >&5 +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 <<EOF + cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -EOF +_ACEOF fi + done + for ac_header in langinfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:4695: checking for $ac_header" >&5 +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 - cat >conftest.$ac_ext <<_ACEOF -#line 4701 "configure" -#include "confdefs.h" + # 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 +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include <$ac_header> _ACEOF -if { (eval echo "$as_me:4705: \"$ac_cpp conftest.$ac_ext\"") >&5 +rm -f conftest.$ac_objext +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); } && + { 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.$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 +#line $LINENO "configure" +/* 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=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4711: \$? = $ac_status" >&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 @@ -4713,167 +5939,335 @@ else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +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 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 preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + 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: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_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:4730: result: `eval echo '${'$as_ac_Header'}'`" >&5 +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 <<EOF + cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -EOF +_ACEOF fi + done -echo "$as_me:4740: checking for mbsrtowcs" >&5 -echo $ECHO_N "checking for mbsrtowcs... $ECHO_C" >&6 -if test "${ac_cv_func_mbsrtowcs+set}" = set; then + +echo "$as_me:$LINENO: checking for mbrtowc" >&5 +echo $ECHO_N "checking for mbrtowc... $ECHO_C" >&6 +if test "${ac_cv_func_mbrtowc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4746 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char mbsrtowcs (); below. */ -#include <assert.h> + which can conflict with char mbrtowc (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif /* 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 mbsrtowcs (); -char (*f) (); +char mbrtowc (); +/* 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_mbrtowc) || defined (__stub___mbrtowc) +choke me +#else +char (*f) () = mbrtowc; +#endif +#ifdef __cplusplus +} +#endif int main () { +return f != mbrtowc; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='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_mbrtowc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mbrtowc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mbrtowc" >&5 +echo "${ECHO_T}$ac_cv_func_mbrtowc" >&6 +if test $ac_cv_func_mbrtowc = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_MBRTOWC 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for mbsrtowcs" >&5 +echo $ECHO_N "checking for mbsrtowcs... $ECHO_C" >&6 +if test "${ac_cv_func_mbsrtowcs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mbsrtowcs (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif +/* 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 mbsrtowcs (); /* 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_mbsrtowcs) || defined (__stub___mbsrtowcs) choke me #else -f = mbsrtowcs; +char (*f) () = mbsrtowcs; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != mbsrtowcs; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4777: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4780: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4783: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4786: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mbsrtowcs=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_mbsrtowcs=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4796: result: $ac_cv_func_mbsrtowcs" >&5 +echo "$as_me:$LINENO: result: $ac_cv_func_mbsrtowcs" >&5 echo "${ECHO_T}$ac_cv_func_mbsrtowcs" >&6 if test $ac_cv_func_mbsrtowcs = yes; then - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define HAVE_MBSRTOWCS 1 -EOF +_ACEOF fi -echo "$as_me:4805: checking for wcwidth" >&5 +echo "$as_me:$LINENO: checking for wcwidth" >&5 echo $ECHO_N "checking for wcwidth... $ECHO_C" >&6 if test "${ac_cv_func_wcwidth+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4811 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char wcwidth (); below. */ -#include <assert.h> + which can conflict with char wcwidth (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif /* 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 wcwidth (); -char (*f) (); - -int -main () -{ /* 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_wcwidth) || defined (__stub___wcwidth) choke me #else -f = wcwidth; +char (*f) () = wcwidth; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != wcwidth; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4842: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4845: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4848: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4851: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_wcwidth=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_wcwidth=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4861: result: $ac_cv_func_wcwidth" >&5 +echo "$as_me:$LINENO: result: $ac_cv_func_wcwidth" >&5 echo "${ECHO_T}$ac_cv_func_wcwidth" >&6 if test $ac_cv_func_wcwidth = yes; then - cat >>confdefs.h <<\EOF + have_wcwidth=yes +fi + +if test "$have_wcwidth" = yes; then + cat >>confdefs.h <<\_ACEOF #define HAVE_WCWIDTH 1 -EOF +_ACEOF + + +else + WCWIDTH_OBJ=wcwidth.o fi -echo "$as_me:4870: checking for mbstate_t" >&5 +echo "$as_me:$LINENO: checking for mbstate_t" >&5 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6 if test "${bash_cv_have_mbstate_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:4876: error: cannot run test program while cross compiling" >&5 -echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { { 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 -#line 4881 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <wchar.h> int @@ -4884,43 +6278,49 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:4893: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4896: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:4898: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4901: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_have_mbstate_t=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) bash_cv_have_mbstate_t=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:4913: result: $bash_cv_have_mbstate_t" >&5 +echo "$as_me:$LINENO: result: $bash_cv_have_mbstate_t" >&5 echo "${ECHO_T}$bash_cv_have_mbstate_t" >&6 if test $bash_cv_have_mbstate_t = yes; then - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define HAVE_MBSTATE_T 1 -EOF +_ACEOF fi -echo "$as_me:4922: checking for nl_langinfo and CODESET" >&5 +echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${bash_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4928 "configure" -#include "confdefs.h" +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <langinfo.h> int main () @@ -4931,34 +6331,37 @@ char* cs = nl_langinfo(CODESET); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4940: \"$ac_link\"") >&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4943: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4946: \"$ac_try\"") >&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4949: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bash_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + bash_cv_langinfo_codeset=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4959: result: $bash_cv_langinfo_codeset" >&5 +echo "$as_me:$LINENO: result: $bash_cv_langinfo_codeset" >&5 echo "${ECHO_T}$bash_cv_langinfo_codeset" >&6 if test $bash_cv_langinfo_codeset = yes; then - cat >>confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 -EOF +_ACEOF fi + + case "$host_cpu" in *cray*) LOCAL_CFLAGS=-DCRAY ;; *s390*) LOCAL_CFLAGS=-fsigned-char ;; @@ -4974,11 +6377,22 @@ esac # ${srcdir}/support/shobj-conf # if test -f ${srcdir}/support/shobj-conf; then - echo "$as_me:4983: checking configuration for building shared libraries" >&5 + echo "$as_me:$LINENO: checking configuration for building shared libraries" >&5 echo $ECHO_N "checking configuration for building shared libraries... $ECHO_C" >&6 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` - echo "$as_me:4987: result: $SHLIB_STATUS" >&5 + + + + + + + + + + + + echo "$as_me:$LINENO: result: $SHLIB_STATUS" >&5 echo "${ECHO_T}$SHLIB_STATUS" >&6 # SHLIB_STATUS is either `supported' or `unsupported'. If it's @@ -4992,6 +6406,7 @@ echo "${ECHO_T}$SHLIB_STATUS" >&6 SHLIB_MAJOR=`expr "$LIBVERSION" : '\([0-9]\)\..*'` SHLIB_MINOR=`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'` + fi if test "$opt_static_libs" = "yes"; then @@ -5003,13 +6418,35 @@ if test "$opt_shared_libs" = "yes"; then SHARED_INSTALL_TARGET=install-shared fi + + + + + case "$host_os" in msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file *) BUILD_DIR=`pwd` ;; esac -ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile shlib/Makefile" -ac_config_commands="$ac_config_commands default" + + + + + + + + + + + + + + + + + + ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile shlib/Makefile" + 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 @@ -5020,7 +6457,7 @@ cat >confcache <<\_ACEOF # 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 overriden when +# `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. @@ -5055,7 +6492,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +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 @@ -5086,35 +6523,227 @@ fi DEFS=-DHAVE_CONFIG_H +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} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:5098: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL -# Generated automatically by configure. +# Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false +ac_cs_recheck=false +ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} -ac_cs_invocation="\$0 \$@" - _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + # 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 +# Support unset when possible. +if (FOO=FOO; unset FOO) >/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 -n "`(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=`echo "$0" |sed 's,.*[\\/],,'` +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 + + # 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; }; } + + # 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 @@ -5140,24 +6769,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file -as_executable_p="test -f" - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: else - as_unset=false + as_mkdir_p=false fi -# NLS nuisances. -$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } -$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } -$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } -$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } -$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } -$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } -$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } -$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + # IFS # We need space, tab and new line, in precisely that order. @@ -5166,10 +6791,34 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export 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 readline $as_me 4.3, which was +generated by GNU Autoconf 2.57. 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. @@ -5189,7 +6838,7 @@ if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi -cat >>$CONFIG_STATUS <<\EOF +cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the @@ -5199,6 +6848,7 @@ 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] @@ -5216,12 +6866,12 @@ Configuration commands: $config_commands Report bugs to <bug-autoconf@gnu.org>." -EOF +_ACEOF -cat >>$CONFIG_STATUS <<EOF +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ readline config.status 4.3 -configured by $0, generated by GNU Autoconf 2.52, +configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -5230,9 +6880,9 @@ This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" -EOF +_ACEOF -cat >>$CONFIG_STATUS <<\EOF +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=: @@ -5242,30 +6892,30 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + 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 $1 in + case $ac_option in # Handling of the options. -EOF -cat >>$CONFIG_STATUS <<EOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -EOF -cat >>$CONFIG_STATUS <<\EOF + ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:5274: error: ambiguous option: $1 + { { 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;} @@ -5275,16 +6925,19 @@ Try \`$0 --help' for more information." >&2;} --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" + $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:5293: error: unrecognized option: $1 + -*) { { 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;} @@ -5296,25 +6949,27 @@ Try \`$0 --help' for more information." >&2;} shift done -exec 5>>config.log -cat >&5 << _ACEOF +ac_configure_extra_args= -## ----------------------- ## -## Running config.status. ## -## ----------------------- ## +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi -This file was extended by $as_me (readline 4.3) 2.52, executed with - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - > $ac_cs_invocation -on `(hostname || uname -n) 2>/dev/null | sed 1q` +_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 -EOF -cat >>$CONFIG_STATUS <<\EOF + + + + +cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in @@ -5325,7 +6980,7 @@ do "shlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES shlib/Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - *) { { echo "$as_me:5334: error: invalid argument: $ac_config_target" >&5 + *) { { 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 @@ -5341,6 +6996,9 @@ if $ac_need_defaults; then test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 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 || { @@ -5349,23 +7007,23 @@ $debug || } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -EOF +_ACEOF -cat >>$CONFIG_STATUS <<EOF +cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. @@ -5378,6 +7036,12 @@ if test -n "\$CONFIG_FILES"; then 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 @@ -5393,19 +7057,13 @@ s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;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,@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,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t @@ -5424,6 +7082,7 @@ s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t s,@CROSS_COMPILING_FLAG@,$CROSS_COMPILING_FLAG,;t t s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t @@ -5433,6 +7092,7 @@ s,@AR@,$AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@MAKE_SHELL@,$MAKE_SHELL,;t t +s,@WCWIDTH_OBJ@,$WCWIDTH_OBJ,;t t s,@SHOBJ_CC@,$SHOBJ_CC,;t t s,@SHOBJ_CFLAGS@,$SHOBJ_CFLAGS,;t t s,@SHOBJ_LD@,$SHOBJ_LD,;t t @@ -5458,11 +7118,13 @@ s,@LOCAL_DEFS@,$LOCAL_DEFS,;t t s,@ARFLAGS@,$ARFLAGS,;t t s,@LIBVERSION@,$LIBVERSION,;t t s,@TERMCAP_LIB@,$TERMCAP_LIB,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF -EOF +_ACEOF - cat >>$CONFIG_STATUS <<\EOF + 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 @@ -5501,8 +7163,8 @@ EOF fi fi # test -n "$CONFIG_FILES" -EOF -cat >>$CONFIG_STATUS <<\EOF +_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 @@ -5516,7 +7178,8 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + 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\(/\)' \| \ @@ -5527,60 +7190,84 @@ echo X"$ac_file" | /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || mkdir "$as_incr_dir" - ;; - esac -done; } - - 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'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" else - ac_dir_suffix= ac_dots= - fi + 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; }; }; } - case $srcdir in - .) ac_srcdir=. - if test -z "$ac_dots"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; + 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_dots$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_dots$srcdir ;; - esac + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_dots$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then - { echo "$as_me:5581: creating $ac_file" >&5 + { 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 automatically by config.status. */ - configure_input="Generated automatically from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + # /* 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. @@ -5590,7 +7277,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:5599: error: cannot find input file: $f" >&5 + 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;; @@ -5603,23 +7290,29 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:5612: error: cannot find input file: $f" >&5 + { { 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; } -EOF -cat >>$CONFIG_STATUS <<EOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub -EOF -cat >>$CONFIG_STATUS <<\EOF +_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 @@ -5631,8 +7324,8 @@ s,@INSTALL@,$ac_INSTALL,;t t fi done -EOF -cat >>$CONFIG_STATUS <<\EOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. @@ -5664,7 +7357,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:5673: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -5675,7 +7368,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:5684: error: cannot find input file: $f" >&5 + 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;; @@ -5688,7 +7381,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:5697: error: cannot find input file: $f" >&5 + { { 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;; @@ -5697,7 +7390,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in -EOF +_ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into @@ -5713,16 +7406,16 @@ rm -f conftest.defines conftest.undefs # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\EOF +cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end -EOF +_ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. @@ -5733,14 +7426,14 @@ rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\EOF +cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -EOF +_ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail @@ -5764,7 +7457,7 @@ do mv conftest.tail conftest.defines done rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS +echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size @@ -5792,23 +7485,24 @@ do done rm -f conftest.undefs -cat >>$CONFIG_STATUS <<\EOF +cat >>$CONFIG_STATUS <<\_ACEOF # 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 automatically by config.status. */ + # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then - echo "/* Generated automatically by configure. */" >$tmp/config.h + echo "/* Generated by configure. */" >$tmp/config.h else - echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:5814: $ac_file is unchanged" >&5 + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + 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\(/\)' \| \ @@ -5819,24 +7513,31 @@ echo X"$ac_file" | /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || mkdir "$as_incr_dir" - ;; - esac -done; } + { 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; }; }; } - fi rm -f $ac_file mv $tmp/config.h $ac_file fi @@ -5845,8 +7546,8 @@ done; } rm -f $tmp/config.h fi done -EOF -cat >>$CONFIG_STATUS <<\EOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. @@ -5854,7 +7555,53 @@ cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + 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 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in default ) # Makefile uses this timestamp file to record whether config.h is up to date. @@ -5862,15 +7609,16 @@ echo > stamp-h ;; esac done -EOF +_ACEOF -cat >>$CONFIG_STATUS <<\EOF +cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } -EOF +_ACEOF chmod +x $CONFIG_STATUS 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 @@ -5881,8 +7629,11 @@ ac_clean_files=$ac_clean_files_save # 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_cs_success=false + $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. diff --git a/readline/rlmbutil.h b/readline/rlmbutil.h index 27ca32b..9b8464a 100644 --- a/readline/rlmbutil.h +++ b/readline/rlmbutil.h @@ -35,7 +35,8 @@ #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) # include <wchar.h> # include <wctype.h> -# if defined (HAVE_MBSRTOWCS) /* system is supposed to support XPG5 */ +# if defined (HAVE_MBRTOWC) && defined (HAVE_MBSRTOWCS) + /* system is supposed to support XPG5 */ # define HANDLE_MULTIBYTE 1 # endif #endif diff --git a/readline/shlib/Makefile.in b/readline/shlib/Makefile.in index 0cba57e..22748c4 100644 --- a/readline/shlib/Makefile.in +++ b/readline/shlib/Makefile.in @@ -103,6 +103,8 @@ SHARED_READLINE = libreadline.$(SHLIB_LIBVERSION) SHARED_HISTORY = libhistory.$(SHLIB_LIBVERSION) SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY) +WCWIDTH_OBJ = @WCWIDTH_OBJ@ + # The C code source files for this library. CSOURCES = $(topdir)/readline.c $(topdir)/funmap.c $(topdir)/keymaps.c \ $(topdir)/vi_mode.c $(topdir)/parens.c $(topdir)/rltty.c \ @@ -115,7 +117,7 @@ CSOURCES = $(topdir)/readline.c $(topdir)/funmap.c $(topdir)/keymaps.c \ $(topdir)/histfile.c $(topdir)/nls.c $(topdir)/search.c \ $(topdir)/shell.c $(topdir)/savestring.c $(topdir)/tilde.c \ $(topdir)/text.c $(topdir)/misc.c $(topdir)/compat.c \ - $(topdir)/mbutil.c + $(topdir)/mbutil.c $(WCWIDTH_SRC) # The header files for this library. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \ @@ -129,7 +131,7 @@ SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \ rltty.so complete.so bind.so isearch.so display.so signals.so \ util.so kill.so undo.so macro.so input.so callback.so terminal.so \ text.so nls.so misc.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ) \ - compat.so + compat.so $(WCWIDTH_OBJ) ########################################################################## @@ -153,6 +155,10 @@ $(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so $(RM) $@ $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) xmalloc.so $(SHLIB_LIBS) +wcwidth.o: $(srcdir)/support/wcwidth.c + $(RM) $@ + $(SHOBJ_CC) -c $(CCFLAGS) $(SHOBJ_FLAGS) $(srcdir)/support/wcwidth.c + # Since tilde.c is shared between readline and bash, make sure we compile # it with the right flags when it's built as part of readline tilde.so: tilde.c diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index ca21f15..5e4b316 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,12 @@ +2003-03-02 Nick Clifton <nickc@redhat.com> + + * armos.c (SWIWrite0): Catch big-endian bug when printing + characters. + +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * wrapper.c (sim_create_inferior, sim_open): Rename _bfd to bfd. + 2003-01-10 Ben Elliston <bje@redhat.com> * README.Cygnus: Rename from this .. diff --git a/sim/arm/armos.c b/sim/arm/armos.c index c4cb051..04916d6 100644 --- a/sim/arm/armos.c +++ b/sim/arm/armos.c @@ -274,7 +274,13 @@ SWIWrite0 (ARMul_State * state, ARMword addr) struct OSblock *OSptr = (struct OSblock *) state->OSptr; while ((temp = ARMul_SafeReadByte (state, addr++)) != 0) - (void) sim_callback->write_stdout (sim_callback, (char *) &temp, 1); + { + char buffer = temp; + /* Note - we cannot just cast 'temp' to a (char *) here, + since on a big-endian host the byte value will end + up in the wrong place and a nul character will be printed. */ + (void) sim_callback->write_stdout (sim_callback, & buffer, 1); + } OSptr->ErrorNo = sim_callback->get_errno (sim_callback); } diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 262e2e7..244c475 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -204,7 +204,7 @@ sim_resume (sd, step, siggnal) SIM_RC sim_create_inferior (sd, abfd, argv, env) SIM_DESC sd ATTRIBUTE_UNUSED; - struct _bfd * abfd; + struct bfd * abfd; char ** argv; char ** env; { @@ -610,7 +610,7 @@ SIM_DESC sim_open (kind, ptr, abfd, argv) SIM_OPEN_KIND kind; host_callback *ptr; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { sim_kind = kind; diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 46a2cc8..a7c8f4f 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,33 @@ +2003-03-01 Andrew Cagney <cagney@redhat.com> + + * sim-engine.c (sim_engine_halt): If jmpbuf is invalid, abort. + (sim_engine_vabort): Ditto. + +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * sim-utils.h (sim_analyze_program, sim_load_file): Rename _bfd to bfd. + * sim-hload.c (sim_load), sim-base.h (sim_state_base): Ditto. + * nrun.c (main): Ditto. + +2003-02-26 Andrew Cagney <cagney@redhat.com> + + * sim-engine.h (sim_engine_abort): Add noreturn attribute. + (sim_engine_vabort): Ditto. + (sim_engine_halt, sim_engine_restart): Ditto. + +2003-02-20 Andrew Cagney <ac131313@redhat.com> + + * Make-common.in (SIM_NEW_COMMON_OBJS): Remove sim-break.o + (sim-break_h): Delete macro. + (sim-break.o): Delete rule. + * sim-break.c: Delete file. + * sim-break.h: Delete file. + * sim-base.h [SIM_HAVE_BREAKPOINTS]: Don't include "sim-break.h". + (STATE_BREAKPOINTS): Delete macro. + (sim_state_base): Delete field breakpoints. + * sim-module.c (modules) [SIM_HAVE_BREAKPOINTS]: Don't add + sim_break_install to array. + 2003-01-08 Kazu Hirata <kazu@cs.umass.edu> * run.c (usage): Fix typos. diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index e3e1239..9e2c7c4 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -161,7 +161,6 @@ SIM_COMMON_HW_OBJS = \ SIM_NEW_COMMON_OBJS = \ sim-arange.o \ sim-bits.o \ - sim-break.o \ sim-config.o \ sim-core.o \ sim-endian.o \ @@ -335,7 +334,6 @@ sim-events_h = $(srccom)/sim-events.h sim-fpu_h = $(srccom)/sim-fpu.h sim-io_h = $(srccom)/sim-io.h sim-options_h = $(srccom)/sim-options.h -sim-break_h = $(srccom)/sim-break.h sim-signal_h = $(srccom)/sim-signal.h hw-alloc_h = $(srccom)/hw-alloc.h @@ -477,10 +475,6 @@ sim-watch.o: $(srccom)/sim-watch.c $(sim_main_headers) sim-load.o: $(srccom)/sim-load.c $(callback_h) $(CC) -c $(srccom)/sim-load.c $(ALL_CFLAGS) -sim-break.o: $(srccom)/sim-break.c $(sim_main_headers) \ - $(sim_break_h) - $(CC) -c $(srccom)/sim-break.c $(ALL_CFLAGS) - # FIXME This is one very simple-minded way of generating the file hw-config.h hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile diff --git a/sim/common/nrun.c b/sim/common/nrun.c index ef25d68..7c77f5c 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -47,7 +47,7 @@ main (int argc, char **argv) { char *name; char **prog_argv = NULL; - struct _bfd *prog_bfd; + struct bfd *prog_bfd; enum sim_stop reason; int sigrc = 0; int single_step = 0; diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h index 420b137..3f702f6 100644 --- a/sim/common/sim-base.h +++ b/sim/common/sim-base.h @@ -1,5 +1,7 @@ /* Simulator pseudo baseclass. - Copyright (C) 1997-1998 Free Software Foundation, Inc. + + Copyright 1997, 1998, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. @@ -90,9 +92,6 @@ typedef struct _sim_cpu sim_cpu; #include "sim-engine.h" #include "sim-watch.h" #include "sim-memopt.h" -#ifdef SIM_HAVE_BREAKPOINTS -#include "sim-break.h" -#endif #include "sim-cpu.h" /* Global pointer to current state while sim_resume is running. @@ -172,7 +171,7 @@ typedef struct { #define STATE_PROG_ARGV(sd) ((sd)->base.prog_argv) /* The program's bfd. */ - struct _bfd *prog_bfd; + struct bfd *prog_bfd; #define STATE_PROG_BFD(sd) ((sd)->base.prog_bfd) /* Symbol table for prog_bfd */ @@ -227,10 +226,6 @@ typedef struct { sim_watchpoints watchpoints; #define STATE_WATCHPOINTS(sd) (&(sd)->base.watchpoints) - /* Pointer to list of breakpoints */ - struct sim_breakpoint *breakpoints; -#define STATE_BREAKPOINTS(sd) ((sd)->base.breakpoints) - #if WITH_HW struct sim_hw *hw; #define STATE_HW(sd) ((sd)->base.hw) diff --git a/sim/common/sim-break.c b/sim/common/sim-break.c deleted file mode 100644 index 3b89560..0000000 --- a/sim/common/sim-break.c +++ /dev/null @@ -1,278 +0,0 @@ -/* Simulator breakpoint support. - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Cygnus Support. - -This file is part of GDB, the GNU debugger. - -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., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdio.h> - -#include "sim-main.h" -#include "sim-assert.h" -#include "sim-break.h" - -#ifndef SIM_BREAKPOINT -#define SIM_BREAKPOINT {0x00} -#define SIM_BREAKPOINT_SIZE (1) -#endif - -struct -sim_breakpoint -{ - struct sim_breakpoint *next; - SIM_ADDR addr; /* Address of this breakpoint */ - int flags; - unsigned char loc_contents[SIM_BREAKPOINT_SIZE]; /* Contents of addr while - BP is enabled */ -}; - -#define SIM_BREAK_INSERTED 0x1 /* Breakpoint has been inserted */ -#define SIM_BREAK_DISABLED 0x2 /* Breakpoint is disabled */ - -static unsigned char sim_breakpoint [] = SIM_BREAKPOINT; - -static void insert_breakpoint PARAMS ((SIM_DESC sd, - struct sim_breakpoint *bp)); -static void remove_breakpoint PARAMS ((SIM_DESC sd, - struct sim_breakpoint *bp)); -static SIM_RC resume_handler PARAMS ((SIM_DESC sd)); -static SIM_RC suspend_handler PARAMS ((SIM_DESC sd)); - - -/* Do the actual work of inserting a breakpoint into the instruction - stream. */ - -static void -insert_breakpoint (sd, bp) - SIM_DESC sd; - struct sim_breakpoint *bp; -{ - if (bp->flags & (SIM_BREAK_INSERTED | SIM_BREAK_DISABLED)) - return; - - sim_core_read_buffer (sd, NULL, exec_map, bp->loc_contents, - bp->addr, SIM_BREAKPOINT_SIZE); - sim_core_write_buffer (sd, NULL, exec_map, sim_breakpoint, - bp->addr, SIM_BREAKPOINT_SIZE); - bp->flags |= SIM_BREAK_INSERTED; -} - -/* Do the actual work of removing a breakpoint. */ - -static void -remove_breakpoint (sd, bp) - SIM_DESC sd; - struct sim_breakpoint *bp; -{ - if (!(bp->flags & SIM_BREAK_INSERTED)) - return; - - sim_core_write_buffer (sd, NULL, exec_map, bp->loc_contents, - bp->addr, SIM_BREAKPOINT_SIZE); - bp->flags &= ~SIM_BREAK_INSERTED; -} - -/* Come here when a breakpoint insn is hit. If it's really a breakpoint, we - halt things, and never return. If it's a false hit, we return to let the - caller handle things. */ - -void -sim_handle_breakpoint (sd, cpu, cia) - SIM_DESC sd; - sim_cpu *cpu; - sim_cia cia; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - if (bp->addr == CIA_ADDR (cia)) - break; - - if (!bp || !(bp->flags & SIM_BREAK_INSERTED)) - return; - - sim_engine_halt (sd, STATE_CPU (sd, 0), NULL, cia, sim_stopped, SIM_SIGTRAP); -} - -/* Handler functions for simulator resume and suspend events. */ - -static SIM_RC -resume_handler (sd) - SIM_DESC sd; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - insert_breakpoint (sd, bp); - - return SIM_RC_OK; -} - -static SIM_RC -suspend_handler (sd) - SIM_DESC sd; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - remove_breakpoint (sd, bp); - - return SIM_RC_OK; -} - -/* Called from simulator module initialization. */ - -SIM_RC -sim_break_install (sd) - SIM_DESC sd; -{ - sim_module_add_resume_fn (sd, resume_handler); - sim_module_add_suspend_fn (sd, suspend_handler); - - return SIM_RC_OK; -} - -/* Install a breakpoint. This is a user-function. The breakpoint isn't - actually installed here. We just record it. Resume_handler does the - actual work. -*/ - -SIM_RC -sim_set_breakpoint (sd, addr) - SIM_DESC sd; - SIM_ADDR addr; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - if (bp->addr == addr) - return SIM_RC_DUPLICATE_BREAKPOINT; /* Already there */ - else - break; /* FIXME: why not scan all bp's? */ - - bp = ZALLOC (struct sim_breakpoint); - - bp->addr = addr; - bp->next = STATE_BREAKPOINTS (sd); - bp->flags = 0; - STATE_BREAKPOINTS (sd) = bp; - - return SIM_RC_OK; -} - -/* Delete a breakpoint. All knowlege of the breakpoint is removed from the - simulator. -*/ - -SIM_RC -sim_clear_breakpoint (sd, addr) - SIM_DESC sd; - SIM_ADDR addr; -{ - struct sim_breakpoint *bp, *bpprev; - - for (bp = STATE_BREAKPOINTS (sd), bpprev = NULL; - bp; - bpprev = bp, bp = bp->next) - if (bp->addr == addr) - break; - - if (!bp) - return SIM_RC_UNKNOWN_BREAKPOINT; - - remove_breakpoint (sd, bp); - - if (bpprev) - bpprev->next = bp->next; - else - STATE_BREAKPOINTS (sd) = NULL; - - zfree (bp); - - return SIM_RC_OK; -} - -SIM_RC -sim_clear_all_breakpoints (sd) - SIM_DESC sd; -{ - while (STATE_BREAKPOINTS (sd)) - sim_clear_breakpoint (sd, STATE_BREAKPOINTS (sd)->addr); - - return SIM_RC_OK; -} - -SIM_RC -sim_enable_breakpoint (sd, addr) - SIM_DESC sd; - SIM_ADDR addr; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - if (bp->addr == addr) - break; - - if (!bp) - return SIM_RC_UNKNOWN_BREAKPOINT; - - bp->flags &= ~SIM_BREAK_DISABLED; - - return SIM_RC_OK; -} - -SIM_RC -sim_disable_breakpoint (sd, addr) - SIM_DESC sd; - SIM_ADDR addr; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - if (bp->addr == addr) - break; - - if (!bp) - return SIM_RC_UNKNOWN_BREAKPOINT; - - bp->flags |= SIM_BREAK_DISABLED; - - return SIM_RC_OK; -} - -SIM_RC -sim_enable_all_breakpoints (sd) - SIM_DESC sd; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - bp->flags &= ~SIM_BREAK_DISABLED; - - return SIM_RC_OK; -} - -SIM_RC -sim_disable_all_breakpoints (sd) - SIM_DESC sd; -{ - struct sim_breakpoint *bp; - - for (bp = STATE_BREAKPOINTS (sd); bp; bp = bp->next) - bp->flags |= SIM_BREAK_DISABLED; - - return SIM_RC_OK; -} diff --git a/sim/common/sim-break.h b/sim/common/sim-break.h deleted file mode 100644 index 8b0338f..0000000 --- a/sim/common/sim-break.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Simulator breakpoint support. - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Cygnus Support. - -This file is part of GDB, the GNU debugger. - -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., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#ifndef SIM_BREAK_H -#define SIM_BREAK_H - -/* Call this to install the resume and suspend handlers for the breakpoint - module. */ - -MODULE_INSTALL_FN sim_break_install; - -/* Call this inside the simulator when we execute the potential - breakpoint insn. If the breakpoint system knows about it, the - breakpoint is handled, and this routine never returns. If this - isn't really a breakpoint, then it returns to allow the caller to - handle things. */ - -void sim_handle_breakpoint PARAMS ((SIM_DESC sd, sim_cpu *cpu, sim_cia cia)); - -#endif /* SIM_BREAK_H */ diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c index 9415f63..192b9ac 100644 --- a/sim/common/sim-engine.c +++ b/sim/common/sim-engine.c @@ -79,7 +79,10 @@ sim_engine_halt (SIM_DESC sd, longjmp (*halt_buf, sim_engine_halt_jmpval); } else - sim_io_error (sd, "sim_halt - bad long jump"); + { + sim_io_error (sd, "sim_halt - bad long jump"); + abort (); + } } @@ -127,6 +130,7 @@ sim_engine_vabort (SIM_DESC sd, sim_io_evprintf (sd, fmt, ap); sim_io_eprintf (sd, "\n"); sim_io_error (sd, "Quit Simulator"); + abort (); } else { diff --git a/sim/common/sim-engine.h b/sim/common/sim-engine.h index 41aa51f..18513a6 100644 --- a/sim/common/sim-engine.h +++ b/sim/common/sim-engine.h @@ -63,7 +63,7 @@ extern void sim_engine_halt sim_cpu *next_cpu, /* NULL -> succ (last_cpu) or event-mgr */ sim_cia cia, enum sim_stop reason, - int sigrc); + int sigrc) __attribute__ ((noreturn)); /* Halt hook - allow target specific operation when halting a simulator */ @@ -116,14 +116,14 @@ extern void sim_engine_abort sim_cpu *cpu, sim_cia cia, const char *fmt, - ...) __attribute__ ((format (printf, 4, 5))); + ...) __attribute__ ((format (printf, 4, 5))) __attribute__ ((noreturn)); extern void sim_engine_vabort (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, const char *fmt, - va_list ap); + va_list ap) __attribute__ ((noreturn)); /* No abort hook - when possible this function exits using the engine_halt function (and SIM_ENGINE_HALT_HOOK). */ diff --git a/sim/common/sim-hload.c b/sim/common/sim-hload.c index b8726ba..07a608b 100644 --- a/sim/common/sim-hload.c +++ b/sim/common/sim-hload.c @@ -31,7 +31,7 @@ SIM_RC sim_load (sd, prog_name, prog_bfd, from_tty) SIM_DESC sd; char *prog_name; - struct _bfd *prog_bfd; + struct bfd *prog_bfd; int from_tty; { bfd *result_bfd; diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c index 35eb32a..8f01723 100644 --- a/sim/common/sim-module.c +++ b/sim/common/sim-module.c @@ -1,5 +1,7 @@ /* Module support. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + + Copyright 1996, 1997, 1998, 2003 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. @@ -56,9 +58,6 @@ static MODULE_INSTALL_FN * const modules[] = { #if WITH_SCACHE scache_install, #endif -#ifdef SIM_HAVE_BREAKPOINTS - sim_break_install, -#endif #if WITH_HW sim_hw_install, #endif diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h index 8e80e6a..661ac70 100644 --- a/sim/common/sim-utils.h +++ b/sim/common/sim-utils.h @@ -49,7 +49,7 @@ unsigned long sim_elapsed_time_since (SIM_ELAPSED_TIME start); /* Utilities for manipulating the load image. */ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name, - struct _bfd *prog_bfd); + struct bfd *prog_bfd); /* Load program PROG into the simulator using the function DO_LOAD. If PROG_BFD is non-NULL, the file has already been opened. @@ -65,10 +65,10 @@ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name, typedef int sim_write_fn PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)); -struct _bfd *sim_load_file (SIM_DESC sd, const char *myname, - host_callback *callback, char *prog, - struct _bfd *prog_bfd, int verbose_p, - int lma_p, sim_write_fn do_load); +struct bfd *sim_load_file (SIM_DESC sd, const char *myname, + host_callback *callback, char *prog, + struct bfd *prog_bfd, int verbose_p, + int lma_p, sim_write_fn do_load); /* Internal version of sim_do_command, include formatting */ void sim_do_commandf (SIM_DESC sd, const char *fmt, ...); diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index 9c42d35..54d84e6 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-11-13 Andrew Cagney <cagney@redhat.com> * simops.c: Include <string.h>. diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 0f7295d..718acca 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -788,7 +788,7 @@ SIM_DESC sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { struct simops *s; @@ -1194,7 +1194,7 @@ sim_info (sd, verbose) SIM_RC sim_create_inferior (sd, abfd, argv, env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog index 92b2950..5bf54d7 100644 --- a/sim/erc32/ChangeLog +++ b/sim/erc32/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interf.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-06-16 Andrew Cagney <ac131313@redhat.com> * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c index 1931886..9d59471 100644 --- a/sim/erc32/interf.c +++ b/sim/erc32/interf.c @@ -184,7 +184,7 @@ SIM_DESC sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; struct host_callback_struct *callback; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { @@ -304,7 +304,7 @@ sim_load(sd, prog, abfd, from_tty) SIM_RC sim_create_inferior(sd, abfd, argv, env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 2753416..0e62569 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2003-02-05 Kazu Hirata <kazu@cs.umass.edu> * compile.c (init_pointers): Abort if wreg never gets initialized. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 2a066a3..cd60b86 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -2125,7 +2125,7 @@ set_h8300h (int h_flag, int s_flag) SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *ptr, - struct _bfd *abfd, + struct bfd *abfd, char **argv) { /* FIXME: Much of the code in sim_load can be moved here. */ @@ -2228,7 +2228,7 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct _bfd *abfd, char **argv, char **env) +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) { if (abfd != NULL) cpu.pc = bfd_get_start_address (abfd); diff --git a/sim/h8500/ChangeLog b/sim/h8500/ChangeLog index d42834c..fe72e49 100644 --- a/sim/h8500/ChangeLog +++ b/sim/h8500/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-06-16 Andrew Cagney <ac131313@redhat.com> * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/h8500/compile.c b/sim/h8500/compile.c index aec8ce9..5db2bee 100644 --- a/sim/h8500/compile.c +++ b/sim/h8500/compile.c @@ -2443,7 +2443,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { sim_kind = kind; @@ -2484,7 +2484,7 @@ sim_load (sd, prog, abfd, from_tty) SIM_RC sim_create_inferior (sd, abfd, argv, env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { diff --git a/sim/i960/ChangeLog b/sim/i960/ChangeLog index 6a727fe..1f61c31 100644 --- a/sim/i960/ChangeLog +++ b/sim/i960/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-06-16 Andrew Cagney <ac131313@redhat.com> * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/i960/sim-if.c b/sim/i960/sim-if.c index 6179739..423dac0 100644 --- a/sim/i960/sim-if.c +++ b/sim/i960/sim-if.c @@ -52,7 +52,7 @@ SIM_DESC sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { char c; @@ -178,7 +178,7 @@ sim_close (sd, quitting) SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **envp; { diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index 532e024..b4097db 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-12-19 Doug Evans <dje@sebabeach.org> * arch.c,arch.h,cpuall.h: Regenerate. diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c index a7cbe1c..95568cc 100644 --- a/sim/m32r/sim-if.c +++ b/sim/m32r/sim-if.c @@ -56,7 +56,7 @@ SIM_DESC sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; host_callback *callback; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { SIM_DESC sd = sim_state_alloc (kind, callback); @@ -199,7 +199,7 @@ sim_close (sd, quitting) SIM_RC sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **envp; { diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index abe5f55..9c34d47 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,19 @@ +2003-03-02 Stephane Carrez <stcarrez@nerim.fr> + + * Makefile.in (SIM_EXTRA_CFLAGS): Set WITH_TARGET_ADDRESS_BITSIZE + to 32 to support memory bank switching; temporarily use 32-bit for + WORD_BITSIZE to avoid a bug in sim-common. + +2003-03-01 Stephane Carrez <stcarrez@nerim.fr> + + * interp.c (sim_fetch_register): Only store a single byte for + 1 byte registers. + +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_prepare_for_program, sim_open) + (sim_create_inferior): Rename _bfd to bfd. + 2002-08-13 Stephane Carrez <stcarrez@nerim.fr> * dv-m68hc11eepr.c (struct m68hc11eepr ): Use const char* for filename. diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in index a054a32..604c3a7 100644 --- a/sim/m68hc11/Makefile.in +++ b/sim/m68hc11/Makefile.in @@ -35,9 +35,15 @@ SIM_OBJS = $(M68HC11_OBJS) \ $(SIM_EXTRA_OBJS) SIM_PROFILE= -DPROFILE=1 -DWITH_PROFILE=-1 -SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=16 \ +# We must use 32-bit addresses to support memory bank switching. +# The WORD_BITSIZE is normally 16 but must be switched (temporarily) +# to 32 to avoid a bug in the sim-common which uses 'unsigned_word' +# instead of 'address_word' in some places (the result is a truncation +# of the 32-bit address to 16-bit; and this breaks the simulator). +SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 \ -DWITH_TARGET_CELL_BITSIZE=32 \ - -DWITH_TARGET_WORD_MSB=15 + -DWITH_TARGET_ADDRESS_BITSIZE=32 \ + -DWITH_TARGET_WORD_MSB=31 SIM_EXTRA_CLEAN = clean-extra SIM_EXTRA_OBJS = @m68hc11_extra_objs@ diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c index 74674ce..3da382d 100644 --- a/sim/m68hc11/interp.c +++ b/sim/m68hc11/interp.c @@ -295,7 +295,7 @@ sim_hw_configure (SIM_DESC sd) } static int -sim_prepare_for_program (SIM_DESC sd, struct _bfd* abfd) +sim_prepare_for_program (SIM_DESC sd, struct bfd* abfd) { sim_cpu *cpu; @@ -341,7 +341,7 @@ sim_prepare_for_program (SIM_DESC sd, struct _bfd* abfd) SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, - struct _bfd *abfd, char **argv) + struct bfd *abfd, char **argv) { SIM_DESC sd; sim_cpu *cpu; @@ -486,7 +486,7 @@ sim_info (SIM_DESC sd, int verbose) } SIM_RC -sim_create_inferior (SIM_DESC sd, struct _bfd *abfd, +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) { return sim_prepare_for_program (sd, abfd); @@ -554,8 +554,15 @@ sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length) val = 0; break; } - memory[0] = val >> 8; - memory[1] = val & 0x0FF; + if (size == 1) + { + memory[0] = val; + } + else + { + memory[0] = val >> 8; + memory[1] = val & 0x0FF; + } return size; } diff --git a/sim/mcore/ChangeLog b/sim/mcore/ChangeLog index afa841f..be79bec 100644 --- a/sim/mcore/ChangeLog +++ b/sim/mcore/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-06-16 Andrew Cagney <ac131313@redhat.com> * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c index 79c7d2e..bf04ed9 100644 --- a/sim/mcore/interp.c +++ b/sim/mcore/interp.c @@ -1901,7 +1901,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback * cb; - struct _bfd * abfd; + struct bfd * abfd; char ** argv; { int osize = sim_memory_size; @@ -2009,7 +2009,7 @@ sim_load (sd, prog, abfd, from_tty) SIM_RC sim_create_inferior (sd, prog_bfd, argv, env) SIM_DESC sd; - struct _bfd * prog_bfd; + struct bfd * prog_bfd; char ** argv; char ** env; { diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 0482ab2..76c676c 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,8 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_open): + (sim_create_inferior): + 2003-01-14 Chris Demetriou <cgd@broadcom.com> * mips.igen (LUXC1, SUXC1): New, for mipsV and mips64. diff --git a/sim/mips/interp.c b/sim/mips/interp.c index b2828e0..f8c14c8 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -326,7 +326,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { SIM_DESC sd = sim_state_alloc (kind, cb); @@ -971,7 +971,7 @@ sim_fetch_register (sd,rn,memory,length) SIM_RC sim_create_inferior (sd, abfd, argv,env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { diff --git a/sim/mn10200/ChangeLog b/sim/mn10200/ChangeLog index 8a539c5..090b05c 100644 --- a/sim/mn10200/ChangeLog +++ b/sim/mn10200/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-06-16 Andrew Cagney <ac131313@redhat.com> * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/mn10200/interp.c b/sim/mn10200/interp.c index 43a8750..ea4e04f 100644 --- a/sim/mn10200/interp.c +++ b/sim/mn10200/interp.c @@ -211,7 +211,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { struct simops *s; @@ -717,7 +717,7 @@ sim_info (sd, verbose) SIM_RC sim_create_inferior (sd, abfd, argv, env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index e7d77c8..9a5b602 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,4 +1,13 @@ -2003-02-24 David Carlton <carlton@math.stanford.edu> +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_open, sim_create_inferior, sim_open) + (sim_create_inferior): Rename _bfd to bfd. + +2003-02-26 Andrew Cagney <cagney@redhat.com> + + * am33.igen: Call sim_engine_abort instead of abort. + +2003-02-26 David Carlton <carlton@math.stanford.edu> * dv-mn103tim.c (read_special_timer6_reg): Add break after empty default: label. diff --git a/sim/mn10300/am33.igen b/sim/mn10300/am33.igen index a5745e2..db41889 100644 --- a/sim/mn10300/am33.igen +++ b/sim/mn10300/am33.igen @@ -34,7 +34,7 @@ case 4: return REG_MCVF; default: - abort (); + sim_engine_abort (SD, CPU, cia, "%s:%d: bad switch\n", __FILE__, __LINE__); } } diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 2003c2d..fd93b6d 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -312,7 +312,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { struct simops *s; @@ -852,7 +852,7 @@ sim_info (sd, verbose) SIM_RC sim_create_inferior (sd, abfd, argv, env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { @@ -946,7 +946,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { SIM_DESC sd = sim_state_alloc (kind, cb); @@ -1170,7 +1170,7 @@ sim_close (sd, quitting) SIM_RC sim_create_inferior (sd, prog_bfd, argv, env) SIM_DESC sd; - struct _bfd *prog_bfd; + struct bfd *prog_bfd; char **argv; char **env; { diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 26d0431..b625ac9 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * sim_calls.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-09-27 Andrew Cagney <ac131313@redhat.com> * hw_disk.c (hw_disk_init_address): Set device type to "block", diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c index f2c2d19..22aa21b 100644 --- a/sim/ppc/sim_calls.c +++ b/sim/ppc/sim_calls.c @@ -85,7 +85,7 @@ static host_callback *callbacks; SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, - struct _bfd *abfd, + struct bfd *abfd, char **argv) { callbacks = callback; @@ -244,7 +244,7 @@ sim_info (SIM_DESC sd, int verbose) SIM_RC sim_create_inferior (SIM_DESC sd, - struct _bfd *abfd, + struct bfd *abfd, char **argv, char **envp) { diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 60b41f7..007bf46 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,8 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (init_dsp, sim_open, sim_create_inferior): Rename _bfd + to bfd. + Fri Oct 11 16:22:28 2002 J"orn Rennecke <joern.rennecke@superh.com> * interp.c (trap): Return int. Take extra parameter for address diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 8c2f359..887b7a6 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -1424,7 +1424,7 @@ sim_size (power) static void init_dsp (abfd) - struct _bfd *abfd; + struct bfd *abfd; { int was_dsp = target_dsp; unsigned long mach = bfd_get_mach (abfd); @@ -2140,7 +2140,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { char **p; @@ -2239,7 +2239,7 @@ sim_load (sd, prog, abfd, from_tty) SIM_RC sim_create_inferior (sd, prog_bfd, argv, env) SIM_DESC sd; - struct _bfd *prog_bfd; + struct bfd *prog_bfd; char **argv; char **env; { diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 5510497..9dcfd05 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-11-30 Andrew Cagney <cagney@redhat.com> * simops.c: Use int, 1, 0 instead of boolean, true and false. diff --git a/sim/v850/interp.c b/sim/v850/interp.c index 85b1795..62a4616 100644 --- a/sim/v850/interp.c +++ b/sim/v850/interp.c @@ -192,7 +192,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { SIM_DESC sd = sim_state_alloc (kind, cb); @@ -297,7 +297,7 @@ sim_close (sd, quitting) SIM_RC sim_create_inferior (sd, prog_bfd, argv, env) SIM_DESC sd; - struct _bfd *prog_bfd; + struct bfd *prog_bfd; char **argv; char **env; { diff --git a/sim/z8k/ChangeLog b/sim/z8k/ChangeLog index 11e2a45..1bc783b 100644 --- a/sim/z8k/ChangeLog +++ b/sim/z8k/ChangeLog @@ -1,3 +1,7 @@ +2003-02-27 Andrew Cagney <cagney@redhat.com> + + * iface.c (sim_open, sim_create_inferior): Rename _bfd to bfd. + 2002-06-16 Andrew Cagney <ac131313@redhat.com> * configure: Regenerated to track ../common/aclocal.m4 changes. diff --git a/sim/z8k/iface.c b/sim/z8k/iface.c index c76d63f..5104172 100644 --- a/sim/z8k/iface.c +++ b/sim/z8k/iface.c @@ -183,7 +183,7 @@ SIM_DESC sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; - struct _bfd *abfd; + struct bfd *abfd; char **argv; { /* FIXME: The code in sim_load that determines the exact z8k arch @@ -237,7 +237,7 @@ sim_load (sd, prog, abfd, from_tty) SIM_RC sim_create_inferior (sd, abfd, argv, env) SIM_DESC sd; - struct _bfd *abfd; + struct bfd *abfd; char **argv; char **env; { |